Commit Graph

14795 Commits

Author SHA1 Message Date
nhmall
aee2ff57e8 additional Soundeffect, additional SoundAchievement
Also adds a macro SoundeffectEvenIfDeaf for a couple of proposed
special cases where Deafness shouldn't factor in.
2023-01-27 01:25:05 -05:00
nhmall
219c1155f8 a missing break and an incorrect magic number 2023-01-26 22:39:14 -05:00
nhmall
049b90e25e fix the missing break mentioned in previous commit
... but inadvertently left out of that commit.
2023-01-26 17:38:18 -05:00
nhmall
446044e1d5 1st of a few sequencing changes
rename display_gamewindows() to init_sound_and_display_gamewindows()
(I know that's getting pretty long-named).

move activate_chosen_soundlib() into init_sound_and_display_gamewindows()
from moveloop_preamble().

Also included was a missing break in a switch related to sounds.
2023-01-26 17:15:59 -05:00
PatR
52a44b3255 fix github issue #967 - nearby objects
Issue reported by entrez:  distant_name() used different criteria
for 'nearby' than map_object() and see_nearby_objects(), so it could
mark objects as seen when they were being displayed as generic,
without redisplaying them as a specific.  Generic object with dknown
set leads to confusion.  Example was "a spellbook spellbook".

I think this should fix things, but I've only done a small amount of
testing so far.

Fixes #967
2023-01-26 14:05:03 -08:00
PatR
b684f2c401 offer_real_amulet() tweaks
Mote PR #965.  Add a couple of comments and fix up some formatting.
2023-01-26 13:39:00 -08:00
PatR
cef8206af4 \#version warning fix
Avoid #ifdef/#else/#endif inside expansion of Strcat() macro.

Also, change constructed
|soundlib_nosound, soundlib_macsound, and soundlib_qtsound, user sounds.
to be
|nosound, macsound, qtsound, and user sounds.

OPTIONS=soundlib:somelib doesn't--or won't, when finished being
implemented--include the "soundlib_" prefix in the user-visible
value, and placement of "and" vs "user sounds" was odd.

The code should probably be reorganized so that makedefs can put that
into dat/options or at least have it put a placeholder for the missing
paragraph.
2023-01-26 09:10:24 -08:00
PatR
3a2d6d6d0a pull request #965 - split offering the Amulet
into a separate routine

Pull request from argrath:  move the code used when offering the
Amulet of Yendor on a high altar out of dosacrifice() into a new
routine.

Closes #965
2023-01-26 08:28:27 -08:00
Pasi Kallinen
f61e1e8e23 Tiny chance of breaking iron bars with war hammer
Also add some different sounds to hitting the iron bars,
and make it noisy.
2023-01-26 18:21:53 +02:00
SHIRAKATA Kentaro
38cb1b9096 split offering the real amulet into a separate function 2023-01-26 08:19:39 -08:00
Michael Meyer
7f4e69f885 Fix: use-after-free in dog_eat()
I think moving the m_consume_obj call (which will free the eaten item)
further down should fix this without causing any really wacky message
sequencing issues, but if maintaining the exact order is important
obj->unpaid and its price could be cached before the free instead.
2023-01-26 08:30:00 +02:00
nhmall
7ecb1e0757 fix warning
In file included from makedefs.c:180:
./../src/mdlib.c:92:12: warning: unused function 'count_and_validate_soundlibopts' [-Wunused-function]
static int count_and_validate_soundlibopts(void);
           ^
1 warning generated.

Function definition is in the #ifndef MAKEDEFS_C section, so move the prototype there too.
2023-01-26 00:49:11 -05:00
nhmall
4ac30aa2ec list which soundlib support is compiled in 2023-01-26 00:45:32 -05:00
nhmall
021cda2bdd transcription error 2023-01-25 23:10:51 -05:00
nhmall
8e0ed1e69d smooth use of soundlib(s) in Makefile.nmake
Related: also add a preprocesor #if defined(SND_LIB_WINDSOUND) around the
assign_soundlib() call in sys/windows/windmain.c
2023-01-25 23:05:36 -05:00
nhmall
b89d2e0ef1 Fix potential warning in music.c
I saw this included in PR966, but it has nothing to do with the
use-after-free that the pull request is meant to fix. It should
get applied independently of that pull request.
2023-01-25 15:21:30 -05:00
nhmall
24c99e005a add a sounds.c comment in two places 2023-01-25 15:14:27 -05:00
Pasi Kallinen
d19c92281a Give gremlin the property it stole, if possible 2023-01-25 21:55:11 +02:00
nhmall
1b8edf852f more Soundeffects fiddling 2023-01-25 14:23:22 -05:00
PatR
bb0698bb00 sound shell script permissions 2023-01-25 11:14:44 -08:00
nhmall
8bbf9a5b8f add missing entries to visual studio files.props 2023-01-25 09:41:20 -05:00
nhmall
e861adecbd cron Files update 2023-01-25 08:23:10 -05:00
Pasi Kallinen
5b8dc1eff7 Split pet ranged attack into separate function 2023-01-25 11:27:14 +02:00
Pasi Kallinen
84c14982bd Hellfill: Add an angel to the cage 2023-01-25 10:04:56 +02:00
nhmall
a48e32a1f9 add missing Magic_Flute files 2023-01-25 01:16:08 -05:00
nhmall
8fe423d65d Merge branch 'fix-makefile' of https://github.com/argrath/NetHack into NetHack-3.7 2023-01-24 14:44:16 -05:00
SHIRAKATA Kentaro
06615b6e9e substitute non-ASCII chararacters in Makefile.nmake 2023-01-25 04:09:02 +09:00
Pasi Kallinen
ed7e344f00 Giants occasionally have a weapon 2023-01-24 20:54:39 +02:00
nhmall
84b9af9151 add a few missing Soundeffects to apply.c 2023-01-24 13:36:33 -05:00
nhmall
5171fcdc1d some macsound instrument play refinements
Also some better core placement of some of the Hero_playnotes calls.
2023-01-24 13:02:29 -05:00
Pasi Kallinen
09fa9a865d Hellfill: Caged monster 2023-01-24 18:06:16 +02:00
Pasi Kallinen
0cbb9899cb Rename variable from tmp to dmg 2023-01-24 17:02:13 +02:00
Pasi Kallinen
2f40a8c9aa Split hmon_hitmon into multiple functions
hmon_hitmon was the biggest function by far; this makes it far more
manageable.

There should be no change in functionality, and although I didn't
test every case, this was just moving chunks of code and changing
variable names until compiler did not complain anymore.
2023-01-24 15:25:35 +02:00
PatR
641065ee74 some mkmaze.c reformatting 2023-01-24 00:22:23 -08:00
PatR
cc287ebc0c fix sounds warning
Avoid a warning issued when 'nosound' is the only entry in the array
of sound libraries.  Also, panic() if soundlib index is out of bounds.
2023-01-24 00:17:25 -08:00
PatR
0e761836ca fix misplaced parenthesis in end.c 2023-01-23 23:45:19 -08:00
Pasi Kallinen
fd25cb177f Lua doc bits 2023-01-24 09:37:32 +02:00
Pasi Kallinen
0bfd6b22f1 Gehennom tweaks: replace some walls with iron bars 2023-01-24 09:00:43 +02:00
Pasi Kallinen
9c21832cf2 Gehennom tweaks: replace some walls with boulders 2023-01-24 08:34:27 +02:00
nhmall
9f1493e0ad remove a multi-line debug/dev comment 2023-01-24 00:45:45 -05:00
nhmall
cab068d48e Merge branch 'fix-hacklib' of https://github.com/argrath/NetHack into NetHack-3.7 2023-01-24 00:39:10 -05:00
nhw_cron
97ec9460b2 This is cron-daily v1-May-8-2022. 000files updated: Files 2023-01-24 00:29:04 -05:00
nhmall
3f87ce3539 issue with an added comment 2023-01-24 00:25:09 -05:00
nhmall
46f86343e6 Merge branch 'macsound' into NetHack-3.7 2023-01-23 23:52:07 -05:00
nhmall
3d908c49ef take initial stab at macsound interface
Use macOS AppKit framework routines for a first cut at a
macsound soundlib interface.

Requires WANT_MACSOUND=1 on build.

Nothing has been done to move the stock sounds into the resources
of a bundle, so after building, if you want to try the stock sounds
out:
	cp sound/wav/*.wav ~/Library/Sounds

Because the NSSound macOS routines always do the search, supposedly
the following locations are searched in this order:
   1. the application’s main bundle
   2. ~/Library/Sounds
   3. /Library/Sounds
   4. /Network/Library/Sounds
   5. /System/Library/Sounds

Although not specifically implemented as of yet, it may be pretty
close to being able to put soundeffects wav files (by se_ name)
into ~/Library/Sounds working for the SND_SOUNDEFFECTS_AUTOMAP feature.

Feedback is welcome. Contributions for improving it are even more
welcome.

The new soundlib supporting file is named
sound/macsound/macsound.m since it's got objective C in it.

Known bugs and glitches:

The Hero_playnotes on a set of 5 notes goes too fast, so there
needs to be a slight delay added between the note of a multi-note
play.
2023-01-23 23:50:43 -05:00
SHIRAKATA Kentaro
b8ec2dfc96 Avoid casting time_t to int
As time_t may not fit int, cast -1 to time_t instead.
2023-01-24 13:48:43 +09:00
Pasi Kallinen
1d8c944c5a Eating garlic makes some monsters flee 2023-01-24 06:17:17 +02:00
PatR
c5aad9fe56 reimplement pull request #944 - grave contents
Pull request from entrez:  if bones left dead hero's corpse on top
of a new grave, don't find a corpse or summon a zombie when digging
the grave up.  It also removed the chance that a ghoul might be
summoned when engraving on a headstone, switching to zombie or mummy
instead.

Rather than adopting the pull request, this retains summoning a
ghoul via engraving and adds the possibly of doing so when kicking
a headstone.  Having a ghoul prowl around the grave is independent
of whether there is a corpse or zombie inside the grave.  To achieve
this, another flag in 'struct rm' is needed; the single bit for
'disturbed' isn't sufficient.  The bigger 'flags' field wasn't in
use for graves so commandeer that for new 'emptygrave'.  'disturbed'
still uses the 'horizontal' bit in order to have engraving and/or
kicking summon at most one ghoul.

Closes #944
2023-01-23 11:38:15 -08:00
Pasi Kallinen
3b5c53de86 Add triple nesting theme room 2023-01-23 20:00:21 +02:00
Pasi Kallinen
83eaa85dd8 Fix ancient subroom location bug
Randomly placed subrooms were never generated touching
the right or bottom walls of the parent room.

This bug has been present since at least 3.1.0
2023-01-23 19:50:37 +02:00