-/* 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. */
/* NetHack may be freely redistributed. See license for details. */
#define Is_box(otmp) (otmp->otyp == LARGE_BOX || otmp->otyp == CHEST)
#define Is_mbag(otmp) (otmp->otyp == BAG_OF_HOLDING || \
otmp->otyp == BAG_OF_TRICKS)
+#define SchroedingersBox(o) ((o)->otyp == LARGE_BOX && (o)->spe == 1)
/* dragon gear */
#define Is_dragon_scales(obj) ((obj)->otyp >= GRAY_DRAGON_SCALES && \
switch(what) {
case CAT_CHECK: /* Schroedinger's Cat */
/* Ascending is deterministic */
- if (otmp->otyp == LARGE_BOX && otmp->spe == 1)
+ if (SchroedingersBox(otmp))
return rn2(2);
break;
}
box->cknown = 1; /* we're looking at the contents now */
if (identified) box->lknown = 1;
cat = deadcat = FALSE;
- if (box->otyp == LARGE_BOX &&
- box->spe == 1 && !Schroedingers_cat) {
+ if (SchroedingersBox(box) && !Schroedingers_cat) {
/* Schroedinger's Cat? */
cat = odds_and_ends(box, CAT_CHECK);
if (cat) Schroedingers_cat = TRUE;
-/* 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. */
/* NetHack may be freely redistributed. See license for details. */
{
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;
if (Is_container(obj) || obj->otyp == STATUE) {
struct obj *contents;
-/* 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. */
/* NetHack may be freely redistributed. See license for details. */
/* from here on out, all early returns go through containerdone */
/* check for Schroedinger's Cat */
- quantum_cat = (current_container->spe == 1); /* "it's _now_ empty" */
+ quantum_cat = SchroedingersBox(current_container);
if (quantum_cat) {
observe_quantum_cat(current_container);
used = 1;
}
if (maybeshopgoods && !box->no_charge)
subfrombill(box, shop_keeper(*in_rooms(ox, oy, SHOPBASE)));
- } else if (box->spe) {
+ } else if (SchroedingersBox(box)) {
char yourbuf[BUFSZ];
observe_quantum_cat(box);
-/* 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. */
/* NetHack may be freely redistributed. See license for details. */
#else
if (mtmp->minvent) {
#endif
- for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
+ for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) {
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 {
pline("%s is not carrying anything.", noit_Monnam(mtmp));
}
obj->dknown = 1;
if (Is_container(obj) || obj->otyp == STATUE) {
obj->cknown = obj->lknown = 1;
- if (!obj->cobj)
- pline("%s empty.", Tobjnam(obj, "are"));
- else {
+ if (!obj->cobj) {
+ boolean catbox = 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"));
+ } else {
struct obj *o;
/* view contents (not recursively) */
for (o = obj->cobj; o; o = o->nobj)
{
struct obj *otmp;
- for (otmp = invent; otmp; otmp = otmp->nobj)
+ for (otmp = invent; otmp; otmp = otmp->nobj) {
otmp->dknown = 1;
+ if (Is_container(otmp) || otmp->otyp == STATUE) {
+ otmp->lknown = 1;
+ if (!SchroedingersBox(otmp)) otmp->cknown = 1;
+ }
+ }
learn_it = TRUE;
ustatusline();
break;