version 1.49 | | version 1.50 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_effect_c = | | * static char *rcsid_spell_effect_c = |
* "$Id: spell_effect.c,v 1.49 2001/04/18 20:17:22 mardahl Exp $"; | | * "$Id: spell_effect.c,v 1.50 2001/04/24 08:13:26 mardahl Exp $"; |
*/ | | */ |
| | |
| | |
| | |
char buf[MAX_BUF]; | | char buf[MAX_BUF]; |
for(tmp=get_map_ob(op->map,op->x,op->y);tmp!=NULL;tmp=tmp->above) { | | for(tmp=get_map_ob(op->map,op->x,op->y);tmp!=NULL;tmp=tmp->above) { |
int atk_lev, def_lev; | | int atk_lev, def_lev; |
| | object *victim=tmp; |
if(!QUERY_FLAG(tmp,FLAG_MONSTER)) continue; | | if(tmp->head) victim=tmp->head; |
if(QUERY_FLAG(tmp,FLAG_UNAGGRESSIVE)) continue; | | if(!QUERY_FLAG(victim,FLAG_MONSTER)) continue; |
if(tmp->stats.exp == 0) continue; | | if(QUERY_FLAG(victim,FLAG_UNAGGRESSIVE)) continue; |
def_lev = MAX(1,tmp->level); | | if(victim->stats.exp == 0) continue; |
| | def_lev = MAX(1,victim->level); |
atk_lev = MAX(1,op->level); | | atk_lev = MAX(1,op->level); |
if(RANDOM() % atk_lev > def_lev) { | | if(RANDOM() % atk_lev > def_lev) { |
| | |
/* make this sucker peaceful. */ | | /* make this sucker peaceful. */ |
tmp->stats.dam = 0; | | victim->stats.dam = 0; |
add_exp(op->owner,tmp->stats.exp); | | add_exp(op->owner,victim->stats.exp); |
tmp->stats.exp=0; | | victim->stats.exp=0; |
tmp->stats.sp = 0; | | victim->stats.sp = 0; |
tmp->stats.grace = 0; | | victim->stats.grace = 0; |
tmp->stats.Pow = 0; | | victim->stats.Pow = 0; |
tmp->move_type = RANDO2; | | victim->move_type = RANDO2; |
SET_FLAG(tmp,FLAG_UNAGGRESSIVE); | | SET_FLAG(victim,FLAG_UNAGGRESSIVE); |
SET_FLAG(tmp,FLAG_RUN_AWAY); | | SET_FLAG(victim,FLAG_RUN_AWAY); |
SET_FLAG(tmp,FLAG_RANDOM_MOVE); | | SET_FLAG(victim,FLAG_RANDOM_MOVE); |
CLEAR_FLAG(tmp,FLAG_MONSTER); | | CLEAR_FLAG(victim,FLAG_MONSTER); |
if(tmp->name) { | | if(victim->name) { |
sprintf(buf,"%s no longer feels like fighting.",tmp->name); | | sprintf(buf,"%s no longer feels like fighting.",victim->name); |
new_draw_info(NDI_UNIQUE,0,op->owner,buf); | | new_draw_info(NDI_UNIQUE,0,op->owner,buf); |
} | | } |
} | | } |