Merge branch 'OverworldShuffleDev' into OverworldShuffle

This commit is contained in:
codemann8
2021-07-18 06:10:41 -05:00
4 changed files with 353 additions and 415 deletions

View File

@@ -1,5 +1,10 @@
# Changelog # Changelog
### 0.1.6.8
- Implemented a smarter Balanced Flute Shuffle algorithm
- Fixed Collection Rate in credits
- Removed sortedcontainers dependency
### 0.1.6.7 ### 0.1.6.7
- Mountain Entry and West Death Mountain are now Swapped independently (Old Man rescue is always in your starting world) - Mountain Entry and West Death Mountain are now Swapped independently (Old Man rescue is always in your starting world)
- Fixed issue with AT/GT access logic - Fixed issue with AT/GT access logic
@@ -7,7 +12,6 @@
- Fixed Boss Music when boss room is entered thru straight stairs - Fixed Boss Music when boss room is entered thru straight stairs
- Suppressed in-dungeon music changes when DR is enabled - Suppressed in-dungeon music changes when DR is enabled
- Fixed issue with Pyramid Exit exiting to wrong location in ER - Fixed issue with Pyramid Exit exiting to wrong location in ER
- Removed sortedcontainers dependency
- ~~Merged DR v0.4.0.11 - Various DR changes~~ - ~~Merged DR v0.4.0.11 - Various DR changes~~
### 0.1.6.6 ### 0.1.6.6

View File

