LttP: Add Allow collect option, default Off. (#414)

* LttP: Add Allow collect option, default Off.

* Add allow_collect to the sample yaml.
This commit is contained in:
CaitSith2
2022-04-04 18:54:49 -07:00
committed by GitHub
parent f7c601b863
commit 944571ea89
7 changed files with 41 additions and 17 deletions

View File

@@ -1765,7 +1765,7 @@ def hud_format_text(text):
def apply_rom_settings(rom, beep, color, quickswap, menuspeed, music: bool, sprite: str, palettes_options,
world=None, player=1, allow_random_on_event=False, reduceflashing=False,
triforcehud: str = None, deathlink: bool = False):
triforcehud: str = None, deathlink: bool = False, allowcollect: bool = False):
local_random = random if not world else world.slot_seeds[player]
disable_music: bool = not music
# enable instant item menu
@@ -1899,7 +1899,9 @@ def apply_rom_settings(rom, beep, color, quickswap, menuspeed, music: bool, spri
elif palettes_options['dungeon'] == 'random':
randomize_uw_palettes(rom, local_random)
rom.write_byte(0x18008D, int(deathlink))
rom.write_byte(0x18008D, (0b00000001 if deathlink else 0) |
# 0b00000010 is already used for death_link_allow_survive in super metroid.
(0b00000100 if allowcollect else 0))
apply_random_sprite_on_event(rom, sprite, local_random, allow_random_on_event,
world.sprite_pool[player] if world else [])