Pasi Kallinen [Sun, 10 Jan 2016 16:27:34 +0000 (18:27 +0200)]
Fix bz175: Pile mark is shown when potion is destroyed
Original bug report:
> When killing something that's carrying a potion, or death-drops a potion,
> or stands on top of a potion, with a force bolt or a wand of striking,
> "you hear something shatter" or "a potion of foo shatters" but the corpse
> is inverse as if it's (still) a pile.
Unfortunately the newsym() checks for already existing glyph, and
the gbuf doesn't distinguish between object piles and single items,
so newsym doesn't mark the location for update.
This is a dirty hack to force the newsym to update the glyph.
The glyph buffering should be revisited in a future version.
Pasi Kallinen [Sun, 10 Jan 2016 08:35:27 +0000 (10:35 +0200)]
TTY: Add compile-time option for tile data hinting
Several people have asked if 3.6.0 supports playing with tiles on
a public server. Because there's no way for the user's end to know
what that white @ is, this adds special console escape codes for
tile hinting.
The idea was originally a patch called TelnetTiles by Justin Hiltscher,
but this expanded version comes via NAO, where it's been in use for years.
This is basically an interim hack, which should go away when/if
we support actual client-server model.
PatR [Sat, 9 Jan 2016 23:28:25 +0000 (15:28 -0800)]
fix #H4083 - globs preID'd as "uncursed"
I think there was also a report about this during beta testing.
Killing an ooze, slime, or pudding left a glob of same which had its
bknown flag pre-set so was immediately shown as "uncursed" even to
non-priests. Use another way to maximize glob mergability: allow
globs to merge even when one has bknown set and the other doesn't.
PatR [Sat, 9 Jan 2016 21:57:15 +0000 (13:57 -0800)]
fix #H4187 - doppelgangers posing as Riders...
... never transform and can leave Rider corpses
Riders can't be polymorphed, and the code to prevent that was also
preventing doppelgangers in Rider form from changing shape.
Using ring of protection from shape changers effectively turned such
doppelgangers into actual Riders which would leave self-reviving
corpses. That didn't prevent Riders from appearing on the Astral
Plane though.
Pasi Kallinen [Fri, 8 Jan 2016 20:17:37 +0000 (22:17 +0200)]
TTY: Add menu_overlay option
This was a request from a blind player. It's hard to find
the left edge of the menu when it's drawn on the map, so
clear the screen and align menus to the left edge of the screen
when this option is turned off.
PatR [Fri, 8 Jan 2016 08:38:34 +0000 (00:38 -0800)]
integrate 'msgtype' option and Norep()
Allow 'msgtype=show' for messages that nethack uses Norep() for.
I don't know whether anyone will ever want to do that, but if felt
strange to have two different message suppression mechanisms that
were completely disconnected from each other.
For a user with no msgtype filter, there'll be no difference in
behavior.
PatR [Thu, 7 Jan 2016 09:53:06 +0000 (01:53 -0800)]
fix #H4181 - strange death messages
"Petrified by <foo>, while getting stoned." -- multi_reason "while
getting stoned" explains why no last-second recovery could be made,
but doesn't explain how the petrification happened, so suppress it.
"Died of starvation, while fainted from lack of food." -- nethack
does not display this; presumeably the IRC death notices for NAO are
generated from xlogfile entries. Change 'while fainted from lack of
food' to 'while fainted' at time of death if reason for death is
starvation. The longer version is accurate but sounds fairly silly.
When starvation is set in motion, set it up before checking whether
the initial faint triggers falling on a wielded cockatrice corpse, so
that fainting isn't applied after recovery in case of life-saving.
PatR [Thu, 7 Jan 2016 01:57:39 +0000 (17:57 -0800)]
fix #4138 - 'text bug' for freezing moat
Freezing a moat--unlike other types of water--substitutes the type
of water (because that isn't "moat" for Medusa's level) in the freeze
message but was doing so after changing the affected terrain to ICE,
yielding "The ice is bridged with ice."
PatR [Thu, 7 Jan 2016 00:47:30 +0000 (16:47 -0800)]
getpos() for objects
Extend the 'm' and 'M' functionality (move cursor to nearest monster
or farthest monster, respectively, then to next nearest/next farthest
when used successively) to 'o' and 'O' for objects.
'M' was picking the wrong monster (nearest) on first use; now fixed.
Hero is now included in the monster list, and will be the last one
reached if you cycle all the way through in either direction. (Makes
it easier to tell that you have actually been all the way through.
Unfortunately, objects don't have any seen-'em-all indicator. Perhaps
the hero's coordinates should go on that list too?)
PatR [Wed, 6 Jan 2016 23:37:46 +0000 (15:37 -0800)]
get_count() cleanup
Fix several warnings. Accept ASCII RUBOUT (aka DELETE) in addition
to backspace. [Should use erase_char (and add support for kill_char)
but that means pushing get_count() into the interface code.] Guard
against user causing the count to wrap if someone ever adds a call to
get_count() which doesn't specifying a maximum value.
PatR [Wed, 6 Jan 2016 08:45:46 +0000 (00:45 -0800)]
tribute: Equal Rites revisited
The number of passages felt a little light, so split one of the
long-ish ones into two. The punchline that now ends the first one was
being watered down by continuing the text, and an interesting bit that
was left out can be added to finish the second part. They both lose
some context but I think they work ok separately.
PatR [Wed, 6 Jan 2016 08:07:54 +0000 (00:07 -0800)]
provisional fix for bz239 - '[tty] Enter key...'
'... inconsistency in character creation menus'.
During role selection, the final 'is this ok?' menu has 'yes'
preselected so accepted <return> or <enter> to answer yes. The
pick-role, pick-race, &c menus prior to getting to that stage didn't
have a default, so using <enter> meant nothing was chosen, and choosing
nothing was treated as a request to quit. This changes that so it's a
request for 'random' instead.
'Provisional fix' because it ought to do this by making 'random' be a
pre-selected menu entry so that the default choice is visible. But
that takes more effort than I'm inclined to expend on this.
PatR [Wed, 6 Jan 2016 07:19:14 +0000 (23:19 -0800)]
fix getpos() m,M to move to next monster
Fixing a couple of warnings led to discovery of a couple of real bugs.
Warnings:
1) -Wshadow warning for 'dist2' variable blocking access to dist2()
function.
2) Declaration not at top of block not allowed for C89/C90 (let alone
for pre-ANSI).
Bugs:
3) there might be 0 visible monsters, in which case the code prior to
qsort will call alloc(0). I think ANSI requires malloc(0) to return
a unique pointer which can be freed, but pre-ANSI malloc might
return Null to satisfy it, leading to panic from nethack's alloc().
4) visible monsters in direct line with hero horizontally or vertically
were unintentionally skipped when collecting monster locations.
I think looking at monsters is the wrong way to implement this. It
should be scanning the map for monster glyphs instead. (Coin toss as
to whether it should also treat statues-shown-as-monsters as if they
were monsters while doing this. I'm leaning towards yes. And what
about warning glyphs and instances of the remembered-invisible monster
glyph? They aren't interesting to look at but they might provide a
shortcut to positioning the cursor near something else.)
Using '^' to move to next trap moves from hero's position to end of
hero's line, then columns 1 to N of next line, and so on to bottom
right, then top left columns 1 to N, second line 1 to N, on down to
hero's line. Having 'm' traverse monsters from nearest to farthest
feels like a noticeable inconsistency between the two. Especially if
you move the cursor with direction or topology keystrokes prior to 'm'.
Pasi Kallinen [Wed, 6 Jan 2016 01:32:42 +0000 (03:32 +0200)]
Fix unmapped branch stairs on premapped levels
This happens when levelporting to the first Sokoban level in wizard mode
before visiting the level, causing the branch stairs to not appear until
the space it is in comes in sight of the player.
The issue was that levels flagged premapped would cause the special
level coder to call sokoban_detect() before fixup_special() had a chance
to place the branch stairs properly.
PatR [Wed, 6 Jan 2016 01:29:36 +0000 (17:29 -0800)]
fix #H4179 - death reason for rotted globs
'Poisoned by a rotted gray ooze corpse' should have been
'Poisoned by a rotted glob of gray ooze'.
eatcorpse() is called for non-corpse globs and then corpse_xname()
is called for them too to set up death reason for make_sick(), but
it didn't know anything about globs. Now it does. Blob size is
ignored since it's not relevant for cause of death.
PatR [Wed, 6 Jan 2016 00:17:38 +0000 (16:17 -0800)]
fix #H4179 - lava vs boots
Stepping onto lava destroyed water walking boots if they weren't
fireproof but didn't do that for other types of boots unless hero
was not fire resistant and got killed by the lava. Burn up all
non-fireproof leather boots when stepping onto lava.
Pasi Kallinen [Tue, 5 Jan 2016 08:00:27 +0000 (10:00 +0200)]
Fix bz270, H4166: Finding a secret corridor shows it unlit with lit_corridor
Also #terrain command with dark_room on showed lit room floor on places with
objects or traps. We don't want to show dark room symbol anyway, because
the dark room symbols are only for line-of-sight, and #terrain should
override that...
PatR [Tue, 5 Jan 2016 00:51:24 +0000 (16:51 -0800)]
build fix for ck_server_admin_msg()
ck_server_admin_msg() is only available for '#if (UNIX && MAIL)' but
moveloop() tried to call it unconditionally. Call if from the UNIX
edition of ckmailstatus() instead.
Pasi Kallinen [Mon, 4 Jan 2016 21:04:56 +0000 (23:04 +0200)]
Add server admin messaging functionality
It's occasionally important for public servers to notify
all the players. Sending a mail is not reliable, as not everyone
wants to break conduct, or have mail on.
This adds a compile-time defined filename, which NetHack
will monitor. The contents of the file are in the same
format as SIMPLE_MAIL: "sender:message" on one line.
PatR [Mon, 4 Jan 2016 00:22:22 +0000 (16:22 -0800)]
fix reformatting typo in monmove.c
Fix the vault guard error in dochug() discovered by Alex K. The
behavior of a vault guard ignoring Conflict when confronting the
hero in the vault and escorting him through the temporary corridor
isn't affected. 3.4.3 already behaved that way. (I didn't track
the cause of that down so don't know whether it's intentional.)
PatR [Sun, 3 Jan 2016 08:36:31 +0000 (00:36 -0800)]
fix #H4153 - killed by kicking something weird
Steps to make sure 'kickedobj' didn't end up as a stale pointer
prevented it from being around to format the reason for death when
a kicking attempt was fatal.
Pasi Kallinen [Sat, 2 Jan 2016 11:40:47 +0000 (13:40 +0200)]
Move and reorder ap exc, menucolor and msgtype entries in options
Move autopickup exception, menucolor, and message type entries
in the options menu under "Other settings" -header, and reorders
them into alphabetical order.
nhmall [Sat, 2 Jan 2016 01:33:14 +0000 (20:33 -0500)]
SYSCF_FILE corrections for windows
Changes to be committed:
modified: src/files.c
modified: sys/share/pcmain.c
Related to #H4170, bz274
The current startup code seeks out the SYSCONFPREFIX using:
envp = nh_getenv("COMMONPROGRAMFILES");
which is fine and usually translates to something like
"C:\\Program Files (x86)\\Common Files\\
NetHack then tacks on the NetHack subfolder to the path
"C:\\Program Files (x86)\\Common Files\\NetHack\\"
That should always be the definitive location.
However, in the event that there is no SYSCF_FILE actually
located at that system-wide spot (and ONLY in that event),
fall back to a secondary location of HACKDIR for locating
the SYSCF_FILE.
Also, there's some explicit tweaking added for the Microsoft
visual studio compiler debug execution to all a debug
session to correctly locate things. By default, on a
visual studio build, the executables are linked down in
subfolders of the build directory (Release, or Debug,
depending on visual studio build configuration options).
nhmall [Fri, 1 Jan 2016 16:17:57 +0000 (11:17 -0500)]
improve messaging on vampire bat to fog cloud transition in Vlad's
Bug 271 - #H4167: vampires being fog clouds show up as bats on telepathy
A bug reporter wrote:
> In top level of Vlad's, the vampires hiding as fog clouds in the closets show
> up on telepathy as B, when far-looked as vampire bat. once the door opens they
> are fog clouds.
>
> I currently have telepathy from the PYEC.
The vampire /was/ shapeshifted into a vampire bat, but once the secret door
was revealed, it shifted into a fog cloud in order to pass under the door.
If you were to blast the door with a wand of striking from a distance,
you would have encountered the vampire bat.
This clarifies the situation through better messaging.
--------
Original debug call stack trace:
NetHack.exe!newcham(monst * mtmp, permonst * mdat, char polyspot, char msg) Line 3140
NetHack.exe!vamp_shift(monst * mon, permonst * ptr) Line 1598
NetHack.exe!m_move(monst * mtmp, int after) Line 1219
NetHack.exe!dochug(monst * mtmp) Line 566
NetHack.exe!dochugw(monst * mtmp) Line 100
NetHack.exe!movemon(...) Line 707
NetHack.exe!moveloop(char resuming) Line 105
NetHack.exe!main(int argc, char * * argv) Line 105
PatR [Thu, 31 Dec 2015 07:38:11 +0000 (23:38 -0800)]
fix bz265 - accessibility fix for reluctant pet
Requested by a blind player. The message "Fido moves only reluctantly"
didn't convey enough information to be useful. Describe the reason why
the move is reluctant: "Fido steps reluctantly over <some object>."
If there is a pile, it will describe the top item rather than whichever
cursed item the pet doesn't want to step on.
PatR [Wed, 30 Dec 2015 10:33:42 +0000 (02:33 -0800)]
fix #H4147 - "unlockable chest" desc is misleading
Change "unlockable" to "broken" so that it won't be misunderstood to
mean "capable of being unlocked". The accompanying suggestion to omit
"broken" unless/until a lock or unlock attempt is made is no good since
the main reason for describing the broken lock is to avoid unnecessary
attempts to lock or unlock a container that the hero knows to be broken
but the player may have forgotten.
I also changed remote look-at for objects to use distant_name(doname)
instead of distant_name(xname) so that qualifiers like "empty" and
"broken" will show up on chests you've investigated before but aren't
standing on now. Monster type for corpse also gets shown, instead of
just 'food (corpse)'. Other remote items will become more verbose,
but only those that the hero has already seen up close.
PatR [Tue, 29 Dec 2015 23:09:50 +0000 (15:09 -0800)]
fix 'doterrain menu bug'
From a report sent directly to devteam: the #terrain command had the
same bug as the '`' command (which was one of the very first ones
reported): impossible("add_menu called before start_menu"). Only X11
notices.
PatR [Tue, 29 Dec 2015 01:32:31 +0000 (17:32 -0800)]
fix 'blind sink behavior'
Reported directly to devteam: teleporting or polymorphing a sink when
dropping the relevant ring into it was suppressed if the hero couldn't
see it happen.
Being unable to see the sink transform or vanish shouldn't stop that
from happening. Since the hero is known to not be levitating (because
of the sink), it can be assumed that he can feel the transformation or
vanishment (is that a real word?), so use the same messages regardless
of blindness.
PatR [Mon, 28 Dec 2015 23:10:22 +0000 (15:10 -0800)]
occupation vs running
Noticed while testing a potential change to running while confused:
when confusion timed out, I kept running even though I was headed in
the wrong direction. Timeout calls stop_occupation() but running is
not an occupation.
Make stop_occupation() also stop counted activity under control of
the player (ie, multi > 0). Some places in the code use both
stop_occuation() and nomul(0), some just use one or the other. But
most of those probably intend for both.