Commit Graph

1019 Commits

Author SHA1 Message Date
nhmall
1d94e65e45 finish mapglyph() removal 2021-01-02 09:22:53 -05:00
Michael Meyer
47884d63ac Merge branch 'NetHack-3.7' into fix322 2020-12-30 14:05:16 -05:00
Dean Luick
a4e7646f4c Remove src and unix VISION_TABLES
Remove all references to the unused vision tables in the main source
and unix build.  Leave makedefs able to generate the vision tables.
makdefs will be cleaned up in a different commit, once all ports
are clear of dependencies.
2020-12-29 20:38:37 -06:00
nhmall
fd13f2a2f2 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
2020-12-27 10:45:13 -05:00
nhmall
0c3b9642e4 pmnames mons gender naming plus a window port interface change
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.
2020-12-26 11:23:23 -05:00
PatR
1971adbe45 feedback for monsters' health
For farlook description of a monster, and for "killed by monster"
when game ends, include an indication of the monster's health:
  uninjured          full health
  barely wounded     95%+ health
  slightly wounded   80%+
  wounded            20%..80%
  heavily wounded    20%-
  nearly deceased     5%-, or 1HP for really weak monsters
These descriptions and the criteria for choosing which one will
probably need some tuning.

Messages referring to the monster, including combat, do not
include the extra verbosity.
2020-12-23 10:43:58 -08:00
PatR
4cf6727b4e re-implement pull req #334 - sorting discoveries
The pull request changed \ and ` output to unconditionally show
discoveries in alphabetical order.  That's nearly useless except
when looking at prediscovered weapons and armor that fighter
types start out knowing.

This allows the player to choose sorting order via the new
'sortdiscoveries' option.  In addition to setting it via
config file or 'O', it can be set via 'm' prefix for \ and `.
Choices are:
 o - sort by class, by order of discovery in class (default);
 s - sort by 'sortloot' classification which groups sub-class
     items (so all helmets before any other armor, then all
     gloves, then boots, and so on); within each sub-class, or
     whole class for classes which don't subdivide so usefully,
     partly-discovered types (where a name has been assigned)
     come before fully ID'd types;
 c - sort by class, alphabetically within class;
 a - sort alphabetically across all classes.

Turned out to be a large amount of work for fairly little gain,
although I suspect that 'sortdiscoveries:s' will eventually be
more popular than the default.

Invalidates existing save files so that current sort setting can
persist across save/restore cycles.

Closes #334
2020-12-19 17:45:49 -08:00
PatR
aa7f01eed7 github pull request #417 - disclosing apron text
Adopt the patch to show the writing on any alchemy smocks in
hero's inventory during end of game disclosure.

I also added one more saying among the choices for alchemy
smock/apron.  It's based on a T-shirt descibed in a movie.
(I remember the description of the text but I don't remember
noticing anybody wearing the T-shirt that lead to that.)
Since so many of the smock quotes are about cooking, it seems
better to add it as an alchemy quote instead of just another
T-shirt where there'd be no context to explain it.

Closes #417
2020-12-14 03:30:58 -08:00
nhmall
8c42d306f7 purge trampoli.h 2020-12-13 10:27:49 -05:00
Pasi Kallinen
4729062846 Make Death revive faster
Death will revive faster than the other riders.
Make all the riders revive after 67 turns, instead of 500.
There was practically a zero chance a rider would revive at 500,
so keep it somewhat sensible.
2020-12-13 12:28:45 +02:00
Pasi Kallinen
ea93c17fa7 Monsters can revive corpses on floor with undead turning
... but only if the corpse is in direct line from the monster to hero
2020-12-11 19:49:25 +02:00
PatR
e1406a8c08 txt2key() - parsing key binding specifications
While testing some addtional ?i (list of key assignments)
changes, I wanted to give every key a binding.  When I tried
BIND=M-^A:exploremode
the text to key conversion didn't like that.  This adds support
for M-^x and M-C-x plus variations where dashes are omitted.

This adds support for ^? even though that isn't really a
control character.  I bound #terrain to it and surprising--to
me at least--the <delete> key worked to invoke that command.

