From 6ac00c296808e4ad8cb854197f96b75b4d033f12 Mon Sep 17 00:00:00 2001 From: tolmar Date: Sun, 15 Sep 2019 11:35:35 -0700 Subject: [PATCH] Eastern Palace Logic Works sometimes. Either needs a south-facing big key door hack, or a way to avoid placing big key doors in places where you can see their back. --- DoorShuffle.py | 1 + Doors.py | 1 + Regions.py | 8 +++++--- Rules.py | 26 ++++++++++++++++++++++---- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/DoorShuffle.py b/DoorShuffle.py index 736a93fa..c7ba6b22 100644 --- a/DoorShuffle.py +++ b/DoorShuffle.py @@ -739,6 +739,7 @@ interior_doors = [('Hyrule Dungeon Armory Interior Key Door S', 'Hyrule Dungeon key_doors = [('Sewers Key Rat Key Door N', 'Sewers Secret Room Key Door S'), ('Sewers Dark Cross Key Door N', 'Sewers Dark Cross Key Door S'), ('Eastern Dark Square Key Door WN', 'Eastern Cannonball Ledge Key Door EN'), + ('Eastern Darkness Up Stairs', 'Eastern Attic Start Down Stairs'), ('Eastern Big Key NE', 'Eastern Compass Area SW'), ('Eastern Darkness S', 'Eastern Courtyard N')] diff --git a/Doors.py b/Doors.py index 72476c6b..76a00c15 100644 --- a/Doors.py +++ b/Doors.py @@ -113,6 +113,7 @@ def create_doors(world, player): create_dir_door(player, 'Eastern Big Key EN', DoorType.Normal, Direction.East, 0xb8, Top, High), create_big_key_door(player, 'Eastern Big Key NE', DoorType.Normal, Direction.North, 0xb8, Right, High), create_small_key_door(player, 'Eastern Darkness S', DoorType.Normal, Direction.South, 0x99, Mid, High), + # TODO: Up is a keydoor and down is not. Are they both spiralkeys or what? create_spiral_stairs(player, 'Eastern Darkness Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x99, 0, HTH, Z, 0x1a, 0x6c, False, True), create_spiral_stairs(player, 'Eastern Attic Start Down Stairs', DoorType.SpiralStairs, Direction.Down, 0xda, 0, HTH, Z, 0x11, 0x80, False, True), create_dir_door(player, 'Eastern Attic Start WS', DoorType.Normal, Direction.West, 0xda, Bot, High), diff --git a/Regions.py b/Regions.py index 9ea5eaab..ea5fe587 100644 --- a/Regions.py +++ b/Regions.py @@ -329,9 +329,9 @@ def create_regions(world, player): create_dungeon_region(player, 'Eastern Courtyard', 'A dungeon', ['Eastern Palace - Big Chest'], ['Eastern Courtyard WN', 'Eastern Courtyard EN', 'Eastern Courtyard N', 'Eastern Courtyard Potholes', 'Eastern Courtyard Warp End']), create_dungeon_region(player, 'Eastern Fairies', 'A dungeon', None, ['Eastern Fairies\' Warp', 'Eastern Fairy Landing']), create_dungeon_region(player, 'Eastern Map Valley', 'A dungeon', None, ['Eastern Map Valley WN', 'Eastern Map Valley SW']), - create_dungeon_region(player, 'Eastern Dark Square', 'A dungeon', None, ['Eastern Dark Square NW', 'Eastern Dark Square Key Door WN']), + create_dungeon_region(player, 'Eastern Dark Square', 'A dungeon', ['Eastern Palace - Dark Square Pot Key'], ['Eastern Dark Square NW', 'Eastern Dark Square Key Door WN']), create_dungeon_region(player, 'Eastern Big Key', 'A dungeon', ['Eastern Palace - Big Key Chest'], ['Eastern Big Key EN', 'Eastern Big Key NE']), - create_dungeon_region(player, 'Eastern Darkness', 'A dungeon', None, ['Eastern Darkness S', 'Eastern Darkness Up Stairs']), + create_dungeon_region(player, 'Eastern Darkness', 'A dungeon', ['Eastern Palace - Dark Eyegore Key Drop'], ['Eastern Darkness S', 'Eastern Darkness Up Stairs']), create_dungeon_region(player, 'Eastern Attic Start', 'A dungeon', None, ['Eastern Attic Start Down Stairs', 'Eastern Attic Start WS']), create_dungeon_region(player, 'Eastern Attic Switches', 'A dungeon', None, ['Eastern Attic Switches ES', 'Eastern Attic Switches WS']), create_dungeon_region(player, 'Eastern Eyegores', 'A dungeon', None, ['Eastern Eyegores ES', 'Eastern Eyegores NE']), @@ -461,7 +461,9 @@ default_shop_contents = { key_only_locations = { 'Hyrule Castle - Map Guard Key Drop': 'Small Key (Escape)', - 'Hyrule Castle - Boomerang Guard Key Drop': 'Small Key (Escape)' + 'Hyrule Castle - Boomerang Guard Key Drop': 'Small Key (Escape)', + 'Eastern Palace - Dark Square Pot Key': 'Small Key (Eastern Palace)', + 'Eastern Palace - Dark Eyegore Key Drop': 'Small Key (Eastern Palace)', } location_table = {'Mushroom': (0x180013, False, 'in the woods'), diff --git a/Rules.py b/Rules.py index 05827283..08e90ab0 100644 --- a/Rules.py +++ b/Rules.py @@ -282,20 +282,38 @@ def global_rules(world, player): set_rule(world.get_entrance('Sewers Dark Cross South Stairs', player), lambda state: state.has('Lamp', player)) set_rule(world.get_entrance('Sewers Dark Cross Key Door N', player), lambda state: state.has('Lamp', player)) set_rule(world.get_entrance('Sewers Dark Cross Key Door S', player), lambda state: state.has('Lamp', player)) + set_rule(world.get_location('Sewers - Dark Cross', player), lambda state: state.has('Lamp', player)) set_rule(world.get_entrance('Sewers Water W', player), lambda state: state.has('Lamp', player)) set_rule(world.get_entrance('Sewers Key Rat E', player), lambda state: state.has('Lamp', player)) set_rule(world.get_entrance('Sewers Key Rat Key Door N', player), lambda state: state.has('Lamp', player)) - # End of door rando rules. + # Eastern Palace + # The stalfos room and eyegore with a key can be killed with pots. + # Eastern Palace has dark rooms. + for location in ['Eastern Palace - Dark Square Pot Key', 'Eastern Palace - Dark Eyegore Key Drop']: + add_rule(world.get_location(location, player), lambda state: state.has('Lamp', player)) + for door in ['Eastern Darkness S', 'Eastern Darkness Up Stairs', 'Eastern Dark Square NW', 'Eastern Dark Square Key Door WN']: + add_rule(world.get_entrance(door, player), lambda state: state.has('Lamp', player)) + # Eyegore room needs a bow + set_rule(world.get_entrance('Eastern Eyegores NE', player), lambda state: state.can_shoot_arrows(player)) + # Big key rules + set_rule(world.get_location('Eastern Palace - Big Chest', player), lambda state: state.has('Big Key (Eastern Palace)', player)) + set_rule(world.get_entrance('Eastern Big Key NE', player), lambda state: state.has('Big Key (Eastern Palace)', player)) + set_rule(world.get_entrance('Eastern Courtyard N', player), lambda state: state.has('Big Key (Eastern Palace)', player)) + # There are two keys and we don't know how we shuffled, so careful with key doors. + # TODO: Generate key rules in the shuffler. (But make sure this way works first.) + for door in ['Eastern Dark Square Key Door WN', 'Eastern Cannonball Ledge Key Door EN', 'Eastern Darkness Up Stairs', 'Eastern Attic Start Down Stairs']: + set_rule(world.get_entrance(door, player), lambda state: state.has_key('Small Key (Eastern Palace)', player, 2)) + + # End of door rando rules. # set_rule(world.get_entrance('Sewers Door', player), lambda state: state.has_key('Small Key (Escape)', player)) # set_rule(world.get_entrance('Sewers Back Door', player), lambda state: state.has_key('Small Key (Escape)', player)) - set_rule(world.get_location('Eastern Palace - Big Chest', player), lambda state: state.has('Big Key (Eastern Palace)', player)) set_rule(world.get_location('Eastern Palace - Boss', player), lambda state: state.can_shoot_arrows(player) and state.has('Big Key (Eastern Palace)', player) and world.get_location('Eastern Palace - Boss', player).parent_region.dungeon.boss.can_defeat(state)) set_rule(world.get_location('Eastern Palace - Prize', player), lambda state: state.can_shoot_arrows(player) and state.has('Big Key (Eastern Palace)', player) and world.get_location('Eastern Palace - Prize', player).parent_region.dungeon.boss.can_defeat(state)) - for location in ['Eastern Palace - Boss', 'Eastern Palace - Big Chest']: - forbid_item(world.get_location(location, player), 'Big Key (Eastern Palace)', player) +# for location in ['Eastern Palace - Boss', 'Eastern Palace - Big Chest']: +# forbid_item(world.get_location(location, player), 'Big Key (Eastern Palace)', player) set_rule(world.get_location('Desert Palace - Big Chest', player), lambda state: state.has('Big Key (Desert Palace)', player)) set_rule(world.get_location('Desert Palace - Torch', player), lambda state: state.has_Boots(player))