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.
PatR [Sat, 29 Jan 2022 23:00:49 +0000 (15:00 -0800)]
more fixes*.* rename
nethack 3.0, nethack 2.2, and hack 1.0 did not use a three component
version numbering scheme so their corresponding fixes files shouldn't
do so either. Change those from fixesX-Y-0.txt to fixesX-Y--.txt.
PatR [Sat, 29 Jan 2022 20:26:22 +0000 (12:26 -0800)]
reformat dat/hh
For
key name description
reduce the width of the first column from 8 spaces to 6 and increase
the width of the second column from 8 spaces to 10 so that fewer lines
have misaligned third column caused by long name.
Also a small amount of extra verbosity, mostly for I and A/P/R/T/W.
PatR [Sat, 29 Jan 2022 19:18:26 +0000 (11:18 -0800)]
pull request #624 - Add missing const
git has me really confused right now, first requiring a merge, then
not needing any merge. Anyway, add pull request #624 which was
unintentinoally closed and then couldn't re-opened. Now it's been
incorporated so is intentionally closed.
nhmall [Sat, 29 Jan 2022 14:20:29 +0000 (09:20 -0500)]
try to work around a mingw shortcoming within CI
The mingw-w64 version on the CI platform is older and
is missing a sought copy of winres.h.
This attempts to work around that by having the Makefile
create a temporary copy of winres.h in the win/win32 directory
which that windres.exe is already search in. The file is
then immediately removed after windres uses it.
The contents of the temporary winres.h match the contents
of that file that is distributed with the more up-to-date msys2
distribution of mingw-w64.
It won't be known if this workaround solves all the CI issues
with the mingw build until after it is committed and observed.
Pasi Kallinen [Sat, 29 Jan 2022 10:57:58 +0000 (12:57 +0200)]
Swap running and rushing modes back
I unintentionally swapped the shift and ctrl movement keys
when redoing the movement input - change them back to how
it was earlier.
Also change the number_pad meta-key bindings, and explain
in the comments why: We can't bind shift or ctrl numbers.
Meta (aka alt-key) works with number-pad numbers when
the altmeta-option is on. There was no altmeta in 3.4.3.
Here's a table of the flags.run/g.context.run values,
from 3.4.3 and 3.7 as of this commit:
PatR [Fri, 28 Jan 2022 00:11:22 +0000 (16:11 -0800)]
X11 topten display
Make the same change as was done for Qt three or so weeks ago: force
the 'toptenwin' option on in X11_init_nhwdinows() so that scores (or
wizard mode "your score is ignored") are shown in a popup text window
instead of being sent to stdout.
PatR [Fri, 28 Jan 2022 00:10:11 +0000 (16:10 -0800)]
X11 ant extermination
The X11 tiled map was being initialized to the tile for giant ant.
Visible during the role/race/&c selection dialog and if you get the
"already a game in progress under your name; destroy it?" prompt.
Add $(USE_LUADLL) to release lua-5.4.3.dll, instead of link static
lua.lib into .exe files.
Add windres "--target" option, to fix the NetHackW.exe startup problem.
Add "-s" option to $(LDFLAGS) in release mode, to make exe/dll smaller.
Add $(CLEAN_DIR) and $(CLEAN_FILE) to track what to clean.
Remove *.tag, but use "order-only prerequisites" to make directory
before any '.o' is built.
Use make variables and functions to improve readability.
Each project has its own directory to hold object files, to fix the
interference problem between different projects, like NetHack.exe object
files were built with "-DTILES".
Add "-mconsole" option when linking NetHack.exe, to fix that sometimes
GetStdHandle returned with invalid handle error.
Add ".PHONY" statements.
Use "gcc -E -MM -MT" to implement semi-auto "Prerequisites Generating".
Feiyun Wang [Thu, 27 Jan 2022 10:54:22 +0000 (18:54 +0800)]
Some improvements in Makefile.mingw32.depend
- Change $(cce) to output .d file prerequisite too, the same as .o
- Replace $(CLEAN_FILE) handling w/ "clean: cleandep", for more encapsulation
Pasi Kallinen [Tue, 25 Jan 2022 09:19:12 +0000 (11:19 +0200)]
X11: Fix map expose area
The stop_row and stop_col were off-by-one in some cases, leaving
black lines on the map when a window on top was closed.
Simplify the calculation by always going one row/col further,
ensuring previously covered area gets redrawn for sure.
This should not affect speed or resource usage noticeably these days.
PatR [Mon, 24 Jan 2022 01:18:05 +0000 (17:18 -0800)]
throttle excessive HP and En gains
The priest/cleric quest provides unlimited wraiths and a player
(not a robot with limitless patience) posting on reddit gave up
building up his character by killing them and eating the corpses
after accumulating 40K HP and 20K En. (Or something close to that;
I can't get back to the post right now.) His character might have
been capable of surviving decapitation or bisection.
Make it very much harder to get to 5 digits of HP or En via level
gains after reaching level 30. If maxhp < 300, new gains will be
capped at 5 extra HP; 300..599, cap is 4; 600..899, cap is 3;
900..1199, cap is 2; and once 1200 is reached, further level gains
will only add 1 HP. For maxen < 200, extra En is capped at 4;
200..399, cap is 3; 400..599, cap is 2; and once 600 is reached,
further gains only add 1 En. Note: this only kicks in when gaining
levels while already at level 30.
PatR [Sun, 23 Jan 2022 19:02:26 +0000 (11:02 -0800)]
more 'O' tinkering
Make the code for setting up the 'O' menu's '?' entry more compact.
Also adds 'skipinvert' flag for that entry but it doesn't do anthing
here. I thought that it had been implemented, but aside from the
flag itself, it doesn't seem to exist.
Pasi Kallinen [Sat, 22 Jan 2022 12:32:50 +0000 (14:32 +0200)]
Curses: fix extended command input
The extended command input prompt was behaving in an unintended way:
Typing #a<enter> executed #adjust. Spaces in the entry prevented matching
any command. No error message was given when no command was matched.
Fix all of those, so it behaves more like the tty.
Clean up the tty, curses, and X11 windowport code, so they don't use
the extcmdlist array directly, but query with extcmds_match
and extcmds_getentry.
PatR [Sat, 22 Jan 2022 08:30:39 +0000 (00:30 -0800)]
more 'rest_on_space'
Honor any key binding for <space> when rest_on_space is Off.
Toggling it On and Off remembers the key binding if there is one.
So if the RC file has BIND=\32:attributes, <space> will run #wait
when rest_on_space is On and run #attributes when it's Off.
PatR [Fri, 21 Jan 2022 23:51:05 +0000 (15:51 -0800)]
fix rest_on_space
When rest_on_space is On, assign same function as for #wait to the
<space> key. When Off, set that key to Null instead. Binding some
other command to <space> when rest_on_space is Off doesn't work but
I would classify that as something to be discouraged anyway.
PatR [Fri, 21 Jan 2022 22:27:21 +0000 (14:27 -0800)]
autodig '>'
This fixes moving in direction '>' while wielding a pick-axe with
the 'autodig' option On. Attempting to dig assumed size-to-side
activity because u.dz wasn't being set, so the pick-axe was swung at
thin air instead making a pit or turning an existing pit into a hole.
dodown() and doup() should probably call set_move_cmd() instead of
manipulating u.dz directly. But they would also need to suppress
g.move_attempting or the game says "you can't get there from here..."
after successfully digging or plunging into a pit.
PatR [Fri, 21 Jan 2022 21:37:33 +0000 (13:37 -0800)]
reconcile toss_up() with hmon_hitmon()
Throwing silver or blessed non-weapons upward and having them fall
back onto susceptible hero's head wasn't adding the extra bonus damage
that a weapon would get in that situation.
Make hitting vulnerable monsters with blessed just-about-anything get
the 1d4 bonus that blessed weapons get for that. Doesn't apply to
things that have their own special handing, like potions or eggs.
PatR [Fri, 21 Jan 2022 19:38:21 +0000 (11:38 -0800)]
wet towel tweaks
When hitting with a wielded wet towel, use "you lash <mon>" like
bullwhip. If you continue with the towel after it has dried out,
message reverts to ordinary "you hit <mon>".
Enhance damage slightly and double the wetness bonus when target
is an iron golem. Damage was (tmp=rnd(1..7), max(tmp,6)); now it's
rnd(1 + 1..7) for other monsters, rnd(1 + 2*(1..7)) for iron golem,
with no cap of 6 for either.
Sequencing: defer "your towel dries" until after the lash message.
PatR [Fri, 21 Jan 2022 00:31:34 +0000 (16:31 -0800)]
slippery fingers
When the hero has the Glib condition, ^X reports "you have slippery
fingers" or "you have slippery gloves" but self-probing (either wand
or stethoscope aimed at self) was reporting "you have slippery hands."
Change self-probing to match enlightenment for this.
PatR [Thu, 20 Jan 2022 20:44:43 +0000 (12:44 -0800)]
more 'O' tinkering
When picking '?', showing help, and then re-executing the 'O' menu,
let doset() perform its normal cleanup after the first pass instead
of duplicating that prior to making the second pass.
PatR [Thu, 20 Jan 2022 20:25:24 +0000 (12:25 -0800)]
'O' help bulletproofing
When using the 'O' menu, if player picks '?' plus additional choices,
it shows help and then operates on the other choices as if normal.
But for the latter, it was re-using the '?' pick as an option to
change, attempting (and silently failing) to toggle the legacy option
because it happens to be allopts['?' - 1]. It was also relying on
the list of picks being sorted in menu order rather than in player's
selection order or some other arbitrary ordering, something not
specified by the windowing specs.
Instead of looking for '?' as the first selection, process the list
normally and show the options menu help if '?' is found as a choice.
If any interface doesn't return a set of multiple picks in menu
order, the help might not be seen before prompting for compounds,
but it would be very unusual to ask for help and also try to make
changes at the same time so this doesn't seem worth worrying about.
nhmall [Thu, 20 Jan 2022 15:37:53 +0000 (10:37 -0500)]
adjust build procedures for added file
Builds for:
sys/msdos/Makefile.GCC - for local build on msdos itself (untested)
sys/unix/NetHack.xcodeproj/project.pbxproj - for Xcode build
sys/windows/Makefile.gcc - for Windows build via Ming-w64 (untested)
sys/windows/Makefile.msc - for visual studio nmake build
sys/windows/vs/files.props for visual studio solution/project build