From: PatR Date: Fri, 22 Apr 2022 13:11:12 +0000 (-0700) Subject: fix github issue #742 - suit of no digestion X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8374b36a1c4825a9e5b20621addc805984412b3;p=nethack fix github issue #742 - suit of no digestion Reported by vultur-cadens: slow digestion from wearing white dragon scales/mail blocked per-turn hunger and didn't cause any hunger, unlike ring of slow digestion which blocks per-turn hunger but still causes some hunger as a worn ring itself. If no rings or amulet were worn, wearing the suit prevented the hero from ever burning any nutrition. Change to treat wearing the suit to be quite a bit like wearing a ring, unless hero is also wearing an actual ring of slow digestion (then the hunger cost of the suit is 'free'). Wearing a ring of slow digestion and another ring consumes two units of nutrition every 20 turns, no matter what suit. Wearing white dragon scales/mail and two non-slow digestion rings now consumes three units of nutrition every 20 turns. Using the suit to effectively get an extra ring finger isn't free. Fixes #742 --- diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index a4a685978..c8b4afaa3 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1163,6 +1163,9 @@ corpses of neuter monsters had random chance to be flagged as female so would one-shot food testing ability conferred by blessed scroll of food detection didn't warn about globs of green slime because the relevant code was only executed for corpses, eggs, and tins, not for globs +worn ring of slow digestion blocks per-turn hunger but not the hunger caused + by wearing it; white dragon scales/mail was blocking per-turn hunger + and didn't cause any hunger itself; change to treat it like the ring curses: 'msg_window' option wasn't functional for curses unless the binary also included tty support diff --git a/src/eat.c b/src/eat.c index 075a96299..1f7be1577 100644 --- a/src/eat.c +++ b/src/eat.c @@ -3036,8 +3036,26 @@ gethungry(void) * +0 ring of protection might do something (enhanced "magical * cancellation") if hero doesn't have protection from some * other source (cloak or second ring). + * + * [If wearing duplicate rings whose effects don't stack, + * should they both consume nutrition, or just one of them? + * Two +0 rings of protection are treated as if only one, + * but this could apply to most rings.] */ switch (accessorytime) { /* note: use even cases among 0..19 only */ + case 0: + /* 3.7: if not wearing a ring of slow digestion, obtaining + that property from worn armor (white dragon scales/mail) + causes the armor to burn nutrition; since it's not + actually a ring, we don't check for it on the ring + turns; because of that, wearing two (non-slow digestion) + rings plus the armor consumes more nutrition that one + non-slow digestion ring plus ring of slow digestion */ + if (Slow_digestion + && (!uright || uright->otyp != RIN_SLOW_DIGESTION) + && (!uleft || uleft->otyp != RIN_SLOW_DIGESTION)) + u.uhunger--; + break; case 4: if (uleft && uleft->otyp != MEAT_RING /* more hungry if +/- is nonzero or +/- doesn't apply or