version 1.33 | | version 1.34 |
---|
| | |
/* | | /* |
* static char *rcsid_rune_c = | | * static char *rcsid_rune_c = |
* "$Id: rune.c,v 1.33 2003/09/03 12:25:06 tchize Exp $"; | | * "$Id: rune.c,v 1.34 2003/09/04 06:25:32 temitchell Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
if (trap->stats.hp <= 0) | | if (trap->stats.hp <= 0) |
return; | | return; |
| | |
| | if (QUERY_FLAG(trap,FLAG_IS_LINKED)) |
| | use_trigger(trap); |
| | |
/* get the spell number from the name in the slaying field, and set | | /* get the spell number from the name in the slaying field, and set |
that as the spell to be cast. */ | | that as the spell to be cast. */ |
if ((spell_in_rune = look_up_spell_by_name (NULL, trap->slaying)) != -1) | | if ((spell_in_rune = look_up_spell_by_name (NULL, trap->slaying)) != -1) |
| | |
* player is standing on top? | | * player is standing on top? |
*/ | | */ |
if (mflags & P_OUT_OF_MAP) { | | if (mflags & P_OUT_OF_MAP) { |
new_draw_info(NDI_UNIQUE, 0,op,"There's no trap there!"); | | new_draw_info(NDI_UNIQUE, 0,op,"There's nothing there!"); |
} | | } |
| | |
for(tmp=get_map_ob(m,x, y); tmp!=NULL; tmp=tmp->above) { | | for(tmp=get_map_ob(m,x, y); tmp!=NULL; tmp=tmp->above) { |
if(tmp->type==RUNE) break; | | if(tmp->type==RUNE || tmp->type==TRAP) break; |
| | |
/* we could put a probability chance here, but since nothing happens | | /* we could put a probability chance here, but since nothing happens |
* if you fail, no point on that. I suppose we could do a level | | * if you fail, no point on that. I suppose we could do a level |
| | |
* This is for chests, where the rune is in the chests inventory. | | * This is for chests, where the rune is in the chests inventory. |
*/ | | */ |
for(tmp2=tmp->inv;tmp2!=NULL;tmp2=tmp2->below) { | | for(tmp2=tmp->inv;tmp2!=NULL;tmp2=tmp2->below) { |
if(tmp2->type==RUNE) { | | if(tmp2->type==RUNE || tmp2->type==TRAP) { |
tmp=tmp2; | | tmp=tmp2; |
searchflag=0; | | searchflag=0; |
break; | | break; |
| | |
| | |
/* no rune there. */ | | /* no rune there. */ |
if(tmp==NULL) { | | if(tmp==NULL) { |
new_draw_info(NDI_UNIQUE, 0,op,"There's no trap there!"); | | new_draw_info(NDI_UNIQUE, 0,op,"There's nothing there!"); |
return 0; | | return 0; |
} | | } |
trap_disarm(op,tmp,risk); | | trap_disarm(op,tmp,risk); |