]> granicus.if.org Git - nethack/commitdiff
Use define for iron ball weight increment
authorPasi Kallinen <paxed@alt.org>
Wed, 6 Jan 2016 14:23:48 +0000 (16:23 +0200)
committerPasi Kallinen <paxed@alt.org>
Wed, 6 Jan 2016 14:23:48 +0000 (16:23 +0200)
include/hack.h
src/objnam.c
src/read.c
src/weapon.c

index 2eae9e6bac16ea0a58cf9612258e2d4fcf026395..816b7fee02685eb858bf65b846fc74ddf5a42cd8 100644 (file)
@@ -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
index 5dc1e8c2e132813d00a8b4ebb80f2ab699531355..8e98e07b88c8d6389db22a31457c694c14e97d1d 100644 (file)
@@ -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;
 }
index 94619ba1124f7d668a2e8e11da703d4e6794eb10..4ba274146e9837ffeed1ee9548872ad0b95ef09e 100644 (file)
@@ -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)
index cc14f35ec4912ef7e10ebcd15b42154d06db29ee..cdbd440db44c136cf9131415c7e55d699c465587 100644 (file)
@@ -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 */