version 1.17 | | version 1.18 |
---|
| | |
/* | | /* |
* static char *rcsid_alchemy_c = | | * static char *rcsid_alchemy_c = |
* "$Id: alchemy.c,v 1.17 2003/01/30 00:07:09 garbled Exp $"; | | * "$Id: alchemy.c,v 1.18 2003/02/06 08:08:50 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; |
| | |
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 */ | | /* strip the materialname out of the name, so alchemy works */ |
if (tmp->materialname && !strncmp(tmp->materialname, tmp->name, | | if (tmp->materialname && tmp->arch->clone.materialname == NULL && |
strlen(tmp->materialname))) { | | (IS_ARMOR(tmp) || IS_WEAPON(tmp))) { |
tval = ((strtoint(name) - strtoint(tmp->materialname) - | | 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)); | | strtoint(" ")) * (tmp->nrof?tmp->nrof:1)); |
| | else |
| | tval = (strtoint(name) * (tmp->nrof?tmp->nrof:1)); |
} else | | } 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," --requested recipe: %s of %s.\n",rp->arch_name,rp->title); | | LOG(llevDebug," --requested recipe: %s of %s.\n",rp->arch_name,rp->title); |
return (object *) NULL; | | return (object *) NULL; |
} | | } |
| | transmute_materialname(item, art->item); |
give_artifact_abilities(item,art->item); | | give_artifact_abilities(item,art->item); |
} | | } |
| | |