new container flags

[Attention: This patch increments EDITLEVEL in patchlevel.h, rendering all
 previous save and bones files obsolete.]

Here's the first cut at the two recommended flags lknown and cknown.
I've attempted to stay close to Pat's recommendations:
   "Containers ought to have two new flags:  lknown for lock status known,
    and cknown for contents known (ie, `secret').  Formatted box and chest
    descriptions should include locked/unlocked/broken when that is known
    and empty/nonempty (or something like "holds N items") when contents
    are known. The contents indicator would also apply to nonlockable
    containers."

I probably overlooked a place where a flag should be adjusted, but this
should give us a good starting point.

I wasn't sure what to do with the case of the auditory feedback for
magical locking "Click" and "Clunk". The question that came to my mind
was: Should those reveal the locked or unlocked status of a box?
I suppose if you knew the type of wand you were zapping or the spell
you were casting, you could argue that they should.

In the end, I opted for setting lknown right off the zap/cast effect
for anyone playing a Wizard role, and not setting it for anyone else,
thus advancing class differentiation a little bit too.

I haven't checked the cknown results under all flags.menu_style options
at this point, only MENU_FULL.
This commit is contained in:
nethack.allison
2004-12-15 23:50:18 +00:00
parent 10b227e242
commit 5a433fe0e0
10 changed files with 79 additions and 8 deletions

View File

@@ -117,6 +117,7 @@ picklock() /* try to open/close a lock */
else xlock.door->doormask = D_LOCKED;
} else {
xlock.box->olocked = !xlock.box->olocked;
xlock.box->lknown = 1;
if(xlock.box->otrapped)
(void) chest_trap(xlock.box, FINGER, FALSE);
}
@@ -163,6 +164,7 @@ forcelock() /* try to force a locked chest */
You("succeed in forcing the lock.");
xlock.box->olocked = 0;
xlock.box->obroken = 1;
xlock.box->lknown = 1;
if(!xlock.picktyp && !rn2(3)) {
struct monst *shkp;
boolean costly;
@@ -301,6 +303,7 @@ pick_lock(pick) /* pick a lock with a given object */
safe_qbuf("", sizeof("There is here, unlock its lock?"),
doname(otmp), an(simple_typename(otmp->otyp)), "a box"),
verb, it ? "it" : "its lock");
otmp->lknown = 1;
c = ynq(qbuf);
if(c == 'q') return(0);
@@ -461,12 +464,14 @@ doforce() /* try to force a chest with your weapon */
if (otmp->obroken || !otmp->olocked) {
There("is %s here, but its lock is already %s.",
doname(otmp), otmp->obroken ? "broken" : "unlocked");
otmp->lknown = 1;
continue;
}
Sprintf(qbuf,"There is %s here, force its lock?",
safe_qbuf("", sizeof("There is here, force its lock?"),
doname(otmp), an(simple_typename(otmp->otyp)),
"a box"));
otmp->lknown = 1;
c = ynq(qbuf);
if(c == 'q') return(0);
@@ -702,6 +707,7 @@ register struct obj *obj, *otmp; /* obj *is* a box */
pline("Klunk!");
obj->olocked = 1;
obj->obroken = 0;
if (Role_if(PM_WIZARD)) obj->lknown = 1;
res = 1;
} /* else already closed and locked */
break;
@@ -711,6 +717,7 @@ register struct obj *obj, *otmp; /* obj *is* a box */
pline("Klick!");
obj->olocked = 0;
res = 1;
if (Role_if(PM_WIZARD)) obj->lknown = 1;
} else /* silently fix if broken */
obj->obroken = 0;
break;