PatR [Sat, 24 Oct 2020 10:17:19 +0000 (03:17 -0700)]
disclosure prompt phrasing
With to-be-3.7, if game ends without any achievements, the conduct
disclosure prompt is the same as it has always been
Do you want to see your conduct?
If it ends after attaining one achievement (probably entering the
mines or acquiring the second rank title when gaining Xp level 3)
you're asked
Do you want to see your conduct and achievement?
which looks awkward after the fact if 'y' reveals multiple conducts.
Instead of deciding whether to pluralize "conduct(s)", simplify the
prompt when one or more achievements have been attained to be
Do you want to see your conduct and achievements?
That works even when there is only one achievement.
PatR [Sat, 24 Oct 2020 03:15:01 +0000 (20:15 -0700)]
fix #K2622 - fire/frost horn feedback for monster
When a monster used a fire horn or frost horn to attack the hero,
the feedback claimed that the attack was being directed at itself.
The error occurred in code that was added to 3.7 during 3.6
development but wasn't present in 3.6.x so fixes entry is in the
"exposed by git" section.
PatR [Sat, 24 Oct 2020 02:43:10 +0000 (19:43 -0700)]
fix #K2617 - metallivores eating iron bars
Monsters with rust attacks (rust monster) and corrosion attacks
(black pudding, gray ooze) can eat or otherwise destroy iron bars
but xorns could only move through the iron bars spot without being
able to eat the metal there. Change xorn to eat bars instead of
phazing through them. Lets rock moles eat bars too.
Hero polymorphed into a rust monster would eat bars if trying to
move to their location but couldn't do so if already there (maybe
was in xorn form and now in rust monster form). Xorns could pass
through them but not eat them. Allow hero metallivores to eat
bars at the current location via 'e', similar to eating food off
the floor. Hero as rock mole behaves like rust monster.
Pasi Kallinen [Wed, 21 Oct 2020 18:04:03 +0000 (21:04 +0300)]
Mild Zombie Apocalypse
When a zombie (or lich) kills a monster in melee without a weapon,
the monster can rise few turns later as a zombie.
The only creatures that can be zombified are ones that actually have
a zombie counterpart monster. A zombie cannot turn a jackal into
a zombie, for instance. But it could turn a shopkeeper into a human
zombie, or a dwarf king into a dwarf zombie.
Zombies will fight with monsters that can be turned into zombies.
Originally this was a SliceHack feature, but this is based on xNetHack
version of it, with some modifications.
Bart House [Sat, 13 Jul 2019 17:53:53 +0000 (10:53 -0700)]
Removing assertion that does not hold under all scenarios.
When we save gamestate as part of making an insurance snapshot, we will
save message history which will clear toplines but leaving window state
in tack including the need for more.
Bart House [Fri, 12 Jul 2019 04:04:29 +0000 (21:04 -0700)]
Fixed bug with inmore and toplin state management.
When fuzzing, we would increment ttyDisplay->inmore but then prematurely
exit more() leaving ttyDisplay->inmore set.
Under various conditions, we can request to remember the topline when
the topline had not yet been acknowledged leaving toplin state in an
inappropriate state.
Bart House [Sat, 13 Jul 2019 23:00:14 +0000 (16:00 -0700)]
Add stopping in the debugger when nhassert() is hit in the windows port.
When stopping in the debugger after having called impossible, the windowing
state will have been modified since the assertion was hit. This made
examining state that caused the nhassert to fire no longer possible.
To avoid this issue, we now detect the debugger and stop in the debugger
prior to impossible.
Bart House [Fri, 12 Jul 2019 03:46:19 +0000 (20:46 -0700)]
Remove the remapping of snprintf to _snprintf when compiling with MSC.
_snprintf and snprintf have one very important semantic difference.
_snprintf does NOT add terminating null character when the buffer limit
is reached while snprintf guarantees a terminating null character. It
was a mistake to make this naming change hiding the fact that the
semantics don't match what the developer might expect.
PatR [Sat, 17 Oct 2020 18:10:00 +0000 (11:10 -0700)]
Qt status window icon alignment
When the game windows were initialized, the anhk icon for alignment
was centered relative to Lawful/Neutral/Chaotic label but during
the first status update it noticeably shifted left. Non-blank
hunger or encumbrance states could change from centered to left
justified when they were present and the icon was replaced. Oddly,
resetting the 'centered' attribute for the widget wasn't sufficient
to fix this. Running the resize code for that widget did. Another
case of trial and error to make things work the way they ought.
Also, don't highlight a change in alignment or dungeon location as
"got worse" if the internal numeric value went down instead of up;
always highlight as "got better" for those two fields. There ought
to be a third choice for just "changed" but that would have been
more complicated.
PatR [Fri, 16 Oct 2020 01:22:26 +0000 (18:22 -0700)]
Qt paperdoll - slight reorganization
Three-way swap: move blindfold to alt-weapon slot, alt-weapon to
quiver slot, and quiver to former blindfold slot. Affects first
and third rows of the 6x3 grid.
Before |After
x H b | b H q
S a w | S a w
G C q | G C x
[x=alt-weapon, H=helmet, b=blindfold, S=shield, a=amulet, w=weapon,
G=gloves, C=cloak, q=quiver; bottom three rows not changed so not
shown.]
PatR [Wed, 14 Oct 2020 23:06:25 +0000 (16:06 -0700)]
Qt paperdoll - tool tips used to describe items
New for Qt, moving the mouse over one of the slots in the paperdoll
inventory subset and letting it pause there will use Qt's tool tip
mechanism to give a description of the item under the pointer, if
there is one, or of what the slot would contain when there isn't.
So "e - uncursed leather gloves (being worn)" or "no gloves" when
the pointer is over the glove slot. If you do something with the
keyboard to make the paperdoll change while the mouse is still
hovering, you'll need to move the pointer slightly to have Qt
recheck for tool tip at that spot. It may be feasible to force
an immediate update, but I'm satisfied with how it's working.
Interestingly, you can move pointer and hover while yn_function()
has asked you to pick an inventory item and is waiting for an
answer. Mostly useful for Take-off/Remove or #adjust.
PatR [Wed, 14 Oct 2020 10:02:55 +0000 (03:02 -0700)]
Qt toolbar: add button for 'search'
The toolbar contains do-Again, Pick up, Drop, Kick, Throw, Fire,
Eat, and Rest. Insert Search in front of Rest since it's useful
in its own right and some players prefer it even when resting.
Includes a new 12x13 icon; a tiny magnifying glass shown straight
on is something I can manage.
PatR [Tue, 13 Oct 2020 21:05:52 +0000 (14:05 -0700)]
Qt "Get" -> "Pick up"
Both the toolbar button for pick up and the action menu entry for
pick up were labeled "Get". That's confusing for an experienced
player who is looking for "Pick up". Rename both of them.
Also, consolidate repetitive code used to set up toolbar buttons.
PatR [Tue, 13 Oct 2020 20:41:57 +0000 (13:41 -0700)]
Qt toolbar 'rest' button
An issue in the core made the "Zz" button in the Qt toolbar only
work if rest_on_space was enabled. cmd_from_func() was returning
' ' instead of '.' for the keystroke to run the rest command.
PatR [Sat, 10 Oct 2020 18:46:02 +0000 (11:46 -0700)]
fix github issue #399 - [not] fixing chest lock
Use ansimpleoname() instead of doname() to describe the key or
lock pick or credit card when reporting "You can't fix a chest's
broken lock with a <foo>." doname() includes BUC status when
known and feedback mentioning a particular bless/curse state on
the tool that can't be used to fix the lock suggests that some
other bless/curse state might be viable.
nhmall [Sat, 10 Oct 2020 12:55:43 +0000 (08:55 -0400)]
silence some util/makdefs.c src/mdlib warnings
In file included from makedefs.c:213:0:
../src/mdlib.c: In function ‘runtime_info_init’:
../src/mdlib.c:808:12: warning: variable ‘timeresult’ set but not used [-Wunused-but-set-variable]
time_t timeresult;
^~~~~~~~~~
makedefs.c: In function ‘do_date’:
makedefs.c:1140:16: warning: unused variable ‘ind’ [-Wunused-variable]
const char ind[] = " ";
^~~
makedefs.c:1139:9: warning: unused variable ‘steps’ [-Wunused-variable]
int steps = 0;
^~~~~
makedefs.c: In function ‘do_monstr’:
makedefs.c:1934:12: warning: variable ‘j’ set but not used [-Wunused-but-set-variable]
int i, j;
^
PatR [Fri, 9 Oct 2020 15:45:03 +0000 (08:45 -0700)]
unix/Makefile.utl
Replace use of $(LINK) with $(CLINK) or $(CXXLINK) as warranted.
When the Qt interface is enabled, the utility programs were all
(except dlb) being linked with C++ support. That didn't cause
any problems, just looked wrong. Link them as C instead of C++.
Two actually do need C++ support (and still have it) but both
are dead: 'tile2beos' because the source file doesn't exist (not
even in 'outdated'), 'tileedit' because it won't build with Qt5.
I didn't bother with QUIETCC support for them.
There were still a couple of references to dgn_comp (for the lint
target; just in the name of a macro, not its value); remove those.
PatR [Thu, 8 Oct 2020 18:24:11 +0000 (11:24 -0700)]
Qt prompt highlighting
When qt_yn_function() or qt_more() is asking for a single character
response, typing anything will cause the prompt line in the message
window to stop being highlighted. If they reject what's been typed,
they beep (--More-- doesn't start beeping until second rejection);
change both of them to also rehighlight the prompt line to give a
visual indication that the question/acknowledgement is still being
asked.
PatR [Thu, 8 Oct 2020 17:18:44 +0000 (10:18 -0700)]
Qt menu hack
Prevent a small inventory menu as the first one shown from forcing
all subsequent ones from being the same short height by forcing it
to have room for at least 15 lines. Temporary hack until someone
figures out why resizing the reused WIN_INVEN isn't working.
Does not affect non-inventory menus which get created on demand and
destroyed when done so don't need to change size to fit different
contents.
PatR [Tue, 6 Oct 2020 22:20:25 +0000 (15:20 -0700)]
Qt status panel as command button
Clicking on the status panel runs ^X to show character and status
information without abbreviations. The code needed is identical
to what's now used for clicking on the paper doll inventory panel
except for the command to execute.
PatR [Tue, 6 Oct 2020 16:42:59 +0000 (09:42 -0700)]
Qt "paperdoll" as command button
Clicking on the paper doll inventory subset window will cause
the '*' command (#seeall) to execute. They convey the same
information (unless multiple leashes or multiple light sources
are in use; seeall lists all of them instead of just the first
of each) but the doll shows the info with a small grid of map
tiles and seeall shows it with an inventory display of worn and
wielded items plus tools in active use.
Ideally it should show information about a specific item as a
"tool tip" when the mouse hovers over one of the doll slots.
I don't know whether I'll ever attempt to tackle that or even
if that's feasible with Qt. Perhaps use right click instead.
PatR [Tue, 6 Oct 2020 16:09:09 +0000 (09:09 -0700)]
Qt menus, mostly item counts
Don't allow the user to construct a count value when operating on
a pick-none menu where counts aren't meaningful. Unfortunately
that can still be done on pick-one or pick-any menus which don't
happen to have any entries where a count is applicable.
Allow a count to be optionally started with '#'. Note that if
there is an entry using '#' for the selector letter (probably
inventory that has something in the overflow slot), typing '#'
will select the entry instead of initiating a count.
Flail about a bit trying to get menu size correct--failed on this
front.
nhmall [Tue, 6 Oct 2020 15:00:33 +0000 (11:00 -0400)]
update Cross-compiling document for PR385 Web Assemply and libnethack
Credit: The initial Web Assembly cross compile was found in a pull request:
https://github.com/NetHack/NetHack/pull/385
by apowers313. The pull request was merged with some accompanying
NetHack source tree integration changes in early October 2020.
Here's a brief guide to obtaining the cross-compiler sources via git and
building it on your system.
For Ubuntu, the build prerequisite packages for building the compiler can
be easily obtained:
sudo apt-get install python3 cmake default-jre
For macOS, you will need to install Xcode, git, cmake, Python 3.5 or new
(at time of this writing).
After installing the prerequite packages above, obtain the cross-compiler
via git and build it from the directory of your choice using steps similar
to these:
That is the definitive source and trumps anything documented here.
On your linux host, prepare to cross-compile NetHack as follows:
cd sys/unix ; sh setup.sh hints/linux.2020 ; cd ../..
make fetch-lua
On your macOS host, prepare to cross-compile NetHack as follows:
cd sys/unix ; sh setup.sh hints/macOS.2020 ; cd ../..
make fetch-lua
Then, cross-compile to targets/wasm as follows:
make CROSS_TO_WASM=1
You can build src/nethacklib.a from pull request 385 as follows:
make WANT_LIBNH=1
Do not add any additional windowport interfaces to your build
(such as WANT_WIN_TTY=1 WANT_WIN_CURSES=1 WANT_WIN_X11=1 or
WANT_WIN_QT=1) as those aren't applicable to the Web Assembly
or nethacklib builds. A "shim" pseudo-windowport is included
from pull request 385.
Result: As mentioned, the wasm cross-compile will end up in
targets/wasm and the nethacklib.a will end up
src.
The cross-compiler hints additions are enclosed inside ifdef sections
and shouldn't interfere with the non-cross-compile builds using
hints/linux.2020 or hints/macOS.2020.
PatR [Mon, 5 Oct 2020 23:26:27 +0000 (16:26 -0700)]
Qt menu search
Remove a 'TODO' for once. Have the popup that's used to accept the
target string--after clicking on [search] or typing ':' to initiate
menu search+select operation--force keyboard focus to itself. Menu
searching worked without this, but only if you manually clicked on
the search popup prior to typing the target string. Failure to do
so resulted in typed characters being used to select menu entries.
nhmall [Mon, 5 Oct 2020 13:24:42 +0000 (09:24 -0400)]
clear a -Wshadow warning in options.c
options.c
options.c: In function ‘match_optname’:
options.c:5734:27: warning: declaration of ‘opt_name’ shadows a global declaration [-Wshadow]
const char *user_string, *opt_name;
^~~~~~~~
In file included from options.c:52:0:
../include/optlist.h:56:1: note: shadowed declaration is here
opt_##a,
^
../include/optlist.h:307:5: note: in expansion of macro ‘NHOPTC’
NHOPTC(name, PL_NSIZ, opt_in, set_gameview, No, Yes, No, No, NoAlias,
^~~~~~
PatR [Sun, 4 Oct 2020 23:34:59 +0000 (16:34 -0700)]
Makefile.src: avoid extra feedback while linking
Recently added cross-compile stuff had resulted in an extra line
of feedback when linking: 'true;'. Suppress that.
Also, I think 'AWK=nawk' was needed for Solaris or maybe even
SunOS. Switch 'make depend' to use ordinary awk by default since
most systems have Posix-compliant awk these days and OSX doesn't
have nawk.
Adam Powers [Thu, 27 Aug 2020 02:22:00 +0000 (19:22 -0700)]
libnethack pr385
roll parts of pr385 into source tree
This does not take the PR as is.
Unlike the PR, this streamlines and minimizes the integration somewhat:
- use hints/include mechanism instead of creating alternative
Makefile.dat, Makefile.src, Makefile.top, Makefile.utl in sys/lib;
those would have been a maintenance nightmare.
- don't have alternative mkmkfile.sh and setup.sh in sys/lib.
- sys/lib/libnethackmain.c differed from sys/unix/unixmain.c by
very little, so just place a small bit of conditional code at the
top of sys/unix/unixmain.c instead.
- changed the conditional code bits from __EMSCRIPTEN__ to
CROSS_TO_WASM.
- You should be able to build the wasm result by:
cd sys/unix ; sh setup.sh hints/linux.2020 ; cd ../..
make fetch-lua (<-one time)
make WANT_LIBNH all
- You should be able to build LIBNBH by:
cd sys/unix ; sh setup.sh hints/linux.2020 ; cd ../..
make fetch-lua (<-one time)
make CROSS_TO_WASM=1 all