Added Luigi sounds (#77)

* added a new audio bank 10 for luigi sounds
* made some audio memory buffers larger to fix sound cuts
* added option to enable/disable luigi sounds in the sound options menu
* added Andrat's "90's Classic Luigi Voice Pack" as default luigi sounds

Co-authored-by: anzz1 <>
This commit is contained in:
anzz1 2020-10-16 21:54:59 +03:00 committed by GitHub
parent 2b0f892251
commit d1739648e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
57 changed files with 1367 additions and 162 deletions

View File

@ -262,6 +262,11 @@ ifeq ($(DUMMY),FAIL)
endif
endif
# Copy missing luigi sounds from mario sound banks
$(shell mkdir -p sound/samples/sfx_custom_luigi sound/samples/sfx_custom_luigi_peach )
$(shell cp -n sound/samples/sfx_mario/*.aiff sound/samples/sfx_custom_luigi/ )
$(shell cp -n sound/samples/sfx_mario_peach/*.aiff sound/samples/sfx_custom_luigi_peach/ )
# Make tools if out of date
DUMMY != make -C tools >&2 || echo FAIL
ifeq ($(DUMMY),FAIL)

View File

@ -11,6 +11,8 @@
#define SOUND_ARG_LOAD(bank, playFlags, soundID, priority, flags2) (((u32) (bank) << 28) | \
((u32) (playFlags) << 24) | ((u32) (soundID) << 16) | ((u32) (priority) << 8) | \
((u32) (flags2) << 4) | SOUND_STATUS_STARTING)
#include "luigi_audio_defines.h"
#define SOUNDARGS_MASK_BANK 0xF0000000
#define SOUNDARGS_MASK_SOUNDID 0x00FF0000

View File

@ -0,0 +1,57 @@
#ifndef LUIGI_AUDIO_DEFINES_H
#define LUIGI_AUDIO_DEFINES_H
/* Mario Sound Effects */
// A random number 0-2 is added to the sound ID before playing, producing Yah/Wah/Hoo
#define SOUND_LUIGI_YAH_WAH_HOO SOUND_ARG_LOAD(0x0A, 4, 0x00, 0x80, 8)
#define SOUND_LUIGI_HOOHOO SOUND_ARG_LOAD(0x0A, 4, 0x03, 0x80, 8)
#define SOUND_LUIGI_YAHOO SOUND_ARG_LOAD(0x0A, 4, 0x04, 0x80, 8)
#define SOUND_LUIGI_UH SOUND_ARG_LOAD(0x0A, 4, 0x05, 0x80, 8)
#define SOUND_LUIGI_HRMM SOUND_ARG_LOAD(0x0A, 4, 0x06, 0x80, 8)
#define SOUND_LUIGI_WAH2 SOUND_ARG_LOAD(0x0A, 4, 0x07, 0x80, 8)
#define SOUND_LUIGI_WHOA SOUND_ARG_LOAD(0x0A, 4, 0x08, 0xC0, 8)
#define SOUND_LUIGI_EEUH SOUND_ARG_LOAD(0x0A, 4, 0x09, 0x80, 8)
#define SOUND_LUIGI_ATTACKED SOUND_ARG_LOAD(0x0A, 4, 0x0A, 0xFF, 8)
#define SOUND_LUIGI_OOOF SOUND_ARG_LOAD(0x0A, 4, 0x0B, 0x80, 8)
#define SOUND_LUIGI_OOOF2 SOUND_ARG_LOAD(0x0A, 4, 0x0B, 0xD0, 8)
#define SOUND_LUIGI_HERE_WE_GO SOUND_ARG_LOAD(0x0A, 4, 0x0C, 0x80, 8)
#define SOUND_LUIGI_YAWNING SOUND_ARG_LOAD(0x0A, 4, 0x0D, 0x80, 8)
#define SOUND_LUIGI_SNORING1 SOUND_ARG_LOAD(0x0A, 4, 0x0E, 0x80, 8)
#define SOUND_LUIGI_SNORING2 SOUND_ARG_LOAD(0x0A, 4, 0x0F, 0x80, 8)
#define SOUND_LUIGI_WAAAOOOW SOUND_ARG_LOAD(0x0A, 4, 0x10, 0xC0, 8)
#define SOUND_LUIGI_HAHA SOUND_ARG_LOAD(0x0A, 4, 0x11, 0x80, 8)
#define SOUND_LUIGI_HAHA_2 SOUND_ARG_LOAD(0x0A, 4, 0x11, 0xF0, 8)
#define SOUND_LUIGI_UH2 SOUND_ARG_LOAD(0x0A, 4, 0x13, 0xD0, 8)
#define SOUND_LUIGI_UH2_2 SOUND_ARG_LOAD(0x0A, 4, 0x13, 0x80, 8)
#define SOUND_LUIGI_ON_FIRE SOUND_ARG_LOAD(0x0A, 4, 0x14, 0xA0, 8)
#define SOUND_LUIGI_DYING SOUND_ARG_LOAD(0x0A, 4, 0x15, 0xFF, 8)
#define SOUND_LUIGI_PANTING_COLD SOUND_ARG_LOAD(0x0A, 4, 0x16, 0x80, 8)
// A random number 0-2 is added to the sound ID before playing
#define SOUND_LUIGI_PANTING SOUND_ARG_LOAD(0x0A, 4, 0x18, 0x80, 8)
#define SOUND_LUIGI_COUGHING1 SOUND_ARG_LOAD(0x0A, 4, 0x1B, 0x80, 8)
#define SOUND_LUIGI_COUGHING2 SOUND_ARG_LOAD(0x0A, 4, 0x1C, 0x80, 8)
#define SOUND_LUIGI_COUGHING3 SOUND_ARG_LOAD(0x0A, 4, 0x1D, 0x80, 8)
#define SOUND_LUIGI_PUNCH_YAH SOUND_ARG_LOAD(0x0A, 4, 0x1E, 0x80, 8)
#define SOUND_LUIGI_PUNCH_HOO SOUND_ARG_LOAD(0x0A, 4, 0x1F, 0x80, 8)
#define SOUND_LUIGI_MAMA_MIA SOUND_ARG_LOAD(0x0A, 4, 0x20, 0x80, 8)
//#define SOUND_LUIGI_OKEY_DOKEY 0x2021
#define SOUND_LUIGI_GROUND_POUND_WAH SOUND_ARG_LOAD(0x0A, 4, 0x22, 0x80, 8)
#define SOUND_LUIGI_DROWNING SOUND_ARG_LOAD(0x0A, 4, 0x23, 0xF0, 8)
#define SOUND_LUIGI_PUNCH_WAH SOUND_ARG_LOAD(0x0A, 4, 0x24, 0x80, 8)
// A random number 0-4 is added to the sound ID before playing, producing one of
// Yahoo! (60% chance), Waha! (20%), or Yippee! (20%).
#define SOUND_LUIGI_YAHOO_WAHA_YIPPEE SOUND_ARG_LOAD(0x0A, 4, 0x2B, 0x80, 8)
#define SOUND_LUIGI_DOH SOUND_ARG_LOAD(0x0A, 4, 0x30, 0x80, 8)
#define SOUND_LUIGI_GAME_OVER SOUND_ARG_LOAD(0x0A, 4, 0x31, 0xFF, 8)
#define SOUND_LUIGI_HELLO SOUND_ARG_LOAD(0x0A, 4, 0x32, 0xFF, 8)
#define SOUND_LUIGI_PRESS_START_TO_PLAY SOUND_ARG_LOAD(0x0A, 4, 0x33, 0xFF, 0xA)
#define SOUND_LUIGI_TWIRL_BOUNCE SOUND_ARG_LOAD(0x0A, 4, 0x34, 0x80, 8)
#define SOUND_LUIGI_SNORING3 SOUND_ARG_LOAD(0x0A, 4, 0x35, 0xFF, 8)
#define SOUND_LUIGI_SO_LONGA_BOWSER SOUND_ARG_LOAD(0x0A, 4, 0x36, 0x80, 8)
#define SOUND_LUIGI_IMA_TIRED SOUND_ARG_LOAD(0x0A, 4, 0x37, 0x80, 8)
#endif // LUIGI_AUDIO_DEFINES_H

665
include/seq_luigi.inc Normal file
View File

@ -0,0 +1,665 @@
.channel10:
chan_largenoteson
chan_setinstr 0
chan_setpanmix 127
chan_setnotepriority 14
chan_setval 0
chan_iowriteval 5
chan_stereoheadseteffects 1
chan_setdyntable .channel10_table
chan_jump .main_loop_luigi
.main_loop_luigi:
chan_delay1
chan_ioreadval 0
chan_bltz .main_loop_luigi
.start_playing_luigi:
chan_freelayer 0
chan_freelayer 1
chan_freelayer 2
chan_setval 0
chan_iowriteval 5
chan_ioreadval 4
chan_dyncall
.poll_luigi:
chan_delay1
chan_ioreadval 0
chan_bltz .skip_luigi
chan_beqz .force_stop_luigi
chan_jump .start_playing_luigi
.skip_luigi:
chan_testlayerfinished 0
chan_beqz .poll_luigi
chan_jump .main_loop_luigi
.force_stop_luigi:
chan_freelayer 0
chan_freelayer 1
chan_freelayer 2
chan_jump .main_loop_luigi
.channel10_table:
sound_ref .sound_luigi_jump_yah
sound_ref .sound_luigi_jump_wah
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_hoohoo
sound_ref .sound_luigi_yahoo
sound_ref .sound_luigi_uh
sound_ref .sound_luigi_hrmm
sound_ref .sound_luigi_wah2
sound_ref .sound_luigi_whoa
sound_ref .sound_luigi_eeuh
sound_ref .sound_luigi_attacked
sound_ref .sound_luigi_ooof
sound_ref .sound_luigi_here_we_go
sound_ref .sound_luigi_yawning
sound_ref .sound_luigi_snoring1
sound_ref .sound_luigi_snoring2
sound_ref .sound_luigi_waaaooow
sound_ref .sound_luigi_haha
sound_ref .sound_luigi_panting1
sound_ref .sound_luigi_uh2
sound_ref .sound_luigi_on_fire
sound_ref .sound_luigi_dying
sound_ref .sound_luigi_panting_cold
sound_ref .sound_luigi_coughing3
sound_ref .sound_luigi_panting1
sound_ref .sound_luigi_panting2
sound_ref .sound_luigi_panting3
sound_ref .sound_luigi_coughing1
sound_ref .sound_luigi_coughing2
sound_ref .sound_luigi_coughing3
sound_ref .sound_luigi_punch_yah
sound_ref .sound_luigi_punch_hoo
sound_ref .sound_luigi_mama_mia
sound_ref .sound_luigi_okey_dokey
sound_ref .sound_luigi_ground_pound_wah
sound_ref .sound_luigi_drowning
sound_ref .sound_luigi_punch_wah
sound_ref .sound_luigi_uh
sound_ref .sound_luigi_hrmm
sound_ref .sound_luigi_wah2
.ifdef VERSION_JP
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
.else
sound_ref .sound_peach_dear_luigi
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_jump_hoo
sound_ref .sound_luigi_yahoo
sound_ref .sound_luigi_yahoo
sound_ref .sound_luigi_yahoo
sound_ref .sound_luigi_waha
sound_ref .sound_luigi_yippee
sound_ref .sound_luigi_doh
sound_ref .sound_luigi_game_over
sound_ref .sound_luigi_hello
sound_ref .sound_luigi_press_start_to_play
sound_ref .sound_luigi_twirl_bounce
sound_ref .sound_luigi_snoring3
sound_ref .sound_luigi_so_longa_bowser
sound_ref .sound_luigi_ima_tired
.endif
.sound_luigi_jump_hoo:
chan_setbank 11
chan_setinstr 0
chan_setlayer 0, .layer_luigi_C3C
chan_end
.layer_luigi_C3C:
.ifdef VERSION_EU
layer_transpose 2
.endif
layer_portamento 0x82, 41, 127
layer_note1 37, 0x14, 127
layer_end
.sound_luigi_jump_wah:
chan_setbank 11
chan_setinstr 1
chan_setlayer 0, .layer_luigi_C4C
chan_end
.layer_luigi_C4C:
layer_transpose 254
.layer_luigi_C4E:
layer_note1 38, 0x18, 127
layer_end
.sound_luigi_jump_yah:
chan_setbank 12
chan_setinstr 9
chan_setlayer 0, .layer_luigi_C5A
chan_end
.layer_luigi_C5A:
layer_transpose 254
.layer_luigi_C5C:
layer_portamento 0x82, 39, 200
layer_note1 38, 0x24, 120
layer_end
.sound_luigi_hoohoo:
chan_setbank 12
chan_setinstr 1
chan_setlayer 0, .layer_luigi_C6C
chan_end
.layer_luigi_C6C:
.ifdef VERSION_EU
layer_transpose 1
.endif
layer_portamento 0x82, 44, 200
layer_note1 39, 0x30, 127
layer_end
.sound_luigi_yahoo:
chan_setbank 11
chan_setinstr 4
chan_setlayer 0, .layer_luigi_C7C
chan_end
.layer_luigi_C7C:
layer_transpose 254
layer_somethingon
layer_portamento 0x85, 39, 255
layer_note1 42, 0x1e, 110
layer_note1 39, 0x41, 110
layer_end
.sound_luigi_uh:
chan_setbank 11
chan_setinstr 5
chan_setlayer 0, .layer_luigi_C92
chan_end
.layer_luigi_C92:
layer_transpose 254
layer_portamento 0x81, 41, 255
layer_note1 38, 0x2b, 115
layer_end
.sound_luigi_hrmm:
chan_setbank 11
chan_setinstr 6
chan_setlayer 0, .layer_luigi_CA4
chan_end
.layer_luigi_CA4:
layer_transpose 254
layer_note1 44, 0x1e, 110
layer_end
.sound_luigi_wah2:
chan_setbank 11
chan_setinstr 7
chan_setlayer 0, .layer_luigi_CB2
chan_end
.layer_luigi_CB2:
layer_transpose 253
layer_note1 39, 0x1c, 127
layer_end
.sound_luigi_whoa:
chan_setbank 11
chan_setinstr 8
chan_setlayer 0, .layer_luigi_CC0
chan_end
.layer_luigi_CC0:
layer_transpose 254
layer_note1 40, 0x30, 110
layer_end
.sound_luigi_eeuh:
chan_setbank 11
chan_setinstr 9
chan_setlayer 0, .layer_luigi_CCE
chan_end
.layer_luigi_CCE:
layer_transpose 254
layer_note1 40, 0x44, 105
layer_end
.sound_luigi_attacked:
chan_setbank 11
chan_setinstr 10
chan_setlayer 0, .layer_luigi_CDC
chan_end
.layer_luigi_CDC:
layer_transpose 254
layer_note1 41, 0x30, 120
layer_end
.sound_luigi_ooof:
chan_setbank 11
chan_setinstr 11
chan_setlayer 0, .layer_luigi_CEA
chan_end
.layer_luigi_CEA:
layer_transpose 254
layer_note1 38, 0x30, 127
layer_end
.sound_luigi_here_we_go:
chan_setbank 11
chan_setinstr 12
chan_setlayer 0, .layer_luigi_CF8
chan_end
.layer_luigi_CF8:
layer_portamento 0x81, 38, 200
layer_note1 41, 0x85, 127
layer_end
.sound_luigi_yawning:
chan_setbank 11
chan_setinstr 13
chan_setlayer 0, .layer_luigi_D09
chan_end
.layer_luigi_D09:
layer_transpose 254
layer_note1 39, 0x7f, 105
layer_end
.sound_luigi_snoring1:
chan_setbank 11
chan_setinstr 14
chan_setlayer 0, .layer_luigi_D17
chan_end
.layer_luigi_D17:
layer_transpose 254
layer_note1 39, 0x60, 64
layer_end
.sound_luigi_snoring2:
chan_setbank 11
chan_setinstr 15
chan_setlayer 0, .layer_luigi_D25
chan_end
.layer_luigi_D25:
layer_transpose 254
layer_note1 39, 0x5c, 52
layer_end
.sound_luigi_waaaooow:
chan_setbank 12
chan_setinstr 0
chan_setlayer 0, .layer_luigi_D33
chan_end
.layer_luigi_D33:
layer_transpose 254
layer_note1 39, 0xaa, 127
layer_end
.sound_luigi_haha:
chan_setbank 11
chan_setinstr 3
chan_setlayer 0, .layer_luigi_D42
chan_end
.layer_luigi_D42:
layer_transpose 255
layer_note1 39, 0x4d, 120
layer_end
.sound_luigi_uh2:
chan_setbank 12
chan_setinstr 6
chan_setlayer 0, .layer_luigi_D50
chan_end
.layer_luigi_D50:
layer_transpose 254
layer_note1 43, 0x1e, 105
layer_end
.sound_luigi_on_fire:
chan_setbank 12
chan_setinstr 5
chan_setlayer 0, .layer_luigi_D5E
chan_end
.layer_luigi_D5E:
layer_transpose 254
layer_note1 39, 0xc8, 127
layer_end
.sound_luigi_dying:
chan_setbank 12
chan_setinstr 4
chan_setlayer 0, .layer_luigi_D6D
chan_end
.layer_luigi_D6D:
layer_transpose 254
layer_note1 39, 0x8c, 110
layer_end
.sound_luigi_panting_cold:
chan_setbank 12
chan_setinstr 2
chan_setlayer 0, .layer_luigi_D7C
chan_end
.layer_luigi_D7C:
layer_transpose 254
layer_portamento 0x82, 35, 255
layer_note1 38, 0x30, 127
layer_end
.sound_luigi_panting1:
chan_setbank 12
chan_setinstr 2
chan_setlayer 0, .layer_luigi_D8E
chan_end
.layer_luigi_D8E:
layer_transpose 254
layer_note1 39, 0x3c, 100
layer_end
.sound_luigi_panting2:
chan_setbank 12
chan_setinstr 2
chan_setlayer 0, .layer_luigi_D9C
chan_end
.layer_luigi_D9C:
layer_transpose 254
layer_delay 0x4
layer_note1 38, 0x3c, 100
layer_end
.sound_luigi_panting3:
chan_setbank 12
chan_setinstr 2
chan_setlayer 0, .layer_luigi_DAC
chan_end
.layer_luigi_DAC:
layer_transpose 254
layer_delay 0x8
layer_note1 40, 0x3c, 100
layer_end
.sound_luigi_coughing1:
chan_setbank 12
chan_setinstr 7
chan_setlayer 0, .layer_luigi_DBC
chan_end
.layer_luigi_DBC:
layer_transpose 254
layer_note1 39, 0x10, 115
layer_end
.sound_luigi_coughing2:
chan_setbank 12
chan_setinstr 7
chan_setlayer 0, .layer_luigi_DCA
chan_end
.layer_luigi_DCA:
layer_transpose 254
layer_portamento 0x81, 38, 255
layer_note1 41, 0x18, 115
layer_end
.sound_luigi_coughing3:
chan_setbank 12
chan_setinstr 7
chan_setlayer 0, .layer_luigi_DDC
chan_end
.layer_luigi_DDC:
layer_transpose 254
layer_somethingon
layer_portamento 0x85, 38, 255
layer_note1 41, 0xc, 115
layer_note1 35, 0x12, 115
layer_end
.sound_luigi_punch_yah:
chan_setbank 12
chan_setinstr 9
chan_setlayer 0, .layer_luigi_DFE
chan_setval 1
chan_call .delay
chan_setbank 0
chan_setinstr 0
chan_setlayer 1, .layer_luigi_538
chan_end
.layer_luigi_538:
layer_portamento 0x81, 46, 255
layer_note1 31, 0xf, 100
layer_end
.layer_luigi_DFE:
layer_transpose 254
layer_jump .layer_luigi_C5C
.sound_luigi_punch_hoo:
chan_setbank 12
chan_setinstr 10
chan_setlayer 0, .layer_luigi_E17
chan_setval 1
chan_call .delay
chan_setbank 0
chan_setinstr 0
chan_setlayer 1, .layer_luigi_548
chan_end
.layer_luigi_548:
layer_note1 39, 0x12, 100
layer_end
.layer_luigi_E17:
layer_transpose 254
layer_portamento 0x81, 42, 255
layer_note1 38, 0x30, 115
layer_end
.sound_luigi_mama_mia:
chan_setbank 12
chan_setinstr 11
chan_setlayer 0, .layer_luigi_E29
chan_end
.layer_luigi_E29:
layer_portamento 0x81, 38, 255
layer_note1 36, 0x8c, 115
layer_end
.sound_luigi_okey_dokey:
chan_setbank 12
chan_setinstr 12
chan_setlayer 0, .layer_luigi_E3A
chan_end
.layer_luigi_E3A:
layer_note1 39, 0x60, 115
layer_end
.sound_luigi_ground_pound_wah:
chan_jump .sound_luigi_wah2
.sound_luigi_drowning:
chan_setbank 12
chan_setinstr 13
chan_setlayer 0, .layer_luigi_E49
chan_end
.layer_luigi_E49:
layer_note1 38, 0x91, 127
layer_end
.sound_luigi_punch_wah:
chan_setbank 11
chan_setinstr 1
chan_setlayer 0, .layer_luigi_E62
chan_setval 1
chan_call .delay
chan_setbank 0
chan_setinstr 0
chan_setlayer 1, .layer_luigi_536
chan_end
.layer_luigi_536:
layer_transpose 1
.layer_luigi_E62:
layer_transpose 255
layer_jump .layer_luigi_C4E
.ifndef VERSION_JP
.sound_peach_dear_luigi:
chan_setbank 12
chan_setinstr 15
chan_setlayer 0, .layer_luigi_E6F
chan_end
.layer_luigi_E6F:
layer_note1 39, 0x2bc, 127
layer_end
.sound_luigi_waha:
chan_setbank 11
chan_setinstr 24
chan_setlayer 0, .layer_luigi_E7C
chan_end
.layer_luigi_E7C:
layer_note1 39, 0x5a, 127
layer_end
.sound_luigi_yippee:
chan_setbank 11
chan_setinstr 25
chan_setlayer 0, .layer_luigi_E88
chan_end
.layer_luigi_E88:
layer_note1 39, 0x5a, 97
layer_end
.sound_luigi_doh:
chan_setbank 11
chan_setinstr 16
chan_setlayer 0, .layer_luigi_E94
chan_end
.layer_luigi_E94:
layer_note1 41, 0x46, 127
layer_end
.sound_luigi_game_over:
chan_setbank 11
chan_setinstr 17
chan_setlayer 0, .layer_luigi_EA0
chan_end
.layer_luigi_EA0:
layer_note1 39, 0x55, 110
layer_end
.sound_luigi_hello:
chan_setbank 11
chan_setinstr 18
chan_setlayer 0, .layer_luigi_EAC
chan_end
.layer_luigi_EAC:
layer_note1 39, 0x46, 127
layer_end
.sound_luigi_press_start_to_play:
chan_setbank 11
chan_setinstr 19
chan_setlayer 0, .layer_luigi_EB8
chan_end
.layer_luigi_EB8:
layer_note1 39, 0x12c, 127
layer_end
.sound_luigi_twirl_bounce:
chan_setbank 11
chan_setinstr 20
chan_setlayer 0, .layer_luigi_EC5
chan_end
.layer_luigi_EC5:
layer_note1 39, 0x30, 127
layer_end
.sound_luigi_snoring3:
chan_setbank 11
chan_setlayer 0, .layer_luigi_ECF
chan_end
.layer_luigi_ECF:
layer_delay 0x4e
.layer_luigi_ED1:
layer_loop 50
layer_call .layer_luigi_fn_EE1
layer_loopend
layer_setinstr 21
layer_note1 39, 0x44c, 127
layer_jump .layer_luigi_ED1
layer_end
.layer_luigi_fn_EE1:
layer_setinstr 21
layer_note1 37, 0x53, 127
layer_setinstr 15
layer_note1 37, 0x4e, 64
layer_end
.sound_luigi_so_longa_bowser:
chan_setbank 11
chan_setinstr 22
chan_setlayer 0, .layer_luigi_EF7
chan_setlayer 1, .layer_luigi_EF7
chan_end
.layer_luigi_EF7:
layer_portamento 0x82, 42, 200
layer_note1 39, 0xc8, 110
layer_end
.sound_luigi_ima_tired:
chan_setbank 11
chan_setinstr 23
chan_setlayer 0, .layer_luigi_F08
chan_end
.layer_luigi_F08:
layer_note1 39, 0x96, 110
layer_end
.endif

View File

@ -149,6 +149,8 @@
#define TEXT_OPT_CHEAT8 _("Huge Mario")
#define TEXT_OPT_CHEAT9 _("Tiny Mario")
#define TEXT_OPT_LUIGISND _("Luigi Sounds")
#endif // VERSION
#endif // TEXT_OPTIONS_STRINGS_H

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
{
"comment": "This file lists all sequences together with the sound banks they use. If a sequence uses multiple banks, the first bank will be used by default, and it can switch between them using the chan_setbank command; e.g. chan_setbank 0 will switch to the first bank in the given list.",
"00_sound_player": ["00", "01_terrain", "02_water", "03", "04", "05", "06", "07", "08_mario", "09", "0A_mario_peach"],
"00_sound_player": ["00", "01_terrain", "02_water", "03", "04", "05", "06", "07", "08_mario", "09", "0A_mario_peach", "26_custom_luigi", "27_custom_luigi_peach"],
"01_cutscene_collect_star": ["22"],
"02_menu_title_screen": ["11"],
"03_level_grass": ["22"],

View File

@ -7,7 +7,7 @@ seq_setmutebhv 0x60
seq_setmutescale 0
seq_setvol 127
seq_settempo 120
seq_initchannels 0x3ff
seq_initchannels 0x7ff
seq_startchannel 0, .channel0
seq_startchannel 1, .channel1
seq_startchannel 2, .channel2
@ -18,10 +18,13 @@ seq_startchannel 6, .channel6
seq_startchannel 7, .channel7
seq_startchannel 8, .channel38
seq_startchannel 9, .channel59
seq_startchannel 10, .channel10
.seq_loop:
seq_delay 20000
seq_jump .seq_loop
.include "seq_luigi.inc"
.channel0:
chan_largenoteson
chan_setinstr 0

View File

@ -0,0 +1,189 @@
{
"date": "1996-02-14",
"sample_bank": "sfx_custom_luigi",
"envelopes": {
"envelope0": [
[2, 32700],
[1, 32700],
[32700, 29430],
"hang"
]
},
"instruments": {
"inst0": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "00"
},
"inst1": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "01"
},
"inst2": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "02"
},
"inst3": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "03"
},
"inst4": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "04"
},
"inst5": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "05"
},
"inst6": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "06"
},
"inst7": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "07"
},
"inst8": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "08"
},
"inst9": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "09"
},
"inst10": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "0A"
},
"inst11": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "0B"
},
"inst12": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "0C"
},
"inst13": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "0D"
},
"inst14": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "0E"
},
"inst15": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "0F"
},
"inst16": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "10"
},
"inst17": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "11"
},
"inst18": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "12"
},
"inst19": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "13"
},
"inst20": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "14"
},
"inst21": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "15"
},
"inst22": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "16"
},
"inst23": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "17"
},
"inst24": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "18"
},
"inst25": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "19"
},
"inst26": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "1A"
}
},
"instrument_list": [
"inst0",
"inst1",
"inst2",
"inst3",
"inst4",
"inst5",
"inst6",
"inst7",
"inst8",
"inst9",
"inst10",
"inst11",
"inst12",
"inst13",
"inst14",
"inst15",
"inst16",
"inst17",
"inst18",
"inst19",
"inst20",
"inst21",
"inst22",
"inst23",
"inst24",
"inst25",
"inst26"
]
}

