discovered objects within class for a and u
If any artifacts are discovered and menustyle traditional is in use,
the player can type `a to get the artifact subset of discovered items.
Likewise with `u to for unique items (the invocation tools and the
real Amulet). For normal object classes, `<class> works for every
class, even when there aren't any discoveries for it (where you get
told "you haven't discovered any yet" if you pick such). But `a
and `u were only allowed if at least one thing in the corresponding
category had been discovered. Change to allow it even when none have
been. The feedback of "you haven't discovered any {unique items,
artifacts} yet" was already in place.
Doesn't apply for picking the class via menu. Menus don't have any
concept of "allowed as a response even though not listed as a choice".
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 o_init.c $NHDT-Date: 1614812489 2021/03/03 23:01:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.50 $ */
|
||||
/* NetHack 3.7 o_init.c $NHDT-Date: 1646953028 2022/03/10 22:57:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.56 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -833,11 +833,14 @@ doclassdisco(void)
|
||||
/* have player choose a class */
|
||||
c = '\0'; /* class not chosen yet */
|
||||
if (traditional) {
|
||||
char allclasses_plustwo[sizeof allclasses + 2];
|
||||
|
||||
/* we'll prompt even if there's only one viable class; we add all
|
||||
nonviable classes as unseen acceptable choices so player can ask
|
||||
for discoveries of any class whether it has discoveries or not */
|
||||
for (s = allclasses, xtras = 0; *s; ++s) {
|
||||
c = def_oc_syms[(int) *s].sym;
|
||||
Sprintf(allclasses_plustwo, "%s%c%c", allclasses, 'u', 'a');
|
||||
for (s = allclasses_plustwo, xtras = 0; *s; ++s) {
|
||||
c = (*s == 'u' || *s == 'a') ? *s : def_oc_syms[(int) *s].sym;
|
||||
if (!index(discosyms, c)) {
|
||||
if (!xtras++)
|
||||
(void) strkitten(discosyms, '\033');
|
||||
|
||||
Reference in New Issue
Block a user