Changed GT/AT swap in Mixed OW to prioritize leaving AT vanilla unless GT is the only one in the starting world

This commit is contained in:
codemann8
2022-02-03 06:12:18 -06:00
parent 7e7efb0533
commit 392cb7187c
4 changed files with 10 additions and 11 deletions

View File

@@ -90,7 +90,7 @@ def link_entrances(world, player):
for entrancename, exitname in default_skulldrop_connections: for entrancename, exitname in default_skulldrop_connections:
connect_logical(world, entrancename, exitname, player, False) connect_logical(world, entrancename, exitname, player, False)
if (0x03 in world.owswaps[player][0]) == (0x1b in world.owswaps[player][0]) and (0x03 not in world.owswaps[player][0]) == invFlag: if (0x03 in world.owswaps[player][0]) == (0x1b in world.owswaps[player][0]) == (not invFlag):
for entrancename, exitname in inverted_default_dungeon_connections: for entrancename, exitname in inverted_default_dungeon_connections:
connect_logical(world, entrancename, exitname, player, True) connect_logical(world, entrancename, exitname, player, True)
else: else:

13
Rom.py
View File

@@ -33,7 +33,7 @@ from source.classes.SFX import randomize_sfx
JAP10HASH = '03a63945398191337e896e5771f77173' JAP10HASH = '03a63945398191337e896e5771f77173'
RANDOMIZERBASEHASH = 'b300438a7242825e33300f9d155814ef' RANDOMIZERBASEHASH = '9ff49ef63fdddeb32de09646bd459bf8'
class JsonRom(object): class JsonRom(object):
@@ -877,7 +877,8 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False):
rom.write_byte(0x138006, 1) rom.write_byte(0x138006, 1)
# swap in non-ER Lobby Shuffle Inverted - but only then # swap in non-ER Lobby Shuffle Inverted - but only then
if world.mode[player] == 'inverted' and world.intensity[player] >= 3 and world.doorShuffle[player] != 'vanilla' and world.shuffle[player] == 'vanilla': if (0x03 in world.owswaps[player][0]) == (0x1b in world.owswaps[player][0]) == (world.mode[player] != 'inverted') and \
world.intensity[player] >= 3 and world.doorShuffle[player] != 'vanilla' and world.shuffle[player] == 'vanilla':
aga_portal = world.get_portal('Agahnims Tower', player) aga_portal = world.get_portal('Agahnims Tower', player)
gt_portal = world.get_portal('Ganons Tower', player) gt_portal = world.get_portal('Ganons Tower', player)
aga_portal.exit_offset, gt_portal.exit_offset = gt_portal.exit_offset, aga_portal.exit_offset aga_portal.exit_offset, gt_portal.exit_offset = gt_portal.exit_offset, aga_portal.exit_offset
@@ -1286,6 +1287,7 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False):
rom.write_bytes(0xE9A5, [0x7E, 0x00, 0x24]) # disable below ganon chest rom.write_bytes(0xE9A5, [0x7E, 0x00, 0x24]) # disable below ganon chest
rom.write_byte(0x18008B, 0x01 if world.open_pyramid[player] or world.goal[player] == 'trinity' else 0x00) # pre-open Pyramid Hole rom.write_byte(0x18008B, 0x01 if world.open_pyramid[player] or world.goal[player] == 'trinity' else 0x00) # pre-open Pyramid Hole
rom.write_byte(0x18008C, 0x01 if world.crystals_needed_for_gt[player] == 0 else 0x00) # GT pre-opened if crystal requirement is 0 rom.write_byte(0x18008C, 0x01 if world.crystals_needed_for_gt[player] == 0 else 0x00) # GT pre-opened if crystal requirement is 0
rom.write_byte(0x18008F, 0x01 if (0x03 in world.owswaps[player][0]) == (0x1b in world.owswaps[player][0]) == (world.mode[player] != 'inverted') else 0x00) # AT/GT swapped
rom.write_byte(0xF5D73, 0xF0) # bees are catchable rom.write_byte(0xF5D73, 0xF0) # bees are catchable
rom.write_byte(0xF5F10, 0xF0) # bees are catchable rom.write_byte(0xF5F10, 0xF0) # bees are catchable
rom.write_byte(0x180086, 0x00 if world.aga_randomness else 0x01) # set blue ball and ganon warp randomness rom.write_byte(0x180086, 0x00 if world.aga_randomness else 0x01) # set blue ball and ganon warp randomness
@@ -2168,7 +2170,7 @@ def write_strings(rom, world, player, team):
entrances_to_hint = {} entrances_to_hint = {}
entrances_to_hint.update(InconvenientDungeonEntrances) entrances_to_hint.update(InconvenientDungeonEntrances)
if world.shuffle_ganon: if world.shuffle_ganon:
if world.mode[player] == 'inverted': if (0x03 in world.owswaps[player][0]) == (0x1b in world.owswaps[player][0]) == (world.mode[player] != 'inverted'):
entrances_to_hint.update({'Agahnims Tower': 'The sealed castle door'}) entrances_to_hint.update({'Agahnims Tower': 'The sealed castle door'})
else: else:
entrances_to_hint.update({'Ganons Tower': 'Ganon\'s Tower'}) entrances_to_hint.update({'Ganons Tower': 'Ganon\'s Tower'})
@@ -2201,7 +2203,7 @@ def write_strings(rom, world, player, team):
if world.shuffle[player] not in ['simple', 'restricted', 'restricted_legacy']: if world.shuffle[player] not in ['simple', 'restricted', 'restricted_legacy']:
entrances_to_hint.update(ConnectorEntrances) entrances_to_hint.update(ConnectorEntrances)
entrances_to_hint.update(DungeonEntrances) entrances_to_hint.update(DungeonEntrances)
if world.mode[player] == 'inverted': if (0x03 in world.owswaps[player][0]) == (0x1b in world.owswaps[player][0]) == (world.mode[player] != 'inverted'):
entrances_to_hint.update({'Ganons Tower': 'The dark mountain tower'}) entrances_to_hint.update({'Ganons Tower': 'The dark mountain tower'})
else: else:
entrances_to_hint.update({'Agahnims Tower': 'The sealed castle door'}) entrances_to_hint.update({'Agahnims Tower': 'The sealed castle door'})
@@ -2523,8 +2525,7 @@ def set_inverted_mode(world, player, rom, inverted_buffer):
# switch AT and GT # switch AT and GT
if world.shuffle[player] == 'vanilla' and \ if world.shuffle[player] == 'vanilla' and \
(0x03 in world.owswaps[player][0]) == (0x1b in world.owswaps[player][0]) and \ (0x03 in world.owswaps[player][0]) == (0x1b in world.owswaps[player][0]) == (world.mode[player] != 'inverted'):
(0x03 not in world.owswaps[player][0]) == world.mode[player] == 'inverted':
rom.write_byte(0xDBB73 + 0x23, 0x37) rom.write_byte(0xDBB73 + 0x23, 0x37)
rom.write_byte(0xDBB73 + 0x36, 0x24) rom.write_byte(0xDBB73 + 0x36, 0x24)
if world.doorShuffle[player] == 'vanilla' or world.intensity[player] < 3: if world.doorShuffle[player] == 'vanilla' or world.intensity[player] < 3:

