new composite status conditions: weaponstatus,\

armorstatus, and terrainstatus

This adds three special status items to show at a glance what the hero
is wielding, wearing, and standing on.

Each of the three items has its own boolean option rather than try to
fix them in with the existing opttional status conditions.  After a
lot of testing, I think the weapon and armor ones will prove useful
but the terrain one probably won't be.

Presently it is implemented for tty and curses.  When I developed it
six years ago, it was also working for X11 but I'm not able to test
the resurrection of that part so have left it out.
This commit is contained in:
PatR
2026-04-16 13:35:08 -07:00
parent 45e8305918
commit 84ddf85cb4
20 changed files with 659 additions and 72 deletions

View File

@@ -5320,12 +5320,24 @@ optfn_boolean(
return optn_ok;
switch (optidx) {
case opt_time:
#ifdef SCORE_ON_BOTL
case opt_terrainstatus:
classify_terrain(); /* bring iflags.terrain_typ up to date */
FALLTHROUGH;
/*FALLTHRU*/
case opt_weaponstatus:
case opt_armorstatus:
if (!wc2_supported(allopt[optidx].name)) {
/* not actually an error */
config_error_add("'%s' is not supported.",
allopt[optidx].name);
return optn_ok;
}
FALLTHROUGH;
/*FALLTHRU*/
case opt_showscore:
#endif
case opt_showvers:
case opt_showexp:
case opt_time:
if (VIA_WINDOWPORT())
status_initialize(REASSESS_ONLY);
disp.botl = TRUE;
@@ -9827,6 +9839,7 @@ static struct wc_Opt wc_options[] = {
{ (char *) 0, 0L }
};
static struct wc_Opt wc2_options[] = {
{ "armorstatus", WC2_EXTRASTATUS },
{ "fullscreen", WC2_FULLSCREEN },
{ "guicolor", WC2_GUICOLOR },
{ "hilite_status", WC2_HILITE_STATUS },
@@ -9841,7 +9854,9 @@ static struct wc_Opt wc2_options[] = {
{ "statuslines", WC2_STATUSLINES },
{ "term_cols", WC2_TERM_SIZE },
{ "term_rows", WC2_TERM_SIZE },
{ "terrainstatus", WC2_EXTRASTATUS },
{ "use_darkgray", WC2_DARKGRAY },
{ "weaponstatus", WC2_EXTRASTATUS },
{ "windowborders", WC2_WINDOWBORDERS },
{ "wraptext", WC2_WRAPTEXT },
{ (char *) 0, 0L }