Skip to content

Commit 0151f69

Browse files
committed
Singularity SFX shuffle
1 parent e8ca4a5 commit 0151f69

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

worlds/smw/Aesthetics.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -582,8 +582,7 @@ def generate_shuffled_sfx(rom, world: World):
582582
rom.write_bytes(0x06D41 + 0x05, bytearray([0xEA, 0xEA, 0xEA, 0xEA])) # nop #4
583583

584584
# Manually add "Map: Stepping onto a level tile" random SFX
585-
random_sfx = world.random.randint(0, len(valid_sfxs)-1)
586-
selected_sfx = valid_sfxs[random_sfx]
585+
selected_sfx = world.random.choice(valid_sfxs)
587586
rom.write_byte(0x2169F + 0x01, selected_sfx[0])
588587
rom.write_byte(0x2169F + 0x04, selected_sfx[1] + 0xF9)
589588

@@ -593,8 +592,8 @@ def generate_shuffled_sfx(rom, world: World):
593592
# Randomize SFX calls
594593
for address in game_sfx_calls:
595594
# Get random SFX
596-
random_sfx = world.random.randint(0, len(valid_sfxs)-1)
597-
selected_sfx = valid_sfxs[random_sfx]
595+
if world.options.sfx_shuffle != "singularity":
596+
selected_sfx = world.random.choice(valid_sfxs)
598597
# Write randomized SFX num
599598
rom.write_byte(address + 0x01, selected_sfx[0])
600599
# Write randomized SFX port

worlds/smw/Options.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,18 @@ class MusicShuffle(Choice):
273273
default = 0
274274

275275

276-
class SFXShuffle(Toggle):
276+
class SFXShuffle(Choice):
277277
"""
278278
Shuffles almost every instance of sound effect playback
279279
Archipelago elements that play sound effects aren't randomized
280+
None: No Music is shuffled
281+
Full: Each individual SFX call has a random SFX
282+
Singularity: The entire game uses one SFX for every SFX call
280283
"""
281-
display_name = "Sound effect shuffle"
284+
display_name = "Sound Effect Shuffle"
285+
option_none = 0
286+
option_full = 1
287+
option_singularity = 2
282288
default = 0
283289

284290

worlds/smw/Rom.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2820,7 +2820,7 @@ def patch_rom(world: World, rom, player, active_level_dict):
28202820
if world.options.overworld_palette_shuffle == "on_curated":
28212821
generate_curated_map_palette_data(rom, world)
28222822

2823-
if world.options.sfx_shuffle:
2823+
if world.options.sfx_shuffle != "none":
28242824
generate_shuffled_sfx(rom, world)
28252825

28262826
if world.options.swap_donut_gh_exits:

0 commit comments

Comments
 (0)