PatR [Tue, 21 Mar 2017 02:11:48 +0000 (19:11 -0700)]
tty prompting fix and DUMPLOG of prompts+answers
Update DUMPLOG's message history to include player responses to
most queries. For tty, both getlin() and yn_function(). For other
interfaces, only yn_function() is covered. (It's intercepted by a
core routine that can take care of the logging; getlin() isn't.)
Also includes saved messages from previous session(s), for the
interfaces which support that (tty), to fill out the logging when
a game ends shortly after a save/restore cycle.
The tty interface was using pline() to display prompt strings.
Having 'MSGTYPE=hide "#"' or 'MSGTYPE=hide "yn"' in .nethackrc
would suppress many prompt strings (in the two examples mentioned,
entering extended commands or the vast majority of yes/no questions,
respectively) and generally lead to substantial confusion even if
done intentionally, so switch to putstr(WIN_MESSAGE) instead.
PatR [Fri, 17 Mar 2017 10:20:11 +0000 (03:20 -0700)]
fix Bell of Opening segfault
Noticed on nethack.alt.org; the Bell of Opening could trigger a
segfault if applied near a trap door or bear trap (and a few others)
that had no monster at the trap location. Reproducible if done
while mounted; {open,close}{fall,hold}ingtrap() would try to access
monst->mx and monst->my of a Null monst pointer if given one when
u.usteed was non-Null.
PatR [Tue, 14 Mar 2017 12:27:45 +0000 (05:27 -0700)]
fix #H5188 - getting an artifact break illiterate
To-be-3.6.1 bug, caused by a patch (of mine...) incorporated about
a week after 3.6.0 was released that was intended to be for naming
Sting or Orcist. Any artifact creation ended up breaking illiterate
conduct whether user-assigned naming was involved or not (because
oname() is always used to apply the name, not just when do_name() is
executing).
This should be handled differently but I don't want to go through
the dozen and half or so calls to oname() to add an extra argument.
PatR [Mon, 13 Mar 2017 22:43:08 +0000 (15:43 -0700)]
more control key formatting
The previous fix to use highc(UNCTRL(x)) worked for ^A through ^Z,
but not for NUL (yielded ^` instead of usual ^@) or ^[ through ^_
(yielded lowercase ^{ and so on). The problem was UNCTRL(); it
shouldn't have been forcing on the lowercase bit to begin with.
Also, the code that used UNMETA() for formatting wouldn't work as
intended for M-control char since it stripped off the 8th bit but
didn't apply any fixup for control chars.
Just get rid of ISCTRL/ISMETA/UNCTRL/UNMETA and use the existing
visctrl() routine instead. (Its 3.6.0 edition didn't handle
M-control char, but the to-be-3.6.1 branch has done so since a
week or two after the 3.6.0 release.)
PatR [Sat, 11 Mar 2017 00:41:49 +0000 (16:41 -0800)]
dumplog message history groundwork
Separate the message logging out of pline so that other things (for
instance, one-line summary for quest block messages) can be logged.
The code that utilizes this isn't ready for prime time yet.
For FREE_ALL_MEMORY, release DUMPLOG message history when saving.
(Actually, this frees it unconditionally rather just doing so for
FREE_ALL_MEMORY.) It was being freed when logged at end of game,
but not during save. If dumplog message history and interface
message history get integrated, the existing message history
save/restore handling should become applicable instead.
PatR [Sat, 11 Mar 2017 00:35:49 +0000 (16:35 -0800)]
vanquished monsters tidbit
Use the same terminology ("creatures" rather than "monsters") for
the two "no <foo> {have been, were} vanquished" messages as for the
"disclose vanquished <foo>" prompt and its "M <foo> vanquished"
summary.
The dumplog data was including a final tombstone unconditionally,
which looked awfully strange for characters who didn't die. Make
it conditional, like actual end-of-game tombstone. (One difference
though: dumplog has a tombstone for hero who died from genocide,
end-of-game does not. I think the latter should display one even
though no grave gets generated.) [Potential for future enhancement:
add some alternate ascii art in place of tombstone for survivors.]
The list of genocided and/or extincted species was never shown
since caller passed 'a' to list_genocided() and it expected 'y'.
Also, once shown, the list entries were lacking indentation that
other sections of the dump generally have.
Both vanquished monsters and genocided/extinct monsters included
a blank line separator even when there was no feedback, making a
noticeable gap in the dumplog text. Have them report "no creatures
vanquished" and "no species genocided", when applicable, so that
their separator lines always have something to separate.
When dumping, omit a couple of blank lines each from vanquished
creatures list, genocided species list, and tombstone so the
relevant sections of the dump are more compact.
PatR [Sun, 5 Mar 2017 03:45:15 +0000 (19:45 -0800)]
more DUMPLOG lint
The recently added dumplog code assumed that 'time_t' is 'long int'
or at least will give sensible results when formatted with '%ld'.
This is more of a Band-Aid(tm) than a proper fix.
PatR [Fri, 17 Feb 2017 20:24:24 +0000 (12:24 -0800)]
fix #H5082 - growing into opposite sex monster
When a female dwarf grows (via level gain) into a dwarf lord, it
changes sex as well as base monster form because all dwarf lords
are male. The earlier fix for #H4276 (16-Mar-2016, to give an
alternate grow-up message acknowledging the change) used the wrong
monster form (monst's old one instead of new one).
PatR [Sun, 12 Feb 2017 08:24:29 +0000 (00:24 -0800)]
some fixes36.1 fixes
Fix a couple of typos, change one entry which referenced internal
coding issues to a more general description for end-users, and remove
a duplicate about color handling for status hilites and menucolors.
(I've only skimmed through the first section. There are likely more
inconsistencies in the file.)
PatR [Wed, 8 Feb 2017 21:10:15 +0000 (13:10 -0800)]
fix g.cubes eating green slime
Back when dead green slime left a corpse, gelatinous cubes wouldn't
eat that, but they would eat globs of green slime without being
affected. Add the missing glob check so g.cubes will engulf globs
of green slime instead of eating those.
Pasi Kallinen [Thu, 19 Jan 2017 17:46:37 +0000 (19:46 +0200)]
Prevent a segfault with leashed vanished monster
It's apparently somehow possible to have a leash "attached" to
a monster not present on the current level. Complain instead of
segfaulting. (This is a post-3.6.0 bug)
Pasi Kallinen [Tue, 10 Jan 2017 20:19:00 +0000 (22:19 +0200)]
Accessibility: option to prevent status line updates
Apparently some screen readers keep reading the status lines
at the bottom of the screen when parts of those change.
Add an option to prevent updates to those lines.
PatR [Tue, 20 Dec 2016 20:43:35 +0000 (12:43 -0800)]
tty's compress_str(), core's dat/keyhelp
Rewrite 3.6.1's compress_str() to avoid peeking past the end of the
input string. This should eliminate the reported valgrind complaint.
The problem was noticed for post-3.6.0 code introduced [by me...] last
June, but it looks like it was present in the old code too.
Also, fix the wording in the paragraph about NUL in the keyhelp text.
tty_putstr() always passes non-message window text through compress_str(),
clobbering usage of two spaces to separate sentences. putstr()'s caller
ought to have more control over that (possibly via its hardly ever used
'attribute' arg?).
Pasi Kallinen [Mon, 12 Dec 2016 15:42:02 +0000 (17:42 +0200)]
Impossible instead of segfault in cursed
While fuzz testing, I've seen segfault a handful of times in here,
coming from do_takeoff(). Looks like context.takeoff.what is stale,
having WORN_BLINDF, but we're not wearing the blindfold anymore.
Haven't been able to trace it down yet, so guard it with impossible.
PatR [Fri, 9 Dec 2016 00:39:55 +0000 (16:39 -0800)]
fix #H4706 - non-zero hit points for poison death
For "the poison was deadly" against hero, hit points were set to -1
(which gets displayed as 0 when shown) but the status lines weren't
being updated, so stale positive HP value was visible during final
disclosure.
Pasi Kallinen [Wed, 7 Dec 2016 18:23:07 +0000 (20:23 +0200)]
Fix segfault when attacked while polyed into disenchanter
The pointer keeping tabs of monster's current weapon was
not cleared.
How to trigger: Get hit by a monster wielding a weapon,
teleport to another level, poly into disenchanter, get hit
by any monster with AD_PHYS attack and not wielding any weapon.
Pasi Kallinen [Fri, 2 Dec 2016 20:03:10 +0000 (22:03 +0200)]
Fix segfault when looking at detected monster hiding under unknown armor
This segfault happened when a detected monster such as a garter snake was
hiding under an unknown/unseen armor of a type that has no description
field (eg. a leather armor), and you farlooked at the monster.
Alex Smith [Sat, 12 Nov 2016 01:24:03 +0000 (01:24 +0000)]
Make free actions easier to predict, nonfree actions more predictable
This fixes melee kiting more comprehensively (it now doesn't work
against slower monsters either), and prevents you doing things like
opening up a gap when running from an imp (you couldn't do that in
3.4.3).
Pasi Kallinen [Thu, 27 Oct 2016 18:44:38 +0000 (21:44 +0300)]
Make older corpses not taste okay
Post-3.6.0 change made practically all corpses taste okay.
Change it so there's always a 10% chance for the corpse
to taste terrible, and increase the chance if the corpse
is slightly old.
Alex Smith [Mon, 17 Oct 2016 17:26:44 +0000 (18:26 +0100)]
Change the rules for Elbereth erosion
If you attack a monster under Elbereth protection, and it wasn't
scuffed by the attack itself, then it'll be automatically removed
with an alignment penalty. It no longer fades from scaring monsters;
only from being abused to attack monsters while protected.
Alex Smith [Mon, 17 Oct 2016 17:15:57 +0000 (18:15 +0100)]
Differentiate between monster anger from attacks and from other causes
setmangry() and wakeup() were being used for multiple purposes. Add an
extra parameter to track which. This fixes several minor bugs (e.g.
whether monsters with no eyes were angered by (useless) gaze attacks
against them previously depended on the state of a UI option, and
the Minetown guards would be annoyed if you used a cursed scroll of
tame monster on a shopkeeper). It's also a prerequisite for the
Elbereth changes I'm working on.
Alex Smith [Mon, 17 Oct 2016 16:31:00 +0000 (17:31 +0100)]
Make the Elbereth restrictions more flavour-consistent
Elbereth now has to be on a square by itself; it's hard to justify
why text before it would prevent it working if text after it fails
to prevent it working.
Pasi Kallinen [Sat, 8 Oct 2016 10:57:39 +0000 (13:57 +0300)]
Hero polyed into ghoul can eat only non-veggy corpses or eggs
Change via dNetHack. Restrict heroes polymorphed into ghouls
so they can only eat non-vegan corpses and eggs. This matches
more closely what pet ghouls prefer.
Pasi Kallinen [Thu, 6 Oct 2016 10:03:56 +0000 (13:03 +0300)]
Accessibility: Pick travel/cursor targets from a menu
Adds two new configurable keys to the cursor targeting: 'A' (getpos.menu)
and 'a' (getpos.menu.cansee). First one shows a menu of all interesting
glyphs on the map, second one shows only those in sight.
Travel command also now obeys the "request menu" -prefix, showing
the menu with interesting targets in sight, and then traveling there.
Idea via the NetHack accessibility research by Alexei Pepers.
Pasi Kallinen [Wed, 5 Oct 2016 14:19:06 +0000 (17:19 +0300)]
Add key rebinding
This is a modified version of Jason Dorje Short's key rebinding
patch, and allows also binding special keys, such as the ones
used in getloc and getpos.
One of the ways to play NetHack on nethack.alt.org is via a HTML
terminal in browser. Unfortunately this means several ctrl-key
combinations cannot be entered, because the browser intercepts
those. Similar thing applies to some international keyboard layouts
on Windows. With this patch, the user can just rebind the command
to a key that works best for them.
I've tested this on Linux TTY, X11, and Windows TTY and GUI.