]> granicus.if.org Git - nethack/log
nethack
4 years agomore window port interface adjustments
nhmall [Tue, 5 Jan 2021 15:09:37 +0000 (10:09 -0500)]
more window port interface adjustments

further adjustments to the window port interface to pass a pointer
to a glyph_info struct which describes not just the glyph number
itself, but also the ttychar, the color, the glyphflags, and the
symset index.

This affects two existing window port calls that get passed glyphs
and does the parameter consistently for both of them using the
glyph_info struct pointer:
print_glyph()
add_menu().

The recently added glyphmod parameter is now unnecessary and has been
removed.

4 years agocurses askname()
PatR [Tue, 5 Jan 2021 02:01:49 +0000 (18:01 -0800)]
curses askname()

Noticed when implementing restore-via-menu for curses a couple
of days ago:  The "Who are you?" prompt wouldn't let me cancel
out via <escape>.  I created a character named '\033' which was
displayed as "^[" during play and produced a save file shown by
'ls' as "501?.Z".

To fix this properly, we will need to replace use of wgetnstr()
with something of our own.  That's more work than I feel like
tackling.  This fakes ESC handling if the player is willing to
type <escape><return> rather than just <escape> when terminating
the prompt.

4 years agoThis is cron-daily v1-Jan-20-2020. manpages updated: makedefs.txt
nhw_cron [Sun, 3 Jan 2021 20:24:07 +0000 (15:24 -0500)]
This is cron-daily v1-Jan-20-2020.  manpages updated: makedefs.txt

