]> granicus.if.org Git - nethack/commitdiff
Use TAINT_AGE for old corpses instead of hardcoded value
authorPasi Kallinen <paxed@alt.org>
Mon, 16 Mar 2020 09:27:33 +0000 (11:27 +0200)
committerPasi Kallinen <paxed@alt.org>
Mon, 16 Mar 2020 09:28:09 +0000 (11:28 +0200)
include/hack.h
src/dig.c
src/mklev.c
src/mkobj.c
src/mon.c

index 5d0d134841d51a49ebcf36f224df1f76726a9a64..feb24001e39d45bbf61b677c1c8eafa1c0e2ace6 100644 (file)
@@ -477,6 +477,11 @@ enum bodypart_types {
 #define RANDOM_TIN (-2)
 #define HEALTHY_TIN (-3)
 
+/* Corpse aging */
+#define TAINT_AGE (50L)        /* age when corpses go bad */
+#define TROLL_REVIVE_CHANCE 37 /* 1/37 chance for 50 turns ~ 75% chance */
+#define ROT_AGE (250L)         /* age when corpses rot away */
+
 /* Some misc definitions */
 #define POTION_OCCUPANT_CHANCE(n) (13 + 2 * (n))
 #define WAND_BACKFIRE_CHANCE 100
index 9579b66b71fba3f86f6dce943a45c345059b7d9e..64dc5f1177298b97c8db593ceec692c99bd75e42 100644 (file)
--- a/src/dig.c
+++ b/src/dig.c
@@ -928,7 +928,7 @@ coord *cc;
     case 1:
         You("unearth a corpse.");
         if ((otmp = mk_tt_object(CORPSE, dig_x, dig_y)) != 0)
-            otmp->age -= 100; /* this is an *OLD* corpse */
+            otmp->age -= (TAINT_AGE + 1); /* this is an *OLD* corpse */
         break;
     case 2:
         if (!Blind)
index 85127f6cc36465bc5d2dd0d971a2ad2e46f81f7e..414bd90b690d84517cd236ee94594d1fe91074c9 100644 (file)
@@ -1543,7 +1543,7 @@ coord *tm;
         otmp = mkcorpstat(CORPSE, NULL, &mons[victim_mnum], m.x, m.y,
                           CORPSTAT_INIT);
         if (otmp)
-            otmp->age -= 51; /* died too long ago to eat */
+            otmp->age -= (TAINT_AGE + 1); /* died too long ago to eat */
     }
 }
 
index 91e12b88282f523677666128d130357bc83d4803..0248c873e0212eb7329dfa9db3d37e2c02a1f3e8 100644 (file)
@@ -1189,10 +1189,6 @@ struct obj *body;
     int rot_adjust;
     short action;
 
-#define TAINT_AGE (50L)        /* age when corpses go bad */
-#define TROLL_REVIVE_CHANCE 37 /* 1/37 chance for 50 turns ~ 75% chance */
-#define ROT_AGE (250L)         /* age when corpses rot away */
-
     /* lizards and lichen don't rot or revive */
     if (body->corpsenm == PM_LIZARD || body->corpsenm == PM_LICHEN)
         return;
index 77c7bf073815b2355c1fbeb642821586492bd6c7..3fe0697b1f7e9de142a07384ddb28d5f3c8af258 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -350,7 +350,7 @@ unsigned corpseflags;
         num = undead_to_corpse(mndx);
         corpstatflags |= CORPSTAT_INIT;
         obj = mkcorpstat(CORPSE, mtmp, &mons[num], x, y, corpstatflags);
-        obj->age -= 100; /* this is an *OLD* corpse */
+        obj->age -= (TAINT_AGE + 1); /* this is an *OLD* corpse */
         break;
     case PM_KOBOLD_MUMMY:
     case PM_DWARF_MUMMY:
@@ -371,7 +371,7 @@ unsigned corpseflags;
         num = undead_to_corpse(mndx);
         corpstatflags |= CORPSTAT_INIT;
         obj = mkcorpstat(CORPSE, mtmp, &mons[num], x, y, corpstatflags);
-        obj->age -= 100; /* this is an *OLD* corpse */
+        obj->age -= (TAINT_AGE + 1); /* this is an *OLD* corpse */
         break;
     case PM_IRON_GOLEM:
         num = d(2, 6);