trapped box->tknown
If 'autounlock' is set to test a chest for traps, skip "check for traps?" when tknown is set; go directly to "disarm trap?" if the chest is trapped, skip that too if it isn't. If wand of probing hits a chest, set the tknown bit.
This commit is contained in:
+3
-10
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 lock.c $NHDT-Date: 1718745135 2024/06/18 21:12:15 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.137 $ */
|
/* NetHack 3.7 lock.c $NHDT-Date: 1741793439 2025/03/12 07:30:39 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.145 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -432,14 +432,6 @@ pick_lock(
|
|||||||
boolean it;
|
boolean it;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
/*
|
|
||||||
* FIXME:
|
|
||||||
* (chest->otrapped && chest->tknown) is handled, to skip
|
|
||||||
* checking for a trap and continue with asking about disarm;
|
|
||||||
* (chest->tknown && !chest->otrapped) ignores tknown and will
|
|
||||||
* ask about checking for non-existant trap.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (u.dz < 0 && !autounlock) { /* beware stale u.dz value */
|
if (u.dz < 0 && !autounlock) { /* beware stale u.dz value */
|
||||||
There("isn't any sort of lock up %s.",
|
There("isn't any sort of lock up %s.",
|
||||||
Levitation ? "here" : "there");
|
Levitation ? "here" : "there");
|
||||||
@@ -478,7 +470,8 @@ pick_lock(
|
|||||||
|
|
||||||
if (autounlock && (flags.autounlock & AUTOUNLOCK_UNTRAP) != 0
|
if (autounlock && (flags.autounlock & AUTOUNLOCK_UNTRAP) != 0
|
||||||
&& could_untrap(FALSE, TRUE)
|
&& could_untrap(FALSE, TRUE)
|
||||||
&& (c = ynq(safe_qbuf(qbuf, "Check ", " for a trap?",
|
&& (c = otmp->tknown ? (otmp->otrapped ? 'y' : 'n')
|
||||||
|
: ynq(safe_qbuf(qbuf, "Check ", " for a trap?",
|
||||||
otmp, yname, ysimple_name, "this")))
|
otmp, yname, ysimple_name, "this")))
|
||||||
!= 'n') {
|
!= 'n') {
|
||||||
if (c == 'q')
|
if (c == 'q')
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 zap.c $NHDT-Date: 1737344505 2025/01/19 19:41:45 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.562 $ */
|
/* NetHack 3.7 zap.c $NHDT-Date: 1741793439 2025/03/12 07:30:39 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.564 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -2209,10 +2209,14 @@ bhito(struct obj *obj, struct 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;
|
||||||
/* plural handling here is superfluous because containers
|
if (Is_box(obj) && !obj->tknown) {
|
||||||
and statues don't stack */
|
/* obj->tknown applies to boxes and chests, not bags or
|
||||||
if (obj->otrapped)
|
statues; plural handling here and the "empty" case
|
||||||
pline("%s trapped!", Tobjnam(obj, "are"));
|
below are superfluous because containers don't stack */
|
||||||
|
if (obj->otrapped)
|
||||||
|
pline("%s trapped!", Tobjnam(obj, "are"));
|
||||||
|
obj->tknown = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!obj->cobj) {
|
if (!obj->cobj) {
|
||||||
pline("%s empty.", Tobjnam(obj, "are"));
|
pline("%s empty.", Tobjnam(obj, "are"));
|
||||||
|
|||||||
Reference in New Issue
Block a user