Add new Full Shuffle

Add stubs for other new modes
This commit is contained in:
Kevin Cathcart 2018-01-18 21:36:06 -05:00
parent 3becad7c10
commit 8672099a3c
4 changed files with 181 additions and 5 deletions

View File

@ -125,6 +125,10 @@ def link_entrances(world):
# place remaining doors
connect_doors(world, single_doors, door_targets)
elif world.shuffle == 'new_restricted':
# TODO
raise NotImplementedError()
# TODO: decide if we need a new restricted cross_worlds mode
elif world.shuffle == 'restricted':
simple_shuffle_dungeons(world)
@ -184,6 +188,100 @@ def link_entrances(world):
elif world.shuffle == 'full':
skull_woods_shuffle(world)
lw_entrances = list(LW_Entrances + LW_Dungeon_Entrances + LW_Single_Cave_Doors)
dw_entrances = list(DW_Entrances + DW_Dungeon_Entrances + DW_Single_Cave_Doors)
dw_must_exits = list(DW_Entrances_Must_Exit + DW_Dungeon_Entrances_Must_Exit)
lw_must_exits = list(LW_Dungeon_Entrances_Must_Exit)
old_man_entrances = list(Old_Man_Entrances)
caves = list(Cave_Exits + Dungeon_Exits + Cave_Three_Exits) # don't need to consider three exit caves, have one exit caves to avoid parity issues
bomb_shop_doors = list(Bomb_Shop_Single_Cave_Doors + Bomb_Shop_Multi_Cave_Doors)
blacksmith_doors = list(Blacksmith_Single_Cave_Doors + Blacksmith_Multi_Cave_Doors)
door_targets = list(Single_Cave_Targets)
# tavern back door cannot be shuffled yet
connect_doors(world, ['Tavern North'], ['Tavern'])
if world.mode == 'standard':
# must connect front of hyrule castle to do escape
connect_two_way(world, 'Hyrule Castle Entrance (South)', 'Hyrule Castle Exit (South)')
else:
caves.append(('Hyrule Castle Exit (South)', 'Hyrule Castle Exit (West)', 'Hyrule Castle Exit (East)'))
lw_entrances.append('Hyrule Castle Entrance (South)')
if not world.shuffle_ganon:
connect_two_way(world, 'Ganons Tower', 'Ganons Tower Exit')
else:
dw_entrances.append('Ganons Tower')
caves.append('Ganons Tower Exit')
# we randomize which world requirements we fulfill first so we get better dungeon distribution
if random.randint(0, 1) == 0:
connect_mandatory_exits(world, lw_entrances, caves, lw_must_exits)
connect_mandatory_exits(world, dw_entrances, caves, dw_must_exits)
else:
connect_mandatory_exits(world, dw_entrances, caves, dw_must_exits)
connect_mandatory_exits(world, lw_entrances, caves, lw_must_exits)
if world.mode == 'standard':
# rest of hyrule castle must be in light world to avoid fake darkworld stuff
connect_caves(world, lw_entrances, [], [('Hyrule Castle Exit (West)', 'Hyrule Castle Exit (East)')])
connect_caves(world, lw_entrances, [], list(LW_Dungeon_Exits)) # Agahnim must be light world
# place old man, has limited options
# exit has to come from specific set of doors, the entrance is free to move about
random.shuffle(old_man_entrances)
old_man_exit = old_man_entrances.pop()
connect_two_way(world, old_man_exit, 'Old Man Cave Exit (East)')
lw_entrances.extend(old_man_entrances)
# place blacksmith, has limited options
# cannot place it anywhere already taken
all_entrances = lw_entrances + dw_entrances
blacksmith_doors = [door for door in blacksmith_doors if door in all_entrances]
random.shuffle(blacksmith_doors)
blacksmith_hut = blacksmith_doors.pop()
connect_entrance(world, blacksmith_hut, 'Blacksmiths Hut')
if blacksmith_hut in lw_entrances:
lw_entrances.remove(blacksmith_hut)
if blacksmith_hut in dw_entrances:
dw_entrances.remove(blacksmith_hut)
bomb_shop_doors.extend(blacksmith_doors)
# place dam and pyramid fairy, have limited options
all_entrances = lw_entrances + dw_entrances
bomb_shop_doors = [door for door in bomb_shop_doors if door in all_entrances]
random.shuffle(bomb_shop_doors)
bomb_shop = bomb_shop_doors.pop()
connect_entrance(world, bomb_shop, 'Big Bomb Shop')
if bomb_shop in lw_entrances:
lw_entrances.remove(bomb_shop)
if bomb_shop in dw_entrances:
dw_entrances.remove(bomb_shop)
# place the old man cave's entrance somewhere in the light world
random.shuffle(lw_entrances)
old_man_entrance = lw_entrances.pop()
connect_two_way(world, old_man_entrance, 'Old Man Cave Exit (West)')
# place Old Man House in Light World, so using the s&q point does not cause fake dark world
connect_caves(world, lw_entrances, [], [('Old Man House Exit (Bottom)', 'Old Man House Exit (Top)')])
# now scramble the rest
connect_caves(world, lw_entrances, dw_entrances, caves)
# scramble holes
scramble_holes(world)
doors = lw_entrances + dw_entrances
# place remaining doors
connect_doors(world, doors, door_targets)
elif world.shuffle == 'new_full_cross_worlds':
# TODO
raise NotImplementedError()
elif world.shuffle == 'full_legacy':
skull_woods_shuffle(world)
lw_entrances = list(LW_Entrances + LW_Dungeon_Entrances)
dw_entrances = list(DW_Entrances + DW_Dungeon_Entrances)
dw_must_exits = list(DW_Entrances_Must_Exit + DW_Dungeon_Entrances_Must_Exit)
@ -497,7 +595,9 @@ def link_entrances(world):
# place remaining doors
connect_doors(world, single_doors, door_targets)
elif world.shuffle == 'new_insanity':
# TODO
raise NotImplementedError()
elif world.shuffle == 'insanity':
world.fix_fake_world = False
# beware ye who enter here
@ -1001,6 +1101,83 @@ DW_Entrances = ['Bumper Cave (Bottom)',
'Superbunny Cave (Bottom)',
'Hookshot Cave']
# TODO: Fill this in. Any entries added here must be properly accounted for in the special bomb shop logic rules
Bomb_Shop_Multi_Cave_Doors = []
# TODO: Fill this in. Any entries added here must be properly accounted for in the special bomb shop logic rules
# because any unused blacksmith shop location is rolled over as a possible bomb shop location
Blacksmith_Multi_Cave_Doors = []
LW_Single_Cave_Doors = ['Blinds Hideout',
'Lake Hylia Fairy',
'Swamp Fairy',
'Desert Fairy',
'Chicken House',
'Aginahs Cave',
'Sahasrahlas Hut',
'Cave Shop (Lake Hylia)',
'Blacksmiths Hut',
'Sick Kids House',
'Lost Woods Gamble',
'Fortune Teller (Light)',
'Snitch Lady (East)',
'Snitch Lady (West)',
'Bush Covered House',
'Tavern (Front)',
'Light World Bomb Hut',
'Kakariko Shop',
'Mini Moldorm Cave',
'Long Fairy Cave',
'Good Bee Cave',
'20 Rupee Cave',
'50 Rupee Cave',
'Ice Rod Cave',
'Library',
'Potion Shop',
'Dam',
'Lumberjack House',
'Lake Hylia Fortune Teller',
'Kakariko Gamble Game',
'Waterfall of Wishing',
'Capacity Upgrade',
'Bonk Rock Cave',
'Graveyard Cave',
'Checkerboard Cave',
'Cave 45',
'Kings Grave',
'Bonk Fairy (Light)',
'Hookshot Fairy',
'Mimic Cave']
DW_Single_Cave_Doors = ['Bonk Fairy (Dark)',
'Dark Sanctuary Hint',
'Dark Lake Hylia Fairy',
'C-Shaped House',
'Big Bomb Shop',
'Dark Death Mountain Fairy',
'Dark Lake Hylia Shop',
'Dark World Shop',
'Red Shield Shop',
'Mire Shed',
'East Dark World Hint',
'Dark Desert Hint',
'Spike Cave',
'Palace of Darkness Hint',
'Dark Lake Hylia Ledge Spike Cave',
'Cave Shop (Dark Death Mountain)',
'Dark World Potion Shop',
'Pyramid Fairy',
'Archery Game',
'Dark World Lumberjack Shop',
'Hype Cave',
'Brewery',
'Dark Lake Hylia Ledge Hint',
'Chest Game',
'Dark Desert Fairy',
'Dark Lake Hylia Ledge Fairy',
'Fortune Teller (Dark)',
'Dark World Hammer Peg Cave']
Blacksmith_Single_Cave_Doors = ['Blinds Hideout',
'Lake Hylia Fairy',
'Swamp Fairy',

View File

@ -285,7 +285,6 @@ def create_playthrough(world):
old_world.spoiler.paths = {location.name : get_path(state, location.parent_region) for sphere in collection_spheres for location in sphere}
if any(exit == 'Pyramid Fairy' for path in old_world.spoiler.paths.values() for (_, exit) in path):
old_world.spoiler.paths['Big Bomb Shop'] = get_path(state, world.get_region('Big Bomb Shop'))
print(world.seed)
# we can finally output our playthrough
old_world.spoiler.playthrough = OrderedDict([(str(i + 1), {str(location): str(location.item) for location in sphere}) for i, sphere in enumerate(collection_spheres)])

4
Rom.py
View File

@ -15,7 +15,7 @@ from Items import ItemFactory
JAP10HASH = '03a63945398191337e896e5771f77173'
RANDOMIZERBASEHASH = '214e4b2a50cb65cd13a8194bc88cb030'
RANDOMIZERBASEHASH = 'fbd91e1eeaf168cff1a6d58c6e193761'
class JsonRom(object):
@ -326,7 +326,7 @@ def patch_rom(world, rom, hashtable, beep='normal', sprite=None):
rom.write_byte(0x15DB5 + 2 * offset, 0x00A4)
else:
rom.write_int16_to_rom(0x15DB5 + 2 * offset, link_y)
rom.write_int16_to_rom(0x15E53 + 2 * offset, link_x)
rom.write_int16_to_rom(0x15EF1 + 2 * offset, camera_y)
rom.write_int16_to_rom(0x15F8F + 2 * offset, camera_x)

File diff suppressed because one or more lines are too long