version 1.39 | | version 1.40 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_attack_c = | | * static char *rcsid_spell_attack_c = |
* "$Id: spell_attack.c,v 1.39 2006/07/25 22:37:22 ryo_saeba Exp $"; | | * "$Id: spell_attack.c,v 1.40 2006/08/19 21:22:26 ryo_saeba Exp $"; |
*/ | | */ |
| | |
| | |
| | |
/* Only bother looking on this space if there is something living here */ | | /* Only bother looking on this space if there is something living here */ |
if (mflags & P_IS_ALIVE) { | | if (mflags & P_IS_ALIVE) { |
/* search this square for a victim */ | | /* search this square for a victim */ |
for(walk=get_map_ob(m,x,y);walk;walk=walk->above) | | for(walk=get_map_ob(m,x,y);walk;walk=walk->above) { |
if (QUERY_FLAG(walk,FLAG_MONSTER) || (walk->type==PLAYER)) { /* found a victim */ | | /* Flags for monster is set on head only, so get it now */ |
object *disease = arch_to_object(spell->other_arch); | | |
| | |
/* Handle multitile monsters */ | | |
if (walk->head) | | |
target_head = walk->head; | | |
else | | |
target_head = walk; | | target_head = walk; |
| | while (target_head->head) |
| | target_head = target_head->head; |
| | if (QUERY_FLAG(target_head,FLAG_MONSTER) || (target_head->type==PLAYER)) { /* found a victim */ |
| | object *disease = arch_to_object(spell->other_arch); |
| | |
set_owner(disease,op); | | set_owner(disease,op); |
set_spell_skill(op, caster, spell, disease); | | set_spell_skill(op, caster, spell, disease); |
| | |
return 1; | | return 1; |
} | | } |
free_object(disease); | | free_object(disease); |
} | | } /* Found a victim */ |
} /* if living creature */ | | } /* Search squares for living creature */ |
| | } /* if living creature on square */ |
} /* for range of spaces */ | | } /* for range of spaces */ |
new_draw_info(NDI_UNIQUE,0,op,"No one caught anything!"); | | new_draw_info(NDI_UNIQUE,0,op,"No one caught anything!"); |
return 1; | | return 1; |