View File

@ -0,0 +1,164 @@
{
"date": "1996-02-14",
"sample_bank": "sfx_custom_luigi_peach",
"envelopes": {
"envelope0": [
[2, 32700],
[1, 32700],
[32700, 29430],
"hang"
]
},
"instruments": {
"inst0": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "00"
},
"inst1": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "01"
},
"inst2": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "02"
},
"inst3": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "03"
},
"inst4": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "04"
},
"inst5": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "05"
},
"inst6": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "06"
},
"inst7": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "07"
},
"inst8": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "08"
},
"inst9": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "09"
},
"inst10": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "0A"
},
"inst11": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "0B"
},
"inst12": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "0C"
},
"inst13": {
"release_rate": 208,
"envelope": "envelope0",
"sound": "0D"
},
"inst14": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "0E"
},
"inst15": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "0F"
},
"inst16": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "10"
},
"inst17": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "11"
},
"inst18": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "12"
},
"inst19": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "13"
},
"inst20": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "14"
},
"inst21": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "15"
},
"inst22": {
"ifdef": ["VERSION_US", "VERSION_EU"],
"release_rate": 208,
"envelope": "envelope0",
"sound": "16"
}
},
"instrument_list": [
"inst0",
"inst1",
"inst2",
null,
"inst3",
"inst4",
"inst5",
"inst6",
"inst7",
"inst8",
"inst9",
"inst10",
"inst11",
"inst12",
"inst13",
"inst14",
"inst15",
"inst16",
"inst17",
"inst18",
"inst19",
"inst20",
"inst21",
"inst22"
]
}

