Commit Graph

14853 Commits

Author SHA1 Message Date
Pasi Kallinen
c2a1b97627 Stun from knockback only if not already stunned 2023-02-02 13:50:59 +02:00
Pasi Kallinen
6af26751e6 Monsters never try to pick up ball or chain
Apparently my m_move reorg made it possible for monsters to
pick up the chain attached to hero; explicitly prevent that.
2023-02-01 21:43:26 +02:00
nhmall
b45895c01d correct a predefined preprocessor macro for clang 2023-02-01 14:15:34 -05:00
nhmall
3214335bb5 undefine X11_BUILD after hack.h or config.h
So as not to complicate any onefile efforts by leaving it defined.
2023-02-01 14:04:20 -05:00
nhmall
d4a111083a avoid some issues with c++ and X11 2023-02-01 10:41:04 -05:00
nhmall
79d8f95f57 don't make the catch inline 2023-02-01 10:16:22 -05:00
nhmall
d90fa596a3 refine detection by compiler version in tradstdc.h 2023-02-01 09:55:41 -05:00
nhmall
a5ed0d0363 follow-up 2023-02-01 09:41:35 -05:00
nhmall
14962a5a33 catch use of pre-C99 non-standard functions 2023-02-01 09:22:16 -05:00
Pasi Kallinen
56f1201e43 Use strchr, not index 2023-02-01 16:10:41 +02:00
Pasi Kallinen
df8a0ac654 Split monster looking for items into separate function 2023-02-01 14:37:12 +02:00
Pasi Kallinen
6c9700ab25 Monster movement and object pickup cleanup
Clean up some of the code for monster deciding what objects
to pick up, removing duplicate code.  There should be no real
difference in behaviour, other than monsters now can pick up
one stack of items at a time; previously monster could pick up
gold, then a practical item, followed by a magical item all
in a single turn, although this very rarely mattered.

Not extensively tested.

Code originally from NetHack4.
2023-02-01 10:23:23 +02:00
nhmall
56d4822f4e prototype was within #ifdef block, function wasn't
Move the prototype in extern.h
2023-01-31 23:05:15 -05:00
nhmall
8ee42f5644 further work on soundlib support code
move some inline code into functions
replace some magic numbers

The mingw code is not tested yet.
2023-01-31 22:19:29 -05:00
Pasi Kallinen
4ccee5a177 Use could_reach_item 2023-01-31 19:09:43 +02:00
Pasi Kallinen
97d7a735a4 Separate function for monster safe touch object
Also added the check for touching an artifact to it
2023-01-31 18:44:13 +02:00
nhmall
e6012ab658 Only embed wav resources if soundlib defined 2023-01-31 02:22:25 -05:00
nhmall
f2dc7f308d missed a reference in a header file 2023-01-31 01:29:23 -05:00
nhmall
20c7a217ba mingw follow-up 2023-01-31 01:13:03 -05:00
nhmall
2c5bbdc0ed fix a naming conflict 2023-01-31 01:10:02 -05:00
nhmall
ce0a4f60ca more windows Makefile tinkering
It looks like the Windows API call for PlaySound using SND_RESOURCE, from a
mingw32 built program, cannot find the resources that are
embeded into the .exe by the mingw32 resource compiler. That works fine
from visual studio.

For now, fall back to not using the SND_RESOURCE flag, use an ordinary
wav file name in the filesystem. Makefile.mingw32 has been modified
to copy the wav files to the binary directory along with the exe.

This probably won't be the final approach, but it will get things
working for now.
2023-01-31 00:45:27 -05:00
nhmall
a7b8099ecb some Makefile.nmake fixups 2023-01-30 19:24:21 -05:00
nhw_cron
5bf0bc3ba4 This is cron-daily v1-May-8-2022. 005guidebook updated: doc/Guidebook.txt 2023-01-30 12:37:14 -05:00
nhmall
9bbb2e17cf add a master off/on switch for sounds
sounds can be set in the config file or on the fly with the Options menu.

This also adds a mechanism for specifying a terminology preference
for a boolean option in the options menu.

The choices are: Term_False, Term_Off, Term_Disabled

Term_False, the default, will use the terms "false" and "true" in the
Options menu.
Term_Off will use the terms "off" and "on" in the Options menu.
Term_Disabled will use the terms "disabled" and "enabled" in the Options
menu.

I didn't review any of the existing options to see if one of the new
alternative terms might be a better fit. They were all left at the default.
2023-01-30 12:07:03 -05:00
Pasi Kallinen
fe99bcd591 Hellfill: Lich
Similar to the fake wizard towers.
2023-01-30 18:30:39 +02:00
Pasi Kallinen
71f900f174 Add helltweaks to fake wiz towers 2023-01-30 17:58:51 +02:00
Pasi Kallinen
a4c15f23bc Add helltweaks to wizard3 2023-01-30 17:47:21 +02:00
Pasi Kallinen
788492bdcd Add helltweaks to wizard2 2023-01-30 17:43:34 +02:00
Pasi Kallinen
7def7ece92 Add helltweaks to wizard1 2023-01-30 17:31:25 +02:00
Pasi Kallinen
744d64487b Helltweaks: improve lava river
The lava river will now draw another river, until a certain
amount of map locations have been turned into lava, so you don't
get a teensy "river" made out of 2 lava pools.

