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

@@ -1917,15 +1917,27 @@ dounpaid()
*/
for (otmp = invent; otmp; otmp = otmp->nobj) {
if (Has_contents(otmp)) {
long contcost = 0L;
marker = (struct obj *) 0; /* haven't found any */
while (find_unpaid(otmp->cobj, &marker)) {
totcost += cost = unpaid_cost(marker);
save_unpaid = marker->unpaid;
marker->unpaid = 0; /* suppress "(unpaid)" suffix */
putstr(win, 0,
contcost += cost;
if (otmp->cknown) {
save_unpaid = marker->unpaid;
marker->unpaid = 0; /* suppress "(unpaid)" suffix */
putstr(win, 0,
xprname(marker, distant_name(marker, doname),
CONTAINED_SYM, TRUE, cost, 0L));
marker->unpaid = save_unpaid;
marker->unpaid = save_unpaid;
}
}
if (!otmp->cknown) {
char contbuf[BUFSZ];
/* Shopkeeper knows what to charge for contents */
Sprintf(contbuf, "%s contents", s_suffix(xname(otmp)));
putstr(win, 0,
xprname((struct obj *)0, contbuf,
CONTAINED_SYM, TRUE, contcost, 0L));
}
}
}
@@ -2937,6 +2949,7 @@ register struct obj *obj;
free((genericptr_t)selected);
} else
ret = (struct obj *) 0;
obj->cknown = 1;
return ret;
}