Commit Graph

4006 Commits

Author SHA1 Message Date
Dean Luick
3ffd330c31 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.
2021-01-03 13:37:25 -06:00
nhmall
dd15a1c46d cron doc/Guidebook.txt update 2021-01-02 22:57:14 -05:00
PatR
46460255ef 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.
2021-01-02 18:50:04 -08:00
PatR
c71dd6696d 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.
2021-01-02 17:07:46 -08:00
PatR
b1d0943d6d 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.
2021-01-02 11:59:40 -08:00
nhmall
1f78be370d fixes37.0 update 2021-01-02 10:49:48 -05:00
nhmall
1d94e65e45 finish mapglyph() removal 2021-01-02 09:22:53 -05:00
nhmall
eb14a7ddf2 Check bones data directly for deja vu messages PR #374
Closes #374
Closes #322
2020-12-31 21:31:13 -05:00
nhmall
862c4064ab gender-specific names can be used in .lua files with the gender upheld
Revert "monster name references in .lua files"
This reverts commit 0e0aa7bdf6.
2020-12-31 18:51:00 -05:00
PatR
4c8a8bcfee 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.
2020-12-31 11:23:29 -08:00
nhmall
0e0aa7bdf6 monster name references in .lua files
Closes #434
2020-12-30 19:18:25 -05:00
nhmall
a1678d62f3 fixes entry for PR #433
Closes #433
2020-12-29 18:02:01 -05:00
PatR
9c6a65f49b 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
2020-12-29 14:34:37 -08:00
nhmall
f30bb8aaa4 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
2020-12-28 14:02:22 -05:00
nhmall
30fe65b5e0 fix tilemap.c compile when STATUES_LOOK_LIKE_MONSTERS wasn't defined 2020-12-28 09:14:39 -05:00
nhmall
7e20be61df 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.
2020-12-27 18:00:48 -05: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
4c8d33839b trailing semicolon bit 2020-12-26 19:09:54 -05:00
nhmall
772e876e44 incorporate some pmnames feedback
Also an update to a fixes37.0 entry
2020-12-26 19:07:19 -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
0ec355bdb4 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
2020-12-25 13:57:05 -08:00
PatR
5552f141ba 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
2020-12-24 13:41:17 -08: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
1b7c372f5d 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.
2020-12-22 13:48:29 -08:00
PatR
934808be0e 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.
2020-12-22 11:10:32 -08:00
PatR
ae23330adc 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.
2020-12-21 14:09:17 -08:00
nhmall
1c7420af7f cron daily Guidebook.txt update 2020-12-20 21:24:51 -05: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
nhmall
143850e3c9 cron daily updates to Files and doc/Guidebook 2020-12-18 21:01:10 -05:00
PatR
b9535a84f1 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.
2020-12-18 15:46:13 -08:00
PatR
c709c45780 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.
2020-12-18 15:05:54 -08:00
PatR
65763f9bec 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.
2020-12-17 12:21:35 -08:00
PatR
d27b8cb043 adopt some orphan commands
'? i' shows three keyless commands in the General section.  This
makes M-X the key for #exploremode.  #herecmdmenu and #therecmdmenu
are still keyless but now autocomplete.

A ridiculous amount of documentation for a three line code change.
2020-12-16 19:22:04 -08:00
nhw_cron
b5a085437f This is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt 2020-12-14 07:17:12 -05:00
PatR
788e21ac43 have <del> run #terrain
Having recently noticed that using <del> aka <delete> aka <rubout>
could work as a command, assign it to #terrain.  #terrain was the
only command in the "game" subset of commands as shown by '? i'
that didn't have any key assignment.

