From c740425a90192595be4c81177e9db62e3a333bbf Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 6 Jan 2016 16:23:48 +0200 Subject: [PATCH] Use define for iron ball weight increment --- include/hack.h | 3 +++ src/objnam.c | 2 +- src/read.c | 2 +- src/weapon.c | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/hack.h b/include/hack.h index 2eae9e6ba..816b7fee0 100644 --- a/include/hack.h +++ b/include/hack.h @@ -29,6 +29,9 @@ #define EXT_ENCUMBER 4 /* Overtaxed */ #define OVERLOADED 5 /* Overloaded */ +/* weight increment of heavy iron ball */ +#define IRON_BALL_W_INCR 160 + /* hunger states - see hu_stat in eat.c */ #define SATIATED 0 #define NOT_HUNGRY 1 diff --git a/src/objnam.c b/src/objnam.c index 5dc1e8c2e..8e98e07b8 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -3533,7 +3533,7 @@ typfnd: } otmp->owt = weight(otmp); if (very && otmp->otyp == HEAVY_IRON_BALL) - otmp->owt += 160; + otmp->owt += IRON_BALL_W_INCR; return otmp; } diff --git a/src/read.c b/src/read.c index 94619ba11..4ba274146 100644 --- a/src/read.c +++ b/src/read.c @@ -2271,7 +2271,7 @@ struct obj *sobj; You("are being punished for your misbehavior!"); if (Punished) { Your("iron ball gets heavier."); - uball->owt += 160 * (1 + sobj->cursed); + uball->owt += IRON_BALL_W_INCR * (1 + sobj->cursed); return; } if (amorphous(youmonst.data) || is_whirly(youmonst.data) diff --git a/src/weapon.c b/src/weapon.c index cc14f35ec..cdbd440db 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -304,12 +304,12 @@ struct monst *mon; if (ptr == &mons[PM_SHADE] && !shade_glare(otmp)) tmp = 0; - /* "very heavy iron ball"; weight increase is in increments of 160 */ + /* "very heavy iron ball"; weight increase is in increments */ if (otyp == HEAVY_IRON_BALL && tmp > 0) { int wt = (int) objects[HEAVY_IRON_BALL].oc_weight; if ((int) otmp->owt > wt) { - wt = ((int) otmp->owt - wt) / 160; + wt = ((int) otmp->owt - wt) / IRON_BALL_W_INCR; tmp += rnd(4 * wt); if (tmp > 25) tmp = 25; /* objects[].oc_wldam */ -- 2.40.0