From: nhmall Date: Sun, 27 Dec 2020 15:45:13 +0000 (-0500) Subject: monster gender-related follow-ups X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fd13f2a2f27d92e6f601b6499a7db2a7ebbab19f;p=nethack monster gender-related follow-ups remove unintentionally left M2_MALE flag on dwarf lord/lady/leader provide a way to verify gender information relayed from the core in debug mode on tty via #wizmgender debugging extended command --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index db04f0163..52a6f0ded 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -457,6 +457,8 @@ adding displacer beast inadvertently introduced a regression in swapping with splitting #if MAIL into #if MAIL_STRUCTURES and #if MAIL made it possible to wish for and write scrolls of mail with MAIL disabled, but attempting to read such a scroll issued impossible "What weird effect is this?" +remove M2_MALE flag that was unintentionally left on dwarf lord/lady/leader + entry and was preventing female incarnations curses: 'msg_window' option wasn't functional for curses unless the binary also included tty support @@ -709,6 +711,9 @@ add support for a single monster species to have distinct male and female tiles consolidate several monsters that differed only by their gender into their single species +added wizmgender debugging command to display female monsters in red inverse; + helpful for debugging gender-related matters on tty; currently ignored + on other window ports Platform- and/or Interface-Specific New Features diff --git a/include/extern.h b/include/extern.h index cf66dd4ff..0d9b86a52 100644 --- a/include/extern.h +++ b/include/extern.h @@ -295,6 +295,7 @@ E void NDECL(sokoban_detect); E void NDECL(dump_map); #endif E void FDECL(reveal_terrain, (int, int)); +E int NDECL(wiz_mgender); /* ### dig.c ### */ diff --git a/include/flag.h b/include/flag.h index 4122dd046..1e45e948a 100644 --- a/include/flag.h +++ b/include/flag.h @@ -294,6 +294,7 @@ struct instance_flags { boolean cmdassist; /* provide detailed assistance for some comnds */ boolean time_botl; /* context.botl for 'time' (moves) only */ boolean wizweight; /* display weight of everything in wizard mode */ + boolean wizmgender; /* test gender info from core in window port */ /* * Window capability support. */ diff --git a/src/cmd.c b/src/cmd.c index 0ae12b0db..7425264f5 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1844,6 +1844,8 @@ struct ext_func_tab extcmdlist[] = { wiz_level_change, IFBURIED | AUTOCOMPLETE | WIZMODECMD }, { '\0', "lightsources", "show mobile light sources", wiz_light_sources, IFBURIED | AUTOCOMPLETE | WIZMODECMD }, + { '\0', "wizmgender", "force added info about monster gender", + wiz_mgender, IFBURIED | AUTOCOMPLETE | WIZMODECMD }, { ':', "look", "look at what is here", dolook, IFBURIED }, { M('l'), "loot", "loot a box on the floor", doloot, AUTOCOMPLETE }, #ifdef DEBUG_MIGRATING_MONS diff --git a/src/detect.c b/src/detect.c index db5e84895..efb56d7b3 100644 --- a/src/detect.c +++ b/src/detect.c @@ -2096,4 +2096,15 @@ int which_subset; /* when not full, whether to suppress objs and/or traps */ return; } +int +wiz_mgender(VOID_ARGS) +{ + iflags.wizmgender = !iflags.wizmgender; + pline("wizmgender toggled %s", iflags.wizmgender ? "on" : "off"); + if (!u.uswallow) + see_monsters(); + map_redisplay(); + return 0; /* no time */ +} + /*detect.c*/ diff --git a/src/monst.c b/src/monst.c index ac2700d6f..fbd1f8a99 100644 --- a/src/monst.c +++ b/src/monst.c @@ -448,8 +448,7 @@ NEARDATA struct permonst mons_init[] = { NO_ATTK, NO_ATTK, NO_ATTK), SIZ(900, 300, MS_HUMANOID, MZ_HUMAN), 0, 0, M1_TUNNEL | M1_NEEDPICK | M1_HUMANOID | M1_OMNIVORE, - M2_DWARF | M2_STRONG | M2_LORD | M2_MALE | M2_GREEDY | M2_JEWELS - | M2_COLLECT, + M2_DWARF | M2_STRONG | M2_LORD | M2_GREEDY | M2_JEWELS | M2_COLLECT, M3_INFRAVISIBLE | M3_INFRAVISION, 6, CLR_BLUE), MON3("dwarf king", "dwarf queen", "dwarf ruler", S_HUMANOID, LVL(6, 6, 10, 20, 6), (G_GENO | 1), diff --git a/win/tty/wintty.c b/win/tty/wintty.c index c59ea8fe5..8d96256eb 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ - /* NetHack 3.7 wintty.c $NHDT-Date: 1608861214 2020/12/25 01:53:34 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.264 $ */ +/* NetHack 3.7 wintty.c $NHDT-Date: 1608861214 2020/12/25 01:53:34 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.264 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -3453,7 +3453,14 @@ unsigned *glyphmod; /* don't mark UNUSED as we need to revisit */ #endif #ifdef TEXTCOLOR - if (color != ttyDisplay->color) { + if (iflags.wizmgender && (special & MG_FEMALE) && iflags.use_inverse) { + if (ttyDisplay->color != NO_COLOR) + term_end_color(); + term_start_attr(ATR_INVERSE); + inverse_on = TRUE; + ttyDisplay->color = CLR_RED; + term_start_color(ttyDisplay->color); + } else if (color != ttyDisplay->color) { if (ttyDisplay->color != NO_COLOR) term_end_color(); ttyDisplay->color = color;