add MALE, FEMALE, and gender-neutral names for individual monster species
to the mons array. The gender-neutral name (NEUTRAL) is mandatory, the
MALE and FEMALE versions are not.
replace code uses of the mname field of permonst with one of the three
potentially-available gender-specific names.
consolidate some separate mons entries that differed only by species into a
single mons entry (caveman, cavewoman and priest,priestess etc.)
consolidate several "* lord" and "* queen/* king" monst entries into
their single species, and allow both genders on some where it makes some
sense (there is probably more work and cleanup to come out of this at some
point, and the chosen gender-neutral name variations are not cast in stone
if someone has better suggestions).
related function or macro additions:
pmname(pm, gender) to get the gender variation of the permonst name. It
guards against monsters that haven't got anything except NEUTRAL naming
and falls back to the NEUTRAL version if FEMALE and MALE versions are
missing.
Ugender to obtain the current hero gender.
Mgender(mtmp) to obtain the gender of a monster
While the code can safely refer directly to pmnames[NEUTRAL] safely in the
code because it always exists, the other two (pmnames[MALE] and
pmnames[FEMALE] may not exist so use:
pmname(ptr, gidx)
where -ptr is a permonst *
-gidx is an index into the pmnames array field of the
permonst struct
pmname() checks for a valid index and checks for null-pointers for
pmnames[MALE] and pmnames[FEMALE], and will fall back to pmnames[NEUTRAL] if
the pointer requested if the requested variation is unavailable, or if the
gidx is out-of-range.
Allow code to specify makemon flags to request female or male (via MM_MALE
and MM_FEMALE flags respectively)to makedefs, since the species alone doesn't
distinguish male/female anymore. Specifying MM_MALE or MM_FEMALE won't
override the pm M2_MALE and M2_FEMALE flags on a mons[] entry.
male and female tiles have been added to win/share/monsters.txt.
The majority are duplicated placeholders except for those that were
separate mons entries before. Perhaps someone will contribute artwork in the
future to make the male and female variations visually distinguishable.
tilemapping via has the MALE tile indexes in the glyph2tile[]
array produced at build time. If a window port has information that the
FEMALE tile is required, it just has to increment the index returned
from the glyph2tile[] array by 1.
statues already preserved gender of the monster through STATUE_FEMALE
and STATUE_MALE, so ensure that pmnames takes that into consideration.
I expect some refinement will be required after broad play-testing puts it to
the test.
consolidate caveman,cavewoman and priest,priestess monst.c entries etc
This commit will require a bump of editlevel in patchlevel.h because it alters
the index numbers of the monsters due to the consolidation of some. Those
index numbers are saved in some other structures, even though the mons[] array
itself is not part of the savefile.
Window Port Interface Change
Also add a parameter to print_glyph to convey additional information beyond
the glyph to the window ports. Every single window port was calling back to
mapglyph for the information anyway, so just included it in the interface and
produce the information right in the display core.
The mapglyph() function uses will be eliminated, although there are still some
in the code yet to be dealt with.
win32, tty, x11, Qt, msdos window ports have all had adjustments done to
utilize the new parameter instead of calling mapglyph, but some of those
window ports have not been thoroughly tested since the changes.
Interface change additional info:
print_glyph(window, x, y, glyph, bkglyph, *glyphmod)
-- Print the glyph at (x,y) on the given window. Glyphs are
integers at the interface, mapped to whatever the window-
port wants (symbol, font, color, attributes, ...there's
a 1-1 map between glyphs and distinct things on the map).
-- bkglyph is a background glyph for potential use by some
graphical or tiled environments to allow the depiction
to fall against a background consistent with the grid
around x,y. If bkglyph is NO_GLYPH, then the parameter
should be ignored (do nothing with it).
-- glyphmod provides extended information about the glyph
that window ports can use to enhance the display in
various ways.
unsigned int glyphmod[NUM_GLYPHMOD]
where:
glyphmod[GM_TTYCHAR] is the text characters associated
with the original NetHack display.
glyphmod[GM_FLAGS] are the special flags that denote
additional information that window
ports can use.
glyphmod[GM_COLOR] is the text character
color associated with the original
NetHack display.
Support for including the glyphmod info in the display glyph buffer
alongside the glyph itself was added and is the default operation.
That can be turned off by defining UNBUFFERED_GLYPHMOD at compile time.
With UNBUFFERED_GLYPHMOD operation, a call will be placed to map_glyphmod()
immediately prior to every print_glyph() call.
79 lines
1.9 KiB
C
79 lines
1.9 KiB
C
/* NetHack 3.7 mhmsg.h $NHDT-Date: 1596498356 2020/08/03 23:45:56 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.21 $ */
|
|
/* Copyright (C) 2001 by Alex Kompel */
|
|
/* NetHack may be freely redistributed. See license for details. */
|
|
|
|
#ifndef MHNethackMessages_H
|
|
#define MHNethackMessages_H
|
|
|
|
/* nethack messages */
|
|
#define WM_MSNH_COMMAND (WM_APP + 1)
|
|
|
|
#define MSNH_MSG_ADDWND 100
|
|
#define MSNH_MSG_PUTSTR 101
|
|
#define MSNH_MSG_PRINT_GLYPH 102
|
|
#define MSNH_MSG_CLEAR_WINDOW 103
|
|
#define MSNH_MSG_CLIPAROUND 104
|
|
#define MSNH_MSG_STARTMENU 105
|
|
#define MSNH_MSG_ADDMENU 106
|
|
#define MSNH_MSG_CURSOR 107
|
|
#define MSNH_MSG_ENDMENU 108
|
|
#define MSNH_MSG_DIED 109
|
|
#define MSNH_MSG_CARET 110
|
|
#define MSNH_MSG_GETTEXT 111
|
|
#define MSNH_MSG_UPDATE_STATUS 112
|
|
#define MSNH_MSG_RANDOM_INPUT 113
|
|
|
|
typedef struct mswin_nhmsg_add_wnd {
|
|
winid wid;
|
|
} MSNHMsgAddWnd, *PMSNHMsgAddWnd;
|
|
|
|
typedef struct mswin_nhmsg_putstr {
|
|
int attr;
|
|
const char *text;
|
|
int append;
|
|
} MSNHMsgPutstr, *PMSNHMsgPutstr;
|
|
|
|
typedef struct mswin_nhmsg_print_glyph {
|
|
XCHAR_P x;
|
|
XCHAR_P y;
|
|
int glyph;
|
|
int bkglyph;
|
|
int glyphmod[NUM_GLYPHMOD];
|
|
} MSNHMsgPrintGlyph, *PMSNHMsgPrintGlyph;
|
|
|
|
typedef struct mswin_nhmsg_cliparound {
|
|
int x;
|
|
int y;
|
|
} MSNHMsgClipAround, *PMSNHMsgClipAround;
|
|
|
|
typedef struct mswin_nhmsg_add_menu {
|
|
int glyph;
|
|
const ANY_P *identifier;
|
|
CHAR_P accelerator;
|
|
CHAR_P group_accel;
|
|
int attr;
|
|
const char *str;
|
|
BOOLEAN_P presel;
|
|
unsigned int itemflags;
|
|
} MSNHMsgAddMenu, *PMSNHMsgAddMenu;
|
|
|
|
typedef struct mswin_nhmsg_cursor {
|
|
int x;
|
|
int y;
|
|
} MSNHMsgCursor, *PMSNHMsgCursor;
|
|
|
|
typedef struct mswin_nhmsg_end_menu {
|
|
const char *text;
|
|
} MSNHMsgEndMenu, *PMSNHMsgEndMenu;
|
|
|
|
typedef struct mswin_nhmsg_get_text {
|
|
size_t max_size;
|
|
char buffer[];
|
|
} MSNHMsgGetText, *PMSNHMsgGetText;
|
|
|
|
typedef struct mswin_nhmsg_update_status {
|
|
struct mswin_status_lines * status_lines;
|
|
} MSNHMsgUpdateStatus, *PMSNHMsgUpdateStatus;
|
|
|
|
#endif
|