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.
Pasi Kallinen [Tue, 20 Sep 2016 18:03:47 +0000 (21:03 +0300)]
Add completely blank symbol set
The blank symbol set can be used with screen reader software
to prevent it from reading the map symbols.
Prevent a segfault when looking at the map and many symbols
share the same character. Don't list too many symbols when
looking at those, if many share the same character.
Pasi Kallinen [Fri, 16 Sep 2016 18:28:19 +0000 (21:28 +0300)]
Show mon vs mon attack messages only when target is visible
The visibility check in mattackm doesn't guarantee both the
attacker and defender can be seen by hero. Before giving
messages, check more strictly whether we could see the
message happening - either really seeing the monster or
sensing the monster by some other means, depending on
the message. This should remove most of the "It" messages.
Also unhide mimics who get gazed by umber hulks. We could
keep the mimic hidden and make the messages reflect the
hulk gazing at the thing the mimic is mimicing, but this
is much easier. This fixes bz631 / H4500
With menustyle set to "full" or "partial", using 'D' when not
carrying anything gave no feedback. (Modes "traditional" and
"combination" give "you have nothing to drop" via ggetobj().)
Also, there's no need to reset in-progress armor removal, lock
picking, or trap setting if you don't actually drop anything.
The inventory they're set to operate on or with stays intact.
Eating a corpse and being told that it "tastes okay" (relatively
recent change so that omnivores don't find the taste of everything
to be "terrible") doesn't warrant an exclamation point.
Pasi Kallinen [Wed, 31 Aug 2016 19:00:45 +0000 (22:00 +0300)]
For travel target location, report if no known travel path
Yet another accessibility feature. When asked for a location
to travel, and autodescribe is on, the location description
has "(no travel path)" appended, if there is no known path
to that location.
PatR [Wed, 24 Aug 2016 02:37:42 +0000 (19:37 -0700)]
fix #H4492 - ing_suffix("throw") gave "throwwing"
The bug report assumed "you mime throwwing something" feedback
from 't-' was a typo, but 'throwwing' gets generated from 'throw'.
Change ing_suffix() not to double final 'w'. Presumeably 'w' and 'y'
are exceptions because they're sometimes used as vowels.
Change 'strrchr()' to 'rindex()' like the rest of nethack. Someday
those will need to be switched the other way around.
Add some missing bounds checking, although since ing_suffix() isn't
used for user-supplied strings, that's probably superfluous.
PatR [Sat, 13 Aug 2016 18:17:32 +0000 (11:17 -0700)]
fix #H4482 - "a some <foo> corpses"
farlook was changed (end of December) to use doname instead of xname
to yield more info for items which had already been seen up close,
but it gave away info about ones which hadn't. So doname was changed
(end of April) to use "some" instead of precise quantity (when the
quantity is greater than 1) for the latter, but that doesn't work
well with corpse_xname() when the hero is blind, yielding "a some
<foo> corpses". While testing the first fix attempt, I noticed that
pickup gave "you can only lift some of the some <foo> corpses".
This fix is far from perfect. farlook can still say "some <item>s"
but lookhere and pickup always say "N <item>s". Picking up a stack
while blind will show "N <item>s" in inventory display, but dropping
it while still blind will revert to "some <item>s" for farlook.
PatR [Fri, 12 Aug 2016 01:53:52 +0000 (18:53 -0700)]
fix #H4476 - monster class via member of class
Blessed genocide of "titans" wiped out all quadrupeds because
"titan" is a prefix of "titanothere". After class letters and
class descriptions have been rejected, Have name_to_monclass()
resort to name_to_mon() instead of doing its own less detailed
name matching.
PatR [Wed, 10 Aug 2016 09:04:09 +0000 (02:04 -0700)]
fix #H4475 - shop message about disenchanted item
drain_item() always assumed player was responsible, so called
costly_alteration() to adjust shop price of disenchanted item.
If it was unpaid and the effect was caused by a disenchanter
attack rather than by the hero, the feedback was nonsensical.
This also lets a disenchanter hit worn rings, amulet, or blindfold
if no armor gets targetted. Amulets, blindfolds, and most rings
have no charge to be drained, but several types of rings do.