From 8ff2badf51f7548fe8da7b2f43b334d0f4ccdcf3 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 17 Jul 2021 20:59:40 +0300 Subject: [PATCH] Use define for wand wresting chance --- include/hack.h | 1 + src/zap.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hack.h b/include/hack.h index 792d02d56..ab3670494 100644 --- a/include/hack.h +++ b/include/hack.h @@ -480,6 +480,7 @@ enum bodypart_types { /* Some misc definitions */ #define POTION_OCCUPANT_CHANCE(n) (13 + 2 * (n)) #define WAND_BACKFIRE_CHANCE 100 +#define WAND_WREST_CHANCE 121 #define BALL_IN_MON (u.uswallow && uball && uball->where == OBJ_FREE) #define CHAIN_IN_MON (u.uswallow && uchain && uchain->where == OBJ_FREE) #define NODIAG(monnum) ((monnum) == PM_GRID_BUG) diff --git a/src/zap.c b/src/zap.c index 9771627ad..06aec2901 100644 --- a/src/zap.c +++ b/src/zap.c @@ -2243,7 +2243,7 @@ bhitpile( int zappable(struct obj *wand) { - if (wand->spe < 0 || (wand->spe == 0 && rn2(121))) + if (wand->spe < 0 || (wand->spe == 0 && rn2(WAND_WREST_CHANCE))) return 0; if (wand->spe == 0) You("wrest one last charge from the worn-out wand.");