PatR [Mon, 19 Nov 2018 02:48:59 +0000 (18:48 -0800)]
fix #H7573 - impossible zero payment in money2mon
When paying for shop door or wall damage, if the entire amount was
covered by shop credit then impossible "zero payment in money2mon"
would occur as the shop code tried to transfer 0 zorkmids from hero
to shopkeeper after using credit to pay.
Bart House [Sun, 18 Nov 2018 07:56:31 +0000 (23:56 -0800)]
Build curses if PDCurses is available.
There are two ways to enable curses in the build. Either set the
environment variable PDCURSES to a folder containing a PDCurses repository
OR place the PDCurses folder alongside the NetHack source repository.
PatR [Sun, 18 Nov 2018 00:40:53 +0000 (16:40 -0800)]
src/ formatting
Clean up quite a bit of minor things found with simple grep patterns:
operator at end of continued line instead of beginning of continuation
(and a few comments which produced false matches, so that they won't
do so next time), trailing spaces (only one or two of those), tabs (a
dozen or so of those), several casts which didn't have a space between
the type and the expression (I wasn't systematic about finding these).
I think the only code change was in the function for the help command.
PatR [Sat, 17 Nov 2018 02:49:12 +0000 (18:49 -0800)]
feedback for missing readonly data files
If bogusmon, engrave, epitaph, oralces, or rumors won't open, assume
it's because the file is missing so don't have impossible() tack on
"saving and restoring might fix this" when telling the player.
(Missing rumors or oracles previously only used pline() rather than
impossible() so this hadn't been an issue for them. Now it would be.)
PatR [Fri, 16 Nov 2018 23:34:09 +0000 (15:34 -0800)]
more vms (vmsbuild.com vs monstr.c)
Apparently I exited emacs without saving and the revised vmsbuild.com
ended up as a backup file that 'git nhadd' wouldn't see. This was
supposed to be included in the patch committed several hours ago....
PatR [Fri, 16 Nov 2018 17:16:48 +0000 (09:16 -0800)]
vms build/install update
New-ish files 'engrave', 'epitaph', and 'bogusmon' added for 3.6.0
were not handled by playground setup. NetHack runs without them so
limited testing didn't notice.
Add 'makedefs -s' to build them and include them in installed files.
Bart House [Fri, 16 Nov 2018 05:42:23 +0000 (21:42 -0800)]
Remap unicode control codes.
When running NetHack.exe in a console set to code page 850, the
multi-byte to wide character mapping will generate unicode values
in the unicode control code range. These values need to be re-mapped
to unicode renderable glyphs using the same mappings we use for
control page 437 otherwise the console font might not render a character
for these unicode control values.
nhmall [Thu, 15 Nov 2018 07:34:45 +0000 (02:34 -0500)]
stale gold symbol displayed after symset change
a stale gold symbol could be displayed on the status line following a switch
to a new symset, as observed and reported for Windows RogueEpyx symset.
An update is required for gold in the status line for a change to
any of the following:
context.rndencode value
the encoded glyph value for COIN_CLASS
the gold amount
PatR [Thu, 15 Nov 2018 01:26:10 +0000 (17:26 -0800)]
X11 menu searching
I was experimenting with some potential changes to menu searching but
have not been satisfied with the result. However, this bit of code
consolidation is worthwhile regardless of that.
PatR [Thu, 15 Nov 2018 01:18:12 +0000 (17:18 -0800)]
X11 resource defaults
Some of the items in NetHack.ad were separated from others by "!"
comment line rather than plain blank line and that tended to make it
look like the two items were directly related. For the ones which
aren't, remove '!'.
I also expanded some comments and reordered a couple of resources,
moving 'slow' closer to top and advanced 'translations' farther down.
PatR [Wed, 14 Nov 2018 00:29:48 +0000 (16:29 -0800)]
fix #H7536 - pet vampire behavior
Vampires tend to take vampire bat form and stay that way, unless/until
there's a closed door they want to pass in which case they change to
fog cloud form. Those shifted forms are weak, so pet vampires tend
not to attack other monsters, and if they don't take damage, they
won't change to vampire form. So, when comparing relative strength of
self and foe while deciding whether to attack another monster, treat
their own strength in weak form as if in vampire form, making them be
more aggressive.
Hostile vampires shouldn't need any comparable change. They don't use
relative strengths when deciding whether to attack something.
PatR [Tue, 13 Nov 2018 23:05:54 +0000 (15:05 -0800)]
fix github issue #159 - eating nurse corpses
Fixes #159
The nurse monster definition is flagged to be able to convery poison
resistance when a corpse or tin is eaten, but the post-corpse code
for nurse healed HP and cured blindness then skipped the intrinsic
handling.
PatR [Mon, 12 Nov 2018 19:02:40 +0000 (11:02 -0800)]
conflicting countdowns again
Use the make_foo() intrinsic set/reset routines instead of trying
to manipulate the intrinsics directly. Previous patch left Dex
down by 1 if stoning caused wounded legs to be fixed, and left
delayed killer allocated if stoning cured sliming or vice versa.
PatR [Mon, 12 Nov 2018 10:13:32 +0000 (02:13 -0800)]
conflicting countdowns
I tried 'pick all' in the #wizintrinsics' menu and after 30 turns,
died with "poisoned by a poisoned, while vomiting". Food poisioning
and/or terminal illness beat the other fatal conditions to the coup
de gras. However, the final stage of vomiting sets Sick to 0 cure
food poisoning and ends up clobbering the killer reason if Sick is
due to terminal illness. It's feasible for that to happen without
using #wizintrinsic, so this fixes that, and also a few other
combinations that seemed contradictory:
1) limbs turn to stone during Stoned countdown now cures wounded legs;
2) turn to stone (a couple of turns later) cures vomiting and sliming;
3) turning to slime during Slimed countdown cures stoning.
Bart House [Mon, 12 Nov 2018 09:58:56 +0000 (01:58 -0800)]
Enforced the inclusion of windows headers before nethack headers.
Moved the code page 437 mapping table to winnt.c so that it could be
used in window and console clients.
Added check that fonts support unicode values we use from code page 437.
Use unicode to draw text if font supports it otherwise use ASCII.
PatR [Mon, 12 Nov 2018 00:04:45 +0000 (16:04 -0800)]
prayer vs blocked by boulder
Salvaged from an old, unfinished patch. When checking whether the
hero is trapped by walls and solid rock, adjacent boulders are
evaluated on whether they can be pushed out of the way. Extend that
evaluation: (1) two boulders on a spot are pushable if there is a
pool beyond that spot, and (2) boulders can't be pushed diagonally
in Sokoban.
PatR [Sun, 11 Nov 2018 22:28:54 +0000 (14:28 -0800)]
fix #H7065 - clairvoyance shows trap over monsters
and over the hero. 3.6.0's clairvoyance tried to show things in
a non-standard sequence, which was intentional but had unintended
side-effects like the disappearing monsters complained about in the
report. To make it work as intended would have required --More--
whenever it kicked in, which is much too intrusive when it happens
every N turns rather than when explicitly casting the spell.
Redo it substantially, and give preference to monsters over objects,
objects over traps, and traps over underlying terrain like normal
vision-based display does. It now detects all monsters within its
bounding box but shows ones which aren't directly in view as
"unseen monster" unless via spell cast at skilled or expert, or at
basic when also having intrinsic clairvoyance.
PatR [Sun, 11 Nov 2018 02:22:38 +0000 (18:22 -0800)]
couple of #wizintrinsic fixes
When #wizinstrinsic was expanded to be able to set any timed attribute,
some that need more than just a timeout counter were left inconsistent.
1) Timed Flying wasn't blocked by levitation, and existing flight
wasn't becoming blocked by timed levitation. Also, eventual flight
timeout wasn't updating the status line, so false 'Fly' condition
remained shown until a status update happened for some other reason.
2) Setting timer for Warn_of_mon didn't set up any type of monster to
warn about so wouldn't do anything. This sets that to grid bug
unless already set due to polymorph form or artifact that warns.
PatR [Sat, 10 Nov 2018 09:37:23 +0000 (01:37 -0800)]
otransit_msg() fixes
Fixes #156
githib issue #156 complains that "The Excalibur falls down the stairs,"
is using poor grammar despite the fact that the usual drop message is
"You drop the +0 Excalibur." I agree. Change it to be "Excalibur
falls down the stairs." (Drop message remains unchanged.)
While looking at that, I noticed that when knocking other items down
stairs, text was being appended to the formatted object name. It was
probably safe due to the space reserved for inserting a prefix while
formatting an object's name, which becomes available for a suffix
after that name has been copied into otransit_msg()'s local buffer,
but using a separate buffer is safer.
PatR [Fri, 9 Nov 2018 23:43:50 +0000 (15:43 -0800)]
impossible worm_cross non-adjacent location
Attempting to mount a long worm tail could yield
\#ride -> mount_steed() -> test_move() -> worm_cross() ->
impossible("worm_cross checking for non-adjacent location").
PatR [Thu, 8 Nov 2018 23:33:03 +0000 (15:33 -0800)]
build and bug fixes for USE_OLDARGS
New: call to panic() in impossible() used arbitrary string as a
format so was vulnerable to percent signs in that string. (This
potentially serious problem is not limited to USE_OLDARGS.)
Old: revised message string for impossible ("save/restore might fix
this" instead of "perhaps you'd better quit") passed wrong number of
arguments to pline() when using the clumsy VA_PASSx() mechanism (was
missing arg 0 for the fixed-arg format argument).
Old: varargs config_error_add() in files.c wouldn't compile for
USE_OLDARGS. Evidently no one has been impacted by that but this
fixes it anyway. (Two problems: prototype used FDECL() when it
should have been using VDECL(), and calls to config_error_add() in
the same file would need the VA_PASSx() stuff to force presence of
all optional args. I moved it instead of adding the latter.)
Pasi Kallinen [Thu, 8 Nov 2018 13:50:53 +0000 (15:50 +0200)]
Fuzz testing debug tool
Add code to run a fuzz tester, simulating (more-or-less) random
keyboard mashing. There's no option to turn it on, you need to
set iflags.debug_fuzzer on via a debugger or something along
those lines.
PatR [Wed, 7 Nov 2018 22:50:44 +0000 (14:50 -0800)]
^X about armor
Enlightenment feedback for "nudist" was added 3.5 years ago. Ever
since, ^X has been reporting "you are not wearing any armor" when
wearing a shield without any other armor.
Since Valkyrie starts in that situation, it's very surprising that no
one ever noticed 'til now (or did notice and didn't bother to report).
PatR [Sun, 4 Nov 2018 06:17:49 +0000 (23:17 -0700)]
removing all items via 'A' when looting container
Followup to 'fix #148' patch: looting a container with menustyle:Full
wasn't offering a chance to remove everything in one go. That was due
to an error I introuduced 2.5 years ago with commit 529dad8ef15d255e00ba2d75dd9a92d5030d97f5 when I changed how the flags
passed to query_category() were being set up. It accidentally switched
'A' from take-out to put-in but the only code to handle 'A' at that
time would take everything out (from container to inventory).
Prior to that, removing everything worked as intended and putting in
everything wasn't supported. Now 'A - autoselect all' is a viable
choice for both in and out.
PatR [Sun, 4 Nov 2018 00:45:31 +0000 (17:45 -0700)]
fix github issue #154 - #loot in A-autoselect all
Fixes #154
With menustyle:Full, picking 'A - autoselect all' when putting items
into a container ran code for taking things out and there wasn't any
corresponding code for putting things in.
Add some put-in-everything code. Taking things out doesn't offer
'A - autoselect all' as a choice so the code mentioned above may now
be dead. Taking everything out seems like something that's much more
likely to be desired than putting everything in.
PatR [Sat, 3 Nov 2018 09:01:11 +0000 (02:01 -0700)]
yet another ^X revision...
Hopefully this will be the last one. Change from a text window to
a menu so that it is possible to scroll backwards (without needing
scrollbars) via '^' and '<' keys. End of game disclosure for
attributes still uses a single-forward-pass text window.
Also, move the recently added weapon proficiency line from the new
'basic' section to right after the "you are wielding" line at the
end of the 'status' section.