From aae08a807feae3fdb2c3f947b0cfccbd9d742aa6 Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Mon, 5 Oct 2020 19:57:36 -0700 Subject: [PATCH] Support randomonall for ALL supported events that randomly change sprites. --- Rom.py | 5 ++++- playerSettings.yaml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Rom.py b/Rom.py index fffa4e9c..0164013c 100644 --- a/Rom.py +++ b/Rom.py @@ -169,7 +169,10 @@ def apply_random_sprite_on_event(rom: LocalRom, sprite, local_random, allow_rand allow_random_on_event = not rom.read_byte(0x186381) # Check if explicitly disabled in rom. If so, it stays that way. if sprite and not isinstance(sprite, Sprite): sprite = sprite.lower() - if sprite.startswith('randomon'): + if sprite == 'randomonall': + onevent = 0xFFFF # Support all current and future events that can cause random sprite changes. + onhit = 0x01 + elif sprite.startswith('randomon'): onevent = onhit = 0x01 if 'hit' in sprite else 0x00 onevent += 0x02 if 'enter' in sprite else 0x00 onevent += 0x04 if 'exit' in sprite else 0x00 diff --git a/playerSettings.yaml b/playerSettings.yaml index 70e3411f..472a65c0 100644 --- a/playerSettings.yaml +++ b/playerSettings.yaml @@ -294,6 +294,7 @@ rom: randomonslash: 0 # Random sprite on sword slashes randomonitem: 0 # Random sprite on getting items. # You can combine these events like this. randomonhit-enter-exit if you want it on hit, enter, exit. + randomonall: 0 # Random sprite on any and all currently supported events. Refer to above for the supported events. Link: 50 # To add other sprites: open the gui/Creator, go to adjust, select a sprite and write down the name the gui calls it disablemusic: # If "on", all in-game music will be disabled on: 0