version 1.113 | | version 1.114 |
---|
| | |
/* | | /* |
* static char *rcsid_apply_c = | | * static char *rcsid_apply_c = |
* "$Id: apply.c,v 1.113 2004/10/15 07:09:40 mwedel Exp $"; | | * "$Id: apply.c,v 1.114 2004/10/18 06:54:36 mwedel Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
for(tmp=get_map_ob(m,x,y);tmp!=NULL;tmp=above) { | | for(tmp=get_map_ob(m,x,y);tmp!=NULL;tmp=above) { |
above=tmp->above; | | above=tmp->above; |
| | |
| | |
if (tmp->inv) { | | if (tmp->inv) { |
object *invtmp, *invnext; | | object *invtmp, *invnext; |
| | |
for (invtmp=tmp->inv; invtmp != NULL; invtmp = invnext) { | | for (invtmp=tmp->inv; invtmp != NULL; invtmp = invnext) { |
invnext = invtmp->below; | | invnext = invtmp->below; |
| | |
if(QUERY_FLAG(invtmp,FLAG_AUTO_APPLY)) | | if(QUERY_FLAG(invtmp,FLAG_AUTO_APPLY)) |
auto_apply(invtmp); | | auto_apply(invtmp); |
else if(invtmp->type==TREASURE && HAS_RANDOM_ITEMS(invtmp)) { | | else if(invtmp->type==TREASURE && HAS_RANDOM_ITEMS(invtmp)) { |
while ((invtmp->stats.hp--)>0) | | while ((invtmp->stats.hp--)>0) |
create_treasure(invtmp->randomitems, invtmp, 0, | | create_treasure(invtmp->randomitems, invtmp, 0, |
m->difficulty,0); | | m->difficulty,0); |
| | invtmp->randomitems = NULL; |
} | | } |
else if (invtmp && invtmp->arch && | | else if (invtmp && invtmp->arch && |
invtmp->type!=TREASURE && | | invtmp->type!=TREASURE && |
invtmp->type != SPELL && | | invtmp->type != SPELL && |
| | invtmp->type != CLASS && |
HAS_RANDOM_ITEMS(invtmp)) { | | HAS_RANDOM_ITEMS(invtmp)) { |
create_treasure(invtmp->randomitems, invtmp, 0, | | create_treasure(invtmp->randomitems, invtmp, 0, |
m->difficulty,0); | | m->difficulty,0); |
| | |
while ((tmp->stats.hp--)>0) | | while ((tmp->stats.hp--)>0) |
create_treasure(tmp->randomitems, tmp, 0, | | create_treasure(tmp->randomitems, tmp, 0, |
m->difficulty,0); | | m->difficulty,0); |
| | tmp->randomitems = NULL; |
} | | } |
else if(tmp->type==TIMED_GATE) { | | else if(tmp->type==TIMED_GATE) { |
tmp->speed = 0; | | tmp->speed = 0; |
| | |
* which say how many times to make the treasure. | | * which say how many times to make the treasure. |
*/ | | */ |
else if(tmp && tmp->arch && tmp->type!=PLAYER && tmp->type!=TREASURE && | | else if(tmp && tmp->arch && tmp->type!=PLAYER && tmp->type!=TREASURE && |
tmp->type != SPELL && HAS_RANDOM_ITEMS(tmp)) { | | tmp->type != SPELL && tmp->type != PLAYER_CHANGER && tmp->type != CLASS && |
| | HAS_RANDOM_ITEMS(tmp)) { |
create_treasure(tmp->randomitems, tmp, GT_APPLY, | | create_treasure(tmp->randomitems, tmp, GT_APPLY, |
m->difficulty,0); | | m->difficulty,0); |
tmp->randomitems = NULL; | | tmp->randomitems = NULL; |
/* Treasure has been created for all the inventory, so clear out | | |
* their treasurelists also. | | |
*/ | | |
for (above=tmp->inv; above; above=above->below) | | |
above->randomitems=NULL; | | |
| | |
} | | } |
} | | } |
| | |