version 1.37 | | version 1.38 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_attack_c = | | * static char *rcsid_spell_attack_c = |
* "$Id: spell_attack.c,v 1.37 2006/05/25 17:49:36 akirschbaum Exp $"; | | * "$Id: spell_attack.c,v 1.38 2006/07/17 03:03:45 qal21 Exp $"; |
*/ | | */ |
| | |
| | |
| | |
int cast_cause_disease(object *op, object *caster, object *spell, int dir) { | | int cast_cause_disease(object *op, object *caster, object *spell, int dir) { |
sint16 x,y; | | sint16 x,y; |
int i, mflags, range, dam_mod, dur_mod; | | int i, mflags, range, dam_mod, dur_mod; |
object *walk; | | object *walk, *target_head; |
mapstruct *m; | | mapstruct *m; |
| | |
x = op->x; | | x = op->x; |
| | |
if (QUERY_FLAG(walk,FLAG_MONSTER) || (walk->type==PLAYER)) { /* found a victim */ | | if (QUERY_FLAG(walk,FLAG_MONSTER) || (walk->type==PLAYER)) { /* found a victim */ |
object *disease = arch_to_object(spell->other_arch); | | object *disease = arch_to_object(spell->other_arch); |
| | |
| | /* Handle multitile monsters */ |
| | if (walk->head) |
| | target_head = walk->head; |
| | else |
| | target_head = walk; |
| | |
set_owner(disease,op); | | set_owner(disease,op); |
set_spell_skill(op, caster, spell, disease); | | set_spell_skill(op, caster, spell, disease); |
disease->stats.exp = 0; | | disease->stats.exp = 0; |
| | |
if(disease->stats.sp) | | if(disease->stats.sp) |
disease->stats.sp -= dam_mod; | | disease->stats.sp -= dam_mod; |
| | |
if(infect_object(walk,disease,1)) { | | if(infect_object(target_head,disease,1)) { |
object *flash; /* visual effect for inflicting disease */ | | object *flash; /* visual effect for inflicting disease */ |
| | |
new_draw_info_format(NDI_UNIQUE, 0, op, "You inflict %s on %s!",disease->name,walk->name); | | new_draw_info_format(NDI_UNIQUE, 0, op, "You inflict %s on %s!",disease->name,target_head->name); |
| | |
free_object(disease); /* don't need this one anymore */ | | free_object(disease); /* don't need this one anymore */ |
flash=create_archetype(ARCH_DETECT_MAGIC); | | flash=create_archetype(ARCH_DETECT_MAGIC); |