Added Customizer support for OWR Layout and Whirlpool Shuffle

This commit is contained in:
codemann8
2023-08-25 11:18:21 -05:00
parent eb1888334e
commit 26727fbfca
3 changed files with 169 additions and 32 deletions

View File

@@ -196,6 +196,16 @@ class CustomSettings(object):
return self.file_source['advanced_placements']
return None
def get_owedges(self):
if 'ow-edges' in self.file_source:
return self.file_source['ow-edges']
return None
def get_whirlpools(self):
if 'ow-whirlpools' in self.file_source:
return self.file_source['ow-whirlpools']
return None
def get_owtileflips(self):
if 'ow-tileflips' in self.file_source:
return self.file_source['ow-tileflips']
@@ -355,21 +365,40 @@ class CustomSettings(object):
placements[location.player][location.name] = location.item.name
def record_overworld(self, world):
self.world_rep['ow-edges'] = edges = {}
self.world_rep['ow-whirlpools'] = whirlpools = {}
self.world_rep['ow-tileflips'] = flips = {}
self.world_rep['ow-flutespots'] = flute = {}
for p in self.player_range:
connections = edges[p] = {}
connections['two-way'] = {}
connections['one-way'] = {}
whirlconnects = whirlpools[p] = {}
whirlconnects['two-way'] = {}
whirlconnects['one-way'] = {}
# tile flips
if p in world.owswaps and len(world.owswaps[p][0]) > 0:
flips[p] = {}
flips[p]['force_flip'] = list(HexInt(f) for f in world.owswaps[p][0] if f < 0x40 or f >= 0x80)
flips[p]['force_flip'].sort()
flips[p]['undefined_chance'] = 0
self.world_rep['ow-flutespots'] = flute = {}
for p in self.player_range:
# flute spots
flute[p] = {}
if p in world.owflutespots:
flute[p]['force'] = list(HexInt(id) for id in sorted(world.owflutespots[p]))
else:
flute[p]['force'] = list(HexInt(id) for id in sorted(default_flute_connections))
flute[p]['forbid'] = []
for key, data in world.spoiler.overworlds.items():
player = data['player'] if 'player' in data else 1
connections = edges[player]
sub = 'two-way' if data['direction'] == 'both' else 'one-way'
connections[sub][data['entrance']] = data['exit']
for key, data in world.spoiler.whirlpools.items():
player = data['player'] if 'player' in data else 1
whirlconnects = whirlconnects[player]
sub = 'two-way' if data['direction'] == 'both' else 'one-way'
whirlconnects[sub][data['entrance']] = data['exit']
def record_entrances(self, world):
self.world_rep['entrances'] = entrances = {}