version 1.19 | | version 1.20 |
---|
| | |
/* | | /* |
* static char *rcsid_rune_c = | | * static char *rcsid_rune_c = |
* "$Id: rune.c,v 1.19 2001/07/14 04:11:18 mwedel Exp $"; | | * "$Id: rune.c,v 1.20 2001/09/26 21:34:08 garbled Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
char buf[MAX_BUF]; | | char buf[MAX_BUF]; |
int chance; | | int chance; |
| | |
chance = RANDOM()%100; | | chance = random_roll(0, 99, op, PREFER_HIGH);; |
| | |
/* decide if we see the rune or not */ | | /* decide if we see the rune or not */ |
if((trap->stats.Cha==1) || (chance > | | if((trap->stats.Cha==1) || (chance > |
| | |
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_roll(0, (MAX(2, |
MIN(20,trap->level-disarmer_level | | MIN(20,trap->level-disarmer_level |
+5 - disarmer->stats.Dex/2))))) | | +5 - disarmer->stats.Dex/2))-1), disarmer, PREFER_LOW))) |
{ | | { |
new_draw_info(NDI_UNIQUE, 0,disarmer,"You successfuly disarm it!"); | | new_draw_info(NDI_UNIQUE, 0,disarmer,"You successfuly disarm it!"); |
remove_ob(trap); | | remove_ob(trap); |
| | |
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_roll(0, (MAX(2,disarmer_level-trap->level |
+ disarmer->stats.Dex/2-6))) | | + disarmer->stats.Dex/2-6))-1, disarmer, PREFER_LOW)) &&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!"); |
spring_trap(trap,disarmer); | | spring_trap(trap,disarmer); |
} | | } |