version 1.4 | | version 1.5 |
---|
| | |
/* | | /* |
* static char *rcsid_rune_c = | | * static char *rcsid_rune_c = |
* "$Id: rune.c,v 1.4 2000/05/15 20:57:45 jec Exp $"; | | * "$Id: rune.c,v 1.5 2000/05/26 09:50:49 jec Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
tmp->direction=dir; /* where any spell will go upon detonation */ | | tmp->direction=dir; /* where any spell will go upon detonation */ |
tmp->level=SK_level(op); /* what level to cast the spell at */ | | tmp->level=SK_level(op); /* what level to cast the spell at */ |
set_owner(tmp,op); | | set_owner(tmp,op); |
insert_ob_in_map(tmp,op->map); | | insert_ob_in_map(tmp,op->map,op); |
return 1; | | return 1; |
| | |
} | | } |
| | |
object *tmp; | | object *tmp; |
int det=0; | | int det=0; |
if(!op->level) {return;} /* runes of level zero cannot detonate. */ | | if(!op->level) {return;} /* runes of level zero cannot detonate. */ |
for(tmp=op->above;tmp;tmp=tmp->above) | | |
if(!QUERY_FLAG(tmp,FLAG_FLYING)&&QUERY_FLAG(tmp,FLAG_ALIVE)) | | |
{det|=1;break;} | | |
if(det) spring_trap(op,tmp); | | |
| | |
det=op->invisible; | | det=op->invisible; |
if(!(RANDOM()%(MAX(1,(op->stats.Cha))))) | | if(!(RANDOM()%(MAX(1,(op->stats.Cha))))) |
{ | | { |
| | |
else { /* This is necessary if the trap is inside something else */ | | else { /* This is necessary if the trap is inside something else */ |
remove_ob(trap); | | remove_ob(trap); |
trap->x=victim->x;trap->y=victim->y; | | trap->x=victim->x;trap->y=victim->y; |
insert_ob_in_map(trap,victim->map); | | insert_ob_in_map(trap,victim->map,trap); |
cast_spell(trap,trap,trap->direction,trap->stats.sp,1,spellNormal,NULL); | | cast_spell(trap,trap,trap->direction,trap->stats.sp,1,spellNormal,NULL); |
} | | } |
/* Flash an image of the trap on the map so the poor sod | | /* Flash an image of the trap on the map so the poor sod |
| | |
tmp2=get_archetype("runedet"); | | tmp2=get_archetype("runedet"); |
tmp2->face=&new_faces[GET_ANIMATION(trap, 0)]; | | tmp2->face=&new_faces[GET_ANIMATION(trap, 0)]; |
tmp2->x=where->x;tmp2->y=where->y;tmp2->map=where->map; | | tmp2->x=where->x;tmp2->y=where->y;tmp2->map=where->map; |
insert_ob_in_map(tmp2,where->map); | | insert_ob_in_map(tmp2,where->map,NULL); |
return 1; | | return 1; |
| | |
} | | } |