Same functionality as was recently implemented for tty. If a
character like ':' is an explicit menu selector and the player
types it, select that menu entry rather than treating it as a
search request. (Same for other menu commands like '>', but
offhand I can't think of anything besides container looting's
': - look inside' that uses any non-letter selectors other
than '$', which isn't used as a menu meta command.)
keni [Tue, 31 Mar 2015 13:50:02 +0000 (09:50 -0400)]
NHDT substitution version 2.
Re-run nhgitset.pl to install.
"perldoc DEVEL/hooksdir/nhsub" for details. General docs still to come.
Quick notes:
- "git nhsub" lets you apply substitutions to a file without involving any
version control.
- When doing nhadd/nhcommit, the working directory WILL reflect the results
of the substitutions.
Let's see what this breaks.
Pasi Kallinen [Tue, 31 Mar 2015 09:59:27 +0000 (12:59 +0300)]
Use a menu when user wants to query a glyph
When user presses '/', pop up a meny asking what the user wants to
look at:
What do you want to look at:
a - something on the map
b - something you're carrying
c - something else
This replaces the "Specify unknown object by cursor?" -prompt,
while keepng backwards compatibility, and also allows querying
about items in the inventory.
PatR [Tue, 31 Mar 2015 07:18:00 +0000 (00:18 -0700)]
add .gitignore entries: tile.h, NetHack.ad
Add a couple of missing .gitignore entries for files put into
place when building. include/tile.h is genearated for tiles
and dat/NetHack.ad is copied for X11 resource definitions.
PatR [Tue, 31 Mar 2015 06:20:45 +0000 (23:20 -0700)]
bhitpile lint bit
The 'zdir' function parameter has the same name as 'zdir' global
variable, triggering a 'shadowing' warning. I had to read the 'if'
statement multiple times to convince myself it was doing what was
intended. It was, but I think this rewrite is easier to understand
(at least for my feeble reptilian brain).
I don't know who Tim Wright is, but his 15 mintues of fame has
lasted for at least a decade so I cut his comment out. (The 28.5
year old GAN one a dozen lines lower was a tempting target for
removal, but I managed to stop myself; otherwise it never ends.)
PatR [Mon, 30 Mar 2015 23:10:14 +0000 (16:10 -0700)]
lint cleanup for tty 'gray'
gcc complained about assigning string literals to variables that aren't
const. String literals don't have const type but modifying them results
in undefined behavior, so the warning is justified. Except in this case
the strings were never being modified so if wasn't justified after all.
Switch to a static buffer anyway.
Pasi Kallinen [Mon, 30 Mar 2015 19:09:20 +0000 (22:09 +0300)]
Options to create the character blind or nudist
For those pro players who really want to try their hand
at that zen samurai, without needing to reroll thousands
of times to start with blindfold. Nudist starts without
any armor, and keeps tabs whether you wore any during
the game, for even more bragging rights.
Also makes the Book of the Dead readable even while
blind, for obvious reasons.
Pasi Kallinen [Sun, 29 Mar 2015 19:08:46 +0000 (22:08 +0300)]
Add more explicit helpless reasons
Instead of just "while helpless", the death reason will tell
more explicitly why the player was helpless. For example:
"while frozen by a monster's gaze"
nhmall [Sun, 29 Mar 2015 14:50:39 +0000 (10:50 -0400)]
add data.base suggestion for whistle
On 1/24/2014 6:48 AM, a bug reporter wrote:
> The whistle in Nethack has no encyclopedia entry. I suggest for the next
> release something from the M. R. James ghost story 'Oh, Whistle, and I'll Come
> to You My Lad'.
>
nhmall [Sat, 28 Mar 2015 15:20:44 +0000 (11:20 -0400)]
flavor enhance zap downwards/upwards when hiding
Changes to be committed:
modified: doc/fixes35.0
modified: include/extern.h
modified: src/apply.c
modified: src/zap.c
On 3/23/2015 6:41 PM, a bug reporter wrote:
> When you're hiding under an item (e.g. via garter snake polyform), and
> that item gets polyshuddered into nonexistence, you continue hiding
> (under nothing).
This was addressed previously.
> (Incidentally, it's a bit weird that you use > to aim at items that are
> flavorwise above you at the time.)
PatR [Sat, 28 Mar 2015 01:24:53 +0000 (18:24 -0700)]
tty menu hack for ':'
Looting a container generates a menu which contains ': - look inside'
but the recent change to make ':' be a menu command for selecting
items which match a search string made it impossible to pick that item.
(Well, I suppose you could enter a search string which matched it, but
that's a nuisance compared to just directly picking a choice.) This
makes menu selection for tty give precedence to menu choice characters
over mapped menu commands when some character happens to be both. I'm
not sure whether it ought to be expended to group accelerators too, so
didn't do that.
There's bound to be a better way to do this, but it works.
Pasi Kallinen [Fri, 27 Mar 2015 14:08:06 +0000 (16:08 +0200)]
Show t-shirt text at end of game inventory disclose
Restricting the text display only to the end of game disclose,
so it doesn't clutter the inventory during gameplay and so that
the readability of t-shirts is not given away.
Pasi Kallinen [Fri, 27 Mar 2015 13:29:54 +0000 (15:29 +0200)]
TTY: Guard against impossible x coord
If a menu item was longer than terminal width, the menu wasn't
cleared away after it was finished with. This easily happened
when an inventory item was named.
PatR [Fri, 27 Mar 2015 07:21:40 +0000 (00:21 -0700)]
objnam formatting for bag of tricks
Bag of tricks that had been used at least once was being described
as "empty" regardless of charge count, because it always fails the
Has_contents() test. After half this patch fixed that, it started
being flagged as "empty" as soon as the last charge was used rather
than after attempting to use it again after that, since 'cknown' was
being set whenever it was used. Only set that flag when applying
the bag has been observed to fail.
PatR [Thu, 26 Mar 2015 01:04:50 +0000 (18:04 -0700)]
fix acid_damage() crash
My dog bit an acid blob and triggered a crash, caught by SYSCF panictrace
but yielding confusing information. The backtrace included a call from
'rustm()+N' that turned out to be passivemm(), which was deferencing a
null pointer since no weapon was involved.
nhmall [Wed, 25 Mar 2015 02:07:16 +0000 (22:07 -0400)]
no hiding under nothing
On 3/23/2015 6:41 PM, a bug reporter wrote:
> When you're hiding under an item (e.g. via garter snake polyform), and
> that item gets polyshuddered into nonexistence, you continue hiding
> (under nothing).
This addresses the "hiding under nothing" bug, but does not
address this flavor comment also included in the report:
> (Incidentally, it's a bit weird that you use > to aim at items that are
> flavorwise above you at the time.)
nhmall [Tue, 24 Mar 2015 23:20:14 +0000 (19:20 -0400)]
fix invalid pointer dereference in morguemon
On 3/23/2015 6:41 PM, a bug reporter wrote:
> If the game generates a graveyard, the graveyard places a normal
> demon, but all normal demons are extinct at the time, then morguemon (at
> mkroom.c line 423) indexes mons with NON_PM (the return value of
> ndemon() if it can't find a reference), which is an invalid pointer
> dereference. According to the testbench, this mostly seems to happen on
> dlvl 12.
This fixes the code violation, but the logic will now drop down to the
ghost/wraith/zombie code when that happens.
Is that desireable, or should something else happen (for variety)?