version 1.3 | | version 1.4 |
---|
| | |
/* | | /* |
* static char *rcsid_spells_c = | | * static char *rcsid_spells_c = |
* "$Id: spell_util.c,v 1.3 1999/08/06 21:29:54 cvs Exp $"; | | * "$Id: spell_util.c,v 1.4 1999/09/17 19:18:34 damn Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
case SP_HELLFIRE: | | case SP_HELLFIRE: |
case SP_POISON_CLOUD: | | case SP_POISON_CLOUD: |
case SP_M_MISSILE: | | case SP_M_MISSILE: |
| | case SP_S_MANABALL: |
| | case SP_M_MANABALL: |
| | case SP_L_MANABALL: |
success = fire_arch(op,caster,dir,spellarch[type],type, !ability); | | success = fire_arch(op,caster,dir,spellarch[type],type, !ability); |
break; | | break; |
case SP_MASS_CONFUSION: | | case SP_MASS_CONFUSION: |
| | |
case SP_FIREBREATH: | | case SP_FIREBREATH: |
case SP_LARGE_ICESTORM: | | case SP_LARGE_ICESTORM: |
case SP_BANISHMENT: | | case SP_BANISHMENT: |
| | case SP_MANA_BLAST: |
success = cast_cone(op,caster,dir,duration,type,spellarch[type],!ability); | | success = cast_cone(op,caster,dir,duration,type,spellarch[type],!ability); |
break; | | break; |
case SP_TURN_UNDEAD: | | case SP_TURN_UNDEAD: |
| | |
case SP_S_LIGHTNING: | | case SP_S_LIGHTNING: |
case SP_L_LIGHTNING: | | case SP_L_LIGHTNING: |
case SP_STEAMBOLT: | | case SP_STEAMBOLT: |
| | case SP_MANA_BOLT: |
success = fire_bolt(op,caster,dir,type,!ability); | | success = fire_bolt(op,caster,dir,type,!ability); |
break; | | break; |
case SP_BOMB: | | case SP_BOMB: |
| | |
case SP_AIR_ELEM: | | case SP_AIR_ELEM: |
success = summon_monster(op,caster,dir,spellarch[type],type); | | success = summon_monster(op,caster,dir,spellarch[type],type); |
break; | | break; |
case SP_STAFF_TO_SNAKE: | | |
success = staff_to_snake(op,caster,dir,spellarch[type],type); | | |
break; | | |
case SP_FINGER_DEATH: | | case SP_FINGER_DEATH: |
success = finger_of_death(op,caster,dir); | | success = finger_of_death(op,caster,dir); |
break; | | break; |
| | |
case SP_CAUSE_TYPHOID: | | case SP_CAUSE_TYPHOID: |
success = cast_cause_disease(op,caster,dir,spellarch[type],type); | | success = cast_cause_disease(op,caster,dir,spellarch[type],type); |
break; | | break; |
| | /* DAMN */ |
| | case SP_DANCING_SWORD: |
| | case SP_STAFF_TO_SNAKE: |
| | case SP_ANIMATE_WEAPON: |
| | success = animate_weapon(op,caster,dir,spellarch[type],type); |
| | break; |
} | | } |
| | |
play_sound_map(op->map, op->x, op->y, SOUND_CAST_SPELL_0 + type); | | play_sound_map(op->map, op->x, op->y, SOUND_CAST_SPELL_0 + type); |
| | |
* a player somehow gets a counterspell attacktype. | | * a player somehow gets a counterspell attacktype. |
*/ | | */ |
if ((tmp->attacktype & AT_COUNTERSPELL) && | | if ((tmp->attacktype & AT_COUNTERSPELL) && |
| | (tmp->type != PLAYER) && !QUERY_FLAG(tmp,FLAG_MONSTER) && |
| | (tmp->type != WEAPON) && (tmp->type != BOW) && |
| | (tmp->type != ARROW) && (tmp->type != GOLEM) && |
(immune_stop & AT_MAGIC)) return 0; | | (immune_stop & AT_MAGIC)) return 0; |
| | |
/* This is to prevent 'out of control' spells. Basically, this | | /* This is to prevent 'out of control' spells. Basically, this |
| | |
} | | } |
if(--op->stats.hp<0) { | | if(--op->stats.hp<0) { |
char buf[MAX_BUF]; | | char buf[MAX_BUF]; |
sprintf(buf,"Your %s dissolved.",op->name); | | if(op->exp_obj && op->exp_obj->stats.Wis) { |
if(op->exp_obj && op->exp_obj->stats.Wis) | | if(op->inv) |
| | sprintf(buf,"Your snake turns back into a staff.",op->name); |
| | else |
sprintf(buf,"Your %s departed this plane.",op->name); | | sprintf(buf,"Your %s departed this plane.",op->name); |
| | } else if (!strncmp(op->name,"animated ",9)) { |
| | sprintf(buf,"Your %s falls to the ground.",op->name); |
| | } else { |
| | sprintf(buf,"Your %s dissolved.",op->name); |
| | } |
new_draw_info(NDI_UNIQUE, 0,op->owner,buf); | | new_draw_info(NDI_UNIQUE, 0,op->owner,buf); |
remove_friendly_object(op); | | remove_friendly_object(op); |
op->owner->contr->golem=NULL; | | op->owner->contr->golem=NULL; |
| | |
if(victim->race&&op->race&&strstr(op->race,victim->race)) { | | if(victim->race&&op->race&&strstr(op->race,victim->race)) { |
if(op->owner) new_draw_info_format(NDI_UNIQUE, 0,op->owner, | | if(op->owner) new_draw_info_format(NDI_UNIQUE, 0,op->owner, |
"%s avoids damaging %s.",op->name,victim->name); | | "%s avoids damaging %s.",op->name,victim->name); |
| | } else if (op->exp_obj && op->exp_obj->stats.Wis |
| | && victim == op->owner) { |
| | if(op->owner) new_draw_info_format(NDI_UNIQUE, 0,op->owner, |
| | "%s avoids damaging you.",op->name); |
} else { | | } else { |
hit_map(tmp,op->direction,op->attacktype); | | hit_map(tmp,op->direction,op->attacktype); |
made_attack=1; | | made_attack=1; |