From 406faad87961011cdfbead9ca7dee203b5f4b5bf Mon Sep 17 00:00:00 2001 From: Michael Meyer Date: Thu, 23 Jun 2022 11:19:28 -0400 Subject: [PATCH 1/2] Get wizmgender working again The wizard-mode option to highlight female monsters stopped having any in-game effect after cb0c21e. Formerly it caused female monsters to be highlighted with a red background (red color + inverse); this commit uses inverse video only without overriding their color. Ensuring the color override works consistently with the ENHANCED_SYMBOLS 24-bit color doesn't seem worth it for what is a very niche debugging option, and I think inverse video should probably suffice. It also used to be a TTY-only option, but this enables it in curses as well. --- win/curses/cursmain.c | 7 ++++++- win/tty/wintty.c | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/win/curses/cursmain.c b/win/curses/cursmain.c index a1ce68223..be8074feb 100644 --- a/win/curses/cursmain.c +++ b/win/curses/cursmain.c @@ -806,7 +806,12 @@ curses_print_glyph(winid wid, coordxy x, coordxy y, /* water and lava look the same except for color; when color is off, render lava in inverse video so that they look different */ if ((special & (MG_BW_LAVA | MG_BW_ICE)) != 0 && iflags.use_inverse) { - attr = A_REVERSE; /* map_glyphinfo() only sets this if color is off */ + /* reset_glyphmap() only sets MG_BW_foo if color is off */ + attr = A_REVERSE; + } + /* highlight female monsters (wizard mode option) */ + if ((special & MG_FEMALE) && iflags.wizmgender) { + attr = A_REVERSE; } } diff --git a/win/tty/wintty.c b/win/tty/wintty.c index df4986903..794236ea5 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -4257,6 +4257,7 @@ tty_print_glyph( to see although the Valkyrie quest ends up being hard on the eyes) */ if (((special & MG_PET) != 0 && iflags.hilite_pet) || ((special & MG_OBJPILE) != 0 && iflags.hilite_pile) + || ((special & MG_FEMALE) != 0 && iflags.wizmgender) || ((special & (MG_DETECT | MG_BW_LAVA | MG_BW_ICE)) != 0 && iflags.use_inverse)) { term_start_attr(ATR_INVERSE); From 1ee9e6ae3da06c3fc4db9bdc18805530d2cdb0e9 Mon Sep 17 00:00:00 2001 From: Michael Meyer Date: Thu, 23 Jun 2022 12:10:03 -0400 Subject: [PATCH 2/2] wizmgender: include corpstat gender in object name Add another use to wizmgender: when it is enabled, include the gender specified in corpstat flags in the name of a statue, corpse, or figurine, since it can influence various things but otherwise remains invisible (for monsters without gendered names). A little while ago lichen corpses weren't stacking because, despite being a neuter monster, the corpses they produced were being flagged as female or male; this could be useful for debugging issues along those lines. --- src/objnam.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/objnam.c b/src/objnam.c index ee223660a..96a6e04ef 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1339,6 +1339,17 @@ doname_base( break; } + if ((obj->otyp == STATUE || obj->otyp == CORPSE || obj->otyp == FIGURINE) + && iflags.wizmgender) { + int cgend = (obj->spe & CORPSTAT_GENDER), + mgend = ((cgend == CORPSTAT_MALE) ? MALE + : (cgend == CORPSTAT_FEMALE) ? FEMALE + : NEUTRAL); + Sprintf(eos(bp), " (%s)", + cgend != CORPSTAT_RANDOM ? genders[mgend].adj + : "unspecified gender"); + } + if ((obj->owornmask & W_WEP) && !g.mrg_to_wielded) { boolean twoweap_primary = (obj == uwep && u.twoweap), tethered = (obj->otyp == AKLYS);