Also changes 'char txt2key(...)' to be 'uchar txt2key(...)'.
2020-12-09 16:52:54 -08:00
Pasi Kallinen
13359648dd Remove duplicate wallify_map code 2020-12-06 18:36:37 +02:00
Pasi Kallinen
b797baba7a Make return values use defines 2020-12-04 09:30:21 +02:00
Pasi Kallinen
3ef3b425ad Unify the ad type switches 2020-12-04 09:30:21 +02:00
Pasi Kallinen
88e333a3a8 Unify ad_ssex 2020-12-04 09:30:21 +02:00
Pasi Kallinen
1696019361 Unify ad_sedu 2020-12-04 09:30:21 +02:00
Pasi Kallinen
376593dad5 Unify ad_dise 2020-12-04 09:30:21 +02:00
Pasi Kallinen
4118a7ea44 Unify ad_samu 2020-12-04 09:30:21 +02:00
Pasi Kallinen
d679d3a029 Unify ad_dgst 2020-12-04 09:30:20 +02:00
Pasi Kallinen
e777bd9670 Unify ad_legs 2020-12-04 09:30:20 +02:00
Pasi Kallinen
337e7da049 Unify ad_stun 2020-12-04 09:30:19 +02:00
Pasi Kallinen
12ee144936 Unify ad_heal 2020-12-04 09:30:19 +02:00
Pasi Kallinen
4901c8027c Unify ad_were 2020-12-04 09:30:19 +02:00
Pasi Kallinen
a6a676f720 Unify ad_ston 2020-12-04 09:30:19 +02:00
Pasi Kallinen
20b6ea602b Unify ad_phys 2020-12-04 09:30:19 +02:00
Pasi Kallinen
ac5822fe69 Unify ad_halu 2020-12-04 09:30:19 +02:00
Pasi Kallinen
36bb52466d Unify ad_deth 2020-12-04 09:30:19 +02:00
Pasi Kallinen
2999233332 Unify ad_pest 2020-12-04 09:30:18 +02:00
Pasi Kallinen
cb55d7c30f Unify ad_famn 2020-12-04 09:30:18 +02:00
Pasi Kallinen
618feabd88 Unify ad_poly 2020-12-04 09:30:18 +02:00
Pasi Kallinen
fda63d145b Unify ad_conf 2020-12-04 09:30:18 +02:00
Pasi Kallinen
558ec78b3a Unify ad_slow 2020-12-04 09:30:18 +02:00
Pasi Kallinen
b80c30bcf1 Unify ad_ench 2020-12-04 09:30:18 +02:00
Pasi Kallinen
96a4d14a36 Unify ad_slim 2020-12-04 09:30:17 +02:00
Pasi Kallinen
eb5508ba58 Unify ad_slee 2020-12-04 09:30:17 +02:00
Pasi Kallinen
654220f840 Unify ad_plys 2020-12-04 09:30:17 +02:00
Pasi Kallinen
7914237fbf Unify ad_wrap 2020-12-04 09:30:17 +02:00
Pasi Kallinen
bfb8931188 Unify ad_stck 2020-12-04 09:30:17 +02:00
Pasi Kallinen
b4ed25da46 Unify ad_drin 2020-12-04 09:30:17 +02:00
Pasi Kallinen
1ca0165bb9 Unify ad_drst 2020-12-04 09:30:16 +02:00
Pasi Kallinen
dba9aaf424 Unify ad_curs 2020-12-04 09:30:16 +02:00
Pasi Kallinen
d325e2cc60 Unify ad_blnd 2020-12-04 09:30:16 +02:00
Pasi Kallinen
607d1bcd96 Unify ad_tlpt 2020-12-04 09:30:16 +02:00
Pasi Kallinen
bfe773812e Unify ad_sgld 2020-12-04 09:30:16 +02:00
Pasi Kallinen
b7899ee014 Unify ad_acid 2020-12-04 09:30:15 +02:00
Pasi Kallinen
8a78c49fea Unify ad_elec 2020-12-04 09:30:15 +02:00
Pasi Kallinen
6abfe7e548 Unify ad_cold 2020-12-04 09:30:15 +02:00
Pasi Kallinen
6712876801 Unify ad_fire 2020-12-04 09:30:14 +02:00
Pasi Kallinen
cfd819f1c1 Unify ad_drli 2020-12-04 09:30:14 +02:00