Schroedinger's Cat
If hero was carrying Schroedinger's Box at end of game, disclosing inventory converted it into an ordinary box. That interferred with subsequent disclosure when writing DUMPLOG, which saw an empty box if inventory had been shown or the special box with newly-determined contents if not. I tried a couple of ways to fix it and decided that redoing it was better in the long run. Schroedinger's box is still flagged with box->spe = 1, but instead of having that affect the box's weight, now there is always a cat corpse in the box. When opened, that will already be in place for a dead cat or be discarded for a live one, but the weight will be standard for container+contents and when box->cknown is set it will always be "containing 1 item" (which might turn out to be a monster). Some temporary code fixes up old save/bones files to stay compatible. TODO: food detection used to skip Schroedinger's Box; now it will always find a corpse, so some fixup like the ridiculous probing code is needed.
This commit is contained in:
15
src/zap.c
15
src/zap.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 zap.c $NHDT-Date: 1537234123 2018/09/18 01:28:43 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.287 $ */
|
||||
/* NetHack 3.6 zap.c $NHDT-Date: 1542798627 2018/11/21 11:10:27 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.289 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1916,14 +1916,17 @@ struct obj *obj, *otmp;
|
||||
if (Is_container(obj) || obj->otyp == STATUE) {
|
||||
obj->cknown = obj->lknown = 1;
|
||||
if (!obj->cobj) {
|
||||
boolean catbox = SchroedingersBox(obj);
|
||||
|
||||
pline("%s empty.", Tobjnam(obj, "are"));
|
||||
} else if (SchroedingersBox(obj)) {
|
||||
/* we don't want to force alive vs dead
|
||||
determination for Schroedinger's Cat here,
|
||||
so just make probing be inconclusive for it */
|
||||
if (catbox)
|
||||
obj->cknown = 0;
|
||||
pline("%s empty.", Tobjnam(obj, catbox ? "seem" : "are"));
|
||||
You("aren't sure whether %s has %s or its corpse inside.",
|
||||
the(xname(obj)),
|
||||
/* unfortunately, we can't tell whether rndmonnam()
|
||||
picks a form which can't leave a corpse */
|
||||
an(Hallucination ? rndmonnam((char *) 0) : "cat"));
|
||||
obj->cknown = 0;
|
||||
} else {
|
||||
struct obj *o;
|
||||
/* view contents (not recursively) */
|
||||
|
||||
Reference in New Issue
Block a user