vt23 updates

This commit is contained in:
LLCoolDave 2017-06-23 21:33:04 +02:00
parent 4ec20fa997
commit 350c688d93
6 changed files with 25 additions and 54 deletions

View File

@ -25,7 +25,6 @@ class World(object):
self.spoiler = ''
self.required_locations = []
self.place_dungeon_items = place_dungeon_items # configurable in future
self.agahnim_fix_required = False
self.swamp_patch_required = False
self.sewer_light_cone = mode == 'standard'
self.light_world_light_cone = False
@ -33,10 +32,11 @@ class World(object):
self.treasure_hunt_count = 0
self.treasure_hunt_icon = 'Power Star'
self.clock_mode = 'off'
self.aga_randomness = 'off'
self.aga_randomness = False
self.lock_aga_door_in_escape = False
self.fix_door_frames = self.shuffle not in ['vanilla', 'dungeonssimple', 'dungeonsfull']
self.fix_trock_doors = self.shuffle != 'vanilla'
self.save_and_quite_from_boss = False
def get_region(self, regionname):
if isinstance(regionname, Region):

View File

@ -287,7 +287,7 @@ def link_entrances(world):
lw_entrances_must_exits = list(LW_Dungeon_Entrances_Must_Exit)
old_man_entrances = list(Old_Man_Entrances)
mandatory_light_world = ['Agahnims Tower Exit', 'Old Man House Exit (Bottom)', 'Old Man House Exit (Top)']
mandatory_light_world = ['Old Man House Exit (Bottom)', 'Old Man House Exit (Top)']
mandatory_dark_world = []
caves = list(Cave_Exits + Dungeon_Exits + Cave_Three_Exits)
@ -512,7 +512,7 @@ def link_entrances(world):
old_man_entrances = list(Old_Man_Entrances)
caves = Cave_Exits + Dungeon_Exits + Cave_Three_Exits + ['Old Man House Exit (Bottom)', 'Old Man House Exit (Top)', 'Skull Woods First Section Exit', 'Skull Woods Second Section Exit (East)', 'Skull Woods Second Section Exit (West)',
'Kakariko Well Exit', 'Bat Cave Exit', 'North Fairy Cave Exit', 'Thieves Forest Hideout Exit', 'Lumberjack Tree Exit', 'Sanctuary Exit']
'Kakariko Well Exit', 'Bat Cave Exit', 'North Fairy Cave Exit', 'Thieves Forest Hideout Exit', 'Lumberjack Tree Exit', 'Sanctuary Exit', 'Agahnims Tower Exit']
# shuffle up holes
@ -593,25 +593,6 @@ def link_entrances(world):
ret.append(connect_entrance(world, doors.pop(), 'Old Man Cave Exit (East)'))
caves.append('Old Man Cave Exit (West)')
# Aghanim needs to be Light World to spawn
# find suitable LW Entrance
lw_entrances = LW_Entrances + LW_Dungeon_Entrances + LW_Dungeon_Entrances_Must_Exit + Old_Man_Entrances + \
['Kakariko Well Cave', 'Bat Cave Cave', 'North Fairy Cave', 'Sanctuary', 'Thieves Forest Hideout Stump', 'Lumberjack Tree Cave', 'Hyrule Castle Entrance (South)', 'Hyrule Castle Secret Entrance Stairs']
candidate = None
for entrance in entrances:
if entrance in lw_entrances:
candidate = entrance
break
# should always have enough candidates left here, should never happen
if candidate is None:
raise RuntimeError('Your Algorithm is broken.')
entrances.remove(candidate)
ret.append(connect_exit(world, 'Agahnims Tower Exit', candidate))
ret.append(connect_entrance(world, doors.pop(), 'Agahnims Tower Exit'))
# handle remaining caves
for cave in caves:
if isinstance(cave, str):
@ -652,22 +633,6 @@ def link_entrances(world):
else:
raise NotImplementedError('Shuffling not supported yet')
if world.agahnim_fix_required:
# need to swap contents of Mimic Cave and TRock Ledge Right so Agahnim 1 is in Light World!
ret.append('Fix to prevent Agahnim Softlock: Swap Contents of Turtle Rock Ledge (East) and Mimic Cave:')
mimic_cave_entrance = world.get_entrance('Mimic Cave Mirror Spot')
ddmle_entrance = world.get_entrance('Dark Death Mountain Ledge (East)')
aga_tower = world.get_region('Agahnims Tower')
mimic_cave_target = mimic_cave_entrance.connected_region
mimic_cave_target.entrances.remove(mimic_cave_entrance)
aga_tower.entrances.remove(ddmle_entrance)
ddmle_entrance.connect(mimic_cave_target, door_addresses['Dark Death Mountain Ledge (East)'][0], exit_ids[mimic_cave_target.name])
ret.append('Dark Death Mountain Ledge (East) => %s' % mimic_cave_target.name)
mimic_cave_entrance.connect(aga_tower, door_addresses['Mimic Cave Mirror Spot'], exit_ids['Agahnims Tower Exit'][0])
ret.append('Mimic Cave Mirror Spot => Agahnims Tower Exit')
# check for swamp palace fix
if world.get_entrance('Dam').connected_region.name != 'Dam' or world.get_entrance('Swamp Palace').connected_region.name != 'Swamp Palace (Entrance)':
world.swamp_patch_required = True
@ -905,7 +870,6 @@ def simple_shuffle_dungeons(world):
ret.append(connect_two_way(world, 'Turtle Rock Isolated Ledge Entrance', 'Hyrule Castle Exit (East)'))
ret.append(connect_two_way(world, 'Dark Death Mountain Ledge (West)', 'Hyrule Castle Exit (West)'))
ret.append(connect_two_way(world, 'Dark Death Mountain Ledge (East)', 'Agahnims Tower Exit'))
world.agahnim_fix_required = True # need this for now
if dp_target == 'Hyrule Castle':
ret.append(connect_two_way(world, 'Hyrule Castle Entrance (South)', 'Desert Palace Exit (South)'))
@ -965,7 +929,7 @@ DW_Dungeon_Entrances = ['Thieves Town',
DW_Dungeon_Entrances_Must_Exit = ['Dark Death Mountain Ledge (East)',
'Turtle Rock Isolated Ledge Entrance']
LW_Dungeon_Exits = ['Agahnims Tower Exit']
LW_Dungeon_Exits = []
Dungeon_Exits = [('Desert Palace Exit (South)', 'Desert Palace Exit (West)', 'Desert Palace Exit (East)'),
'Desert Palace Exit (North)',
@ -977,6 +941,7 @@ Dungeon_Exits = [('Desert Palace Exit (South)', 'Desert Palace Exit (West)', 'De
'Misery Mire Exit',
'Dark Palace Exit',
'Swamp Palace Exit',
'Agahnims Tower Exit',
('Turtle Rock Exit (Front)', 'Turtle Rock Ledge Exit (East)', 'Turtle Rock Ledge Exit (West)', 'Turtle Rock Isolated Ledge Exit')]
DW_Entrances_Must_Exit = ['Bumper Cave (Top)', 'Hookshot Cave Back Entrance']

View File

@ -470,7 +470,6 @@ def copy_world(world):
# ToDo: Not good yet
ret = World(world.shuffle, world.logic, world.mode, world.difficulty, world.goal, world.algorithm, world.place_dungeon_items)
ret.required_medallions = list(world.required_medallions)
ret.agahnim_fix_required = world.agahnim_fix_required
ret.swamp_patch_required = world.swamp_patch_required
ret.treasure_hunt_count = world.treasure_hunt_count
ret.treasure_hunt_icon = world.treasure_hunt_icon

20
Rom.py
View File

@ -8,7 +8,7 @@ import hashlib
import logging
JAP10HASH = '03a63945398191337e896e5771f77173'
RANDOMIZERBASEHASH = 'd5b61947feef1972e0f546ba43180e62'
RANDOMIZERBASEHASH = '89fcdb48446bd858878f14e8a994d0b8'
def patch_rom(world, rom, hashtable, quickswap=False, beep='normal', sprite=None):
@ -181,6 +181,12 @@ def patch_rom(world, rom, hashtable, quickswap=False, beep='normal', sprite=None
write_byte(rom, 0x34914, 0x3A) # Bow and Arrow
write_byte(rom, 0x180028, 0x49) # Fighter Sword
# set swordless mode settings
write_byte(rom, 0x18003F, 0x01 if world.mode == 'swordless' else 0x00) # hammer can harm ganon
write_byte(rom, 0x180040, 0x01 if world.mode == 'swordless' else 0x00) # open curtains
write_byte(rom, 0x180041, 0x01 if world.mode == 'swordless' else 0x00) # swordless medallions
write_byte(rom, 0x180042, 0xFF if world.mode == 'swordless' else 0x00) # starting sword for link
# set up clocks for timed modes
if world.clock_mode == 'off':
write_bytes(rom, 0x180190, [0x00, 0x00, 0x00]) # turn off clock mode
@ -215,10 +221,20 @@ def patch_rom(world, rom, hashtable, quickswap=False, beep='normal', sprite=None
write_byte(rom, 0x180030, 0x00) # Disable SRAM trace
write_byte(rom, 0x180036, 0x0A) # Rupoor negative value
write_byte(rom, 0x180169, 0x01 if world.lock_aga_door_in_escape else 0x00) # Lock or unlock aga tower door during escape sequence.
write_byte(rom, 0x180086, 0x00 if world.aga_randomness == 'vanilla' else 0x02 if world.aga_randomness == 'table' else 0x01) # set blue ball and ganon warp randomness
write_byte(rom, 0x180086, 0x00 if world.aga_randomness else 0x01) # set blue ball and ganon warp randomness
write_byte(rom, 0x1800A1, 0x01) # enable overworld screen transition draining for water level inside swamp
if world.goal in ['pedestal', 'starhunt', 'triforcehunt']:
write_byte(rom, 0x18003E, 0x01) # make ganon invincible
elif world.goal in ['dungeons']:
write_byte(rom, 0x18003E, 0x02) # make ganon invincible until all dungeons are beat
write_byte(rom, 0x18016A, 0x00) # disable free roaming item text boxes
write_byte(rom, 0x18003B, 0x00) # disable maps showing crystals on overworld
write_byte(rom, 0x18003C, 0x00) # disable compasses showing dungeon count
digging_game_rng = random.randint(1, 30) # set rng for digging game
write_byte(rom, 0x180020, digging_game_rng)
write_byte(rom, 0xEFD95, digging_game_rng)
write_byte(rom, 0x1800A3, 0x01) # enable correct world setting behaviour after agahnim kills
write_byte(rom, 0x180042, 0x01 if world.save_and_quite_from_boss else 0x00) # Allow Save and Quite after boss kill
# remove shield from uncle
write_bytes(rom, 0x6D253, [0x00, 0x00, 0xf6, 0xff, 0x00, 0x0E])

View File

@ -373,15 +373,6 @@ def standard_rules(world):
forbid_item(world.get_location('[dungeon-C-B1] Escape - Final Basement Room [right chest]'), 'Small Key (Escape)')
forbid_item(world.get_location('[dungeon-C-1F] Sanctuary'), 'Small Key (Escape)')
# don't put gloves in link's house or someone could escape in rain state ...
forbid_item(world.get_location('[cave-040] Links House'), 'Power Glove')
forbid_item(world.get_location('[cave-040] Links House'), 'Titans Mitts')
forbid_item(world.get_location('[cave-040] Links House'), 'Progressive Glove')
add_rule(world.get_location('[dungeon-C-B1] Escape - Final Basement Room [left chest]'), lambda state: state.can_reach('Sewer Drop'))
add_rule(world.get_location('[dungeon-C-B1] Escape - Final Basement Room [middle chest]'), lambda state: state.can_reach('Sewer Drop'))
add_rule(world.get_location('[dungeon-C-B1] Escape - Final Basement Room [right chest]'), lambda state: state.can_reach('Sewer Drop'))
add_rule(world.get_location('[dungeon-C-B1] Escape - First B1 Room'), lambda state: state.can_reach('Sewer Drop') or (state.world.get_location('[dungeon-C-B1] Escape - First B1 Room').item is not None and state.world.get_location('[dungeon-C-B1] Escape - First B1 Room').item.name in ['Small Key (Escape)'])) # you could skip this chest and be unable to go back until you can drop into escape
def set_trock_key_rules(world):
# this is good enough to allow even key distribution but may still prevent certain valid item combinations from being placed

File diff suppressed because one or more lines are too long