Since <delete> might be swapped with <backspace> on some terminals
and is a keypad key on the typical PC keyboard, it might not work
reliably depending on nethack's number_pad mode or the hardware
Num-Lock setting.  Players in either of those situations haven't
lost anything; they can still use extended command #terrain.
2020-12-14 01:00:19 -08:00
PatR
e9d729733b bargethrough/monster-vs-monster displacing
Fix the regression that monster movement flag unification
introduced for monsters able to swap places with adjacent
monsters.  It used to be restricted in order to prevent
Riders swapping places with other Riders so that they didn't
repeatedly exchange places when one was right behind the other
and the farther one moved first.  Then when displacer beasts
were added, that restriction was extended to prevent them
swapping places with Riders (but not the other way around.)
The flags change inadvertently let any displacer swap with any
other displacer.
2020-12-13 15:51:23 -08:00
PatR
04724fc5a0 Qt: remove "Search [______]" from Help menu
Prevent Qt from inserting an extra entry in the Help dropdown
menu displayed in the menu bar across the top of the screen
when nethack has focus.  "Search [______]" lets the user enter
a string to search for but doesn't give nethack any control
over that so we can't have it.

I haven't found a sane way to get rid of it.  The insane way
of not naming any menu "Help" works.  This uses "\177Help" so
that it still looks like "Help" but won't match that string.
2020-12-13 13:45:04 -08: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
PatR
25bcbe3846 fix github pull request #418 - towel wetness
Fire damage would dry out a wet towel but never all the way to 0.
Water damage would wet a towel but if it was already wet, its
wetness might decrease.

This uses the pull request's change for increasing the wetness
but changes dry_a_towel so that the original code for decreasing
that will work as is.  Using wet_a_towel() to set wetness to 0
doesn't make much sense, so still won't do so; dry_a_towel() does
and now will.

This also adds missing perm_invent update for towels in inventory
changing wetness.

Fixes #418
2020-12-12 12:04:20 -08:00
Pasi Kallinen
704b11fb05 Add some new demonic and angelic maledictions
From SpliceHack
2020-12-12 20:54:04 +02:00
PatR
8d65d6dbf0 fix #H3134 - selling container for credit
If a container holds anything that a shop wouldn't ordinarily
buy and sell and you sell it for gold, the 'foreign' contents
are marked no_charge and hero still owns them.  But selling the
same container+contents for credit instead of gold would take
shop possession of all the contents without increasing the
credit amount.

The fixes entry is longer than the fix.  It solves cited case but
I won't be surprised much if it messes up some other case(s).
2020-12-11 22:32:38 -08:00
nhmall
6dc033e5d8 don't miss the special furniture checks during liquid flow
Closes #405
2020-12-11 16:28:59 -05: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
nhw_cron
ee6645cdaf This is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt 2020-12-11 09:29:52 -05:00
nhmall
69455f404e Guidebook date bump 2020-12-11 08:46:39 -05:00
PatR
6f5a1ccc63 fix Guidebook thinko
Fix the recently revised description of "#version".
'windowtype' doesn't have an underscore in it.
2020-12-11 05:26:00 -08:00
nhw_cron
6e960a4667 This is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt 2020-12-10 20:24:37 -05:00
PatR
80a3c0c4d2 key rush.numpad/M-5 doc 2020-12-10 15:32:23 -08:00
PatR
fd5ef1ecaa more key bindings
number_pad==1 adds
 '5' => 'G'
 M-5 => 'g'
 '0' => 'i'
number_pad==2 swaps 5 and M-5 and adds M-0
 '5' => 'g'
 M-5 => 'G'
 '0' => 'i'
 M-0 => 'I'

M-5 and M-0 were missing from the bound key handling; they still
used hardcoded digits even though the actions for plain 5 and
plain 0 can be bound to other keys these days.  This implements
the M-5 variation as NHKF_RUSH2.  Changing numpad from 1 to 2
or vice versa will swap the NHKF_RUN2 and NHKF_RUSH2 actions
regardless of what keys they're assigned to.  I haven't done
anything for unimplemented NHKF_DOINV2 though (and am not
planning to in case someone else wants to jump in...).

This also fixes the description of the 'I' command.  The extended
command name for that still misleadingly refers to "type" rather
than "class" though.
2020-12-10 15:06:26 -08:00
Pasi Kallinen
0dc6792b80 Fixes bit for unifying the traps 2020-12-10 19:04:31 +02:00