Skip to content

Commit

Permalink
fix: prevent crash from bush spawning mimics hopefully
Browse files Browse the repository at this point in the history
  • Loading branch information
aerinon committed Dec 19, 2024
1 parent 96f646b commit 17e48e4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 4 additions & 3 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion source/enemizer/Enemizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
9 changes: 7 additions & 2 deletions source/enemizer/SpriteSheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 17e48e4

Please sign in to comment.