View File

@ -60,24 +60,24 @@ struct AudioSessionSettings gAudioSessionPresets[18] = {
{ 32000, 16, 1, 0x0A00, 0x47FF, 0x7FFF, 0x3F00, 0x6200, 0x4400, 0x2A80 },
{ 32000, 20, 1, 0x0800, 0x37FF, 0x7FFF, 0x3300, 0x5500, 0x4000, 0x1B00 },
#else
{ 32000, 16, 1, 0x0C00, 0x2FFF, 0x7FFF, 0x3A00, 0x6D00, 0x4400, 0x2A00 },
{ 32000, 16, 1, 0x0A00, 0x47FF, 0x7FFF, 0x3A00, 0x6D00, 0x4400, 0x2A00 },
{ 32000, 16, 1, 0x1000, 0x2FFF, 0x7FFF, 0x3A00, 0x6D00, 0x4400, 0x2A00 },
{ 32000, 16, 1, 0x0E00, 0x3FFF, 0x7FFF, 0x3A00, 0x6D00, 0x4400, 0x2A00 },
{ 32000, 16, 1, 0x0C00, 0x4FFF, 0x7FFF, 0x3A00, 0x6D00, 0x4400, 0x2A00 },
{ 32000, 16, 1, 0x0C00, 0x2FFF, 0x7FFF, 0x4000, 0x6E00, 0x3F00, 0x2A00 },
{ 32000, 16, 1, 0x0A00, 0x47FF, 0x7FFF, 0x4100, 0x6E00, 0x4400, 0x2A80 },
{ 32000, 20, 1, 0x0800, 0x37FF, 0x7FFF, 0x34C0, 0x6280, 0x4000, 0x1B00 },
{ 32000, 16, 1, 0x0C00, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 32000, 16, 1, 0x0A00, 0x47FF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 32000, 16, 1, 0x1000, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 32000, 16, 1, 0x0E00, 0x3FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 32000, 16, 1, 0x0C00, 0x4FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 32000, 16, 1, 0x0C00, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 32000, 16, 1, 0x0A00, 0x47FF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 32000, 20, 1, 0x0800, 0x37FF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
#endif
{ 27000, 16, 1, 0x0800, 0x2FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
{ 27000, 16, 1, 0x0800, 0x3FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
{ 27000, 16, 1, 0x1000, 0x2FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
{ 27000, 16, 1, 0x1000, 0x3FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
{ 27000, 16, 1, 0x0C00, 0x4FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
{ 32000, 14, 1, 0x0800, 0x2FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
{ 32000, 12, 1, 0x0800, 0x2FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
{ 32000, 10, 1, 0x0800, 0x2FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
{ 32000, 8, 1, 0x0800, 0x2FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
{ 27000, 16, 1, 0x0800, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 27000, 16, 1, 0x0800, 0x3FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 27000, 16, 1, 0x1000, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 27000, 16, 1, 0x1000, 0x3FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 27000, 16, 1, 0x0C00, 0x4FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 32000, 14, 1, 0x0800, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 32000, 12, 1, 0x0800, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 32000, 10, 1, 0x0800, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 32000, 8, 1, 0x0800, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
#endif
@ -377,15 +377,15 @@ s16 *gWaveSamples[4] = { sSawtoothWave, sTriangleWave, sSineWave, sSquareWave };
#ifdef VERSION_EU
u8 euUnknownData_8030194c[4] = { 0x40, 0x20, 0x10, 0x08 };
u16 gHeadsetPanQuantization[0x10] = {
0x40, 0x40, 0x30, 0x30, 0x20, 0x20, 0x10, 0, 0, 0,
u16 gHeadsetPanQuantization[0x11] = {
0x40, 0x40, 0x30, 0x30, 0x20, 0x20, 0x10, 0, 0, 0, 0x30,
};
s32 euUnknownData_80301950[32] = { //maybe envelope of some kind?
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 500, 0, 0, 0, 500, 0, 0, 0, 500, 0, 0, 0, 500, 0, 0,
};
#else
u16 gHeadsetPanQuantization[10] = { 0x40, 0x30, 0x20, 0x10, 0, 0, 0, 0, 0, 0 };
u16 gHeadsetPanQuantization[11] = { 0x40, 0x30, 0x20, 0x10, 0, 0, 0, 0, 0, 0, 0x20 };
#endif
// Linearly interpolated between

View File

@ -41,12 +41,12 @@ extern s16 *gWaveSamples[4];
#ifdef VERSION_EU
extern u8 euUnknownData_8030194c[4];
extern u16 gHeadsetPanQuantization[0x10];
extern u16 gHeadsetPanQuantization[0x11];
extern s32 euUnknownData_80301950[32];
extern struct NoteSubEu gZeroNoteSub;
extern struct NoteSubEu gDefaultNoteSub;
#else
extern u16 gHeadsetPanQuantization[10];
extern u16 gHeadsetPanQuantization[11];
#endif
extern f32 gHeadsetPanVolume[128];
extern f32 gStereoPanVolume[128];

View File

@ -153,7 +153,7 @@ u8 audioString118__[] = "";
// N.B. sound banks are different from the audio banks referred to in other
// files. We should really fix our naming to be less ambiguous...
#define MAX_BG_MUSIC_QUEUE_SIZE 6
#define SOUND_BANK_COUNT 10
#define SOUND_BANK_COUNT 11
#define MAX_CHANNELS_PER_SOUND 1
#define SEQUENCE_NONE 0xFF
@ -448,10 +448,10 @@ STATIC_ASSERT(ARRAY_COUNT(sBackgroundMusicDefaultVolume) == SEQ_COUNT,
u8 sPlayer0CurSeqId = SEQUENCE_NONE;
u8 sMusicDynamicDelay = 0;
u8 D_803320A4[SOUND_BANK_COUNT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // pointers to head of list
u8 D_803320B0[SOUND_BANK_COUNT] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; // pointers to head of list
u8 D_803320BC[SOUND_BANK_COUNT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // only used for debugging
u8 sMaxChannelsForSoundBank[SOUND_BANK_COUNT] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
u8 D_803320A4[SOUND_BANK_COUNT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // pointers to head of list
u8 D_803320B0[SOUND_BANK_COUNT] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; // pointers to head of list
u8 D_803320BC[SOUND_BANK_COUNT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // only used for debugging
u8 sMaxChannelsForSoundBank[SOUND_BANK_COUNT] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
// Banks 2 and 7 both grew from 0x30 sounds to 0x40 in size in US.
#ifdef VERSION_JP
@ -460,7 +460,7 @@ u8 sMaxChannelsForSoundBank[SOUND_BANK_COUNT] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }
#define BANK27_SIZE 0x40
#endif
u8 sNumSoundsPerBank[SOUND_BANK_COUNT] = {
0x70, 0x30, BANK27_SIZE, 0x80, 0x20, 0x80, 0x20, BANK27_SIZE, 0x80, 0x80,
0x70, 0x30, BANK27_SIZE, 0x80, 0x20, 0x80, 0x20, BANK27_SIZE, 0x80, 0x80, BANK27_SIZE
};
#undef BANK27_SIZE
@ -1296,6 +1296,7 @@ void update_game_sound(void) {
break;
case 0:
case 2:
case 10: // custom luigi audio bank 10
#ifdef VERSION_EU
func_802ad770(0x05020000 | ((channelIndex & 0xff) << 8),
get_sound_reverb(bankIndex, index, channelIndex));

View File

@ -19,8 +19,8 @@
#endif
#endif
#define LAYERS_MAX 4
#define CHANNELS_MAX 16
#define LAYERS_MAX 8
#define CHANNELS_MAX 32
#define NO_LAYER ((struct SequenceChannelLayer *)(-1))

View File

@ -5,7 +5,7 @@
#include "internal.h"
#define AUDIO_FRAME_DMA_QUEUE_SIZE 0x40
#define AUDIO_FRAME_DMA_QUEUE_SIZE 0x80
#define PRELOAD_BANKS 2
#define PRELOAD_SEQUENCE 1

View File

@ -25,6 +25,7 @@
#include "sound_init.h"
#include "thread6.h"
#include "pc/configfile.h"
#include "pc/network/network.h"
#define INT_GROUND_POUND_OR_TWIRL (1 << 0) // 0x01
@ -796,7 +797,8 @@ u32 take_damage_and_knock_back(struct MarioState *m, struct Object *o) {
}
if (o->oDamageOrCoinValue > 0) {
play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_ATTACKED : SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
}
update_mario_sound_and_camera(m);
@ -1382,7 +1384,8 @@ u32 interact_tornado(struct MarioState *m, UNUSED u32 interactType, struct Objec
marioObj->oMarioTornadoYawVel = 0x400;
marioObj->oMarioTornadoPosY = m->pos[1] - o->oPosY;
play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_WAAAOOOW : SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
queue_rumble_data_mario(m, 30, 60);
return set_mario_action(m, ACT_TORNADO_TWIRLING, m->action == ACT_TWIRLING);
@ -1404,7 +1407,8 @@ u32 interact_whirlpool(struct MarioState *m, UNUSED u32 interactType, struct Obj
marioObj->oMarioWhirlpoolPosY = m->pos[1] - o->oPosY;
play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_WAAAOOOW : SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
queue_rumble_data_mario(m, 30, 60);
return set_mario_action(m, ACT_CAUGHT_IN_WHIRLPOOL, 0);
@ -1427,7 +1431,8 @@ u32 interact_strong_wind(struct MarioState *m, UNUSED u32 interactType, struct O
m->forwardVel = -24.0f;
m->vel[1] = 12.0f;
play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_WAAAOOOW : SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
update_mario_sound_and_camera(m);
return set_mario_action(m, ACT_GETTING_BLOWN, 0);
}
@ -1451,7 +1456,8 @@ u32 interact_flame(struct MarioState *m, UNUSED u32 interactType, struct Object
} else {
m->marioObj->oMarioBurnTimer = 0;
update_mario_sound_and_camera(m);
play_sound(SOUND_MARIO_ON_FIRE, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_ON_FIRE : SOUND_MARIO_ON_FIRE, m->marioObj->header.gfx.cameraToObject);
if ((m->action & ACT_FLAG_AIR) && m->vel[1] <= 0.0f) {
burningAction = ACT_BURNING_FALL;
@ -1474,7 +1480,8 @@ u32 interact_snufit_bullet(struct MarioState *m, UNUSED u32 interactType, struct
m->interactObj = o;
take_damage_from_interact_object(m);
play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_ATTACKED : SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
update_mario_sound_and_camera(m);
return drop_and_set_mario_action(m, determine_knockback_action(m, o->oDamageOrCoinValue),
@ -1535,7 +1542,8 @@ u32 interact_bully(struct MarioState *m, UNUSED u32 interactType, struct Object
m->invincTimer = 2;
update_mario_sound_and_camera(m);
play_sound(SOUND_MARIO_EEUH, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_EEUH : SOUND_MARIO_EEUH, m->marioObj->header.gfx.cameraToObject);
play_sound(SOUND_OBJ_BULLY_METAL, m->marioObj->header.gfx.cameraToObject);
push_mario_out_of_object(m, o, 5.0f);
@ -1557,7 +1565,8 @@ u32 interact_shock(struct MarioState *m, UNUSED u32 interactType, struct Object
m->interactObj = o;
take_damage_from_interact_object(m);
play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_ATTACKED : SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
queue_rumble_data_mario(m, 70, 60);
if (m->action & (ACT_FLAG_SWIMMING | ACT_FLAG_METAL_WATER)) {
@ -1617,7 +1626,8 @@ u32 interact_hit_from_below(struct MarioState *m, UNUSED u32 interactType, struc
bounce_off_object(m, o, 80.0f);
reset_mario_pitch(m);
#ifndef VERSION_JP
play_sound(SOUND_MARIO_TWIRL_BOUNCE, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_TWIRL_BOUNCE : SOUND_MARIO_TWIRL_BOUNCE, m->marioObj->header.gfx.cameraToObject);
#endif
return drop_and_set_mario_action(m, ACT_TWIRLING, 0);
} else {
@ -1652,7 +1662,8 @@ u32 interact_bounce_top(struct MarioState *m, UNUSED u32 interactType, struct Ob
bounce_off_object(m, o, 80.0f);
reset_mario_pitch(m);
#ifndef VERSION_JP
play_sound(SOUND_MARIO_TWIRL_BOUNCE, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_TWIRL_BOUNCE : SOUND_MARIO_TWIRL_BOUNCE, m->marioObj->header.gfx.cameraToObject);
#endif
return drop_and_set_mario_action(m, ACT_TWIRLING, 0);
} else {
@ -1770,7 +1781,8 @@ u32 check_object_grab_mario(struct MarioState *m, UNUSED u32 interactType, struc
m->usedObj = o;
update_mario_sound_and_camera(m);
play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_OOOF : SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
queue_rumble_data_mario(m, 5, 80);
return set_mario_action(m, ACT_GRABBED, 0);
}
@ -1900,7 +1912,8 @@ u32 interact_cap(struct MarioState *m, UNUSED u32 interactType, struct Object *o
}
play_sound(SOUND_MENU_STAR_SOUND, m->marioObj->header.gfx.cameraToObject);
play_sound(SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_HERE_WE_GO : SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
if (capMusic != 0) {
play_cap_music(capMusic);
@ -2116,7 +2129,8 @@ void check_death_barrier(struct MarioState *m) {
return;
}
if (level_trigger_warp(m, WARP_OP_WARP_FLOOR) == 20 && !(m->flags & MARIO_UNKNOWN_18)) {
play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_WAAAOOOW : SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
}
}
}

View File

@ -264,13 +264,14 @@ void play_sound_if_no_flag(struct MarioState *m, u32 soundBits, u32 flags) {
*/
void play_mario_jump_sound(struct MarioState *m) {
if (!(m->flags & MARIO_MARIO_SOUND_PLAYED)) {
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
#ifndef VERSION_JP
if (m->action == ACT_TRIPLE_JUMP) {
play_sound(SOUND_MARIO_YAHOO_WAHA_YIPPEE + ((gAudioRandom % 5) << 16),
play_sound(((configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAHOO_WAHA_YIPPEE : SOUND_MARIO_YAHOO_WAHA_YIPPEE) + ((gAudioRandom % 5) << 16),
m->marioObj->header.gfx.cameraToObject);
} else {
#endif
play_sound(SOUND_MARIO_YAH_WAH_HOO + ((gAudioRandom % 3) << 16),
play_sound(((configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAH_WAH_HOO : SOUND_MARIO_YAH_WAH_HOO) + ((gAudioRandom % 3) << 16),
m->marioObj->header.gfx.cameraToObject);
#ifndef VERSION_JP
}
@ -307,7 +308,7 @@ void play_sound_and_spawn_particles(struct MarioState *m, u32 soundBits, u32 wav
}
if ((m->flags & MARIO_METAL_CAP) || soundBits == SOUND_ACTION_UNSTUCK_FROM_GROUND
|| soundBits == SOUND_MARIO_PUNCH_HOO) {
|| soundBits == SOUND_MARIO_PUNCH_HOO || soundBits == SOUND_LUIGI_PUNCH_HOO) {
play_sound(soundBits, m->marioObj->header.gfx.cameraToObject);
} else {
play_sound(m->terrainSoundAddend + soundBits, m->marioObj->header.gfx.cameraToObject);
@ -1909,10 +1910,11 @@ s32 execute_mario_action(UNUSED struct Object *o) {
// HACK: mute snoring even when we skip the waking up action
if (gMarioState->isSnoring && gMarioState->action != ACT_SLEEPING) {
func_803205E8(SOUND_MARIO_SNORING1, gMarioState->marioObj->header.gfx.cameraToObject);
func_803205E8(SOUND_MARIO_SNORING2, gMarioState->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (gMarioState->playerIndex != 0) : (gMarioState->playerIndex == 0);
func_803205E8((configLuigiSounds && isLuigi) ? SOUND_LUIGI_SNORING1 : SOUND_MARIO_SNORING1, gMarioState->marioObj->header.gfx.cameraToObject);
func_803205E8((configLuigiSounds && isLuigi) ? SOUND_LUIGI_SNORING2 : SOUND_MARIO_SNORING2, gMarioState->marioObj->header.gfx.cameraToObject);
#ifndef VERSION_JP
func_803205E8(SOUND_MARIO_SNORING3, gMarioState->marioObj->header.gfx.cameraToObject);
func_803205E8((configLuigiSounds && isLuigi) ? SOUND_LUIGI_SNORING3 : SOUND_MARIO_SNORING3, gMarioState->marioObj->header.gfx.cameraToObject);
#endif
gMarioState->isSnoring = FALSE;
}

View File

@ -19,6 +19,8 @@
#endif
#include "behavior_table.h"
#include "object_helpers.h"
#include "pc/configfile.h"
#include "pc/network/network.h"
void play_flip_sounds(struct MarioState *m, s16 frame1, s16 frame2, s16 frame3) {
s32 animFrame = m->marioObj->header.gfx.unk38.animFrame;
@ -32,7 +34,8 @@ void play_far_fall_sound(struct MarioState *m) {
if (!(action & ACT_FLAG_INVULNERABLE) && action != ACT_TWIRLING && action != ACT_FLYING
&& !(m->flags & MARIO_UNKNOWN_18)) {
if (m->peakHeight - m->pos[1] > 1150.0f) {
play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_WAAAOOOW : SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
m->flags |= MARIO_UNKNOWN_18;
}
}
@ -40,10 +43,11 @@ void play_far_fall_sound(struct MarioState *m) {
#ifndef VERSION_JP
void play_knockback_sound(struct MarioState *m) {
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
if (m->actionArg == 0 && (m->forwardVel <= -28.0f || m->forwardVel >= 28.0f)) {
play_sound_if_no_flag(m, SOUND_MARIO_DOH, MARIO_MARIO_SOUND_PLAYED);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_DOH : SOUND_MARIO_DOH, MARIO_MARIO_SOUND_PLAYED);
} else {
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_UH : SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
}
}
#endif
@ -59,7 +63,8 @@ s32 lava_boost_on_wall(struct MarioState *m) {
m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 12 : 18;
}
play_sound(SOUND_MARIO_ON_FIRE, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_ON_FIRE : SOUND_MARIO_ON_FIRE, m->marioObj->header.gfx.cameraToObject);
update_mario_sound_and_camera(m);
return drop_and_set_mario_action(m, ACT_LAVA_BOOST, 1);
}
@ -88,7 +93,8 @@ s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) {
m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 16 : 24;
queue_rumble_data_mario(m, 5, 80);
if (m->playerIndex == 0) { set_camera_shake_from_hit(SHAKE_FALL_DAMAGE); }
play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_ATTACKED : SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
return drop_and_set_mario_action(m, hardFallAction, 4);
} else if (fallHeight > damageHeight && !mario_floor_is_slippery(m)) {
m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 8 : 12;
@ -96,7 +102,8 @@ s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) {
queue_rumble_data_mario(m, 5, 80);
if (m->playerIndex == 0) { set_camera_shake_from_hit(SHAKE_FALL_DAMAGE); }
play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_ATTACKED : SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
}
}
}
@ -129,10 +136,11 @@ s32 should_get_stuck_in_ground(struct MarioState *m) {
s32 check_fall_damage_or_get_stuck(struct MarioState *m, u32 hardFallAction) {
if (should_get_stuck_in_ground(m)) {
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
#ifdef VERSION_JP
play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_OOOF : SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
#else
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_OOOF2 : SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
#endif
m->particleFlags |= PARTICLE_MIST_CIRCLE;
drop_and_set_mario_action(m, ACT_FEET_STUCK_IN_GROUND, 0);
@ -471,7 +479,8 @@ s32 act_double_jump(struct MarioState *m) {
return set_mario_action(m, ACT_GROUND_POUND, 0);
}
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_HOOHOO);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_HOOHOO : SOUND_MARIO_HOOHOO);
common_air_action_step(m, ACT_DOUBLE_JUMP_LAND, animation,
AIR_STEP_CHECK_LEDGE_GRAB | AIR_STEP_CHECK_HANG);
return FALSE;
@ -493,7 +502,8 @@ s32 act_triple_jump(struct MarioState *m) {
#ifndef VERSION_JP
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, 0);
#else
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_YAHOO);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAHOO : SOUND_MARIO_YAHOO);
#endif
common_air_action_step(m, ACT_TRIPLE_JUMP_LAND, MARIO_ANIM_TRIPLE_JUMP, 0);
@ -509,7 +519,8 @@ s32 act_backflip(struct MarioState *m) {
return set_mario_action(m, ACT_GROUND_POUND, 0);
}
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_YAH_WAH_HOO);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAH_WAH_HOO : SOUND_MARIO_YAH_WAH_HOO);
common_air_action_step(m, ACT_BACKFLIP_LAND, MARIO_ANIM_BACKFLIP, 0);
if (m->action == ACT_BACKFLIP_LAND) {
@ -634,10 +645,11 @@ s32 act_long_jump(struct MarioState *m) {
animation = MARIO_ANIM_SLOW_LONGJUMP;
}
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_YAHOO);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAHOO : SOUND_MARIO_YAHOO);
if (m->floor->type == SURFACE_VERTICAL_WIND && m->actionState == 0) {
play_sound(SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_HERE_WE_GO : SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
m->actionState = 1;
}
@ -716,8 +728,9 @@ s32 act_twirling(struct MarioState *m) {
}
s32 act_dive(struct MarioState *m) {
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
if (m->actionArg == 0) {
play_mario_sound(m, SOUND_ACTION_THROW, SOUND_MARIO_HOOHOO);
play_mario_sound(m, SOUND_ACTION_THROW, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_HOOHOO : SOUND_MARIO_HOOHOO);
} else {
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, 0);
}
@ -750,9 +763,9 @@ s32 act_dive(struct MarioState *m) {
if (should_get_stuck_in_ground(m) && m->faceAngle[0] == -0x2AAA) {
queue_rumble_data_mario(m, 5, 80);
#ifdef VERSION_JP
play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_OOOF : SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
#else
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_OOOF2 : SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
#endif
m->particleFlags |= PARTICLE_MIST_CIRCLE;
drop_and_set_mario_action(m, ACT_HEAD_STUCK_IN_GROUND, 0);
@ -791,7 +804,8 @@ s32 act_air_throw(struct MarioState *m) {
mario_throw_held_object(m);
}
play_sound_if_no_flag(m, SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_WAH2 : SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED);
set_mario_animation(m, MARIO_ANIM_THROW_LIGHT_OBJECT);
update_air_without_turn(m);
@ -935,7 +949,8 @@ s32 act_ground_pound(struct MarioState *m) {
m->actionTimer++;
if (m->actionTimer >= m->marioObj->header.gfx.unk38.curAnim->unk08 + 4) {
play_sound(SOUND_MARIO_GROUND_POUND_WAH, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_GROUND_POUND_WAH : SOUND_MARIO_GROUND_POUND_WAH, m->marioObj->header.gfx.cameraToObject);
m->actionState = 1;
}
} else {
@ -945,10 +960,11 @@ s32 act_ground_pound(struct MarioState *m) {
if (stepResult == AIR_STEP_LANDED) {
if (should_get_stuck_in_ground(m)) {
queue_rumble_data_mario(m, 5, 80);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
#ifdef VERSION_JP
play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_OOOF : SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
#else
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_OOOF2 : SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
#endif
m->particleFlags |= PARTICLE_MIST_CIRCLE;
set_mario_action(m, ACT_BUTT_STUCK_IN_GROUND, 0);
@ -1160,7 +1176,8 @@ s32 act_backward_air_kb(struct MarioState *m) {
#ifndef VERSION_JP
play_knockback_sound(m);
#else
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_UH : SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
#endif
common_air_knockback_step(m, ACT_BACKWARD_GROUND_KB, ACT_HARD_BACKWARD_GROUND_KB, 0x0002, -16.0f);
return FALSE;
@ -1174,7 +1191,8 @@ s32 act_forward_air_kb(struct MarioState *m) {
#ifndef VERSION_JP
play_knockback_sound(m);
#else
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_UH : SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
#endif
common_air_knockback_step(m, ACT_FORWARD_GROUND_KB, ACT_HARD_FORWARD_GROUND_KB, 0x002D, 16.0f);
return FALSE;
@ -1184,7 +1202,8 @@ s32 act_hard_backward_air_kb(struct MarioState *m) {
#ifndef VERSION_JP
play_knockback_sound(m);
#else
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_UH : SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
#endif
common_air_knockback_step(m, ACT_HARD_BACKWARD_GROUND_KB, ACT_HARD_BACKWARD_GROUND_KB, 0x0002,
-16.0f);
@ -1195,7 +1214,8 @@ s32 act_hard_forward_air_kb(struct MarioState *m) {
#ifndef VERSION_JP
play_knockback_sound(m);
#else
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_UH : SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
#endif
common_air_knockback_step(m, ACT_HARD_FORWARD_GROUND_KB, ACT_HARD_FORWARD_GROUND_KB, 0x002D, 16.0f);
return FALSE;
@ -1209,7 +1229,8 @@ s32 act_thrown_backward(struct MarioState *m) {
landAction = ACT_BACKWARD_GROUND_KB;
}
play_sound_if_no_flag(m, SOUND_MARIO_WAAAOOOW, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_WAAAOOOW : SOUND_MARIO_WAAAOOOW, MARIO_MARIO_SOUND_PLAYED);
common_air_knockback_step(m, landAction, ACT_HARD_BACKWARD_GROUND_KB, 0x0002, m->forwardVel);
@ -1227,7 +1248,8 @@ s32 act_thrown_forward(struct MarioState *m) {
landAction = ACT_FORWARD_GROUND_KB;
}
play_sound_if_no_flag(m, SOUND_MARIO_WAAAOOOW, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_WAAAOOOW : SOUND_MARIO_WAAAOOOW, MARIO_MARIO_SOUND_PLAYED);
if (common_air_knockback_step(m, landAction, ACT_HARD_FORWARD_GROUND_KB, 0x002D, m->forwardVel)
== AIR_STEP_NONE) {
@ -1251,7 +1273,8 @@ s32 act_soft_bonk(struct MarioState *m) {
#ifndef VERSION_JP
play_knockback_sound(m);
#else
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_UH : SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
#endif
common_air_knockback_step(m, ACT_FREEFALL_LAND, ACT_HARD_BACKWARD_GROUND_KB, 0x0056, m->forwardVel);
@ -1281,7 +1304,8 @@ s32 act_getting_blown(struct MarioState *m) {
mario_set_forward_vel(m, m->forwardVel);
#ifdef VERSION_JP
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_UH : SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
#endif
set_mario_animation(m, MARIO_ANIM_BACKWARD_AIR_KB);
@ -1509,11 +1533,12 @@ s32 act_hold_butt_slide_air(struct MarioState *m) {
}
s32 act_lava_boost(struct MarioState *m) {
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
if (!(m->flags & MARIO_MARIO_SOUND_PLAYED)) {
play_sound_if_no_flag(m, SOUND_MARIO_ON_FIRE, MARIO_MARIO_SOUND_PLAYED);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_ON_FIRE : SOUND_MARIO_ON_FIRE, MARIO_MARIO_SOUND_PLAYED);
queue_rumble_data_mario(m, 5, 80);
}
play_sound_if_no_flag(m, SOUND_MARIO_ON_FIRE, MARIO_MARIO_SOUND_PLAYED);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_ON_FIRE : SOUND_MARIO_ON_FIRE, MARIO_MARIO_SOUND_PLAYED);
if (!(m->input & INPUT_NONZERO_ANALOG)) {
m->forwardVel = approach_f32(m->forwardVel, 0.0f, 0.35f, 0.35f);
@ -1529,7 +1554,7 @@ s32 act_lava_boost(struct MarioState *m) {
m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 12 : 18;
}
m->vel[1] = 84.0f;
play_sound(SOUND_MARIO_ON_FIRE, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_ON_FIRE : SOUND_MARIO_ON_FIRE, m->marioObj->header.gfx.cameraToObject);
queue_rumble_data_mario(m, 5, 80);
} else {
play_mario_heavy_landing_sound(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND);
@ -1579,7 +1604,8 @@ s32 act_lava_boost(struct MarioState *m) {
s32 act_slide_kick(struct MarioState *m) {
if (m->actionTimer == 0) {
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_HOOHOO);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_HOOHOO : SOUND_MARIO_HOOHOO);
set_mario_animation(m, MARIO_ANIM_SLIDE_KICK);
}
@ -1632,7 +1658,8 @@ s32 act_jump_kick(struct MarioState *m) {
s32 animFrame;
if (m->actionState == 0) {
play_sound_if_no_flag(m, SOUND_MARIO_PUNCH_HOO, MARIO_ACTION_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_PUNCH_HOO : SOUND_MARIO_PUNCH_HOO, MARIO_ACTION_SOUND_PLAYED);
m->marioObj->header.gfx.unk38.animID = -1;
set_mario_animation(m, MARIO_ANIM_AIR_KICK);
m->actionState = 1;
@ -1673,7 +1700,8 @@ s32 act_shot_from_cannon(struct MarioState *m) {
mario_set_forward_vel(m, m->forwardVel);
play_sound_if_no_flag(m, SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAHOO : SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED);
switch (perform_air_step(m, 0)) {
case AIR_STEP_NONE:
@ -1920,7 +1948,8 @@ s32 act_flying(struct MarioState *m) {
if (startPitch <= 0 && m->faceAngle[0] > 0 && m->forwardVel >= 48.0f) {
play_sound(SOUND_ACTION_FLYING_FAST, m->marioObj->header.gfx.cameraToObject);
#ifndef VERSION_JP
play_sound(SOUND_MARIO_YAHOO_WAHA_YIPPEE + ((gAudioRandom % 5) << 16),
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound(((configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAHOO_WAHA_YIPPEE : SOUND_MARIO_YAHOO_WAHA_YIPPEE) + ((gAudioRandom % 5) << 16),
m->marioObj->header.gfx.cameraToObject);
#endif
queue_rumble_data_mario(m, 50, 40);
@ -1944,7 +1973,8 @@ s32 act_riding_hoot(struct MarioState *m) {
m->usedObj->oInteractStatus = 0;
m->usedObj->oHootMarioReleaseTime = gGlobalTimer;
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_UH : SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
queue_rumble_data_mario(m, 4, 40);
return set_mario_action(m, ACT_FREEFALL, 0);
}
@ -2001,7 +2031,8 @@ s32 act_flying_triple_jump(struct MarioState *m) {
}
#endif
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_YAHOO);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAHOO : SOUND_MARIO_YAHOO);
if (m->actionState == 0) {
set_mario_animation(m, MARIO_ANIM_TRIPLE_JUMP_FLY);
@ -2079,7 +2110,8 @@ s32 act_vertical_wind(struct MarioState *m) {
s16 intendedDYaw = m->intendedYaw - m->faceAngle[1];
f32 intendedMag = m->intendedMag / 32.0f;
play_sound_if_no_flag(m, SOUND_MARIO_HERE_WE_GO, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_HERE_WE_GO : SOUND_MARIO_HERE_WE_GO, MARIO_MARIO_SOUND_PLAYED);
if (m->actionState == 0) {
set_mario_animation(m, MARIO_ANIM_FORWARD_SPINNING_FLIP);
if (m->marioObj->header.gfx.unk38.animFrame == 1) {
@ -2120,7 +2152,8 @@ s32 act_special_triple_jump(struct MarioState *m) {
return set_mario_action(m, ACT_GROUND_POUND, 0);
}
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_YAHOO);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAHOO : SOUND_MARIO_YAHOO);
update_air_without_turn(m);

View File

@ -20,6 +20,8 @@
#include "obj_behaviors.h"
#include "level_update.h"
#include "mario_step.h"
#include "pc/configfile.h"
#include "pc/network/network.h"
#define POLE_NONE 0
#define POLE_TOUCHED_FLOOR 1
@ -234,7 +236,8 @@ s32 act_climbing_pole(struct MarioState *m) {
s32 act_grab_pole_slow(struct MarioState *m) {
if (m->usedObj == NULL) { m->usedObj = cur_obj_find_nearest_pole(); }
play_sound_if_no_flag(m, SOUND_MARIO_WHOA, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_WHOA : SOUND_MARIO_WHOA, MARIO_MARIO_SOUND_PLAYED);
if (set_pole_position(m, 0.0f) == POLE_NONE) {
set_mario_animation(m, MARIO_ANIM_GRAB_POLE_SHORT);
@ -251,7 +254,8 @@ s32 act_grab_pole_fast(struct MarioState *m) {
struct Object *marioObj = m->marioObj;
if (m->usedObj == NULL) { m->usedObj = cur_obj_find_nearest_pole(); }
play_sound_if_no_flag(m, SOUND_MARIO_WHOA, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_WHOA : SOUND_MARIO_WHOA, MARIO_MARIO_SOUND_PLAYED);
m->faceAngle[1] += marioObj->oMarioPoleYawVel;
marioObj->oMarioPoleYawVel = marioObj->oMarioPoleYawVel * 8 / 10;
@ -597,7 +601,8 @@ s32 act_ledge_grab(struct MarioState *m) {
}
if (m->actionArg == 0) {
play_sound_if_no_flag(m, SOUND_MARIO_WHOA, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_WHOA : SOUND_MARIO_WHOA, MARIO_MARIO_SOUND_PLAYED);
}
stop_and_set_height_to_floor(m);
@ -619,7 +624,8 @@ s32 act_ledge_climb_slow(struct MarioState *m) {
}
if (m->actionTimer == 10) {
play_sound_if_no_flag(m, SOUND_MARIO_EEUH, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_EEUH : SOUND_MARIO_EEUH, MARIO_MARIO_SOUND_PLAYED);
}
update_ledge_climb(m, MARIO_ANIM_SLOW_LEDGE_GRAB, ACT_IDLE);
@ -637,7 +643,8 @@ s32 act_ledge_climb_down(struct MarioState *m) {
return let_go_of_ledge(m);
}
play_sound_if_no_flag(m, SOUND_MARIO_WHOA, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_WHOA : SOUND_MARIO_WHOA, MARIO_MARIO_SOUND_PLAYED);
update_ledge_climb(m, MARIO_ANIM_CLIMB_DOWN_LEDGE, ACT_LEDGE_GRAB);
m->actionArg = 1;
@ -650,7 +657,8 @@ s32 act_ledge_climb_fast(struct MarioState *m) {
return let_go_of_ledge(m);
}
play_sound_if_no_flag(m, SOUND_MARIO_UH2, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_UH2 : SOUND_MARIO_UH2, MARIO_MARIO_SOUND_PLAYED);
update_ledge_climb(m, MARIO_ANIM_FAST_LEDGE_GRAB, ACT_IDLE);

View File

@ -31,6 +31,7 @@
#include "obj_behaviors.h"
#include "../../include/libc/stdlib.h"
#include "pc/pc_main.h"
#include "pc/configfile.h"
#include "pc/network/network.h"
// TODO: put this elsewhere
@ -648,6 +649,7 @@ s32 act_debug_free_move(struct MarioState *m) {
void general_star_dance_handler(struct MarioState *m, s32 isInWater) {
s32 dialogID;
if (m->actionState == 0) {
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
switch (++m->actionTimer) {
case 1:
for (int i = 0; i < MAX_PLAYERS; i++) {
@ -674,7 +676,7 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) {
break;
case 42:
play_sound(SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_HERE_WE_GO : SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
break;
case 80:
@ -769,7 +771,8 @@ s32 act_standing_death(struct MarioState *m) {
return set_mario_action(m, ACT_SUFFOCATION, 0);
}
play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_DYING : SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
common_death_handler(m, MARIO_ANIM_DYING_FALL_OVER, 80);
if (m->marioObj->header.gfx.unk38.animFrame == 77) {
play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND);
@ -778,19 +781,22 @@ s32 act_standing_death(struct MarioState *m) {
}
s32 act_electrocution(struct MarioState *m) {
play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_DYING : SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
common_death_handler(m, MARIO_ANIM_ELECTROCUTION, 43);
return FALSE;
}
s32 act_suffocation(struct MarioState *m) {
play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_DYING : SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
common_death_handler(m, MARIO_ANIM_SUFFOCATING, 86);
return FALSE;
}
s32 act_death_on_back(struct MarioState *m) {
play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_DYING : SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
if (common_death_handler(m, MARIO_ANIM_DYING_ON_BACK, 54) == 40) {
play_mario_heavy_landing_sound(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND);
}
@ -798,7 +804,8 @@ s32 act_death_on_back(struct MarioState *m) {
}
s32 act_death_on_stomach(struct MarioState *m) {
play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_DYING : SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
if (common_death_handler(m, MARIO_ANIM_DYING_ON_STOMACH, 37) == 37) {
play_mario_heavy_landing_sound(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND);
}
@ -813,7 +820,8 @@ s32 act_quicksand_death(struct MarioState *m) {
}
if (m->actionState == 1) {
if (m->quicksandDepth >= 100.0f) {
play_sound_if_no_flag(m, SOUND_MARIO_WAAAOOOW, MARIO_ACTION_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_WAAAOOOW : SOUND_MARIO_WAAAOOOW, MARIO_ACTION_SOUND_PLAYED);
}
if ((m->quicksandDepth += 5.0f) >= 180.0f) {
//level_trigger_warp(m, WARP_OP_DEATH);
@ -827,7 +835,8 @@ s32 act_quicksand_death(struct MarioState *m) {
}
s32 act_eaten_by_bubba(struct MarioState *m) {
play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_DYING : SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
set_mario_animation(m, MARIO_ANIM_A_POSE);
//m->marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE;
if (m != &gMarioStates[0]) {
@ -1092,7 +1101,8 @@ s32 act_emerge_from_pipe(struct MarioState *m) {
marioObj->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE;
play_sound_if_no_flag(m, SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAHOO : SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED);
if (gCurrLevelNum == LEVEL_THI) {
if (gCurrAreaIndex == 2) {
@ -1274,10 +1284,11 @@ s32 act_exit_land_save_dialog(struct MarioState *m) {
s32 act_death_exit(struct MarioState *m) {
if (15 < m->actionTimer++
&& launch_mario_until_land(m, ACT_DEATH_EXIT_LAND, MARIO_ANIM_GENERAL_FALL, -32.0f)) {
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
#ifdef VERSION_JP
play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_OOOF : SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
#else
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_OOOF2 : SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
#endif
queue_rumble_data_mario(m, 5, 80);
//m->numLives--;
@ -1291,10 +1302,11 @@ s32 act_death_exit(struct MarioState *m) {
s32 act_unused_death_exit(struct MarioState *m) {
if (launch_mario_until_land(m, ACT_FREEFALL_LAND_STOP, MARIO_ANIM_GENERAL_FALL, 0.0f)) {
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
#ifdef VERSION_JP
play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_OOOF : SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
#else
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_OOOF2 : SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
#endif
//m->numLives--;
// restore 7.75 units of health
@ -1307,10 +1319,11 @@ s32 act_unused_death_exit(struct MarioState *m) {
s32 act_falling_death_exit(struct MarioState *m) {
if (launch_mario_until_land(m, ACT_DEATH_EXIT_LAND, MARIO_ANIM_GENERAL_FALL, 0.0f)) {
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
#ifdef VERSION_JP
play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_OOOF : SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
#else
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_OOOF2 : SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
#endif
queue_rumble_data_mario(m, 5, 80);
//m->numLives--;
@ -1326,7 +1339,8 @@ s32 act_falling_death_exit(struct MarioState *m) {
s32 act_special_exit_airborne(struct MarioState *m) {
struct Object *marioObj = m->marioObj;
play_sound_if_no_flag(m, SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAHOO : SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED);
if (m->actionTimer++ < 11) {
marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE;
@ -1574,7 +1588,8 @@ s32 act_teleport_fade_in(struct MarioState *m) {
}
s32 act_shocked(struct MarioState *m) {
play_sound_if_no_flag(m, SOUND_MARIO_WAAAOOOW, MARIO_ACTION_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_WAAAOOOW : SOUND_MARIO_WAAAOOOW, MARIO_ACTION_SOUND_PLAYED);
play_sound(SOUND_MOVING_SHOCKED, m->marioObj->header.gfx.cameraToObject);
if (m->playerIndex == 0) { set_camera_shake_from_hit(SHAKE_SHOCK); }
@ -1636,7 +1651,8 @@ s32 act_squished(struct MarioState *m) {
if (!(m->flags & MARIO_METAL_CAP) && m->invincTimer == 0) {
// cap on: 3 units; cap off: 4.5 units
m->hurtCounter += m->flags & MARIO_CAP_ON_HEAD ? 12 : 18;
play_sound_if_no_flag(m, SOUND_MARIO_ATTACKED, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_ATTACKED : SOUND_MARIO_ATTACKED, MARIO_MARIO_SOUND_PLAYED);
}
// Both of the 1.8's are really floats, but one of them has to
@ -1855,12 +1871,13 @@ static void intro_cutscene_jump_out_of_pipe(struct MarioState *m) {
if (m->actionTimer++ >= 118) {
m->marioObj->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE;
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
#ifdef VERSION_EU
// For some reason these calls were swapped.
play_sound_if_no_flag(m, SOUND_ACTION_HIT_3, MARIO_ACTION_SOUND_PLAYED);
play_sound_if_no_flag(m, SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAHOO : SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED);
#else
play_sound_if_no_flag(m, SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAHOO : SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED);
#ifndef VERSION_JP
play_sound_if_no_flag(m, SOUND_ACTION_HIT_3, MARIO_ACTION_SOUND_PLAYED);
#endif
@ -1872,7 +1889,7 @@ static void intro_cutscene_jump_out_of_pipe(struct MarioState *m) {
sound_banks_enable(2, 0x0330);
play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING);
#ifndef VERSION_JP
play_sound(SOUND_MARIO_HAHA, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_HAHA : SOUND_MARIO_HAHA, m->marioObj->header.gfx.cameraToObject);
#endif
advance_cutscene_step(m);
}
@ -2008,18 +2025,19 @@ static s32 jumbo_star_cutscene_taking_off(struct MarioState *m) {
marioObj->rawData.asF32[0x22] -= 32.0f;
}
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
switch (animFrame) {
case 3:
play_sound(SOUND_MARIO_YAH_WAH_HOO + (gAudioRandom % 3 << 16),
play_sound(((configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAH_WAH_HOO : SOUND_MARIO_YAH_WAH_HOO) + (gAudioRandom % 3 << 16),
m->marioObj->header.gfx.cameraToObject);
break;
case 28:
play_sound(SOUND_MARIO_HOOHOO, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_HOOHOO : SOUND_MARIO_HOOHOO, m->marioObj->header.gfx.cameraToObject);
break;
case 60:
play_sound(SOUND_MARIO_YAHOO, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAHOO : SOUND_MARIO_YAHOO, m->marioObj->header.gfx.cameraToObject);
break;
}
m->particleFlags |= PARTICLE_SPARKLES;

View File

@ -14,6 +14,7 @@
#include "thread6.h"
#include "pc/configfile.h"
#include "pc/cheats.h"
#include "pc/network/network.h"
struct LandingAction {
s16 numFrames;
@ -1386,7 +1387,8 @@ void common_slide_action(struct MarioState *m, u32 endAction, u32 airAction, s32
case GROUND_STEP_LEFT_GROUND:
set_mario_action(m, airAction, 0);
if (m->forwardVel < -50.0f || 50.0f < m->forwardVel) {
play_sound(SOUND_MARIO_HOOHOO, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_HOOHOO : SOUND_MARIO_HOOHOO, m->marioObj->header.gfx.cameraToObject);
}
break;
@ -1605,13 +1607,14 @@ s32 common_ground_knockback_action(struct MarioState *m, s32 animation, s32 arg2
play_mario_heavy_landing_sound_once(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND);
}
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
if (arg4 > 0) {
play_sound_if_no_flag(m, SOUND_MARIO_ATTACKED, MARIO_MARIO_SOUND_PLAYED);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_ATTACKED : SOUND_MARIO_ATTACKED, MARIO_MARIO_SOUND_PLAYED);
} else {
#ifdef VERSION_JP
play_sound_if_no_flag(m, SOUND_MARIO_OOOF, MARIO_MARIO_SOUND_PLAYED);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_OOOF : SOUND_MARIO_OOOF, MARIO_MARIO_SOUND_PLAYED);
#else
play_sound_if_no_flag(m, SOUND_MARIO_OOOF2, MARIO_MARIO_SOUND_PLAYED);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_OOOF2 : SOUND_MARIO_OOOF2, MARIO_MARIO_SOUND_PLAYED);
#endif
}
@ -1662,7 +1665,8 @@ s32 act_hard_backward_ground_kb(struct MarioState *m) {
#ifndef VERSION_JP
if (val04 == 0x36 && m->prevAction == ACT_SPECIAL_DEATH_EXIT) {
play_sound(SOUND_MARIO_MAMA_MIA, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_MAMA_MIA : SOUND_MARIO_MAMA_MIA, m->marioObj->header.gfx.cameraToObject);
}
#endif
@ -1719,7 +1723,8 @@ s32 act_death_exit_land(struct MarioState *m) {
val04 = set_mario_animation(m, MARIO_ANIM_FALL_OVER_BACKWARDS);
if (val04 == 0x36) {
play_sound(SOUND_MARIO_MAMA_MIA, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_MAMA_MIA : SOUND_MARIO_MAMA_MIA, m->marioObj->header.gfx.cameraToObject);
}
if (val04 == 0x44) {
play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING);
@ -1874,7 +1879,8 @@ s32 act_long_jump_land(struct MarioState *m) {
}
if (!(m->input & INPUT_NONZERO_ANALOG)) {
play_sound_if_no_flag(m, SOUND_MARIO_UH2_2, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_UH2_2 : SOUND_MARIO_UH2_2, MARIO_MARIO_SOUND_PLAYED);
}
common_landing_action(m,
@ -1900,7 +1906,8 @@ s32 act_triple_jump_land(struct MarioState *m) {
}
if (!(m->input & INPUT_NONZERO_ANALOG)) {
play_sound_if_no_flag(m, SOUND_MARIO_HAHA, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_HAHA : SOUND_MARIO_HAHA, MARIO_MARIO_SOUND_PLAYED);
}
common_landing_action(m, MARIO_ANIM_TRIPLE_JUMP_LAND, ACT_FREEFALL);
@ -1917,7 +1924,8 @@ s32 act_backflip_land(struct MarioState *m) {
}
if (!(m->input & INPUT_NONZERO_ANALOG)) {
play_sound_if_no_flag(m, SOUND_MARIO_HAHA, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_HAHA : SOUND_MARIO_HAHA, MARIO_MARIO_SOUND_PLAYED);
}
common_landing_action(m, MARIO_ANIM_TRIPLE_JUMP_LAND, ACT_FREEFALL);

View File

@ -11,6 +11,7 @@
#include "engine/math_util.h"
#include "thread6.h"
#include "behavior_data.h"
#include "pc/configfile.h"
#include "pc/network/network.h"
#include "object_helpers.h"
@ -38,9 +39,10 @@ s32 mario_update_punch_sequence(struct MarioState *m) {
endAction = ACT_IDLE, crouchEndAction = ACT_CROUCHING;
}
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
switch (m->actionArg) {
case 0:
play_sound(SOUND_MARIO_PUNCH_YAH, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_PUNCH_YAH : SOUND_MARIO_PUNCH_YAH, m->marioObj->header.gfx.cameraToObject);
// Fall-through:
case 1:
set_mario_animation(m, MARIO_ANIM_FIRST_PUNCH);
@ -80,7 +82,7 @@ s32 mario_update_punch_sequence(struct MarioState *m) {
break;
case 3:
play_sound(SOUND_MARIO_PUNCH_WAH, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_PUNCH_YAH : SOUND_MARIO_PUNCH_WAH, m->marioObj->header.gfx.cameraToObject);
// Fall-through:
case 4:
set_mario_animation(m, MARIO_ANIM_SECOND_PUNCH);
@ -115,7 +117,7 @@ s32 mario_update_punch_sequence(struct MarioState *m) {
break;
case 6:
play_mario_action_sound(m, SOUND_MARIO_PUNCH_HOO, 1);
play_mario_action_sound(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_PUNCH_HOO : SOUND_MARIO_PUNCH_HOO, 1);
animFrame = set_mario_animation(m, MARIO_ANIM_GROUND_KICK);
if (animFrame == 0) {
m->marioBodyState->punchState = (2 << 6) | 6;
@ -131,7 +133,7 @@ s32 mario_update_punch_sequence(struct MarioState *m) {
break;
case 9:
play_mario_action_sound(m, SOUND_MARIO_PUNCH_HOO, 1);
play_mario_action_sound(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_PUNCH_HOO : SOUND_MARIO_PUNCH_HOO, 1);
set_mario_animation(m, MARIO_ANIM_BREAKDANCE);
animFrame = m->marioObj->header.gfx.unk38.animFrame;
@ -191,7 +193,8 @@ s32 act_picking_up(struct MarioState *m) {
// slot (cloning via fake object).
mario_grab_used_object(m);
if (m->heldObj != NULL) {
play_sound_if_no_flag(m, SOUND_MARIO_HRMM, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_HRMM : SOUND_MARIO_HRMM, MARIO_MARIO_SOUND_PLAYED);
m->actionState = 1;
} else {
set_mario_action(m, ACT_IDLE, 0);
@ -271,7 +274,8 @@ s32 act_throwing(struct MarioState *m) {
if (++m->actionTimer == 7) {
mario_throw_held_object(m);
play_sound_if_no_flag(m, SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_WAH2 : SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED);
play_sound_if_no_flag(m, SOUND_ACTION_THROW, MARIO_ACTION_SOUND_PLAYED);
queue_rumble_data_mario(m, 3, 50);
}
@ -291,7 +295,8 @@ s32 act_heavy_throw(struct MarioState *m) {
if (++m->actionTimer == 13) {
mario_drop_held_object(m);
play_sound_if_no_flag(m, SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_WAH2 : SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED);
play_sound_if_no_flag(m, SOUND_ACTION_THROW, MARIO_ACTION_SOUND_PLAYED);
queue_rumble_data_mario(m, 3, 50);
}
@ -328,7 +333,8 @@ s32 act_picking_up_bowser(struct MarioState *m) {
mario_grab_used_object(m);
if (m->heldObj != NULL) {
queue_rumble_data_mario(m, 5, 80);
play_sound(SOUND_MARIO_HRMM, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_HRMM : SOUND_MARIO_HRMM, m->marioObj->header.gfx.cameraToObject);
if (m->playerIndex == 0) {
network_send_object(m->heldObj);
} else {
@ -357,7 +363,8 @@ s32 act_holding_bowser(struct MarioState *m) {
mario_grab_used_object(m);
if (m->heldObj != NULL) {
queue_rumble_data_mario(m, 5, 80);
play_sound(SOUND_MARIO_HRMM, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_HRMM : SOUND_MARIO_HRMM, m->marioObj->header.gfx.cameraToObject);
} else {
set_mario_action(m, ACT_IDLE, 0);
return FALSE;
@ -368,14 +375,15 @@ s32 act_holding_bowser(struct MarioState *m) {
s16 spin;
if (m->playerIndex == 0 && m->input & INPUT_B_PRESSED) {
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
#ifndef VERSION_JP
if (m->angleVel[1] <= -0xE00 || m->angleVel[1] >= 0xE00) {
play_sound(SOUND_MARIO_SO_LONGA_BOWSER, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_SO_LONGA_BOWSER : SOUND_MARIO_SO_LONGA_BOWSER, m->marioObj->header.gfx.cameraToObject);
} else {
play_sound(SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_HERE_WE_GO : SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
}
#else
play_sound(SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_HERE_WE_GO : SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
#endif
return set_mario_action(m, ACT_RELEASING_BOWSER, 0);
}

View File

@ -17,6 +17,8 @@
#include "sound_init.h"
#include "surface_terrains.h"
#include "thread6.h"
#include "pc/configfile.h"
#include "pc/network/network.h"
s32 check_common_idle_cancels(struct MarioState *m) {
mario_drop_held_object(m);
@ -243,18 +245,21 @@ s32 act_start_sleeping(struct MarioState *m) {
#ifndef VERSION_JP
if (m->actionState == 2) {
if (sp24 == -1) {
play_sound(SOUND_MARIO_YAWNING, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAWNING : SOUND_MARIO_YAWNING, m->marioObj->header.gfx.cameraToObject);
}
}
if (m->actionState == 1) {
if (sp24 == -1) {
play_sound(SOUND_MARIO_IMA_TIRED, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_IMA_TIRED : SOUND_MARIO_IMA_TIRED, m->marioObj->header.gfx.cameraToObject);
}
}
#else
if (m->actionState == 2) {
play_sound_if_no_flag(m, SOUND_MARIO_YAWNING, MARIO_MARIO_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_YAWNING : SOUND_MARIO_YAWNING, MARIO_MARIO_SOUND_PLAYED);
}
#endif
@ -289,12 +294,14 @@ s32 act_sleeping(struct MarioState *m) {
}
if (sp24 == 2) {
play_sound(SOUND_MARIO_SNORING1, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_SNORING1 : SOUND_MARIO_SNORING1, m->marioObj->header.gfx.cameraToObject);
m->isSnoring = TRUE;
}
if (sp24 == 20) {
play_sound(SOUND_MARIO_SNORING2, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_SNORING2 : SOUND_MARIO_SNORING2, m->marioObj->header.gfx.cameraToObject);
m->isSnoring = TRUE;
}
@ -318,17 +325,18 @@ s32 act_sleeping(struct MarioState *m) {
}
case 2: {
sp24 = set_mario_animation(m, MARIO_ANIM_SLEEP_LYING);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
#ifndef VERSION_JP
play_sound_if_no_flag(m, SOUND_MARIO_SNORING3, MARIO_ACTION_SOUND_PLAYED);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_SNORING3 : SOUND_MARIO_SNORING3, MARIO_ACTION_SOUND_PLAYED);
m->isSnoring = TRUE;
#else
if (sp24 == 2) {
play_sound(SOUND_MARIO_SNORING2, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_SNORING2 : SOUND_MARIO_SNORING2, m->marioObj->header.gfx.cameraToObject);
m->isSnoring = TRUE;
}
if (sp24 == 25) {
play_sound(SOUND_MARIO_SNORING1, m->marioObj->header.gfx.cameraToObject);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_SNORING1 : SOUND_MARIO_SNORING1, m->marioObj->header.gfx.cameraToObject);
m->isSnoring = TRUE;
}
#endif
@ -340,10 +348,11 @@ s32 act_sleeping(struct MarioState *m) {
s32 act_waking_up(struct MarioState *m) {
if (!m->actionTimer) {
func_803205E8(SOUND_MARIO_SNORING1, m->marioObj->header.gfx.cameraToObject);
func_803205E8(SOUND_MARIO_SNORING2, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
func_803205E8((configLuigiSounds && isLuigi) ? SOUND_LUIGI_SNORING1 : SOUND_MARIO_SNORING1, m->marioObj->header.gfx.cameraToObject);
func_803205E8((configLuigiSounds && isLuigi) ? SOUND_LUIGI_SNORING2 : SOUND_MARIO_SNORING2, m->marioObj->header.gfx.cameraToObject);
#ifndef VERSION_JP
func_803205E8(SOUND_MARIO_SNORING3, m->marioObj->header.gfx.cameraToObject);
func_803205E8((configLuigiSounds && isLuigi) ? SOUND_LUIGI_SNORING3 : SOUND_MARIO_SNORING3, m->marioObj->header.gfx.cameraToObject);
#endif
if (m->playerIndex == 0) {
raise_background_noise(2);
@ -400,7 +409,8 @@ s32 act_shivering(struct MarioState *m) {
sp24 = set_mario_animation(m, MARIO_ANIM_SHIVERING_WARMING_HAND);
if (sp24 == 0x31) {
m->particleFlags |= PARTICLE_BREATH;
play_sound(SOUND_MARIO_PANTING_COLD, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_PANTING_COLD : SOUND_MARIO_PANTING_COLD, m->marioObj->header.gfx.cameraToObject);
}
if (sp24 == 7 || sp24 == 0x51) {
play_sound(SOUND_ACTION_CLAP_HANDS_COLD, m->marioObj->header.gfx.cameraToObject);
@ -438,15 +448,18 @@ s32 act_coughing(struct MarioState *m) {
stationary_ground_step(m);
sp1C = set_mario_animation(m, MARIO_ANIM_COUGHING);
if (sp1C == 0x19 || sp1C == 0x23) {
play_sound(SOUND_MARIO_COUGHING3, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_COUGHING3 : SOUND_MARIO_COUGHING3, m->marioObj->header.gfx.cameraToObject);
}
if (sp1C == 0x32 || sp1C == 0x3A) {
play_sound(SOUND_MARIO_COUGHING2, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_COUGHING2 : SOUND_MARIO_COUGHING2, m->marioObj->header.gfx.cameraToObject);
}
if (sp1C == 0x47 || sp1C == 0x50) {
play_sound(SOUND_MARIO_COUGHING1, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_COUGHING1 : SOUND_MARIO_COUGHING1, m->marioObj->header.gfx.cameraToObject);
}
return 0;
@ -593,7 +606,8 @@ s32 act_panting(struct MarioState *m) {
}
if (set_mario_animation(m, MARIO_ANIM_WALK_PANTING) == 1) {
play_sound(SOUND_MARIO_PANTING + ((gAudioRandom % 3U) << 0x10),
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_PANTING : SOUND_MARIO_PANTING + ((gAudioRandom % 3U) << 0x10),
m->marioObj->header.gfx.cameraToObject);
}

View File

@ -16,6 +16,8 @@
#include "behavior_data.h"
#include "level_table.h"
#include "thread6.h"
#include "pc/configfile.h"
#include "pc/network/network.h"
#define MIN_SWIM_STRENGTH 160
#define MIN_SWIM_SPEED 16.0f
@ -888,7 +890,8 @@ static s32 act_forward_water_kb(struct MarioState *m) {
}
static s32 act_water_shocked(struct MarioState *m) {
play_sound_if_no_flag(m, SOUND_MARIO_WAAAOOOW, MARIO_ACTION_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_WAAAOOOW : SOUND_MARIO_WAAAOOOW, MARIO_ACTION_SOUND_PLAYED);
play_sound(SOUND_MOVING_SHOCKED, m->marioObj->header.gfx.cameraToObject);
if (m->playerIndex == 0) { set_camera_shake_from_hit(SHAKE_SHOCK); }
@ -928,7 +931,8 @@ static s32 act_drowning(struct MarioState *m) {
break;
}
play_sound_if_no_flag(m, SOUND_MARIO_DROWNING, MARIO_ACTION_SOUND_PLAYED);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound_if_no_flag(m, (configLuigiSounds && isLuigi) ? SOUND_LUIGI_DROWNING : SOUND_MARIO_DROWNING, MARIO_ACTION_SOUND_PLAYED);
stationary_slow_down(m);
perform_water_step(m);
@ -976,7 +980,8 @@ static s32 act_water_plunge(struct MarioState *m) {
if (m->actionState == 0) {
play_sound(SOUND_ACTION_UNKNOWN430, m->marioObj->header.gfx.cameraToObject);
if (m->peakHeight - m->pos[1] > 1150.0f) {
play_sound(SOUND_MARIO_HAHA_2, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_HAHA_2 : SOUND_MARIO_HAHA_2, m->marioObj->header.gfx.cameraToObject);
}
m->particleFlags |= PARTICLE_WATER_SPLASH;

View File

@ -90,6 +90,7 @@ static const u8 optsAudioStr[][32] = {
{ TEXT_OPT_MUSVOLUME },
{ TEXT_OPT_SFXVOLUME },
{ TEXT_OPT_ENVVOLUME },
{ TEXT_OPT_LUIGISND },
};
static const u8 optsCheatsStr[][64] = {
@ -271,6 +272,7 @@ static struct Option optsAudio[] = {
DEF_OPT_SCROLL( optsAudioStr[1], &configMusicVolume, 0, MAX_VOLUME, 1),
DEF_OPT_SCROLL( optsAudioStr[2], &configSfxVolume, 0, MAX_VOLUME, 1),
DEF_OPT_SCROLL( optsAudioStr[3], &configEnvVolume, 0, MAX_VOLUME, 1),
DEF_OPT_TOGGLE( optsAudioStr[4], &configLuigiSounds ),
};
static struct Option optsCheats[] = {

View File

@ -106,6 +106,7 @@ unsigned int configPlayerInteraction = 1;
unsigned int configPlayerKnockbackStrength = 25;
unsigned int configStayInLevelAfterStar = 0;
unsigned int configNetworkSystem = 0;
bool configLuigiSounds = true;
static const struct ConfigOption options[] = {
{.name = "fullscreen", .type = CONFIG_TYPE_BOOL, .boolValue = &configWindow.fullscreen},
@ -165,6 +166,7 @@ static const struct ConfigOption options[] = {
{.name = "coop_player_knockback_strength", .type = CONFIG_TYPE_UINT , .uintValue = &configPlayerKnockbackStrength},
{.name = "coop_stay_in_level_after_star", .type = CONFIG_TYPE_UINT , .uintValue = &configStayInLevelAfterStar},
{.name = "coop_network_system", .type = CONFIG_TYPE_UINT , .uintValue = &configNetworkSystem},
{.name = "coop_luigi_sounds", .type = CONFIG_TYPE_BOOL , .boolValue = &configLuigiSounds},
};
// Reads an entire line from a file (excluding the newline character) and returns an allocated string

View File

@ -72,6 +72,7 @@ extern unsigned int configPlayerInteraction;
extern unsigned int configPlayerKnockbackStrength;
extern unsigned int configStayInLevelAfterStar;
extern unsigned int configNetworkSystem;
extern bool configLuigiSounds;
void configfile_load(const char *filename);
void configfile_save(const char *filename);

View File

@ -10,6 +10,7 @@
#include "engine/surface_collision.h"
#include "game/object_list_processor.h"
#include "game/chat.h"
#include "pc/configfile.h"
#pragma pack(1)
struct PacketPlayerData {
@ -325,7 +326,8 @@ void network_receive_player(struct Packet* p) {
if ((m->action == ACT_PUNCHING || m->action == ACT_MOVE_PUNCHING)) {
// play first punching sound, otherwise it will be missed
if (m->action != oldData.action) {
play_sound(SOUND_MARIO_PUNCH_YAH, m->marioObj->header.gfx.cameraToObject);
u8 isLuigi = (gNetworkType == NT_SERVER) ? (m->playerIndex != 0) : (m->playerIndex == 0);
play_sound((configLuigiSounds && isLuigi) ? SOUND_LUIGI_PUNCH_YAH : SOUND_MARIO_PUNCH_YAH, m->marioObj->header.gfx.cameraToObject);
}
// make the first punch large, otherwise it will be missed
if (m->actionArg == 2 && oldData.actionArg == 1) {