4 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Sun, 3 Jan 2021 20:24:07 +0000 (15:24 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

4 years agoRemove vision tables from makedefs
Dean Luick [Sun, 3 Jan 2021 19:37:25 +0000 (13:37 -0600)]
Remove vision tables from makedefs

Update makdefs source and its man page.

Remove all mentions of the vision table files from:
o .gitattributes
o .gitignore
o Files
o Cross-compiling

Add a brief note in the fixes file.

4 years agoUnix 'make clean' and 'make spotless'
PatR [Sun, 3 Jan 2021 19:27:17 +0000 (11:27 -0800)]
Unix 'make clean' and 'make spotless'

Provide a reasonably straightforward way to leave lua alone when
changing git branches (which I precede with 'make spotless').
 make clean-keep-lib
and
 make spotless-keep-lib
are new alternate forms of top level 'make clean' and 'make spotless'
that won't touch lib/lua/.

4 years agocron doc/Guidebook.txt update
nhmall [Sun, 3 Jan 2021 03:57:14 +0000 (22:57 -0500)]
cron doc/Guidebook.txt update

4 years agoWindows SELECTSAVED follow-up
nhmall [Sun, 3 Jan 2021 03:28:54 +0000 (22:28 -0500)]
Windows SELECTSAVED follow-up

set_savefile_name() was misbehaving on Windows if the regularize argument
was false.

4 years agocurses: restoring via menu
PatR [Sun, 3 Jan 2021 02:50:04 +0000 (18:50 -0800)]
curses: restoring via menu

Clone the tty SELECTSAVED code in curses.  If you would be getting
the "who are you?" prompt (perhaps via 'nethack -u player') and
you have at least one save file, you'll get a menu of save files
(plus entries for 'new game' and 'quit') to choose from.  Requires
'#define SELECTDSAVED' at build time (only ntconf.h does that by
default) and when present, can be disabled by setting 'selectsaved'
to False in NETHACKOPTIONS or .nethackrc.

4 years agopickup_types documentation
PatR [Sun, 3 Jan 2021 01:07:46 +0000 (17:07 -0800)]
pickup_types documentation

Another one from several years ago.  Document 'pickup_types:.'
as a way to set pickup_types to a value that won't ever cause
anything to be picked up, in order to leave all autopickup
decisions to player's autopickup exceptions.

Actually implementing pickup_types:none would require just as
much documentation plus extra code.

4 years agoquickmimic fixes
PatR [Sat, 2 Jan 2021 19:59:40 +0000 (11:59 -0800)]
quickmimic fixes

Reported by a beta tester four years ago:  if you telepathically
observed a pet eat a mimic corpse and temporarily change shape,
you were told that you sensed it happening but the map continued
to show its true form (because telepathy overrides mimicking).
Attempting to force the map to show the alternate shape in that
situation was hopeless, so give an alternate message instead.

While trying to fix this, I noticed my dog mimicking a throne
several times.  The list of alternate shapes for quickmimic
included SINK which happens to have the same value as S_throne.
Change that to S_sink.

4 years agoremove mapglyph() remnants from win/curses/
PatR [Sat, 2 Jan 2021 18:46:17 +0000 (10:46 -0800)]
remove mapglyph() remnants from win/curses/

Remove a couple of leftover references to mapglyph() from the
curses code (present inside '#if 0' blocks).  I've tried to
substitute code which should work but have no idea whether it
actually will.

4 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Sat, 2 Jan 2021 15:24:08 +0000 (10:24 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

4 years agofixes37.0 update
nhmall [Sat, 2 Jan 2021 15:49:48 +0000 (10:49 -0500)]
fixes37.0 update

4 years agoanother unused variable
nhmall [Sat, 2 Jan 2021 14:44:09 +0000 (09:44 -0500)]
another unused variable

4 years agounused variables
nhmall [Sat, 2 Jan 2021 14:35:56 +0000 (09:35 -0500)]
unused variables

4 years agofinish mapglyph() removal
nhmall [Sat, 2 Jan 2021 14:22:53 +0000 (09:22 -0500)]
finish mapglyph() removal

4 years agoupdate for 2021
nhmall [Sat, 2 Jan 2021 03:07:54 +0000 (22:07 -0500)]
update for 2021

4 years agoMerge branch 'actual-nh-patch-1' into NetHack-3.7
nhmall [Fri, 1 Jan 2021 03:57:52 +0000 (22:57 -0500)]
Merge branch 'actual-nh-patch-1' into NetHack-3.7

4 years agoMerge branch 'patch-1' of https://github.com/actual-nh/NetHack into actual-nh-patch-1
nhmall [Fri, 1 Jan 2021 03:57:33 +0000 (22:57 -0500)]
Merge branch 'patch-1' of https://github.com/actual-nh/NetHack into actual-nh-patch-1

4 years agoCheck bones data directly for deja vu messages PR #374
nhmall [Fri, 1 Jan 2021 02:31:13 +0000 (21:31 -0500)]
Check bones data directly for deja vu messages PR #374

Closes #374
Closes #322

4 years agoMerge branch 'entrez-fix322' into NetHack-3.7
nhmall [Fri, 1 Jan 2021 02:25:16 +0000 (21:25 -0500)]
Merge branch 'entrez-fix322' into NetHack-3.7

4 years agoMerge branch 'fix322' of https://github.com/entrez/NetHack into entrez-fix322
nhmall [Fri, 1 Jan 2021 02:18:51 +0000 (21:18 -0500)]
Merge branch 'fix322' of https://github.com/entrez/NetHack into entrez-fix322

4 years agoMissing quote mark
actual-nh [Fri, 1 Jan 2021 00:54:39 +0000 (19:54 -0500)]
Missing quote mark

Again, checked vs my copy.

4 years agoTypo (Hogfather)
actual-nh [Fri, 1 Jan 2021 00:51:04 +0000 (19:51 -0500)]
Typo (Hogfather)

One typo in a quotation from Hogfather; I have checked (Corgi edition (13th printing?), 1997, page 310) and corrected it to match the original.

4 years agotermcap followup
PatR [Fri, 1 Jan 2021 00:09:46 +0000 (16:09 -0800)]
termcap followup

A little more testing for ANSI_DEFAULT forced on has revealed
that hilites[Black] has also been left Null, a problem that
MS-DOS hid.

4 years agogender-specific names can be used in .lua files with the gender upheld
nhmall [Thu, 31 Dec 2020 23:49:43 +0000 (18:49 -0500)]
gender-specific names can be used in .lua files with the gender upheld

Revert "monster name references in .lua files"
This reverts commit 0e0aa7bdf602fd8e3c382a40ae7ebe9823b9951b.

4 years agopull request #411 - freeing termcap hilite entries
PatR [Thu, 31 Dec 2020 22:49:21 +0000 (14:49 -0800)]
pull request #411 - freeing termcap hilite entries

(strings to switch color) for ANSI_DEFAULT.  Instead of lumping
more conditional code into tty_shutdown() I put the new code
into a separate routine and also pulled the existing setup code
out of tty_startup() into a separate routine too.

It will be a miracle if this doesn't break anything due to the
crazy amount of convoluted conditionals present in termcap.c.

On the other hand, I found and fixed a bug while trying to test.
The ANSI_DEFAULT hilites for Gray and No_Color were null instead
of an empty string.  MS-DOS stdio apparently fixes that up, but
on OSX (after #undef UNIX and TERMLIB and TERMINFO and #define
ANSI_DEFAULT in termcap.c) I started seeing instances of "(null)"
on the map (OSX stdio does a different fix up for Null pointers)
as soon as I enabled 'color'.  It was an attempt to set No_Color.

Closes #411

4 years agofix github issue #431 - failed displacing
PatR [Thu, 31 Dec 2020 19:23:29 +0000 (11:23 -0800)]
fix github issue #431 - failed displacing

Being able to swap places with peaceful monsters instead of just
with pets made it possible to cause them to flee. Shopkeepers
wouldn't abandon the shop door but temple priests would attack
if hero tried to chat while they were fleeing.

4 years agoRefactor bones search loop
Michael Meyer [Thu, 31 Dec 2020 03:42:48 +0000 (22:42 -0500)]
Refactor bones search loop

Using a for loop instead of an if and a do/while makes the code much
more clear and concise, so that it's easier to understand what the
function does at a glance.  The actual approach to iterating through the
current level's bones files and searching for a match is more or less
unchanged.

4 years agotribute typo: Lords and Ladies #5
PatR [Thu, 31 Dec 2020 01:55:30 +0000 (17:55 -0800)]
tribute typo: Lords and Ladies #5

Add a missing opening quote mark near the end of passage 5 of
Lords and Ladies.

4 years agomonster name references in .lua files
nhmall [Thu, 31 Dec 2020 00:18:25 +0000 (19:18 -0500)]
monster name references in .lua files

Closes #434

4 years agopmnames follow-up
nhmall [Wed, 30 Dec 2020 23:57:24 +0000 (18:57 -0500)]
pmnames follow-up

replace references to "aligned priest" in several lua files with "aligned cleric"

also accept "aligned priest" during ^G parsing

4 years agoMerge branch 'NetHack-3.7' into fix322
Michael Meyer [Wed, 30 Dec 2020 19:05:16 +0000 (14:05 -0500)]
Merge branch 'NetHack-3.7' into fix322

4 years agoanother vision table bit for gcc Makefile for Windows
nhmall [Wed, 30 Dec 2020 17:30:09 +0000 (12:30 -0500)]
another vision table bit for gcc Makefile for Windows

4 years ago Xcode updates for vision table removal part 3
nhmall [Wed, 30 Dec 2020 17:16:33 +0000 (12:16 -0500)]
 Xcode updates for vision table removal part 3

4 years agovis_tab removal for VMS
PatR [Wed, 30 Dec 2020 16:58:15 +0000 (08:58 -0800)]
vis_tab removal for VMS

Get rid of vis_tab.{c,h}, also the commented out remnants of
{dgn_comp,lev_comp}.*, and put back sfstruct.* that erroneously
got removed along with some other stuff way back when.

Untested, and the lua stuff needs to be modularized.

4 years agoremove some obsolete references from the outdated tree
nhmall [Wed, 30 Dec 2020 15:42:56 +0000 (10:42 -0500)]
remove some obsolete references from the outdated tree

untested, of course

4 years agoXcode updates for vision table removal part 2
nhmall [Wed, 30 Dec 2020 15:01:08 +0000 (10:01 -0500)]
Xcode updates for vision table removal part 2

4 years agoXcode updates for vision table removal
nhmall [Wed, 30 Dec 2020 14:56:32 +0000 (09:56 -0500)]
Xcode updates for vision table removal

4 years ago^G prompting revisited
PatR [Wed, 30 Dec 2020 10:24:59 +0000 (02:24 -0800)]
^G prompting revisited

CP_TRYLIM-1 was the right value when the prompt augmentation
was at the top of the loop before the first prompt, but should
been changed to CP_TRYLIM when that got moved to the bottom of
the loop.

First prompt:
|Create what kind of monster?
Second and subsequent prompts if first attempt is unsuccessful:
|Create what kind of monster? [type name or symbol]

Prior to this fix, the shorter prompt was being used on the
first and second tries and not switching to the longer one until
the third.

4 years agoMerge branch 'win-novisiontables' into NetHack-3.7
nhmall [Wed, 30 Dec 2020 03:12:59 +0000 (22:12 -0500)]
Merge branch 'win-novisiontables' into NetHack-3.7

4 years agoRemove src and unix VISION_TABLES
Dean Luick [Tue, 29 Dec 2020 01:16:34 +0000 (19:16 -0600)]
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.

4 years ago^G prompting
PatR [Tue, 29 Dec 2020 23:44:06 +0000 (15:44 -0800)]
^G prompting

Make the initial prompt for ^G be less verbose.  Only expand to
the verbose form if a second or further try is needed.

Also, remove an orphan comment about is_male() and is_female().

4 years agofixes entry for PR #433
nhmall [Tue, 29 Dec 2020 23:02:01 +0000 (18:02 -0500)]
fixes entry for PR #433

Closes #433

4 years agousage of whichpm in new gender code required a null ptr guard
nhmall [Tue, 29 Dec 2020 22:49:30 +0000 (17:49 -0500)]
usage of whichpm in new gender code required a null ptr guard

4 years agofix github issue #432 - bad sanity check
PatR [Tue, 29 Dec 2020 22:34:37 +0000 (14:34 -0800)]
fix github issue #432 - bad sanity check

The block of sanity check code that is causing impossible warnings
about the Wizard mimicking a monster was initially only used for
furniture and objects specifically because of the Wizard.  When it
got extended to check for mimicking monsters, an exception for the
Wizard was needed but not added.

Fixes #432

4 years agoremove vision tables from Windows and msdos builds
nhmall [Tue, 29 Dec 2020 03:07:00 +0000 (22:07 -0500)]
remove vision tables from Windows and msdos builds

4 years agoanother monster gender name handling tweak
nhmall [Mon, 28 Dec 2020 19:02:22 +0000 (14:02 -0500)]
another monster gender name handling tweak

ensure that monster female name variation ends up as a female during ^G

arbitrate when there is a conflict between gender term (male or female) and
a gender-tied monster name (cavewoman) during ^G; gender term wins

4 years agoQt map's "ttychar"
PatR [Mon, 28 Dec 2020 18:01:43 +0000 (10:01 -0800)]
Qt map's "ttychar"

Change the glyphttychar[ROWNO][COLNO] array from uchar to
unsighed short.  DrawWalls() has handling for values in over 2000.

This also reformats pretty much all of the NetHackQtMapViewport
portion of qt_map.cpp.

4 years agotypo in tilemap.c update
nhmall [Mon, 28 Dec 2020 14:19:07 +0000 (09:19 -0500)]
typo in tilemap.c update

4 years agofix tilemap.c compile when STATUES_LOOK_LIKE_MONSTERS wasn't defined
nhmall [Mon, 28 Dec 2020 14:14:39 +0000 (09:14 -0500)]
fix tilemap.c compile when STATUES_LOOK_LIKE_MONSTERS wasn't defined

4 years agoanother wishing gender processing tweak
nhmall [Mon, 28 Dec 2020 03:38:41 +0000 (22:38 -0500)]
another wishing gender processing tweak

4 years agohave a ^G-created monster's gender done in makemon instead of after
nhmall [Mon, 28 Dec 2020 02:44:51 +0000 (21:44 -0500)]
have a ^G-created monster's gender done in makemon instead of after

4 years agoanother extraneous file
nhmall [Mon, 28 Dec 2020 02:31:31 +0000 (21:31 -0500)]
another extraneous file

4 years agoextraneous file
nhmall [Mon, 28 Dec 2020 02:28:50 +0000 (21:28 -0500)]
extraneous file

4 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Mon, 28 Dec 2020 02:22:48 +0000 (21:22 -0500)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

4 years agosome tile processing fix-ups.
nhmall [Mon, 28 Dec 2020 02:20:44 +0000 (21:20 -0500)]
some tile processing fix-ups.

Some of the new colors added to some monster tiles did not
have gray scale mappings. This fixes the processing by
mapping them to *something*, but optimal gray scale mappings
for the new colors will require follow-up evaluation at some
point.

4 years agoreformat Qt/qt_clust.cpp
PatR [Mon, 28 Dec 2020 01:01:33 +0000 (17:01 -0800)]
reformat Qt/qt_clust.cpp

4 years agoArt Contribution: Differentiating gendered monster tiles PR #430
nhmall [Sun, 27 Dec 2020 23:00:48 +0000 (18:00 -0500)]
Art Contribution: Differentiating gendered monster tiles PR #430

From the pull request author NullCGT:

This pull request is a response to 0c3b964, in which nhmall expressed interest in contributions that would make gendered tiles visually distinguishable from one another. Since I've spent way too many hours editing NetHack's default tileset and the thought of trying to merge this commit into my variant gives me an absurdly massive headache, I thought I would have a go at it!

Making tiles of different genders distinct in NetHack presents an interesting problem. While it would be fun to create highly distinct tiles for every gender, doing so would reduce the accessibility of the game, since players would have to remember many more tiles, and might end up confusing one monster for another. Visual clarity is key.

Therefore, I had the following goals when creating this pull request:

1. If there is an interesting way to differentiate tiles by gender, do so.
2. Any sort of differentiation should be minor enough that a user can still tell what a monster is at a glance. Essentially, visual clarity comes before differentiation by gender.
3. Try to use a "TDTTOE method" of differentiating tiles. For example, female cats are more colorful than males, because generally male cats have only two colors of fur. Basically, I spent a lot of time on wikipedia researching sex characteristics of different species.
4. Try not to fall into "female = longer hair / eyelashes." While this feature will unfortunately require some gender-essentialist visual shorthand, this tropes is overdone and exhausting.

Please let me know what you think; I'm totally open to feedback on all of this and happy to make modifications. I've attached the resulting tiles file to this post in png form.

The alterations made in this pull request are as follows:

- Female ants are slightly larger than male ants, just like in real life. I could have added wings to the male ants, but I felt that doing so would lead to some confusion.
- Female wolves are slightly smaller than male wolves. There wasn't a great way to show this without making winter wolves look very similar to winter wolf cubs, so I just made the female wolves tails slightly shorter.
- Calico cats are almost exclusively female, so I turned the female cats into calico cats. The other piece of logic behind this choice was that players will probably really enjoy seeing different variants of their pets.
- Female hobbits, minotaurs, humans, werecreatures, and aleaxes wear slightly different clothing.
- Dwarfs are not differentiated in any way whatsoever. According to Terry Pratchett (in Unseen Academicals, if I remember correctly) it is almost impossible to tell what gender a dwarf is, even for fellow dwarfs. I strongly believe that NetHack should follow this tradition.
- Female leprechauns, archons, frost giants, guards, and all types of gnomes are clean-shaven. Although of course not one hundred percent accurate, it's convenient visual shorthand.
- Centaur tiles have no differentiation because the different types of centaurs are already extremely difficult to tell apart from one another.
- Female ogre tyrants and elven monarchs have slightly different crowns.
- Female quantum mechanics have a different hairstyle and no beard. Genetic engineers look the same, because the genetic engineer tile is perfect.
- Female barrow wights look like old grandmothers with flyaway hair. I kept the hair color the same and used a similar quantity of pixels so that they look similar enough to the males that you can tell they are barrow wights.
- Female archeologist tile is a reference to a certain archeologist known for raiding tombs.

4 years agoMerge branch 'NullCGT-feature/gendered-tiles' into NetHack-3.7
nhmall [Sun, 27 Dec 2020 22:59:30 +0000 (17:59 -0500)]
Merge branch 'NullCGT-feature/gendered-tiles' into NetHack-3.7

4 years agoMerge branch 'feature/gendered-tiles' of https://github.com/NullCGT/NetHack into...
nhmall [Sun, 27 Dec 2020 22:50:29 +0000 (17:50 -0500)]
Merge branch 'feature/gendered-tiles' of https://github.com/NullCGT/NetHack into NullCGT-feature/gendered-tiles

4 years agosome code cleanup, mostly Qt map
PatR [Sun, 27 Dec 2020 20:33:03 +0000 (12:33 -0800)]
some code cleanup, mostly Qt map

The Qt routine NetHackQtMapViewport::Clear() was broken, but
fixing it hasn't changed the glyph display issue.  None of the
other changes here would be expected to affect that but they
are in/among the sections of code under investigation.

4 years agoMore monster gender tiles additions.
Kestrel [Sun, 27 Dec 2020 19:01:27 +0000 (13:01 -0600)]
More monster gender tiles additions.

4 years agotty unused parameter under some configs
nhmall [Sun, 27 Dec 2020 17:51:40 +0000 (12:51 -0500)]
tty unused parameter under some configs

4 years agoDifferentiate male and female ant tiles.
Kestrel [Sun, 27 Dec 2020 16:56:30 +0000 (10:56 -0600)]
Differentiate male and female ant tiles.

Female ants are larger than male ants. I could have added wings to the male ants, but I felt that doing so would lead to a loss in visual clarity.

4 years agomonster gender-related follow-ups
nhmall [Sun, 27 Dec 2020 15:45:13 +0000 (10:45 -0500)]
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

4 years agomimics in inaccessible locations
PatR [Sun, 27 Dec 2020 13:27:02 +0000 (05:27 -0800)]
mimics in inaccessible locations

Suppress insane sanity check.

4 years agocurses comment bit
PatR [Sun, 27 Dec 2020 13:09:44 +0000 (05:09 -0800)]
curses comment bit

Don't require c99, even in code that's suppressed via #if 0.

4 years agounix/Makefile.top vs tiles2bmp
PatR [Sun, 27 Dec 2020 13:01:39 +0000 (05:01 -0800)]
unix/Makefile.top vs tiles2bmp

Add a missing update to sys/unix/Makefile.top.  Makefile.dat
only requires that tiles2bmp exist, without knowing anything
about whether it needs to be rebuilt.  So force Makefile.top to
make sure that it's up to date, similar to how tiles2x11 gets
handled.

4 years agoanother follow-up bit - punctuation consistency
nhmall [Sun, 27 Dec 2020 00:21:37 +0000 (19:21 -0500)]
another follow-up bit - punctuation consistency

an uppercase entry was left in the monsters.txt tile file, but
changed elsewhere

4 years agotrailing semicolon bit
nhmall [Sun, 27 Dec 2020 00:09:54 +0000 (19:09 -0500)]
trailing semicolon bit

4 years agoincorporate some pmnames feedback
nhmall [Sun, 27 Dec 2020 00:07:19 +0000 (19:07 -0500)]
incorporate some pmnames feedback

Also an update to a fixes37.0 entry

4 years agoswitch curses port to use the new tty_print_glyph argument
nhmall [Sat, 26 Dec 2020 23:35:09 +0000 (18:35 -0500)]
switch curses port to use the new tty_print_glyph argument

4 years agopmnames mons gender naming plus a window port interface change
nhmall [Sat, 26 Dec 2020 16:23:23 +0000 (11:23 -0500)]
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.

4 years agohelp: dynamic keylist
PatR [Fri, 25 Dec 2020 22:39:13 +0000 (14:39 -0800)]
help: dynamic keylist

Make '?i' show special commands (primarily prefixes) without any
key assigned (^A and ^C are possible by undefining DOAGAIN and
defining NO_SIGNAL, respectively, not sure about any others) or
are blocked because another special command earlier in the list
is bound to the same key or player has tried to bind one to an
active movement command (ie, key used for movement by the current
number_pad setting).

4 years agofix github issue #426 - binding special commands
PatR [Fri, 25 Dec 2020 21:57:05 +0000 (13:57 -0800)]
fix github issue #426 - binding special commands

Binding 'repeat' (DOAGAIN, or redo) to a different key than ^A
didn't work as intended because the code that used it was
checking for DOAGAIN (a key value from config.h) instead of
g.Cmd.spkeys[NHKF_DOAGAIN] (the key currently bound to repeat).

Contrary to the github issue, re-bound prefix keys worked ok for
me if followed by a direction.  However, they behaved strangely
if followed by anything else.  If the keystroke was stolen from
some other command and that command hadn't been bound to another
key, following the prefix with a non-direction could end up
executing the command that used to own the key.  For example,
 BIND=d:nopickup
to use 'd' to move without auto-pickup would work if you used
d<direction> but if you used d<something-else> if would execute
the drop command.

The NHKF_REQMENU prefix could be bound to some key other than
'm' but it only worked as intended if the new key was a movement
prefix.

This also makes DOAGAIN be unconditional.  If it is deleted or
commented out in config.h, the default binding will be '\000' so
unusable (freeing up ^A for something), but still be available
to be bound to some key (perhaps even ^A).

This also includes an unrelated change to mdlib.c.  The comments
added to config.h will force a full rebuild.  Changing mdlib.c
now rather than separately will avoid forcing that twice.

Fixes #426

4 years agotty: winch_handler vs NO_SIGNAL
PatR [Fri, 25 Dec 2020 01:53:57 +0000 (17:53 -0800)]
tty: winch_handler vs NO_SIGNAL

While testing something unrelated, I built with NO_SIGNAL
defined and winch_handler() caused an unused function warning.

4 years agofix github issue #427 - unreadable mail
PatR [Thu, 24 Dec 2020 21:41:17 +0000 (13:41 -0800)]
fix github issue #427 - unreadable mail

The change to make mail objects and monsters separate from mail
delivery (so that toggling the latter wouldn't invalidate save
and bones files) made it possible to wish for scrolls of mail,
find such in bones left by someone who did, or write such via
magic marker.  That was probably unintentional but I've left it
as-is.  The problem was that reading such scrolls issued a
warning:  "What weird effect is this?" because reading scrolls
of mail was only allowed when interacting with MAIL was enabled.

The issue suggested replacing #if MAIL with #if MAIL_STRUCTURES
in seffects(), and then insert #if MAIL in the part of reading
that deals with 'real' (or randomly faked for micros) mail.  I've
done both of those, and also added a couple of message variations
for the unreal cases.

Closes #427

4 years agoPrevent monsters from picking up locked containers
Pasi Kallinen [Thu, 24 Dec 2020 20:37:58 +0000 (22:37 +0200)]
Prevent monsters from picking up locked containers

4 years agowin32: avoid game exit dialog lacking any explanation
nhmall [Thu, 24 Dec 2020 01:31:54 +0000 (20:31 -0500)]
win32: avoid game exit dialog lacking any explanation

4 years agodata.base: Croesus date
PatR [Wed, 23 Dec 2020 23:48:26 +0000 (15:48 -0800)]
data.base: Croesus date

4 years agofeedback for monsters' health
PatR [Wed, 23 Dec 2020 18:43:58 +0000 (10:43 -0800)]
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.

4 years agoremove a solved item from Qt-issues.txt
PatR [Wed, 23 Dec 2020 16:26:54 +0000 (08:26 -0800)]
remove a solved item from Qt-issues.txt

4 years agofix #K3231 - objects vs pits and holes
PatR [Tue, 22 Dec 2020 21:48:29 +0000 (13:48 -0800)]
fix #K3231 - objects vs pits and holes

This got out of hand pretty quickly.  can_reach_floor() had
different criteria than trap activation.  Objects dropped at a
hole locations that don't fall through were treated as if they
were at the bottom of an abyss, so couldn't be examined or
picked up.

This a bunch of changes; it is bound to introduce some new bugs.

4 years agoQt support for changing 'statuslines' dynamically
PatR [Tue, 22 Dec 2020 19:10:32 +0000 (11:10 -0800)]
Qt support for changing 'statuslines' dynamically

Turns out it was nearly as simple as I originally thought.
I just missed one significant detail the first time around.
This leaves DYNAMIC_STATUSLINES as conditionl but now enables
it by default.  Using 'O' to change 'statuslines' from 2 to 3
or vice versa now works for Qt as well as for curses and tty.

4 years agooption help
PatR [Tue, 22 Dec 2020 03:02:11 +0000 (19:02 -0800)]
option help

I stated out by changing dat/opthelp to stop shouting the boolean
defaults: [TRUE] -> [True], [FALSE] -> [False].  I ended up doing
a partical reconcilliation between ?g (dynamic list of options)
and ?h (dat/opthelp).  There were several inapplicable options in
the dynamic list, so this changes option_help() to avoid those.

I barely glanced at the compound options so they may not sync up.

4 years agoAC and obj->spe limits: +127/-128 -> +99/-99
PatR [Mon, 21 Dec 2020 22:09:17 +0000 (14:09 -0800)]
AC and obj->spe limits: +127/-128 -> +99/-99

Cap overall AC at -99 instead of -128.  Put the same limit of 99
on enchantment and charge count of individual objects.

^X now reports if/when AC has reached its limit since players
could see that reaching that limit and then enchanting worn items
will change the worn items but not the total.  (Same thing would
have happened with -128, just without any explanation and less
likely to accomplish.)

Won't affect normal play for any reasonable definition of normal.

4 years agocron daily Guidebook.txt update
nhmall [Mon, 21 Dec 2020 02:24:51 +0000 (21:24 -0500)]
cron daily Guidebook.txt update

4 years agoMore futureproofing hypotheticals
Pasi Kallinen [Sun, 20 Dec 2020 10:23:09 +0000 (12:23 +0200)]
More futureproofing hypotheticals

If you set COLNO larger than BUFSZ, few places cause a buffer overrun.
Add a new buffer size definition, COLBUFSZ, which is the larger of
COLNO and BUFSZ, used in places that care about a screen-wide string.

4 years agore-implement pull req #334 - sorting discoveries
PatR [Sun, 20 Dec 2020 01:45:49 +0000 (17:45 -0800)]
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

4 years agoAdd a new themed room: "Twin business"
Pasi Kallinen [Sat, 19 Dec 2020 11:11:36 +0000 (13:11 +0200)]
Add a new themed room: "Twin business"

This themed room boasts two shops, a weapons and an armor store,
that can generate in a number of different configurations.

Makes the random corridor joining routine obey unjoined areas.

Fixes a bug in shopkeeper naming routine, where multiple shops
of the same type on the same level might reuse the shopkeeper name.

This is modified and consolidated commit from xNetHack by
copperwater <aosdict@gmail.com>.

4 years agocallable venom
PatR [Sat, 19 Dec 2020 02:04:34 +0000 (18:04 -0800)]
callable venom

Allow the two venoms to be given type names.  Only matters if
player manages to get either of them into inventory.

4 years agocron daily updates to Files and doc/Guidebook
nhmall [Sat, 19 Dec 2020 02:01:10 +0000 (21:01 -0500)]
cron daily updates to Files and doc/Guidebook

4 years agodisplacing pets into water
PatR [Fri, 18 Dec 2020 23:46:13 +0000 (15:46 -0800)]
displacing pets into water

Don't let hero at water or lava location swap places with a
pet that can't survive there.  This was a regression to 3.4.3
behavior introduced when displacer beast monster was added.
I can't remember whether the regression was intentional at the
time, but guess not because I'm fairly sure that I would have
included a comment about it.

4 years agoconcealed monster sanity checks
PatR [Fri, 18 Dec 2020 23:05:54 +0000 (15:05 -0800)]
concealed monster sanity checks

Add some more checks to sanity_check_single_mon().  If mon->data
is discovered to be bad, panic instead of just issuing a warning
since a subsequent crash would be inevitable.  Make sure hidden
ceiling hiders have a ceiling to hide at (so not on the planes of
air or water; some quest levels should probably be classified as
"no ceiling" but currently aren't).  Perform a few mimic checks.

Protection from shape changers had a couple of minor bugs.  A mimic
hidden at a spot the hero couldn't see would be allowed to remain
hidden (and stay that way once within view because protection from
shape changers isn't re-checked during ordinary activity).  Also,
if a pet was shape-changed while eating a mimic corpse at the time
protection from shape changers started, it would fall into untimed
sleep as part of being forced back to normal shape [rescham()] if
its location could be seen.

4 years agoFix monster hide state when chain is moved
Pasi Kallinen [Fri, 18 Dec 2020 17:31:47 +0000 (19:31 +0200)]
Fix monster hide state when chain is moved

4 years agoQt text window search
PatR [Thu, 17 Dec 2020 21:55:10 +0000 (13:55 -0800)]
Qt text window search

Fix the strangeness where typing ':' in a menu window initiated
the menu search operation but typing ':' in a text window saw
the shift key be pressed but not the ';' that went with it, even
though they both called the same key decoding routine.  That made
typing ':' to initiate text search be impossible.  Menu windows
did more input focus manipulation in their constructor.  Mimicking
that in text windows fixes the problem with keys not being seen by
the text window's keystroke handler.

4 years agofix the tail-less long worm placement warning
PatR [Thu, 17 Dec 2020 20:21:35 +0000 (12:21 -0800)]
fix the tail-less long worm placement warning

Hidden tail segment was taken off the map as intended but the
check and warning in place_wormtail_randonly() didn't expect
to see that.  A post-3.6 issue.

Also fix the spelling error in the warning message.

4 years agoclick_to_cmd() vs #therecmdmenu
PatR [Thu, 17 Dec 2020 19:38:18 +0000 (11:38 -0800)]
click_to_cmd() vs #therecmdmenu

Clicking on an adjacent location while 'herecmd_menu' is On
didn't run therecmd as intended.  If it had, maybe somebody
would have noticed how broken it is.  This reorganizes the mouse
click handling but leaves therecmd commented out since it hasn't
been fixed.

The #therecmdmenu command and tentative click handling for
adjacent spots should probably be removed.  They've been in place
for slightly over three years and nobody has ever reported that
they don't work properly.