-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.296 $ $NHDT-Date: 1599184888 2020/09/04 02:01:28 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.297 $ $NHDT-Date: 1599255099 2020/09/04 21:31:39 $
General Fixes and Modified Features
-----------------------------------
noticeable but not harmful for X11, and slightly harmful for Qt
turning into slime rendered hero as slime one turn too soon
avoid potential infinite loop if hangup occurs at ring "right or left?" prompt
+randomize the turns where accessories and extrinsics affect nutrition
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
-/* NetHack 3.7 eat.c $NHDT-Date: 1596498165 2020/08/03 23:42:45 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.231 $ */
+/* NetHack 3.7 eat.c $NHDT-Date: 1599255099 2020/09/04 21:31:39 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.232 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
void
gethungry()
{
+ long accessorytime;
+
if (u.uinvulnerable)
return; /* you don't feel hungrier */
&& !Slow_digestion)
u.uhunger--; /* ordinary food consumption */
- if (g.moves % 2) { /* odd turns */
+ /*
+ * 3.7: trigger is randomized instead of (moves % N). Makes
+ * ring juggling (using the 'time' option to see the turn counter
+ * in order to time swapping of a pair of rings of slow digestion,
+ * wearing one on one hand, then putting on the other and taking
+ * off the first, then vice versa, over and over and over and ...
+ * to avoid any hunger from wearing a ring) become ineffective.
+ * Also causes melee-induced hunger to vary from turn-based hunger
+ * instead of just replicating that.
+ */
+ accessorytime = g.moves + (long) rn2(20);
+ if (accessorytime % 2L) { /* odd */
/* Regeneration uses up food, unless due to an artifact */
if ((HRegeneration & ~FROMFORM)
|| (ERegeneration & ~(W_ARTI | W_WEP)))
u.uhunger--;
if (near_capacity() > SLT_ENCUMBER)
u.uhunger--;
- } else { /* even turns */
+ } else { /* even */
if (Hunger)
u.uhunger--;
/* Conflict uses up food too */
* cancellation") if hero doesn't have protection from some
* other source (cloak or second ring).
*/
- switch ((int) (g.moves % 20)) { /* note: use even cases only */
+ switch ((int) (accessorytime % 20L)) { /* note: use even cases only */
case 4:
if (uleft && uleft->otyp != MEAT_RING
/* more hungry if +/- is nonzero or +/- doesn't apply or