Commit Graph

11197 Commits

Author SHA1 Message Date
Pasi Kallinen
aeb0ea65e3 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.
2020-10-23 19:47:10 +03:00
Patric Mueller
1cc26106bf Tossed upwards objects got two times half physical damage reduction 2020-10-23 11:04:29 +02:00
Bart House
7e3a739ef9 Add stringization of nhassert expression. 2020-10-20 20:14:27 -07:00
nhmall
d1c7f26d4b clear a couple of new warnings
mondata.c:198:17: warning: unused variable 's' [-Wunused-variable]
    const char *s;
                ^
1 warning generated.

steed.c:43:17: warning: unused variable 's' [-Wunused-variable]
    const char *s;
                ^
1 warning generated.
2020-10-20 19:37:51 -04:00
Pasi Kallinen
566dde8683 Match object description via single function
making the code more readable.

Instead of doing strcmp(OBJ_DESCR(objects[otyp]), "foo"),
just call objdescr_is(obj, "foo")

(via xNetHack)
2020-10-20 19:19:57 +03:00
Bart House
5880da9269 Add cpp.hint file to NetHack project. 2020-10-19 16:26:01 -07:00
Bart House
c33a9ed94a Add inlcude files to NetHackW project. Add cpp.hint file. 2020-10-19 16:25:42 -07:00
Bart House
d1404d345c Fix compiler warning. 2020-10-19 16:20:49 -07:00
Bart House
b4c4491229 Fix sign/unsigned comparison bug.
We are comparing a signed char with unsigned int.  The signed char will be
sign exetended when converted to unsigned int causing an unexpected
result.
2020-10-19 16:19:01 -07:00
Bart House
a9deeb69c9 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.
2020-10-19 16:03:10 -07:00
Bart House
2c752cce69 Added assertions to check toplin state. 2020-10-19 15:59:46 -07:00
Bart House
aee1509979 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.
2020-10-19 15:59:01 -07:00
Bart House
362fd6ffbf 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.
2020-10-19 15:56:49 -07:00
Bart House
93ce6857d3 Tweaks to nhassert implementation. Change to warnings on MSC build. 2020-10-19 15:55:32 -07:00
Bart House
3842da9dbd Added nhassert to core. 2020-10-19 15:51:41 -07:00
Bart House
dde11630e8 Modified nhassert_failed to call impossoible. 2020-10-19 15:36:34 -07:00
Bart House
783efd3524 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.
2020-10-19 15:32:58 -07:00
Bart House
7795d82be6 Improved readability of topline state management. 2020-10-19 15:19:09 -07:00
Pasi Kallinen
3a31587ca9 Prevent ghosts from being renamed
(via xNetHack)
2020-10-18 20:28:32 +03:00
Pasi Kallinen
f38cb63714 Spitting monsters try to stay away from melee range 2020-10-18 19:18:38 +03:00
PatR
9a6bc0fd8f 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.
2020-10-17 11:10:00 -07:00
Pasi Kallinen
fc6b491303 Fix thinko in reset travel dest condition 2020-10-17 16:48:07 +03:00
Pasi Kallinen
5ddafa5c81 Only reset if we actually went to travel destination 2020-10-17 12:13:17 +03:00
Pasi Kallinen
a9e4904131 Reset travel destination if reached via teleport 2020-10-17 12:08:51 +03:00
Pasi Kallinen
b6125b8f78 Pre-populate teleport destination prompt with travel destination
This has been implemented in multiple variants, and seems like
a small but useful quality of life improvement.
2020-10-16 19:14:01 +03:00
PatR
9d3dfd59f9 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.]
2020-10-15 18:22:26 -07:00
nhmall
4c933fbf3c recognize visual studio 2019 16.7.6 in sys/winnt/Makefile.msc 2020-10-15 09:38:52 -04:00
PatR
a0c6118c97 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.
2020-10-14 16:06:25 -07:00
PatR
42b466e87b artifact.h formatting
The automated reformatting way back when left artifact.h in need
of manual fixup, particularly SPFX_HPHDAM.
2020-10-14 09:25:45 -07:00
PatR
6a443226d1 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.
2020-10-14 03:02:55 -07:00
PatR
7011b10f64 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.
2020-10-13 14:05:52 -07:00
PatR
267228d0dd 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.
2020-10-13 13:41:57 -07:00
nhmall
060bfe6f5d Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-10-11 14:30:30 -04:00
nhmall
e4473de586 cron daily Files update 2020-10-11 14:29:16 -04:00
nhmall
d9395dcd23 more integration suggestion adoption 2020-10-11 13:42:12 -04:00
nhmall
6806c30a59 adopt some integration suggestions
sys/lib -> sys/libnh
sys/lib/libnethackmain.c -> sys/libnh/libnhmain.c
libnethack.a -> libnh.a
2020-10-11 13:33:51 -04:00
nhmall
0adb64e384 get this working: "make wasm" 2020-10-11 10:51:46 -04:00
nhmall
d4e97cc650 libnethackmain.c includes date.h 2020-10-11 09:43:15 -04:00
nhmall
eaa8b99eea follow-up bit
remove an unnecessary dependency for top Makefile wasm
2020-10-11 09:16:23 -04:00
nhmall
efdf4f8979 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-10-11 09:12:02 -04:00
nhmall
75f852f277 cross-compiles need not build host native lua library
Because some Makefile.top dependencies triggered the build
of the host native lua library, the cross-compiles were
building it needlessly.

Make it a make variable so that it can be overridden by
cross-compile recipes in sys/unix/hints/include/cross-*.2020
2020-10-11 09:08:27 -04:00
nhmall
d6719ea0db cron daily Files update 2020-10-10 19:36:36 -04:00
Bart House
c36a823cab Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-10-10 16:28:54 -07:00
Bart House
cc50aa036d Update files heading to reflect that we support VS 2017 and 2019. 2020-10-10 16:28:41 -07:00
nhmall
9599fa27df update win/win32/vs/.gitattributes text 2020-10-10 18:38:25 -04:00
nhw_cron
c5c43ad00a This is cron-daily v1-Jan-20-2020. files updated: Files 2020-10-10 18:31:30 -04:00
Bart House
bb04a9b041 Support both VS 2017 and VS 2019 without making changes to project files.
Renamed 'vs2017' folder to 'vs'.
2020-10-10 15:15:59 -07:00
Bart House
75f3ccd770 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-10-10 14:18:18 -07:00
Bart House
848f37207d Add text mentioning that LUA sources must be copied into tree. 2020-10-10 14:17:58 -07:00
nhmall
3e66cbd781 more warnings 2020-10-10 16:41:09 -04:00