version 1.77 | | version 1.78 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_effect_c = | | * static char *rcsid_spell_effect_c = |
* "$Id: spell_effect.c,v 1.77 2002/10/04 05:46:23 mwedel Exp $"; | | * "$Id: spell_effect.c,v 1.78 2002/11/11 08:59:09 garbled Exp $"; |
*/ | | */ |
| | |
| | |
| | |
| | |
int alchemy(object *op) | | int alchemy(object *op) |
{ | | { |
int x,y,weight=0,weight_max,large_nuggets,small_nuggets,did_alc=0; | | int x,y,weight=0,weight_max,large_nuggets,small_nuggets; |
object *next,*tmp; | | object *next,*tmp; |
| | |
if(op->type!=PLAYER) | | if(op->type!=PLAYER) |
| | |
small=get_archetype("smallnugget"), | | small=get_archetype("smallnugget"), |
large=get_archetype("largenugget"); | | large=get_archetype("largenugget"); |
| | |
#ifdef ALCHEMY | | |
for(y= op->y-1;y<=op->y+1;y++) { | | |
for(x= op->x-1;x<=op->x+1;x++) { | | |
if(out_of_map(op->map,x,y) || wall(op->map,x,y) || | | |
blocks_view(op->map,x,y)) | | |
continue; | | |
for(tmp=get_map_ob(op->map,x,y);tmp!=NULL;tmp=next) { | | |
next=tmp->above; | | |
if(QUERY_FLAG(tmp,FLAG_IS_CAULDRON)) { | | |
attempt_do_alchemy(op, tmp); | | |
did_alc=1; | | |
continue; | | |
} | | |
} | | |
} | | |
} | | |
if (did_alc) return 1; | | |
#endif | | |
| | |
for(y= op->y-1;y<=op->y+1;y++) { | | for(y= op->y-1;y<=op->y+1;y++) { |
for(x= op->x-1;x<=op->x+1;x++) { | | for(x= op->x-1;x<=op->x+1;x++) { |
if(out_of_map(op->map,x,y) || wall(op->map,x,y) || | | if(out_of_map(op->map,x,y) || wall(op->map,x,y) || |