View File

@@ -854,8 +854,7 @@ def default_rules(world, player):
def ow_rules(world, player): def ow_rules(world, player):
if (0x03 in world.owswaps[player][0]) == (0x1b in world.owswaps[player][0]) and \ if (0x03 in world.owswaps[player][0]) == (0x1b in world.owswaps[player][0]) == (world.mode[player] != 'inverted'):
(0x03 not in world.owswaps[player][0]) == world.mode[player] == 'inverted':
set_rule(world.get_entrance('Agahnims Tower', player), lambda state: state.has_crystals(world.crystals_needed_for_gt[player], player)) set_rule(world.get_entrance('Agahnims Tower', player), lambda state: state.has_crystals(world.crystals_needed_for_gt[player], player))
else: else:
set_rule(world.get_entrance('Agahnims Tower', player), lambda state: state.has('Cape', player) or state.has_beam_sword(player) or state.has('Beat Agahnim 1', player)) # barrier gets removed after killing agahnim, relevant for entrance shuffle set_rule(world.get_entrance('Agahnims Tower', player), lambda state: state.has('Cape', player) or state.has_beam_sword(player) or state.has('Beat Agahnim 1', player)) # barrier gets removed after killing agahnim, relevant for entrance shuffle
@@ -1525,8 +1524,7 @@ def swordless_rules(world, player):
set_rule(world.get_location('Ganon', player), lambda state: state.has('Hammer', player) and state.has_fire_source(player) and state.has('Silver Arrows', player) and state.can_shoot_arrows(player) and state.has_crystals(world.crystals_needed_for_ganon[player], player)) set_rule(world.get_location('Ganon', player), lambda state: state.has('Hammer', player) and state.has_fire_source(player) and state.has('Silver Arrows', player) and state.can_shoot_arrows(player) and state.has_crystals(world.crystals_needed_for_ganon[player], player))
set_rule(world.get_entrance('Ganon Drop', player), lambda state: state.has('Hammer', player)) # need to damage ganon to get tiles to drop set_rule(world.get_entrance('Ganon Drop', player), lambda state: state.has('Hammer', player)) # need to damage ganon to get tiles to drop
if not ((0x03 in world.owswaps[player][0]) == (0x1b in world.owswaps[player][0]) and \ if not ((0x03 in world.owswaps[player][0]) == (0x1b in world.owswaps[player][0]) == (world.mode[player] != 'inverted')):
(0x03 not in world.owswaps[player][0]) == world.mode[player] == 'inverted'):
set_rule(world.get_entrance('Agahnims Tower', player), lambda state: state.has('Cape', player) or state.has('Hammer', player) or state.has('Beat Agahnim 1', player)) # barrier gets removed after killing agahnim, relevant for entrance shuffle set_rule(world.get_entrance('Agahnims Tower', player), lambda state: state.has('Cape', player) or state.has('Hammer', player) or state.has('Beat Agahnim 1', player)) # barrier gets removed after killing agahnim, relevant for entrance shuffle
set_rule(world.get_entrance('Misery Mire', player), lambda state: state.has_misery_mire_medallion(player)) # sword not required to use medallion for opening in swordless (!) set_rule(world.get_entrance('Misery Mire', player), lambda state: state.has_misery_mire_medallion(player)) # sword not required to use medallion for opening in swordless (!)

Binary file not shown.