version 1.17 | | version 1.18 |
---|
| | |
/* | | /* |
* static char *rcsid_rune_c = | | * static char *rcsid_rune_c = |
* "$Id: rune.c,v 1.17 2001/05/11 06:11:14 mwedel Exp $"; | | * "$Id: rune.c,v 1.18 2001/05/29 04:41:54 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
int trap_see(object *op,object *trap) { | | int trap_see(object *op,object *trap) { |
char buf[MAX_BUF]; | | char buf[MAX_BUF]; |
int chance; | | int chance; |
#ifndef ALLOW_SKILLS | | |
int trapworth=0; | | |
#endif | | |
| | |
chance = RANDOM()%100; | | chance = RANDOM()%100; |
| | |
| | |
{ | | { |
sprintf(buf,"You spot a %s!",trap->name); | | sprintf(buf,"You spot a %s!",trap->name); |
new_draw_info(NDI_UNIQUE, 0,op,buf); | | new_draw_info(NDI_UNIQUE, 0,op,buf); |
| | |
#ifndef ALLOW_SKILLS /* this stuff is handled by find_trap skill code -b.t. */ | | |
trapworth = trap->stats.Cha * trap->level; | | |
if(trap->stats.Cha>1) add_exp(op,trapworth); /* finding a trap awards exp */ | | |
trap->stats.Cha=1; /* unhide the rune/trap */ | | |
#endif | | |
return 1; | | return 1; |
} | | } |
return 0; | | return 0; |
| | |
/* If it is your own trap, (or any players trap), don't you don't | | /* If it is your own trap, (or any players trap), don't you don't |
* get exp for it. | | * get exp for it. |
*/ | | */ |
#ifdef ALLOW_SKILLS | | |
if (trap->owner && trap->owner->type!=PLAYER && risk) | | if (trap->owner && trap->owner->type!=PLAYER && risk) |
return trapworth; | | return trapworth; |
else return 1; /* give minimal exp and say success */ | | else return 1; /* give minimal exp and say success */ |
#else | | |
if(!trap->owner) add_exp(disarmer,trapworth); | | |
else if(trap->owner && trap->owner->type!=PLAYER && risk) | | |
add_exp(disarmer,trapworth); | | |
return 1; | | |
#endif | | |
} | | } |
else | | else |
{ | | { |