From: PatR Date: Thu, 22 Nov 2018 02:32:04 +0000 (-0800) Subject: more Schroedinger's Cat X-Git-Tag: NetHack-3.6.2_Released~162^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=55ad316079c857b18456a8d238bd8252f15b845b;p=nethack more Schroedinger's Cat Prevent food detection--scroll or crystal ball--from noticing the cat corpse inside SchroedingersBox since its presence is tentative and resolving its status during detection is a huge can of worms (live cat placement on map from inside locked box, parallel resolution required for monster detection/warning/telepathy that would render the box fairly useless since it would probably end up getting resolved by ESP before hero gains access). Prevent cat corpse in the Box from being added to shop bill if unpaid Box is picked up. That prevents it from being listed as a bought item if the player buys the box (instead of being described as unknown contents; an older, more general bug which still hasn't been fixed). As far as I'm aware, off the revised handling of Schroedingers Cat is finished. --- diff --git a/src/detect.c b/src/detect.c index 57ee916ce..416c2611f 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 detect.c $NHDT-Date: 1522891623 2018/04/05 01:27:03 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.81 $ */ +/* NetHack 3.6 detect.c $NHDT-Date: 1542853884 2018/11/22 02:31:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.87 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2018. */ /* NetHack may be freely redistributed. See license for details. */ @@ -165,8 +165,14 @@ char oclass; if (obj->oclass == oclass) return obj; - - if (Has_contents(obj)) { + /* + * Note: we exclude SchroedingersBox because the corpse it contains + * isn't necessarily a corpse yet. Resolving the status would lead + * to complications if it turns out to be a live cat. We know that + * that Box can't contain anything else because putting something in + * would resolve the cat/corpse situation and convert to ordinary box. + */ + if (Has_contents(obj) && !SchroedingersBox(obj)) { for (otmp = obj->cobj; otmp; otmp = otmp->nobj) if (otmp->oclass == oclass) return otmp; @@ -442,8 +448,7 @@ outgoldmap: return 0; } -/* returns 1 if nothing was detected */ -/* returns 0 if something was detected */ +/* returns 1 if nothing was detected, 0 if something was detected */ int food_detect(sobj) register struct obj *sobj; diff --git a/src/shk.c b/src/shk.c index 472b1f165..c2895a29f 100644 --- a/src/shk.c +++ b/src/shk.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 shk.c $NHDT-Date: 1515144230 2018/01/05 09:23:50 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.136 $ */ +/* NetHack 3.6 shk.c $NHDT-Date: 1542853899 2018/11/22 02:31:39 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.142 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2400,6 +2400,8 @@ register struct monst *shkp; { register struct obj *otmp; + if (SchroedingersBox(obj)) + return; for (otmp = obj->cobj; otmp; otmp = otmp->nobj) { if (otmp->oclass == COIN_CLASS) continue; @@ -2597,15 +2599,16 @@ char *buf; static const char *const honored[] = { "good", "honored", "most gracious", "esteemed", "most renowned and sacred" }; + Strcat(buf, honored[rn2(SIZE(honored) - 1) + u.uevent.udemigod]); if (is_vampire(youmonst.data)) Strcat(buf, (flags.female) ? " dark lady" : " dark lord"); else if (is_elf(youmonst.data)) Strcat(buf, (flags.female) ? " hiril" : " hir"); else - Strcat(buf, !is_human(youmonst.data) ? " creature" : (flags.female) - ? " lady" - : " sir"); + Strcat(buf, !is_human(youmonst.data) ? " creature" + : (flags.female) ? " lady" + : " sir"); } void