Add hilite_peaceful option

Monsters that are peaceful but not tame can be highlighted in the same
way as pets if this is enabled (default off).

This extends and is split off from the following NetHack4 commit:

Track player's knowledge of locked/unlocked doors, draw it onscreen
Alex Smith <ais523@bham.ac.uk>
599c3d156cdb89239ec9b317bb2832290c00d34f
Update map immediately for hilite_pet option

... and also the new hilite_peaceful option.

This bug also exists in upstream NitroHack.

This bug also exists in NetHack4.
Increase compression of NH4 binary blobs in logs

zlib's compression levels range from 1 (fastest) to 9 (best), the
default being 6.  This cranks it up to 9, which has no noticeable impact
on play or replay speed, and saves 10-30% on the huge log filesizes
(more with games with many long actions like running, travel and
autoexplore), according to my very unscientific testing.
Fix fleeing monsters getting stuck in corridors

This fixes the bug where a monster that approaches the player on top of
an active Elbereth engraving will "turn to flee" and then sit there
idly for half a dozen turns before actually moving away.

The bug itself is due to the monster movement logic in m_move() having a
very high chance of ignoring potential moves if they match one of the
monster's last 4 (MTSZ) positions that are stored in its mtrack field.
This fix causes monsters to forget those 4 positions at the moment they
begin to flee so they can do so freely; this fix may have other subtle
effects, e.g. pets that can't be displaced in shops use fleeing logic to
move out of the player's way.

In the case of a monster moving towards the player on Elbereth and
fleeing, the chance that the space they came from being ignored as a
potential move is rn2(4 * 2), where 4 is a fudge factor and 2 is the
number of eligible adjacent moves in a straight corridor; the latter
factor decays for older steps.  The chance to ignore the last 4 stepped
spaces gets even higher when the monster is out in the open: as high as
rn2(4 * 8) in fact!

Contrary to popular belief, the monster is NOT trying to move into solid
stone; mfndpos() does its job and only lists eligible moves.  Also, when
the player retreats in a corridor with a monster stuck like this, the
monster moves towards the player NOT to attack them, but because it
thinks it's the only move it can make.

This bug also exists in vanilla NetHack, upstream NitroHack, UnNetHack
and NetHack4.
NH4: Split build date from build utilities

This allows makedefs to create verinfo.h for lev_comp and dgn_comp,
which is a version of date.h without the build date info.

Compared to NetHack4, this does not make the changes to support aimake
since this branch won't be using it.  The comment in nitrohack_types.h
claiming "CMake just sets UNIX, and only sometimes :)" is wrong; CMake
doesn't add any flags of its own when compiling.  The commit message
claims that this "fixes the problems with cmake where it would rebuild
all the files" but I'm not sure what this refers to specifically.

Build system updates (cmake and aimake)
Alex Smith <ais523@bham.ac.uk>
43a4cbf71040d9156faa38aa062e0c4b04429918
NH4: Support background colors for stacks + stairs

Object stacks are now given a blue background, while stairs, ladders and
magic portals get a red one.  In general, this adds support for
background colors to the interface.  Also, drawbridges now appear as '+'
when closed and '#' when open.

Compared to NetHack4, monster branding is not implemented, since it
causes monsters to look ugly or become difficult to properly see.  The
repeated color checks and magic numbers are also collected into a few
macros for readability, and NAO-style object stack highlighting is
applied.  Unlike NAO, blue objects on top of a stack are automatically
changed to a black foreground so the object type can be seen at a
glance.

Implement background colors in the curses port
Alex Smith <ais523@bham.ac.uk>
b30c90ac4c54a0735e9eb4f3b2f9c2f58da17644
Turn off blink option by default
NH4: View Sokoban walls completely when premapping

This is meant to go with commit cc784daa52 (NH4: track knowledge of door
locked/trapped status).

Map Sokoban walls as if we're viewing them from the correct side
Alex Smith <ais523@bham.ac.uk>
4905bc7cd9780c005e9b6d88c7887d1c4ceaccac
NH4: Configurable terminal color mapping

The 16 logical NitroHack colors can now be remapped to displayed
terminal colors of the player's choice using a custom colormap.conf file
in NitroHack's configuration directory; an example file can be found at
doc/colormap.conf.

Also, NitroHack will no longer remap user-set terminal colors, and the
darkgray option will make foreground black appear the same on any
background instead of only on the default background.

Color mapping
Jared Minch <jmminch@gmail.com>
1fe9c0fd58cbd14a7b181e78a8561f144ea0e485
NH4: Show levitating, unarmed and trapped statuses

Compared to NetHack4, these statuses are also given colors in the
interface, like existing status effects.

New statuses (levitating, unarmed, trapped)
Alex Smith <ais523@bham.ac.uk>
fd746b75343d615c4eedce2ba4d4752bf687e269
CS1291: Show in status when standing on Elbereth

This also extends the internal maximum number of statuses that can be
transmitted between the game and the interface from 12 to 16.
Show "Elbereth" in Ctrl-E message

I added this Ctrl-E feature while going through UnNetHack revisions, but
used code from NetHack4.  Apparently UnNetHack's code shows "Elbereth"
in the engraving message while NetHack4's code does not.

This is meant to go with commit f791887f2c (CS547 allow engraving
Elbereth with Ctrl-E).
NH4:Require invoke instead of apply to break wands

Applying a wand now tells the player that they need to use invoke to
break a wand.  The support for breaking a wand via invoke was added much
earlier, while NitroHack proper was still actively developed.

Compared to NetHack4, this also updates the inventory action command
list and the rewritten command quick reference accordingly.

Require the use of V rather than a to break wands
Alex Smith <ais523@bham.ac.uk>
5a49ff0346f787fb3f814fd8d407427286acb21a
Mention 'A' command in quick command reference
Add adjust to inv action menu of lettered objects

"A - adjust letter" now appears in the inventory object action menu for
all objects with a letter for their inventory slot, i.e. everything
except for gold.  Selecting it will prompt for the letter to move it to.
Don't "darken" extended terminal colors

It turns out that the "(color - 8) == darker" thing only applies to the
first 16 colors of the standard terminal color palette; other colors
turn into all sorts of strange shades when altered like this, so disable
this for those additional colors.

This is meant to go with commit ae95528b99 (NH4: configurable terminal
color mapping).
NH4: Allow "a," as a shortcut for #loot

The way this works internally is that the '-' in getobj() listings can
be replaced with ',' and then the code that uses the object can check
for &zeroobj.

Allow menus to have , as an option, put looting on a,
Alex Smith <ais523@bham.ac.uk>
6b75b3c1a6c285fc89be8d89766138f82f489bf2
NH4: Require "q," to quaff from sinks/fountains

Compared to NetHack4, this factors out the repeated terrain conditional,
and uses UnNetHack's warning function when the zeroobj case is reached
without terrain set.

Move quaffing from fountains/sinks from qy to q,
Alex Smith <ais523@bham.ac.uk>
a1131654208de6ffd04dd8b664d7f5cfab888d74
Fix "Unknown direction" msg at targeting prompt

That message previous appeared when pressing an unhandled key at the map
position targeting prompt, which was nonsense.  This fixes it to read
"Unknown targeting key."

This bug also exists in upstream NitroHack and NetHack4.
Let '@' move targeting position cursor to player

Suggested in #nethack by b_jonas about 30 minutes ago, and was also just
added to NAO by paxed.