version 1.18 | | version 1.19 |
---|
| | |
/* | | /* |
* static char *rcsid_alchemy_c = | | * static char *rcsid_alchemy_c = |
* "$Id: alchemy.c,v 1.18 2003/02/06 08:08:50 garbled Exp $"; | | * "$Id: alchemy.c,v 1.19 2003/02/07 06:57:17 garbled Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
char name[MAX_BUF]; | | char name[MAX_BUF]; |
object *tmp=op->inv; | | object *tmp=op->inv; |
int tval=0, formula=0; | | int tval=0, formula=0; |
materialtype_t *mt; | | |
| | |
while(tmp) { | | while(tmp) { |
tval=0; | | tval=0; |
strcpy(name, tmp->name); | | strcpy(name, tmp->name); |
if (tmp->title) | | if (tmp->title) |
sprintf(name, "%s %s", tmp->name, tmp->title); | | sprintf(name, "%s %s", tmp->name, tmp->title); |
/* strip the materialname out of the name, so alchemy works */ | | |
if (tmp->materialname && tmp->arch->clone.materialname == NULL && | | |
(IS_ARMOR(tmp) || IS_WEAPON(tmp))) { | | |
mt = name_to_material(tmp->materialname); | | |
if (mt && !strncmp(mt->description, tmp->name, strlen(mt->description))) | | |
tval = ((strtoint(name) - strtoint(mt->description) - | | |
strtoint(" ")) * (tmp->nrof?tmp->nrof:1)); | | |
else | | |
tval = (strtoint(name) * (tmp->nrof?tmp->nrof:1)); | | |
} else | | |
tval = (strtoint(name) * (tmp->nrof?tmp->nrof:1)); | | tval = (strtoint(name) * (tmp->nrof?tmp->nrof:1)); |
#ifdef ALCHEMY_DEBUG | | #ifdef ALCHEMY_DEBUG |
LOG(llevDebug,"Got ingredient %d %s(%d)\n", tmp->nrof?tmp->nrof:1, | | LOG(llevDebug,"Got ingredient %d %s(%d)\n", tmp->nrof?tmp->nrof:1, |