Merge branch 'OverworldShuffle' into GwaaKiwi

This commit is contained in:
2025-12-14 09:14:20 -06:00
188 changed files with 1479 additions and 6109 deletions

View File

@@ -1,4 +1,5 @@
import RaceRandom as random
from collections import defaultdict
from Utils import snes_to_pc
from source.dungeon.EnemyList import SpriteType, EnemySprite, sprite_translation
@@ -446,13 +447,16 @@ def randomize_enemies(world, player):
set_mimics(data_tables)
elif world.enemy_shuffle[player] != 'none':
data_tables = world.data_tables[player]
custom_ow, custom_uw = {}, {}
enemy_map = world.customizer.get_enemies() if world.customizer else None
if enemy_map and player in enemy_map:
if 'Underworld' in enemy_map[player]:
custom_uw = enemy_map[player]['Underworld']
if 'Overworld' in enemy_map[player]:
custom_ow = enemy_map[player]['Overworld']
if world.force_enemy[player]:
custom_ow = {area_id: {i: world.force_enemy[player] for i, s in enumerate(sprite_list)} for area_id, sprite_list in world.data_tables[player].ow_enemy_table.items()}
custom_uw = {room_id: {i: world.force_enemy[player] for i, s in enumerate(sprite_list)} for room_id, sprite_list in world.data_tables[player].uw_enemy_table.room_map.items()}
else:
enemy_map = world.customizer.get_enemies() if world.customizer else None
if enemy_map and player in enemy_map:
if 'Underworld' in enemy_map[player]:
custom_uw = enemy_map[player]['Underworld']
if 'Overworld' in enemy_map[player]:
custom_ow = enemy_map[player]['Overworld']
randomize_underworld_sprite_sheets(data_tables.sprite_sheets, data_tables, custom_uw)
randomize_underworld_rooms(data_tables, world, player, custom_uw)
randomize_overworld_sprite_sheets(data_tables.sprite_sheets, data_tables, custom_ow)
@@ -525,6 +529,21 @@ def randomize_enemies(world, player):
green_mail, blue_mail, red_mail = original_table[idx]
del original_table[idx]
world.data_tables[player].enemy_damage[i] = [green_mail, blue_mail, red_mail]
# determine default zelda follower location
if world.mode[player] == 'standard' and world.doorShuffle[player] == 'crossed' and world.shuffle_followers[player]:
def random_zelda():
world.default_zelda_region[player] = random.choice(['Hyrule Dungeon Cellblock', 'Thieves Blind\'s Cell'])
if world.customizer:
placements = world.customizer.get_placements()
if placements and player in placements and 'Zelda Herself' in placements[player].values():
location = [l for (l, item) in placements[player].items() if item == 'Zelda Herself'][0]
if location == 'Suspicious Maiden':
world.default_zelda_region[player] = 'Thieves Blind\'s Cell'
else:
random_zelda()
else:
random_zelda()
def write_enemy_shuffle_settings(world, player, rom):

View File