Add a lua selection method to count the number of locations
in the selection.
2023-01-30 17:10:39 +02:00
nhmall
c7464e8aa5 purge some never-used fields from iflags 2023-01-30 09:03:47 -05:00
Pasi Kallinen
8eeeec41f5 Avoid repeating the god ray
My recent change to hit and wake monsters caused a recursive
ghod_hitsu -> wakeup -> dobuzz -> buzz -> ghod_hitsu loop.
Don't call the ghod_hitsu again if the priest is already angry.
2023-01-30 12:39:35 +02:00
nhmall
8bb1feab61 remove a value used for a test run of nmake 2023-01-29 22:09:54 -05:00
nhmall
6ce2994646 Windows Makefiles easier soundlib opt-in or opt-out 2023-01-29 22:07:31 -05:00
Pasi Kallinen
77797450f5 Remove obsolete comment 2023-01-29 18:49:58 +02:00
Pasi Kallinen
05f6a33092 Nazgul can see invisible 2023-01-29 18:07:03 +02:00
Pasi Kallinen
394a46ab13 Fix teleported eel hiding in dry land 2023-01-29 14:25:01 +02:00
Pasi Kallinen
7c2c692ee5 Generate random eroded, erodeproof, or greased items
Items in initial hero inventory, or generated via lua in
special levels or themed rooms are not subject to this.

Code via xnethack by copperwater <aosdict@gmail.com>,
with some modifications.
2023-01-29 11:20:03 +02:00
nhw_cron
76bac9efe3 This is cron-daily v1-May-8-2022. 000files updated: Files 2023-01-28 23:29:02 -05:00
nhmall
86368148bf soundlib in the Makefile hints updated
Move pieces of the Makefile hints sound-related changes that
are not macOS-specific from sys/unix/hints/macOS.370 to some new
include files. The WANT_MACSOUND block stays in
sys/unix/hints/macOS.370 because it is system-specific.

Before this change, the various Makefiles were assembled via
hints files macOS.370 or linux.370. Both were using included
portions from the following files in the sys/unix/hints/include
directory, in this sequence:

    -INCLUDE multiw-1.370
    -INCLUDE multiw-2.370
    -INCLUDE compiler.370
    -INCLUDE multiw-3.370
    -INCLUDE cross-pre.370
    -INCLUDE gbdates-pre.370
    -INCLUDE gbdates-post.370
    -INCLUDE cross-post.370

After this change, the various Makefiles will still be assembled
via hints files macOS.370 or linux.370. They will continue to use
included portions from the following files in the
sys/unix/hints/include directory, but with three additional
include files related to sound and soundlibs. This is the new
sequence:

    -INCLUDE multiw-1.370
    -INCLUDE multiw-2.370
    -INCLUDE compiler.370
    -INCLUDE multiw-3.370
+   -INCLUDE multisnd1-pre.370
    -INCLUDE cross-pre.370
    -INCLUDE gbdates-pre.370
+   -INCLUDE multisnd2-pre.370
    -INCLUDE gbdates-post.370
+   -INCLUDE multisnd-post.370
    -INCLUDE cross-post.370

The include mechanism continues to allow common portions that can
be shared between macOS and Linux to be maintained in a single
place only, with minimal duplication. Now, that has been extended
to include Makefile lines related to sounds and soundlib.
2023-01-28 22:43:48 -05:00
nhmall
4575d564c7 do warning suppression for soundlib vars another way
Instead of introducing a bunch of preprocessor #ifdef blocks,
this approach is less-intrusive.
2023-01-28 14:55:54 -05:00
Pasi Kallinen
734dcfdabe Don't let monsters loot Schroedinger's box 2023-01-28 20:27:36 +02:00
Pasi Kallinen
60cbab1130 Fix shopkeeper getting mad when monster triggers a trap
When a monster triggered a rolling boulder trap which buried
a shop item in a pit, the shopkeeper would bill the hero.
(Or get mad at hero, if they were out of the shop)

The fix might not be quite right - should the shopkeeper get
mad at hero when monster triggers a trap created by hero?
Or when an item is buried in a pit created by a hero?
2023-01-28 20:03:23 +02:00
Pasi Kallinen
cb81631a38 Fix open showing wrong glyph
Trying to open a location where a pet was removed the glyph
and showed the underlying terrain glyph instead.
Just use newsym - it'll use feel_location when Blind.
2023-01-28 19:12:24 +02:00
nhmall
44677e82ab warning fix if no added soundlib compiled in 2023-01-28 09:09:39 -05:00
nhmall
f91292b349 cut-and-paste error 2023-01-27 23:58:46 -05:00
nhmall
60f62bc4ef follow-up bit sndprocs.h 2023-01-27 23:56:25 -05:00
nhmall
5b3a8b5774 more Soundeffects tinkering 2023-01-27 23:41:54 -05:00
nhmall
90895330c5 soundlib terminology update - sound_triggers
Switch to using the term "sound triggers" for things that
result in a call to one of the soundlib routines.

SNDCAP_* renamed to SOUND_TRIGGER_*
sndcap field in the sound_procs struct changed to sound_triggers
2023-01-27 22:21:53 -05:00
nhw_cron
8560e61c96 This is cron-daily v1-May-8-2022. 000files updated: Files 2023-01-27 17:30:16 -05:00