probing vs Schroedinger's Cat (trunk only)
Someone in the newsgroup complained about zapping probing at a large box dropped by a quantum mechanic and being told that it was empty rather than that it held a corpse or live cat. This sidesteps the issue by reporting "the box seems empty" instead of "the box is empty", and not setting its contents-known flag. (That message is the main difference between probing and the assorted other methods of observation [telepathy and monster detection and possibly Warning for live cat, object detection and food detection for dead cat's corpse] which might be expected to trigger the cat's fate but don't.) This also makes probing of self and of monsters set the contents-known and locking-known flags for containers in inventory, same as is done for probing which hits objects. (Display of container contents still only occurs for loose objects, not in inventory.)
This commit is contained in:
+2
-1
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)obj.h 3.5 2006/12/14 */
|
/* SCCS Id: @(#)obj.h 3.5 2007/02/17 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -242,6 +242,7 @@ struct obj {
|
|||||||
#define Is_box(otmp) (otmp->otyp == LARGE_BOX || otmp->otyp == CHEST)
|
#define Is_box(otmp) (otmp->otyp == LARGE_BOX || otmp->otyp == CHEST)
|
||||||
#define Is_mbag(otmp) (otmp->otyp == BAG_OF_HOLDING || \
|
#define Is_mbag(otmp) (otmp->otyp == BAG_OF_HOLDING || \
|
||||||
otmp->otyp == BAG_OF_TRICKS)
|
otmp->otyp == BAG_OF_TRICKS)
|
||||||
|
#define SchroedingersBox(o) ((o)->otyp == LARGE_BOX && (o)->spe == 1)
|
||||||
|
|
||||||
/* dragon gear */
|
/* dragon gear */
|
||||||
#define Is_dragon_scales(obj) ((obj)->otyp >= GRAY_DRAGON_SCALES && \
|
#define Is_dragon_scales(obj) ((obj)->otyp >= GRAY_DRAGON_SCALES && \
|
||||||
|
|||||||
@@ -515,7 +515,7 @@ int what;
|
|||||||
switch(what) {
|
switch(what) {
|
||||||
case CAT_CHECK: /* Schroedinger's Cat */
|
case CAT_CHECK: /* Schroedinger's Cat */
|
||||||
/* Ascending is deterministic */
|
/* Ascending is deterministic */
|
||||||
if (otmp->otyp == LARGE_BOX && otmp->spe == 1)
|
if (SchroedingersBox(otmp))
|
||||||
return rn2(2);
|
return rn2(2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -972,8 +972,7 @@ boolean identified, all_containers, reportempty;
|
|||||||
box->cknown = 1; /* we're looking at the contents now */
|
box->cknown = 1; /* we're looking at the contents now */
|
||||||
if (identified) box->lknown = 1;
|
if (identified) box->lknown = 1;
|
||||||
cat = deadcat = FALSE;
|
cat = deadcat = FALSE;
|
||||||
if (box->otyp == LARGE_BOX &&
|
if (SchroedingersBox(box) && !Schroedingers_cat) {
|
||||||
box->spe == 1 && !Schroedingers_cat) {
|
|
||||||
/* Schroedinger's Cat? */
|
/* Schroedinger's Cat? */
|
||||||
cat = odds_and_ends(box, CAT_CHECK);
|
cat = odds_and_ends(box, CAT_CHECK);
|
||||||
if (cat) Schroedingers_cat = TRUE;
|
if (cat) Schroedingers_cat = TRUE;
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)mkobj.c 3.5 2007/01/02 */
|
/* SCCS Id: @(#)mkobj.c 3.5 2007/02/17 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -1082,7 +1082,7 @@ register struct obj *obj;
|
|||||||
{
|
{
|
||||||
int wt = objects[obj->otyp].oc_weight;
|
int wt = objects[obj->otyp].oc_weight;
|
||||||
|
|
||||||
if (obj->otyp == LARGE_BOX && obj->spe == 1) /* Schroedinger's Cat */
|
if (SchroedingersBox(obj))
|
||||||
wt += mons[PM_HOUSECAT].cwt;
|
wt += mons[PM_HOUSECAT].cwt;
|
||||||
if (Is_container(obj) || obj->otyp == STATUE) {
|
if (Is_container(obj) || obj->otyp == STATUE) {
|
||||||
struct obj *contents;
|
struct obj *contents;
|
||||||
|
|||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)pickup.c 3.5 2007/01/02 */
|
/* SCCS Id: @(#)pickup.c 3.5 2007/02/17 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -2166,7 +2166,7 @@ int held;
|
|||||||
/* from here on out, all early returns go through containerdone */
|
/* from here on out, all early returns go through containerdone */
|
||||||
|
|
||||||
/* check for Schroedinger's Cat */
|
/* check for Schroedinger's Cat */
|
||||||
quantum_cat = (current_container->spe == 1); /* "it's _now_ empty" */
|
quantum_cat = SchroedingersBox(current_container);
|
||||||
if (quantum_cat) {
|
if (quantum_cat) {
|
||||||
observe_quantum_cat(current_container);
|
observe_quantum_cat(current_container);
|
||||||
used = 1;
|
used = 1;
|
||||||
@@ -2706,7 +2706,7 @@ struct obj *box; /* or bag */
|
|||||||
}
|
}
|
||||||
if (maybeshopgoods && !box->no_charge)
|
if (maybeshopgoods && !box->no_charge)
|
||||||
subfrombill(box, shop_keeper(*in_rooms(ox, oy, SHOPBASE)));
|
subfrombill(box, shop_keeper(*in_rooms(ox, oy, SHOPBASE)));
|
||||||
} else if (box->spe) {
|
} else if (SchroedingersBox(box)) {
|
||||||
char yourbuf[BUFSZ];
|
char yourbuf[BUFSZ];
|
||||||
|
|
||||||
observe_quantum_cat(box);
|
observe_quantum_cat(box);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)zap.c 3.5 2007/01/27 */
|
/* SCCS Id: @(#)zap.c 3.5 2007/02/17 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -434,9 +434,14 @@ struct monst *mtmp;
|
|||||||
#else
|
#else
|
||||||
if (mtmp->minvent) {
|
if (mtmp->minvent) {
|
||||||
#endif
|
#endif
|
||||||
for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
|
for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) {
|
||||||
otmp->dknown = 1; /* treat as "seen" */
|
otmp->dknown = 1; /* treat as "seen" */
|
||||||
(void) display_minventory(mtmp, MINV_ALL, (char *)0);
|
if (Is_container(otmp) || otmp->otyp == STATUE) {
|
||||||
|
otmp->lknown = 1;
|
||||||
|
if (!SchroedingersBox(otmp)) otmp->cknown = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(void) display_minventory(mtmp, MINV_ALL|MINV_NOLET, (char *)0);
|
||||||
} else {
|
} else {
|
||||||
pline("%s is not carrying anything.", noit_Monnam(mtmp));
|
pline("%s is not carrying anything.", noit_Monnam(mtmp));
|
||||||
}
|
}
|
||||||
@@ -1614,9 +1619,16 @@ struct obj *obj, *otmp;
|
|||||||
obj->dknown = 1;
|
obj->dknown = 1;
|
||||||
if (Is_container(obj) || obj->otyp == STATUE) {
|
if (Is_container(obj) || obj->otyp == STATUE) {
|
||||||
obj->cknown = obj->lknown = 1;
|
obj->cknown = obj->lknown = 1;
|
||||||
if (!obj->cobj)
|
if (!obj->cobj) {
|
||||||
pline("%s empty.", Tobjnam(obj, "are"));
|
boolean catbox = SchroedingersBox(obj);
|
||||||
else {
|
|
||||||
|
/* 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"));
|
||||||
|
} else {
|
||||||
struct obj *o;
|
struct obj *o;
|
||||||
/* view contents (not recursively) */
|
/* view contents (not recursively) */
|
||||||
for (o = obj->cobj; o; o = o->nobj)
|
for (o = obj->cobj; o; o = o->nobj)
|
||||||
@@ -2243,8 +2255,13 @@ boolean ordinary;
|
|||||||
{
|
{
|
||||||
struct obj *otmp;
|
struct obj *otmp;
|
||||||
|
|
||||||
for (otmp = invent; otmp; otmp = otmp->nobj)
|
for (otmp = invent; otmp; otmp = otmp->nobj) {
|
||||||
otmp->dknown = 1;
|
otmp->dknown = 1;
|
||||||
|
if (Is_container(otmp) || otmp->otyp == STATUE) {
|
||||||
|
otmp->lknown = 1;
|
||||||
|
if (!SchroedingersBox(otmp)) otmp->cknown = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
learn_it = TRUE;
|
learn_it = TRUE;
|
||||||
ustatusline();
|
ustatusline();
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user