@@ -363,7 +363,7 @@ def init_sprite_requirements():
SpriteRequirement(EnemySprite.TrinexxFireHead).exalt().sub_group(0, 0x40).sub_group(3, 0x3f),
SpriteRequirement(EnemySprite.TrinexxIceHead).exalt().sub_group(0, 0x40).sub_group(3, 0x3f),
SpriteRequirement(EnemySprite.Blind).exalt().sub_group(1, 0x2c).sub_group(2, 0x3b),
SpriteRequirement(EnemySprite.Swamola).no_drop().sub_group(3, 0x19),
SpriteRequirement(EnemySprite.Swamola).skip().no_drop().sub_group(3, 0x19),
SpriteRequirement(EnemySprite.Lynel).sub_group(3, 0x14),
SpriteRequirement(EnemySprite.BunnyBeam).no_drop().ow_skip(),
SpriteRequirement(EnemySprite.FloppingFish).uw_skip().immune(),
@@ -683,9 +683,11 @@ def setup_custom_enemy_sheets(custom_enemies, sheets, data_tables, sheet_range,
if key not in requirements:
continue
req = requirements[key]
if isinstance(req, dict):
if isinstance(req, dict) and room_id in req:
req = req[room_id]
if req.static or not req.can_randomize:
else:
req = None
if req and (req.static or not req.can_randomize):
try:
combine_req(sub_groups_choices, req)
except IncompatibleEnemyException:

View File

@@ -84,7 +84,7 @@ UwGeneralDeny:
- [ 0x0039, 4, [ "RollerVerticalUp", "RollerVerticalDown", "RollerHorizontalLeft", "RollerHorizontalRight", "FirebarCW", "FirebarCCW" ] ] #"Skull Woods - Play Pen - Spike Trap 1"
- [0x0039, 5, ["RollerVerticalUp", "RollerVerticalDown", "RollerHorizontalLeft", "Bumper", "AntiFairyCircle"]] #"Skull Woods - Play Pen - Hardhat Beetle"
- [ 0x0039, 6, [ "RollerVerticalUp", "RollerVerticalDown", "RollerHorizontalLeft", "RollerHorizontalRight", "FirebarCW", "FirebarCCW" ] ] #"Skull Woods - Play Pen - Spike Trap 2"
- [0x003a, 1, ["RollerVerticalUp"]]
- [0x003a, 1, ["RollerVerticalUp", "RollerVerticalDown"]]
- [ 0x003b, 1, [ "Bumper", "AntiFairyCircle" ]]
- [ 0x003b, 4, ["RollerVerticalUp", "RollerVerticalDown"]]
- [ 0x003c, 0, ["BigSpike"]]
@@ -339,7 +339,11 @@ UwGeneralDeny:
- [ 0x00c2, 5, [ "Wizzrobe", "Statue" ] ] # Wizzrobes can't spawn on pots
- [ 0x00c5, 6, [ "RollerVerticalUp", "RollerVerticalDown", "RollerHorizontalLeft", "RollerHorizontalRight", "Beamos", "AntiFairyCircle", "BigSpike", "SpikeBlock", "Bumper" ] ] #"Turtle Rock - Catwalk - Mini Helmasaur"
- [ 0x00c5, 7, [ "Statue" ] ] #"Turtle Rock - Catwalk - Laser Eye (Left) 4"
- [0x00c6, 2, ["Bumper", "AntiFairyCircle"]]
- [0x00c6, 3, ["Bumper", "AntiFairyCircle"]]
- [0x00c6, 4, ["Bumper", "AntiFairyCircle"]]
- [0x00c6, 5, ["Bumper", "AntiFairyCircle"]]
- [0x00c6, 6, ["Bumper", "AntiFairyCircle"]]
- [ 0x00cb, 0, [ "Wizzrobe", "Statue" ] ] # Wizzrobes can't spawn on pots
- [ 0x00cb, 3, [ "RollerVerticalUp", "RollerVerticalDown", "Beamos", "AntiFairyCircle", "BigSpike", "SpikeBlock", "Bumper" ] ] #"Thieves' Town - Grand Room NW - Zol 1"
- [ 0x00cb, 5, [ "RollerVerticalUp", "RollerVerticalDown", "Beamos", "AntiFairyCircle", "BigSpike", "SpikeBlock", "Bumper" ] ] #"Thieves' Town - Grand Room NW - Zol 2"
@@ -397,6 +401,7 @@ UwGeneralDeny:
- [ 0x00e4, 2, [ "RollerHorizontalLeft", "RollerHorizontalRight", "Beamos", "AntiFairyCircle", "BigSpike", "SpikeBlock", "Bumper" ] ] #"Old Man Home - Keese 3"
- [ 0x00e5, 4, [ "RollerVerticalDown", "AntiFairyCircle", "BigSpike", "SpikeBlock", "Bumper" ] ] #"Old Man Home Circle - Keese 5"
- [ 0x00e5, 5, [ "RollerVerticalDown", "AntiFairyCircle", "BigSpike", "SpikeBlock", "Bumper" ] ] #"Old Man Home Circle - Keese 6"
- [0x00e6, 0, ["Statue"]] # Death Mountain Descent Cave Left - Keese 1 - Statue blocking pot access
- [ 0x00e7, 0, [ "RollerVerticalUp", "AntiFairyCircle", "BigSpike", "SpikeBlock", "Bumper" ] ] #"Death Mountain Descent Cave Right - Keese 1"
- [ 0x00e7, 1, [ "RollerVerticalUp", "AntiFairyCircle", "BigSpike", "SpikeBlock", "Bumper" ] ] #"Death Mountain Descent Cave Right - Keese 2"
- [ 0x00e7, 2, [ "RollerVerticalUp", "RollerVerticalDown", "RollerHorizontalRight" ] ] #"Death Mountain Descent Cave Right - Keese 3"
@@ -441,7 +446,7 @@ OwGeneralDeny:
- [0x05, 10, ["Bumper", "AntiFairyCircle"]] # Blocks path
- [0x05, 11, ["Bumper", "AntiFairyCircle"]] # Blocks path to portal
- [0x07, 3, ["Bumper", "AntiFairyCircle", "RollerHorizontalRight", "RollerHorizontalLeft"]] # Blocks path to ladder
- [0x07, 4, ["RollerHorizontalLeft"]] # Blocks path to ladder
- [0x07, 4, ["Bumper", "AntiFairyCircle", "RollerHorizontalLeft"]] # Blocks path to ladder
- [0x1e, 3, ["Beamos", "Bumper", "BigSpike", "AntiFairyCircle"]] # forbid a beamos here
- [0x35, 8, ["RollerVerticalUp", "RollerVerticalDown"]] # blocks the dock
- [0x37, 5, ["RollerVerticalUp"]] # combines with a roller above to make the way impassable
@@ -450,7 +455,7 @@ OwGeneralDeny:
- [0x40, 13, ["Beamos", "Bumper", "BigSpike", "AntiFairyCircle", "Thief"]]
- [0x40, 14, ["Beamos", "Bumper", "BigSpike", "AntiFairyCircle", "Thief"]]
- [0x40, 16, ["RollerVerticalUp", "RollerVerticalDown"]] # Ropa near back hole is really large as a roller
- [0x55, 6, ["BigSpike"]]
- [0x55, 6, ["BigSpike", "Bumper", "AntiFairyCircle"]]
- [0x57, 5, ["RollerVerticalUp", "RollerVerticalDown"]]
- [0x5b, 0, ["AntiFairyCircle", "Bumper"]] # ropa on pyramid
- [0x5e, 0, ["Gibo"]] # kiki eating Gibo
@@ -480,6 +485,7 @@ OwGeneralDeny:
- [0x77, 1, ["Bumper", "AntiFairyCircle"]] # soft-lock potential near ladder
- [0x7f, 1, ["Bumper", "AntiFairyCircle"]] # soft-lock potential near ladder
UwEnemyDrop:
- [0x0015, 8, ["Zoro"]] # layer issues
- [0x0085, 9, ["Babasu"]] # ran off the edge and didn't return
- [0x00cb, 3, ["Zoro"]] # layer issues
- [0x00cb, 5, ["Zoro"]] # layer issues