@@ -687,365 +687,282 @@ OWEdgeGroups = {
) )
} }
OWTileRegions = { OWTileRegions = bidict({
0x00: [ 'Lost Woods West Area': 0x00,
'Lost Woods West Area', 'Lost Woods East Area': 0x00,
'Lost Woods East Area'
], 'Lumberjack Area': 0x02,
0x02: [
'Lumberjack Area' 'West Death Mountain (Top)': 0x03,
], 'Spectacle Rock Ledge': 0x03,
0x03: [ 'West Death Mountain (Bottom)': 0x03,
'West Death Mountain (Top)',
'Spectacle Rock Ledge', 'Death Mountain Floating Island': 0x05,
'West Death Mountain (Bottom)' 'East Death Mountain (Top West)': 0x05,
], 'East Death Mountain (Top East)': 0x05,
0x05: [ 'Spiral Cave Ledge': 0x05,
'Death Mountain Floating Island', 'Mimic Cave Ledge': 0x05,
'East Death Mountain (Top West)', 'Fairy Ascension Ledge': 0x05,
'East Death Mountain (Top East)', 'Fairy Ascension Plateau': 0x05,
'Spiral Cave Ledge', 'East Death Mountain (Bottom Left)': 0x05,
'Mimic Cave Ledge', 'East Death Mountain (Bottom)': 0x05,
'Fairy Ascension Ledge',
'Fairy Ascension Plateau', 'Death Mountain TR Pegs': 0x07,
'East Death Mountain (Bottom Left)', 'Death Mountain TR Pegs Ledge': 0x07,
'East Death Mountain (Bottom)'
], 'Mountain Entry Area': 0x0a,
0x07: [ 'Mountain Entry Entrance': 0x0a,
'Death Mountain TR Pegs', 'Mountain Entry Ledge': 0x0a,
'Death Mountain TR Pegs Ledge'
], 'Zora Waterfall Area': 0x0f,
0x0a: [ 'Zora Waterfall Water': 0x0f,
'Mountain Entry Area', 'Waterfall of Wishing Cave': 0x0f,
'Mountain Entry Entrance',
'Mountain Entry Ledge' 'Lost Woods Pass West Area': 0x10,
], 'Lost Woods Pass East Top Area': 0x10,
0x0f: [ 'Lost Woods Pass East Bottom Area': 0x10,
'Zora Waterfall Area',
'Zora Waterfall Water', 'Kakariko Fortune Area': 0x11,
'Waterfall of Wishing Cave'
], 'Kakariko Pond Area': 0x12,
0x10: [
'Lost Woods Pass West Area', 'Sanctuary Area': 0x13,
'Lost Woods Pass East Top Area', 'Bonk Rock Ledge': 0x13,
'Lost Woods Pass East Bottom Area'
], 'Graveyard Area': 0x14,
0x11: [ 'Graveyard Ledge': 0x14,
'Kakariko Fortune Area' 'Kings Grave Area': 0x14,
],
0x12: [ 'River Bend Area': 0x15,
'Kakariko Pond Area' 'River Bend East Bank': 0x15,
], 'River Bend Water': 0x15,
0x13: [
'Sanctuary Area', 'Potion Shop Area': 0x16,
'Bonk Rock Ledge' 'Potion Shop Northeast': 0x16,
], 'Potion Shop Water': 0x16,
0x14: [
'Graveyard Area', 'Zora Approach Area': 0x17,
'Graveyard Ledge', 'Zora Approach Ledge': 0x17,
'Kings Grave Area' 'Zora Approach Water': 0x17,
],
0x15: [ 'Kakariko Area': 0x18,
'River Bend Area', 'Kakariko Southwest': 0x18,
'River Bend East Bank', 'Kakariko Grass Yard': 0x18,
'River Bend Water'
], 'Forgotten Forest Area': 0x1a,
0x16: [
'Potion Shop Area', 'Hyrule Castle Area': 0x1b,
'Potion Shop Northeast', 'Hyrule Castle Southwest': 0x1b,
'Potion Shop Water' 'Hyrule Castle Courtyard': 0x1b,
], 'Hyrule Castle Courtyard Northeast': 0x1b,
0x17: [ 'Hyrule Castle Ledge': 0x1b,
'Zora Approach Area', 'Hyrule Castle East Entry': 0x1b,
'Zora Approach Ledge',
'Zora Approach Water' 'Wooden Bridge Area': 0x1d,
], 'Wooden Bridge Northeast': 0x1d,
0x18: [ 'Wooden Bridge Water': 0x1d,
'Kakariko Area',
'Kakariko Southwest', 'Eastern Palace Area': 0x1e,
'Kakariko Grass Yard'
], 'Blacksmith Area': 0x22,
0x1a: [ 'Bat Cave Ledge': 0x22,
'Forgotten Forest Area'
], 'Sand Dunes Area': 0x25,
0x1b: [
'Hyrule Castle Area', 'Maze Race Area': 0x28,
'Hyrule Castle Southwest', 'Maze Race Ledge': 0x28,
'Hyrule Castle Courtyard', 'Maze Race Prize': 0x28,
'Hyrule Castle Courtyard Northeast',
'Hyrule Castle Ledge', 'Kakariko Suburb Area': 0x29,
'Hyrule Castle East Entry'
], 'Flute Boy Area': 0x2a,
0x1d: [ 'Flute Boy Pass': 0x2a,
'Wooden Bridge Area',
'Wooden Bridge Northeast', 'Central Bonk Rocks Area': 0x2b,
'Wooden Bridge Water'
], 'Links House Area': 0x2c,
0x1e: [
'Eastern Palace Area' 'Stone Bridge Area': 0x2d,
], 'Stone Bridge Water': 0x2d,
0x22: [
'Blacksmith Area', 'Tree Line Area': 0x2e,
'Bat Cave Ledge' 'Tree Line Water': 0x2e,
],
0x25: [ 'Eastern Nook Area': 0x2f,
'Sand Dunes Area'
], 'Desert Area': 0x30,
0x28: [ 'Desert Ledge': 0x30,
'Maze Race Area', 'Desert Palace Entrance (North) Spot': 0x30,
'Maze Race Ledge', 'Desert Checkerboard Ledge': 0x30,
'Maze Race Prize' 'Desert Palace Stairs': 0x30,
], 'Desert Palace Mouth': 0x30,
0x29: [ 'Desert Palace Teleporter Ledge': 0x30,
'Kakariko Suburb Area' 'Bombos Tablet Ledge': 0x30,
],
0x2a: [ 'Flute Boy Approach Area': 0x32,
'Flute Boy Area', 'Flute Boy Bush Entry': 0x32,
'Flute Boy Pass' 'Cave 45 Ledge': 0x32,
],
0x2b: [ 'C Whirlpool Area': 0x33,
'Central Bonk Rocks Area' 'C Whirlpool Water': 0x33,
], 'C Whirlpool Outer Area': 0x33,
0x2c: [
'Links House Area' 'Statues Area': 0x34,
], 'Statues Water': 0x34,
0x2d: [
'Stone Bridge Area', 'Lake Hylia Area': 0x35,
'Stone Bridge Water' 'Lake Hylia South Shore': 0x35,
], 'Lake Hylia Northeast Bank': 0x35,
0x2e: [ 'Lake Hylia Central Island': 0x35,
'Tree Line Area', 'Lake Hylia Island': 0x35,
'Tree Line Water' 'Lake Hylia Water': 0x35,
],
0x2f: [ 'Ice Cave Area': 0x37,
'Eastern Nook Area'
], 'Desert Pass Area': 0x3a,
0x30: [ 'Desert Pass Southeast': 0x3a,
'Desert Area', 'Desert Pass Ledge': 0x3a,
'Desert Ledge',
'Desert Palace Entrance (North) Spot', 'Dam Area': 0x3b,
'Desert Checkerboard Ledge',
'Desert Palace Stairs', 'South Pass Area': 0x3c,
'Desert Palace Mouth',
'Desert Palace Teleporter Ledge', 'Octoballoon Area': 0x3f,
'Bombos Tablet Ledge' 'Octoballoon Water': 0x3f,
], 'Octoballoon Water Ledge': 0x3f,
0x32: [
'Flute Boy Approach Area', 'Skull Woods Forest': 0x40,
'Flute Boy Bush Entry', 'Skull Woods Portal Entry': 0x40,
'Cave 45 Ledge' 'Skull Woods Forest (West)': 0x40,
], 'Skull Woods Forgotten Path (Southwest)': 0x40,
0x33: [ 'Skull Woods Forgotten Path (Northeast)': 0x40,
'C Whirlpool Area',
'C Whirlpool Water', 'Dark Lumberjack Area': 0x42,
'C Whirlpool Outer Area'
], 'West Dark Death Mountain (Top)': 0x43,
0x34: [ 'GT Approach': 0x43,
'Statues Area', 'West Dark Death Mountain (Bottom)': 0x43,
'Statues Water'
], 'East Dark Death Mountain (Top)': 0x45,
0x35: [ 'East Dark Death Mountain (Bottom Left)': 0x45,
'Lake Hylia Area', 'East Dark Death Mountain (Bottom)': 0x45,
'Lake Hylia South Shore',
'Lake Hylia Northeast Bank', 'Turtle Rock Area': 0x47,
'Lake Hylia Central Island', 'Turtle Rock Ledge': 0x47,
'Lake Hylia Island',
'Lake Hylia Water' 'Bumper Cave Area': 0x4a,
], 'Bumper Cave Entrance': 0x4a,
0x37: [ 'Bumper Cave Ledge': 0x4a,
'Ice Cave Area'
], 'Catfish Area': 0x4f,
0x3a: [
'Desert Pass Area', 'Skull Woods Pass West Area': 0x50,
'Desert Pass Southeast', 'Skull Woods Pass East Top Area': 0x50,
'Desert Pass Ledge' 'Skull Woods Pass East Bottom Area': 0x50,
],
0x3b: [ 'Dark Fortune Area': 0x51,
'Dam Area'
], 'Outcast Pond Area': 0x52,
0x3c: [
'South Pass Area' 'Dark Chapel Area': 0x53,
],
0x3f: [ 'Dark Graveyard Area': 0x54,
'Octoballoon Area',
'Octoballoon Water', 'Qirn Jump Area': 0x55,
'Octoballoon Water Ledge' 'Qirn Jump East Bank': 0x55,
], 'Qirn Jump Water': 0x55,
0x40: [
'Skull Woods Forest', 'Dark Witch Area': 0x56,
'Skull Woods Portal Entry', 'Dark Witch Northeast': 0x56,
'Skull Woods Forest (West)', 'Dark Witch Water': 0x56,
'Skull Woods Forgotten Path (Southwest)',
'Skull Woods Forgotten Path (Northeast)' 'Catfish Approach Area': 0x57,
], 'Catfish Approach Ledge': 0x57,
0x42: [ 'Catfish Approach Water': 0x57,
'Dark Lumberjack Area'
], 'Village of Outcasts Area': 0x58,
0x43: [ 'Dark Grassy Lawn': 0x58,
'West Dark Death Mountain (Top)',
'GT Approach', 'Shield Shop Area': 0x5a,
'West Dark Death Mountain (Bottom)' 'Shield Shop Fence': 0x5a,
],
0x45: [ 'Pyramid Area': 0x5b,
'East Dark Death Mountain (Top)', 'Pyramid Exit Ledge': 0x5b,
'East Dark Death Mountain (Bottom Left)', 'Pyramid Pass': 0x5b,
'East Dark Death Mountain (Bottom)'
], 'Broken Bridge Area': 0x5d,
0x47: [ 'Broken Bridge Northeast': 0x5d,
'Turtle Rock Area', 'Broken Bridge West': 0x5d,
'Turtle Rock Ledge' 'Broken Bridge Water': 0x5d,
],
0x4a: [ 'Palace of Darkness Area': 0x5e,
'Bumper Cave Area',
'Bumper Cave Entrance', 'Hammer Pegs Area': 0x62,
'Bumper Cave Ledge' 'Hammer Pegs Entry': 0x62,
],
0x4f: [ 'Dark Dunes Area': 0x65,
'Catfish Area'
], 'Dig Game Area': 0x68,
0x50: [ 'Dig Game Ledge': 0x68,
'Skull Woods Pass West Area',
'Skull Woods Pass East Top Area', 'Frog Area': 0x69,
'Skull Woods Pass East Bottom Area' 'Frog Prison': 0x69,
], 'Archery Game Area': 0x69,
0x51: [
'Dark Fortune Area' 'Stumpy Area': 0x6a,
], 'Stumpy Pass': 0x6a,
0x52: [
'Outcast Pond Area' 'Dark Bonk Rocks Area': 0x6b,
],
0x53: [ 'Big Bomb Shop Area': 0x6c,
'Dark Chapel Area'
], 'Hammer Bridge North Area': 0x6d,
0x54: [ 'Hammer Bridge South Area': 0x6d,
'Dark Graveyard Area' 'Hammer Bridge Water': 0x6d,
],
0x55: [ 'Dark Tree Line Area': 0x6e,
'Qirn Jump Area', 'Dark Tree Line Water': 0x6e,
'Qirn Jump East Bank',
'Qirn Jump Water' 'Palace of Darkness Nook Area': 0x6f,
],
0x56: [ 'Misery Mire Area': 0x70,
'Dark Witch Area', 'Misery Mire Teleporter Ledge': 0x70,
'Dark Witch Northeast',
'Dark Witch Water' 'Stumpy Approach Area': 0x72,
], 'Stumpy Approach Bush Entry': 0x72,
0x57: [
'Catfish Approach Area', 'Dark C Whirlpool Area': 0x73,
'Catfish Approach Ledge', 'Dark C Whirlpool Water': 0x73,
'Catfish Approach Water' 'Dark C Whirlpool Outer Area': 0x73,
],
0x58: [ 'Hype Cave Area': 0x74,
'Village of Outcasts Area', 'Hype Cave Water': 0x74,
'Dark Grassy Lawn'
], 'Ice Lake Area': 0x75,
0x5a: [ 'Ice Lake Northeast Bank': 0x75,
'Shield Shop Area', 'Ice Lake Ledge (West)': 0x75,
'Shield Shop Fence' 'Ice Lake Ledge (East)': 0x75,
], 'Ice Lake Water': 0x75,
0x5b: [ 'Ice Lake Moat': 0x75,
'Pyramid Area', 'Ice Palace Area': 0x75,
'Pyramid Exit Ledge',
'Pyramid Pass' 'Shopping Mall Area': 0x77,
],
0x5d: [ 'Swamp Nook Area': 0x7a,
'Broken Bridge Area',
'Broken Bridge Northeast', 'Swamp Area': 0x7b,
'Broken Bridge West',
'Broken Bridge Water' 'Dark South Pass Area': 0x7c,
],
0x5e: [ 'Bomber Corner Area': 0x7f,
'Palace of Darkness Area' 'Bomber Corner Water': 0x7f,
], 'Bomber Corner Water Ledge': 0x7f,
0x62: [
'Hammer Pegs Area', 'Master Sword Meadow': 0x80,
'Hammer Pegs Entry' 'Hobo Bridge': 0x80,
],
0x65: [ 'Zoras Domain': 0x81
'Dark Dunes Area' })
],
0x68: [
'Dig Game Area',
'Dig Game Ledge'
],
0x69: [
'Frog Area',
'Frog Prison',
'Archery Game Area'
],
0x6a: [
'Stumpy Area',
'Stumpy Pass'
],
0x6b: [
'Dark Bonk Rocks Area'
],
0x6c: [
'Big Bomb Shop Area'
],
0x6d: [
'Hammer Bridge North Area',
'Hammer Bridge South Area',
'Hammer Bridge Water'
],
0x6e: [
'Dark Tree Line Area',
'Dark Tree Line Water'
],
0x6f: [
'Palace of Darkness Nook Area'
],
0x70: [
'Misery Mire Area',
'Misery Mire Teleporter Ledge'
],
0x72: [
'Stumpy Approach Area',
'Stumpy Approach Bush Entry'
],
0x73: [
'Dark C Whirlpool Area',
'Dark C Whirlpool Water',
'Dark C Whirlpool Outer Area'
],
0x74: [
'Hype Cave Area',
'Hype Cave Water'
],
0x75: [
'Ice Lake Area',
'Ice Lake Northeast Bank',
'Ice Lake Ledge (West)',
'Ice Lake Ledge (East)',
'Ice Lake Water',
'Ice Lake Moat',
'Ice Palace Area'
],
0x77: [
'Shopping Mall Area'
],
0x7a: [
'Swamp Nook Area'
],
0x7b: [
'Swamp Area'
],
0x7c: [
'Dark South Pass Area'
],
0x7f: [
'Bomber Corner Area',
'Bomber Corner Water',
'Bomber Corner Water Ledge'
],
0x80: [
'Master Sword Meadow',
'Hobo Bridge'
],
0x81: [
'Zoras Domain'
]
}
OWTileGroups = { OWTileGroups = {
("Woods", "Regular"): ( ("Woods", "Regular"): (

View File

@@ -2,7 +2,7 @@ import random, logging, copy
from BaseClasses import OWEdge, WorldType, RegionType, Direction, Terrain, PolSlot from BaseClasses import OWEdge, WorldType, RegionType, Direction, Terrain, PolSlot
from OWEdges import OWTileRegions, OWTileGroups, OWEdgeGroups, OpenStd, parallel_links, IsParallel from OWEdges import OWTileRegions, OWTileGroups, OWEdgeGroups, OpenStd, parallel_links, IsParallel
__version__ = '0.1.6.7-u' __version__ = '0.1.6.8-u'
def link_overworld(world, player): def link_overworld(world, player):
# setup mandatory connections # setup mandatory connections
@@ -30,18 +30,18 @@ def link_overworld(world, player):
exist_owids.extend(lw_owids) exist_owids.extend(lw_owids)
exist_owids.extend(dw_owids) exist_owids.extend(dw_owids)
for owid in lw_owids: for owid in lw_owids:
exist_lw_regions.extend(OWTileRegions[owid]) exist_lw_regions.extend(OWTileRegions.inverse[owid])
for owid in dw_owids: for owid in dw_owids:
exist_dw_regions.extend(OWTileRegions[owid]) exist_dw_regions.extend(OWTileRegions.inverse[owid])
tile_groups[(name,)] = (exist_owids, exist_lw_regions, exist_dw_regions) tile_groups[(name,)] = (exist_owids, exist_lw_regions, exist_dw_regions)
else: else:
(exist_owids, exist_lw_regions, exist_dw_regions) = tile_groups[(name, groupType)] (exist_owids, exist_lw_regions, exist_dw_regions) = tile_groups[(name, groupType)]
exist_owids.extend(lw_owids) exist_owids.extend(lw_owids)
exist_owids.extend(dw_owids) exist_owids.extend(dw_owids)
for owid in lw_owids: for owid in lw_owids:
exist_lw_regions.extend(OWTileRegions[owid]) exist_lw_regions.extend(OWTileRegions.inverse[owid])
for owid in dw_owids: for owid in dw_owids:
exist_dw_regions.extend(OWTileRegions[owid]) exist_dw_regions.extend(OWTileRegions.inverse[owid])
tile_groups[(name, groupType)] = (exist_owids, exist_lw_regions, exist_dw_regions) tile_groups[(name, groupType)] = (exist_owids, exist_lw_regions, exist_dw_regions)
#tile shuffle happens here, the groups that remain in the list are the tiles that get swapped #tile shuffle happens here, the groups that remain in the list are the tiles that get swapped
@@ -143,55 +143,6 @@ def link_overworld(world, player):
region = world.get_region(name, player) region = world.get_region(name, player)
region.type = RegionType.LightWorld region.type = RegionType.LightWorld
# flute shuffle
def connect_flutes(flute_destinations):
for o in range(0, len(flute_destinations)):
owslot = flute_destinations[o]
regions = flute_data[owslot][0]
if (world.mode[player] == 'inverted') == (flute_data[owslot][1] in world.owswaps[player][0] and world.owSwap[player] == 'mixed'):
connect_simple(world, 'Flute Spot ' + str(o + 1), regions[0], player)
else:
connect_simple(world, 'Flute Spot ' + str(o + 1), regions[1], player)
if world.owFluteShuffle[player] == 'vanilla':
connect_flutes(default_flute_connections)
else:
flute_pool = list(flute_data.keys())
new_spots = list()
# guarantee desert/mire access
flute_pool.remove(0x38)
new_spots.append(0x38)
# guarantee mountain access
mountainIds = [0x0b, 0x0e, 0x07]
owslot = mountainIds[random.randint(0, 2)]
flute_pool.remove(owslot)
new_spots.append(owslot)
random.shuffle(flute_pool)
f = 0
while len(new_spots) < 8:
if f >= len(flute_pool):
f = 0
if world.owFluteShuffle[player] == 'balanced':
if (flute_pool[f] + 1 in new_spots \
or flute_pool[f] - 1 in new_spots \
or flute_pool[f] + 8 in new_spots \
or flute_pool[f] - 8 in new_spots) \
or (random.randint(0, 31) != 0 \
and (flute_pool[f] + 7 in new_spots
or flute_pool[f] - 7 in new_spots
or flute_pool[f] + 9 in new_spots
or flute_pool[f] - 9 in new_spots)):
f += 1
continue
if flute_pool[f] not in new_spots:
new_spots.append(flute_pool[f])
f += 1
new_spots.sort()
world.owflutespots[player] = new_spots
connect_flutes(new_spots)
# make new connections # make new connections
for owid in ow_connections.keys(): for owid in ow_connections.keys():
if (world.mode[player] == 'inverted') == (owid in world.owswaps[player][0] and world.owSwap[player] == 'mixed'): if (world.mode[player] == 'inverted') == (owid in world.owswaps[player][0] and world.owSwap[player] == 'mixed'):
@@ -261,6 +212,72 @@ def link_overworld(world, player):
assert len(connected_edges) == len(default_connections) * 2, connected_edges assert len(connected_edges) == len(default_connections) * 2, connected_edges
# flute shuffle
def connect_flutes(flute_destinations):
for o in range(0, len(flute_destinations)):
owslot = flute_destinations[o]
regions = flute_data[owslot][0]
if (world.mode[player] == 'inverted') == (flute_data[owslot][1] in world.owswaps[player][0] and world.owSwap[player] == 'mixed'):
connect_simple(world, 'Flute Spot ' + str(o + 1), regions[0], player)
else:
connect_simple(world, 'Flute Spot ' + str(o + 1), regions[1], player)
if world.owFluteShuffle[player] == 'vanilla':
connect_flutes(default_flute_connections)
else:
flute_pool = list(flute_data.keys())
new_spots = list()
ignored_regions = set()
def addSpot(owid, removeFromPool = False):
if world.owFluteShuffle[player] == 'balanced':
def getIgnored(regionname, base_owid, owid):
region = world.get_region(regionname, player)
for exit in region.exits:
if exit.connected_region is not None and exit.connected_region.type in [RegionType.LightWorld, RegionType.DarkWorld] and exit.connected_region.name not in new_ignored:
if OWTileRegions[exit.connected_region.name] in [base_owid, owid] or OWTileRegions[regionname] == base_owid:
new_ignored.add(exit.connected_region.name)
getIgnored(exit.connected_region.name, base_owid, OWTileRegions[exit.connected_region.name])
if (world.mode[player] == 'inverted') == (flute_data[owid][1] in world.owswaps[player][0] and world.owSwap[player] == 'mixed'):
new_region = flute_data[owid][0][0]
else:
new_region = flute_data[owid][0][1]
if new_region in ignored_regions:
return False
new_ignored = {new_region}
getIgnored(new_region, OWTileRegions[new_region], OWTileRegions[new_region])
if random.randint(0, 31) != 0 and new_ignored.intersection(ignored_regions):
return False
ignored_regions.update(new_ignored)
if removeFromPool:
flute_pool.remove(owid)
new_spots.append(owid)
return True
# guarantee desert/mire access
addSpot(0x38, True)
# guarantee mountain access
if world.owShuffle[player] == 'vanilla':
mountainIds = [0x0b, 0x0e, 0x07]
addSpot(mountainIds[random.randint(0, 2)], True)
random.shuffle(flute_pool)
f = 0
while len(new_spots) < 8:
if f >= len(flute_pool):
f = 0
if flute_pool[f] not in new_spots:
addSpot(flute_pool[f])
f += 1
new_spots.sort()
world.owflutespots[player] = new_spots
connect_flutes(new_spots)
def connect_custom(world, connected_edges, player): def connect_custom(world, connected_edges, player):
if hasattr(world, 'custom_overworld') and world.custom_overworld[player]: if hasattr(world, 'custom_overworld') and world.custom_overworld[player]:
for edgename1, edgename2 in world.custom_overworld[player]: for edgename1, edgename2 in world.custom_overworld[player]:

2
Rom.py
View File

@@ -894,7 +894,7 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False):
write_int16(rom, 0x187010, credits_total) # dynamic credits write_int16(rom, 0x187010, credits_total) # dynamic credits
if credits_total != 216: if credits_total != 216:
# collection rate address: # collection rate address:
cr_address = 0x2391C4 cr_address = 0x2391C2
cr_pc = cr_address - 0x120000 # convert to pc cr_pc = cr_address - 0x120000 # convert to pc
mid_top, mid_bot = credits_digit((credits_total // 10) % 10) mid_top, mid_bot = credits_digit((credits_total // 10) % 10)
last_top, last_bot = credits_digit(credits_total % 10) last_top, last_bot = credits_digit(credits_total % 10)