PatR [Tue, 8 Feb 2022 00:53:56 +0000 (16:53 -0800)]
using prefixes via their extended command names
Trying to use #reqmenu/#rush/#run/#fight prefixes by their extended
command names didn't work because rhack()'s post-processing was stuck
dealing with the entry for the '#' key after using doextcmd() to run
any command. Use a static variable (actually a global one since I put
it into struct g) to notify rhack() of the command that ultimately got
executed.
PatR [Mon, 7 Feb 2022 23:55:04 +0000 (15:55 -0800)]
<Mon> suddenly appears! vs ^G
For ^G, throttle the monster creation feedback. Don't say "suddenly"
and don't exclaim the message, just say "<Mon> appears." Also, use
Norep() so creating lots of similar monsters at once only gives a few
messages (just one unless varied by "next to you" vs "nearby" vs no
qualifier for farther away). And for mimics created as objects or
furniture, report the sudden appearance of new object or furniture.
PatR [Mon, 7 Feb 2022 22:22:41 +0000 (14:22 -0800)]
disallow g/G/F prefix with rush/run commands
Reject an attempt to specify a conflicting or redundant prefix with
a Ctrl+<move> or Shift+<move> (not numpad) or Alt+<move> (numpad).
'm' prefix is accepted.
nhmall [Mon, 7 Feb 2022 14:16:31 +0000 (09:16 -0500)]
fix two reported warnings with SERVER_ADMIN_MSG defined
Report stated a -Wformat-nonliteral at line 612,
and a -Wformat-security at line 614
I was only seeing the latter, so I added the former to the
flags in sys/unix/hints/include/compiler.370. Some compiler
versions have that warning on by default internally and others
don't. If the format string isn't a string literal, there's no
inteference with printf argument checking because that only
operates on string literals.
PatR [Mon, 7 Feb 2022 02:09:23 +0000 (18:09 -0800)]
more command prefix handling
When a command doesn't allow a prefix, go back to showing the prefix
keystroke in the can't-do-that feedback rather than the command name
that it has for potential binding. I went away from that earlier
after typing 'G' followed by 'o' and getting "the open command does
not accept 5 prefix" instead of "G prefix".
Fix the lookup routine which was responsible for that. At least
partially fix it; actually it only ignores digits for !numpad. If a
numpad user types G where it isn't allowed, the feedback will still
be about 5 instead of G. The code is going from keystroke-used to
command-it-invokes back to keystroke-for-command which won't
necessarily yield the original keystroke because a command can be
bound to more than one key.
PatR [Mon, 7 Feb 2022 01:46:31 +0000 (17:46 -0800)]
fix movement prefixes
My earlier change resulted in rejecting all commands entered after
a movement prefix key, rather than just ones that aren't supposed to
take any prefix.
This fixes that and also restores the ability to use 'm>' or 'm<' on
stairs to change levels without auto-pickup at the destination.
PatR [Sun, 6 Feb 2022 21:20:15 +0000 (13:20 -0800)]
water description
The wall of water goaded me into updating waterbody_name(). It's
mostly the same, aside from being moved from mkmaze.c to pager.c and
adding "{wall of|limitless} water" instead of plain "water" for WATER
terrain. I'm not very happy with "limitless" for the Plane of Water
because limits imposed by air bubbles are all over the place. "Wall
of water" might work ok for that level.
Water on Medusa's level is now described as "shallow sea" rather than
lame "water". The two unusual pools on the Samurai home level are
described as "pond" rather than previous "water" which replaced 3.6's
ridiculous "moat". When lava is hallucinated, it is described as
"molten <substance>" (yielding silly things like "molten yoghurt"),
rather than just "<substance>" to distinguish it from hallucinated
water. 'autodescribe' doesn't use waterbody_name() though.
PatR [Sun, 6 Feb 2022 19:51:00 +0000 (11:51 -0800)]
command prefix handling
Investigating github issue #664 by argrath turned up a more
significant problem. Prefixes other than 'm' preceding commands
that don't use a prefix didn't get rejected but didn't do anything.
Pasi Kallinen [Sun, 6 Feb 2022 18:38:18 +0000 (20:38 +0200)]
Make solid water behave more consistently
The "water" terrain (as used on the Plane of Water) behaved
strangely outside the plane. Make it behave a bit more consistently,
although it's still not really usable elsewhere.
The rationale here being it's a solid wall of water.
Firstly, disable levitation and flying (which was already done
when moving into the water on the Plane of Water), and moving into
it refers to it as a "wall of water" to make it clear it's a solid
block of water.
PatR [Sun, 6 Feb 2022 02:43:44 +0000 (18:43 -0800)]
Qt: add tool tips for status window icons
Show a tip if the mouse hovers over any of the various icons displayed
in the status window (for one each of the six characteristics, another
for alignment, and one for each status condition). They all already
have text labels below but many of those are abbreviated; the tips can
be more verbose since they don't compete with each for for screen space.
Also fixes "weak" not being centered under the hunger icon. It /was/
centered but invisible trailing spaces made the visible text be shifted
to the left.
nhmall [Sun, 6 Feb 2022 02:34:55 +0000 (21:34 -0500)]
adjust Makefile.mingw32 for 3.7 date and time stamping
NetHack 3.7 stores timestamp information, as well as github
commit hashs information if available, internally by compiling
date.c. It is important to ensure that date.c is always
recompiled after any other NetHack source files are compiled.
nhmall [Sun, 6 Feb 2022 01:12:10 +0000 (20:12 -0500)]
update the dependencies in sys/windows/Makefile.msc
As usual for the visual studio nmake Makefile.msc, steal the generated
dependencies from the tail of sys/unix/Makefile.src, and adjust the text
to suit the Windows build.
nhmall [Sat, 5 Feb 2022 19:12:18 +0000 (14:12 -0500)]
a slight code-reordering in flush_screen()
despite flush_screen() being called with a True argument signifying that
the cursor was to be left on the hero, sometimes the cursor wasn't. That
was confirmed through some debug tracing and discussion. The subsequent
bot() and timebot() calls could leave the cursor in the status area (on
tty at least), and that was particularly observable during some runmodes.
Get the bot() and timebot() calls out of the way ahead of the cursor
placement call to the window port.
PatR [Sat, 5 Feb 2022 12:15:51 +0000 (04:15 -0800)]
Qt 5 vs Qt 6 revisited plus 'make depend' update
Rename the recently added timestamp file used to throw away old qt
'moc' files from moc.qt5 or moc.qt6 to Qt5.h-t or Qt6.h-t and use
that to also throw away old qt_*.o when switching from Qt 5 to Qt 6
or vice versa. Temporarily the old names remain in Makefile.src's
'clean' target and in src/.gitignore but those will be removed soon.
Update 'make depend' to add the timestamp file to qt_*.o dependencies.
Have it generate rules to build qt_*.moc from ../win/Qt/qt_*.h instead
of using a template rule in hints/include/compiler.370. So building
the Qt interface doesn't require use of that hints file anymore and
someone reading Makefile.src won't have to know about it, but using
those hints will make their life easier.
Simplify the Qt timestamp handling portion of compiler.370. Only one
extra rule gets added when creating src/Makefile.
src/Makefile generated from sys/unix/Makefile.src that's been rebuilt
with 'make depend' got broken by uncommenting '#include "amiconf.h"'
in global.h. That file isn't in include/ but every object file now
depended on it and make didn't know what to do about that. Have
depend.awk treat it as a special case so that no object files depend
on it. That means that actually modifying it won't trigger a rebuild;
anyone fiddling with that will have to always do 'make clean' or
'touch config.h-t' after changing it. The alternative is to move it
from outdated/include/ back to include/.
In depend.awk, recent gawk complained that "\." wasn't a defined
escape sequence in regular expressions so it would be treated as ".".
That's exactly what is intended but change it to "[.]" to avoid the
warning. Similarly for one instance each of "\#" and '\"'. I also
tried changing "\/" to "[/]" even though that is a defined sequence
and doesn't trigger any warning. gawk accepted it but the awk that
comes with OSX choked on it so I changed it back to "\/".
PatR [Sat, 5 Feb 2022 00:20:03 +0000 (16:20 -0800)]
fix github issue #666 - cursed light vs worn light
Another gold dragon scales/mail issue, reported bu vultur-cadens:
reading a cursed scroll of light extinguishes carried light sources
except for wielded Sunsword and worn gold dragon scales/mail; there
was a special message for Sunsword (preventing the hero from being in
darkness) but no such message for gold dragon scales/mail. Replace
the special message with a more generic one applicable to both cases.
Also, implement the suggestion that cursed light degrade the amount
of light being emitted (which varies by bless/curse state) for those
two cases. Sunsword has a 75% chance to resist, gold dragon scales
25% chance. And add the inverse: blessed scroll of light might
increase the amount of light by improving their bless/curse state.
The resistance check applies here too and isn't inverted; Sunsword
is still fairly likely to resist.
Uncursed scroll of light, spell of light regardless of skill, zapped
or broken wand of light have so such effect.
PatR [Fri, 4 Feb 2022 22:34:46 +0000 (14:34 -0800)]
more obsolete files: DECUS C's preprocessor
Get rid sys/share/cpp[123].shr, the pre-ANSI C preprocessor that was
included in the source distribution for use on systems with ancient
C compilers whose preprocessor that couldn't cope with nethack's large
number of macros.
PatR [Thu, 3 Feb 2022 12:17:30 +0000 (04:17 -0800)]
Qt: add tool tips to to extended command selector
For the grid of extended commands used to pick one after typing "#",
show a command's description if the mouse hovers over its button.
For once something with Qt was actually easy.
nhmall [Wed, 2 Feb 2022 20:33:49 +0000 (15:33 -0500)]
static keyword on prototype, but function missing it
error 28 in line 4090 of "invent.c": redeclaration of var <adjust_ok> with new storage-class
error 28 in line 4100 of "invent.c": redeclaration of var <adjust_gold_ok> with new storage-class
error 28 in line 610 of "mdlib.c": redeclaration of var <count_and_validate_winopts> with new storage-class
error 28 in line 3846 of "options.c": redeclaration of var <pfxfn_cond_> with new storage-class
error 28 in line 3886 of "options.c": redeclaration of var <pfxfn_font> with new storage-class
error 28 in line 5307 of "options.c": redeclaration of var <determine_ambiguities> with new storage-class
error 28 in line 5343 of "options.c": redeclaration of var <length_without_val> with new storage-class
error 28 in line 6853 of "options.c": redeclaration of var <illegal_menu_cmd_key> with new storage-class
error 28 in line 7708 of "options.c": redeclaration of var <count_apes> with new storage-class
error 28 in line 2686 of "pickup.c": redeclaration of var <stash_ok> with new storage-class
error 28 in line 1008 of "read.c": redeclaration of var <can_center_cloud> with new storage-class
error 28 in line 31 of "rnd.c": redeclaration of var <whichrng> with new storage-class
Michael Meyer [Wed, 2 Feb 2022 18:56:49 +0000 (13:56 -0500)]
Use verbalize for player monster speech
Attempting to chat with a player monster would inspire a witty retort,
but it was presented without quotation marks and so differed from other
types of monster speech.
PatR [Wed, 2 Feb 2022 13:26:03 +0000 (05:26 -0800)]
fix #K3455 - rocks vs xorns
Implement the suggestion that falling rock traps and rolling boulder
traps be harmless to xorns. I've extended that to all missiles made
of stone (rocks, gems, boulders, a handful of other things that will
only matter if poly'd hero throws in '<' direction or is hit by stuff
scattered by an explosion).
I excluded ghosts because they would become even harder to kill and
the missile handling would need extra checks to test for blessed objs.
PatR [Tue, 1 Feb 2022 21:50:12 +0000 (13:50 -0800)]
Qt 5 vs 6 'moc'
This is an attempt to address the issue of switching from Qt 5 to
Qt 6 or vice versa on Unix without running 'make spotless'. Various
*.h files (but not all of them) in win/Qt/ are run through a program
called 'moc' to create new files *.moc that are included by *.cpp.
The problem is that the constructed files use the same names for Qt
5 or 6 but their contents apparently aren't compatible. This adds
rules (specific to GNU make) that use a pair of timestamp files to
track which version of moc made src/*.moc and to destroy them when
switching Qt versions in order to force their re-creation.
As it stands, a hints file which includes hints/include/compiler.370
is now required in order to build the Qt interface with the Unix
Makefiles. There's no change for platforms that don't use those and
I've no idea whether something comparable could be done for macOS
Xcode IDE.
The first time make is run with WANT_WIN_QT=1 after this is in place,
all the .moc files will be rebuilt and the subset of .cpp files which
include them will be recompiled. After that, the .moc files will be
rebuilt as needed--and only as needed--just like any other constructed
files.
nhmall [Tue, 1 Feb 2022 21:43:39 +0000 (16:43 -0500)]
last known Amiga cross-compile -> outdated
Place the last known Amiga cross-compile effort into the outdated folder
tree.
This shell script was meant to be run from the top of the NetHack tree:
outdated/sys/unix/cross-amiga.sh
It attempts two things:
1. obtain the source-code for the Amiga cross compiler and build it
from scratch. Warning: it pulls a number of the required packages
from the internet and installs them. (Linux was tested, but the macOS
usage never was).
2. move the outdated hints file and hints include files for Amiga
into the live tree for someone attempting to resurrect an Amiga port.
It doesn't tinker with any of the files needed for the NetHack-3.7
work-in-progess for other platforms.
Once the shell script completes those things, the cross-compile build
steps would be:
i) cd sys/unix ; sh setup.sh hints/cross-amiga ; cd ../..
ii) make CROSS_TO_AMIGA=1 all
iii) make CROSS_TO_AMIGA=1 package
PatR [Tue, 1 Feb 2022 02:31:34 +0000 (18:31 -0800)]
tty_raw_print_bold() again
Redo the tty handling for raw_print_bold() intended to keep it working
after exit_nhwindows(). Don't assign static addresses to nh_HI and
nh_HE in case the routine to free dynamic termcap data somehow gets
called again.
PatR [Tue, 1 Feb 2022 02:20:34 +0000 (18:20 -0800)]
topten's so (standout) handling
This fixes the broken code that was using a boolean as an integer.
I didn't try to track down when it changed or what it looked like
before the change. The intended effect is fairly straightforward;
just padding a bold line with spaces. I've no idea why someone
deciced that that was useful though.
It also fixes something I broke six years ago: tty_exit_nhwindows()
releases the termcap data needed for turning bold on and off, so
raw_print_bold() used by topten() stopped working on tty then.
Not fixed: the code in really_done() for dealing with topten() vs
the 'toptenwin' option really ought to be redone.
nhmall [Mon, 31 Jan 2022 20:11:05 +0000 (15:11 -0500)]
some warnings with clang version 13.0.0-9
---------------------
win/curses/cursstat.c:
../win/curses/cursstat.c:301:9: warning: variable 'height' set but not used [-Wunused-but-set-variable]
height, width, w, xtra, clen, x, y, t, ex, ey,
^
1 warning generated.
---------------------
win/Qt/qt_menu.cpp:
../win/Qt/qt_menu.cpp:1123:9: warning: variable 'h' set but not used [-Wunused-but-set-variable]
int h=0;
^
1 warning generated.
---------------------
/win/Qt/qt_yndlg.cpp:
../win/Qt/qt_yndlg.cpp:170:6: warning: variable 'x' set but not used [-Wunused-but-set-variable]
int x=margin, y=extra+margin;
^
../win/Qt/qt_yndlg.cpp:170:16: warning: variable 'y' set but not used [-Wunused-but-set-variable]
int x=margin, y=extra+margin;
^
2 warnings generated.
Commenting out the x and y references, then leads to the following additional warnings,
so comment those out too:
../win/Qt/qt_yndlg.cpp:167:12: warning: unused variable 'margin' [-Wunused-variable]
const int margin=8;
^
../win/Qt/qt_yndlg.cpp:168:12: warning: unused variable 'gutter' [-Wunused-variable]
const int gutter=8;
^
../win/Qt/qt_yndlg.cpp:169:12: warning: unused variable 'extra' [-Wunused-variable]
const int extra=fontMetrics().height(); // Extra for group
^
3 warnings generated.
Pasi Kallinen [Mon, 31 Jan 2022 17:52:30 +0000 (19:52 +0200)]
Covetous monsters will teleport to downstairs or upstairs
I accidentally swapped the covetous monsters teleport to stairs to heal
but instead of changing it back like it was, now make those monsters
teleport to either upstairs or downstairs - some of them will go up,
others go down.
nhmall [Sun, 30 Jan 2022 19:27:44 +0000 (14:27 -0500)]
more CI mingw tinkering
The default tar in the path withing the CI environment is not
the bsdtar variation of tar that comes with Windows (the one
which will extract zip files as well as tar files).
Try using powershell instead for the extraction instead.