Update to v22 rom and logic.

This commit is contained in:
LLCoolDave 2017-06-03 21:27:34 +02:00
parent aa909f2eaf
commit 2ef977b386
6 changed files with 15 additions and 14 deletions

View File

@ -26,7 +26,7 @@ class World(object):
self.agahnim_fix_required = False
self.swamp_patch_required = False
self.sewer_light_cone = mode == 'standard'
self.light_world_light_cone = mode == 'standard' # to be changed for v22 ToDo
self.light_world_light_cone = False
self.dark_world_light_cone = False
def get_region(self, regionname):

View File

@ -46,7 +46,7 @@ item_table = {'Bow': (True, False, False, 0x0B, 'You have\nchosen the\narcher cl
'Flippers': (True, False, False, 0x1E, 'fancy a swim?', None, None, None, None, None),
'Ice Rod': (True, False, False, 0x08, 'I\'m the cold\nrod. I make\nthings freeze!', None, None, None, None, None),
'Titans Mitts': (True, False, False, 0x1C, 'Now you can\nlift heavy\nstuff!', None, None, None, None, None),
'Ether': (True, False, False, 0x10, 'Zero Kelvin!\nAbsolute zero!\nFear the cold!', None, None, None, None, None),
'Ether': (True, False, False, 0x10, 'This magic\ncoin freezes\neverything!', None, None, None, None, None),
'Bombos': (True, False, False, 0x0F, 'Burn, baby,\nburn! Fear my\nring of fire!', None, None, None, None, None),
'Quake': (True, False, False, 0x11, 'Maxing out the\nRichter scale\nis what I do!', None, None, None, None, None),
'Bottle': (True, False, False, 0xFF, 'Now you can\nstore potions\nand stuff!', None, None, None, None, None), # specific content written on creation

16
Rom.py
View File

@ -8,7 +8,7 @@ import hashlib
import logging
JAP10HASH = '03a63945398191337e896e5771f77173'
RANDOMIZERBASEHASH = 'de0100dc53a8e755a0fa9a3f15f1d100'
RANDOMIZERBASEHASH = 'ab6634609335a28e99bd915c7b1f3906'
def patch_rom(world, rom, hashtable, quickswap=False, beep='normal', sprite=None):
@ -178,6 +178,8 @@ def patch_rom(world, rom, hashtable, quickswap=False, beep='normal', sprite=None
# assorted fixes
write_byte(rom, 0x180030, 0x00) # Disable SRAM trace
write_byte(rom, 0x180036, 0x0A) # Rupoor negative value
if world.goal == 'pedestal':
write_byte(rom, 0x18003E, 0x01) # make ganon invincible
# remove shield from uncle
write_bytes(rom, 0x6D253, [0x00, 0x00, 0xf6, 0xff, 0x00, 0x0E])
@ -190,10 +192,7 @@ def patch_rom(world, rom, hashtable, quickswap=False, beep='normal', sprite=None
if world.swamp_patch_required:
# patch swamp: Need to enable permanent drain of water as dam or swamp were moved
rom = rom.replace(bytearray([0xAF, 0xBB, 0xF2, 0x7E, 0x29, 0xDF, 0x8F, 0xBB, 0xF2, 0x7E]), bytearray([0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA]))
rom = rom.replace(bytearray([0xAF, 0xFB, 0xF2, 0x7E, 0x29, 0xDF, 0x8F, 0xFB, 0xF2, 0x7E]), bytearray([0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA]))
rom = rom.replace(bytearray([0xAF, 0x16, 0xF2, 0x7E, 0x29, 0x7F, 0x8F, 0x16, 0xF2, 0x7E]), bytearray([0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA]))
rom = rom.replace(bytearray([0xAF, 0x51, 0xF0, 0x7E, 0x29, 0xFE, 0x8F, 0x51, 0xF0, 0x7E]), bytearray([0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA]))
write_byte(rom, 0x1800A1, 0x01)
# set correct flag for hera basement item
if world.get_location('[dungeon-L3-1F] Tower of Hera - Freestanding Key').item is not None and world.get_location('[dungeon-L3-1F] Tower of Hera - Freestanding Key').item.name == 'Small Key (Tower of Hera)':
@ -285,7 +284,10 @@ def write_strings(rom, world):
write_string_to_rom(rom, 'PyramidFairy', PyramidFairy_texts[random.randint(0, len(PyramidFairy_texts) - 1)])
write_string_to_rom(rom, 'Sahasrahla2', Sahasrahla2_texts[random.randint(0, len(Sahasrahla2_texts) - 1)])
write_string_to_rom(rom, 'Blind', Blind_texts[random.randint(0, len(Blind_texts) - 1)])
write_string_to_rom(rom, 'Ganon1', Ganon1_texts[random.randint(0, len(Ganon1_texts) - 1)])
if world.goal == 'pedestal':
write_string_to_rom(rom, 'Ganon1', 'Why are you even here?\n You can\'t even hurt me!')
else:
write_string_to_rom(rom, 'Ganon1', Ganon1_texts[random.randint(0, len(Ganon1_texts) - 1)])
write_string_to_rom(rom, 'TavernMan', TavernMan_texts[random.randint(0, len(TavernMan_texts) - 1)])
altaritem = world.get_location('Altar').item
@ -334,7 +336,7 @@ def patch_base_rom(rom):
rom.extend(bytearray([0x00]*(2097152 - len(rom))))
# load randomizer patches
patches = json.load(open('romreset.json', 'r')) + json.load(open('base2current.json', 'r'))
patches = json.load(open('base2current.json', 'r'))
for patch in patches:
if isinstance(patch, dict):
for baseaddress, values in patch.items():

View File

@ -84,11 +84,11 @@ def global_rules(world):
set_rule(world.get_entrance('South Hyrule Teleporter'), lambda state: state.has('Hammer') and state.can_lift_rocks() and state.has_Pearl())
set_rule(world.get_entrance('Kakariko Teleporter'), lambda state: ((state.has('Hammer') and state.can_lift_rocks()) or state.can_lift_heavy_rocks()) and state.has_Pearl())
set_rule(world.get_location('Haunted Grove'), lambda state: state.has('Shovel'))
set_rule(world.get_location('Purple Chest'), lambda state: state.can_reach('Blacksmiths', 'Location'))
set_rule(world.get_location('Purple Chest'), lambda state: state.can_reach('Blacksmiths', 'Location') and state.has_Mirror()) # ToDo check if can S&Q with chest to avoid mirror
set_rule(world.get_location('Piece of Heart (Zoras River)'), lambda state: state.has('Flippers'))
set_rule(world.get_entrance('Waterfall of Wishing'), lambda state: state.has('Flippers')) # can be fake flippered into, but is in weird state inside that might prevent you from doing things. Can be improved in future Todo
set_rule(world.get_location('Blacksmiths'), lambda state: state.can_lift_heavy_rocks() and state.has_Mirror() and state.can_reach('West Dark World'))
set_rule(world.get_location('Blacksmiths'), lambda state: state.can_lift_heavy_rocks() and state.can_reach('West Dark World'))
set_rule(world.get_location('Magic Bat'), lambda state: state.has('Magic Powder'))
set_rule(world.get_location('Sick Kid'), lambda state: state.has('Bottle'))
set_rule(world.get_location('Library'), lambda state: state.has_Boots())
@ -388,7 +388,7 @@ def set_blacksmith_rules(world):
blacksmith_entrance = world.get_region('Blacksmiths Hut').entrances[0]
# some special handling if shuffled as we cannot use connected caves to take the smith up to death mountain
if blacksmith_entrance.name == 'Hookshot Fairy':
add_rule(world.get_location('Blacksmiths'), lambda state: state.has('Ocarina') and (state.has('Hammer') or state.has('Hookshot')))
add_rule(world.get_location('Blacksmiths'), lambda state: state.has('Ocarina') and (state.has('Hookshot') or (state.has('Hammer') and state.has('Mirror'))))
def set_big_bomb_rules(world):

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long