version 1.6 | | version 1.7 |
---|
| | |
/* | | /* |
* static char *rcsid_rune_c = | | * static char *rcsid_rune_c = |
* "$Id: rune.c,v 1.6 2000/05/26 12:36:49 jec Exp $"; | | * "$Id: rune.c,v 1.7 2000/06/07 23:46:18 jec Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
int trapworth; /* need to compute the experience worth of the trap | | int trapworth; /* need to compute the experience worth of the trap |
before we kill it */ | | before we kill it */ |
| | int disarmer_level = SK_level (disarmer); |
| | |
/* this formula awards a more reasonable amount of exp */ | | /* this formula awards a more reasonable amount of exp */ |
trapworth = MAX(1,trap->level) * disarmer->map->difficulty * | | trapworth = MAX(1,trap->level) * disarmer->map->difficulty * |
sqr(MAX(trap->stats.dam,spells[trap->stats.sp].sp)) / | | sqr(MAX(trap->stats.dam,spells[trap->stats.sp].sp)) / |
disarmer->level; | | disarmer_level; |
| | |
if(!(RANDOM()%(MAX(2, | | if(!(RANDOM()%(MAX(2, |
MIN(20,trap->level-disarmer->level | | MIN(20,trap->level-disarmer_level |
+5 - disarmer->stats.Dex/2))))) | | +5 - disarmer->stats.Dex/2))))) |
{ | | { |
new_draw_info(NDI_UNIQUE, 0,disarmer,"You successfuly disarm it!"); | | new_draw_info(NDI_UNIQUE, 0,disarmer,"You successfuly disarm it!"); |
| | |
else | | else |
{ | | { |
new_draw_info(NDI_UNIQUE, 0,disarmer,"You fail to disarm the trap."); | | new_draw_info(NDI_UNIQUE, 0,disarmer,"You fail to disarm the trap."); |
if(! (RANDOM()% (MAX(2,disarmer->level-trap->level | | if(! (RANDOM()% (MAX(2,disarmer_level-trap->level |
+ disarmer->stats.Dex/2-6))) | | + disarmer->stats.Dex/2-6))) |
&&risk) { | | &&risk) { |
new_draw_info(NDI_UNIQUE, 0,disarmer,"In fact, you set it off!"); | | new_draw_info(NDI_UNIQUE, 0,disarmer,"In fact, you set it off!"); |