From 17e48e4e189aa4cc6d3108bcac9680bd60d39110 Mon Sep 17 00:00:00 2001 From: aerinon Date: Thu, 19 Dec 2024 15:18:09 -0700 Subject: [PATCH] fix: prevent crash from bush spawning mimics hopefully --- RELEASENOTES.md | 7 ++++--- source/enemizer/Enemizer.py | 3 ++- source/enemizer/SpriteSheets.py | 9 +++++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index ec16bd309..4da7420d2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -3,10 +3,11 @@ * 1.4.7 - Fixed generation error with Big Key in starting inventory (thanks Cody!) - HMG/NL logic fixes by Muffins - - Enemizer: Disabled Wlkaing Zora in the UW due to crash with Swamola (they ignore a lot of collison anyway) - - "Beatable" or "accessibility: none" can now use randomized trap doors to seal off entire parts of dungeons + - Enemizer: Disabled Walking Zora in the UW due to crash with Swamola (they ignore a lot of collison anyway) + - Enemizer: Banned new Mimics from being the randomized bush sprite due to crash + - "Beatable" or "accessibility: none" can now use randomized trap doors to seal off entire parts of dungeons (was intended, bug prevented the logic skip) - Logic error with enemizer and standard should use new enemy logic rules - Fixed a bug with the inconsistent treatment of the beemizer setting - Fixed an issue with returning Blacksmith in Simple shuffle (when blacksmith is at Link's House) - Fixed an issue with dark sanctuary spawn at tavern north door (thanks Codemann!) - - Various enemy bans for the last couple months + - Various enemy bans for the last few months diff --git a/source/enemizer/Enemizer.py b/source/enemizer/Enemizer.py index 021b7f03e..4a7a61c8d 100644 --- a/source/enemizer/Enemizer.py +++ b/source/enemizer/Enemizer.py @@ -408,8 +408,9 @@ def randomize_overworld_enemies(data_tables, custom_ow): chosen = random.choices(candidate_sprites, weight, k=1)[0] sprite.kind = chosen.sprite # randomize the bush sprite per area + bush_candidates = [x for x in candidate_sprites if x.bush_valid] weight = [data_tables.ow_weights[r.sprite] for r in candidate_sprites] - bush_sprite_choice = random.choices(candidate_sprites, weight, k=1)[0] + bush_sprite_choice = random.choices(bush_candidates, weight, k=1)[0] data_tables.bush_sprite_table[area_id] = bush_sprite_choice diff --git a/source/enemizer/SpriteSheets.py b/source/enemizer/SpriteSheets.py index b1b240646..bb0210882 100644 --- a/source/enemizer/SpriteSheets.py +++ b/source/enemizer/SpriteSheets.py @@ -21,6 +21,7 @@ def __init__(self, sprite, overlord=0): self.uw_valid = True self.can_randomize = True self.water_phobic = False + self.bush_valid = True self.groups = [] self.sub_groups = defaultdict(list) @@ -94,6 +95,10 @@ def uw_skip(self): self.uw_valid = False return self + def no_bush(self): + self.bush_valid = False + return self + def good_for_uw_water(self): return self.water_only and not self.static and not self.dont_use and self.uw_valid @@ -366,8 +371,8 @@ def init_sprite_requirements(): SpriteRequirement(EnemySprite.MagicShopAssistant).affix().sub_group(0, 0x4b).sub_group(3, 0x5a), SpriteRequirement(EnemySprite.SomariaPlatform).affix().sub_group(2, 0x27), SpriteRequirement(EnemySprite.CastleMantle).affix().sub_group(0, 0x5d), - SpriteRequirement(EnemySprite.GreenMimic).sub_group(1, 0x2c), - SpriteRequirement(EnemySprite.RedMimic).sub_group(1, 0x2c), + SpriteRequirement(EnemySprite.GreenMimic).sub_group(1, 0x2c).no_bush(), + SpriteRequirement(EnemySprite.RedMimic).sub_group(1, 0x2c).no_bush(), SpriteRequirement(EnemySprite.MedallionTablet).affix().sub_group(2, 0x12), # overlord requirements - encapsulated mostly in the required sheets