Completionist mode
100% Locations logic fixes
This commit is contained in:
@@ -84,6 +84,7 @@ class World(object):
|
|||||||
self.spoiler = Spoiler(self)
|
self.spoiler = Spoiler(self)
|
||||||
self.lamps_needed_for_dark_rooms = 1
|
self.lamps_needed_for_dark_rooms = 1
|
||||||
self.pseudoboots = {player: False for player in range(1, players + 1)}
|
self.pseudoboots = {player: False for player in range(1, players + 1)}
|
||||||
|
self.item_counter_hud = {player: False for player in range(1, players + 1)}
|
||||||
|
|
||||||
def intialize_regions(self):
|
def intialize_regions(self):
|
||||||
for region in self.regions:
|
for region in self.regions:
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ def start():
|
|||||||
Palace, to allow for an alternative to firerod.
|
Palace, to allow for an alternative to firerod.
|
||||||
Vanilla: Swords are in vanilla locations.
|
Vanilla: Swords are in vanilla locations.
|
||||||
''')
|
''')
|
||||||
parser.add_argument('--goal', default='ganon', const='ganon', nargs='?', choices=['ganon', 'pedestal', 'dungeons', 'triforcehunt', 'crystals'],
|
parser.add_argument('--goal', default='ganon', const='ganon', nargs='?', choices=['ganon', 'pedestal', 'dungeons', 'triforcehunt', 'crystals', 'all_items', 'completionist'],
|
||||||
help='''\
|
help='''\
|
||||||
Select completion goal. (default: %(default)s)
|
Select completion goal. (default: %(default)s)
|
||||||
Ganon: Collect all crystals, beat Agahnim 2 then
|
Ganon: Collect all crystals, beat Agahnim 2 then
|
||||||
@@ -66,6 +66,8 @@ def start():
|
|||||||
Agahnim fights and then defeat Ganon.
|
Agahnim fights and then defeat Ganon.
|
||||||
Triforce Hunt: Places 30 Triforce Pieces in the world, collect
|
Triforce Hunt: Places 30 Triforce Pieces in the world, collect
|
||||||
20 of them to beat the game.
|
20 of them to beat the game.
|
||||||
|
All Items: Requires collecting 216 items to defeat Ganon.
|
||||||
|
Completionist: Same as above, plus All Dungeons
|
||||||
''')
|
''')
|
||||||
parser.add_argument('--difficulty', default='normal', const='normal', nargs='?', choices=['normal', 'hard', 'expert'],
|
parser.add_argument('--difficulty', default='normal', const='normal', nargs='?', choices=['normal', 'hard', 'expert'],
|
||||||
help='''\
|
help='''\
|
||||||
@@ -240,6 +242,10 @@ def start():
|
|||||||
Alternatively, can be a ALttP Rom patched with a Link
|
Alternatively, can be a ALttP Rom patched with a Link
|
||||||
sprite that will be extracted.
|
sprite that will be extracted.
|
||||||
''')
|
''')
|
||||||
|
parser.add_argument('--huditemcounter', default=False, help='''\
|
||||||
|
Displays a (number of items collected) / (total items available) counter
|
||||||
|
on the HUD.
|
||||||
|
''', action='store_true')
|
||||||
parser.add_argument('--suppress_rom', help='Do not create an output rom file.', action='store_true')
|
parser.add_argument('--suppress_rom', help='Do not create an output rom file.', action='store_true')
|
||||||
parser.add_argument('--gui', help='Launch the GUI', action='store_true')
|
parser.add_argument('--gui', help='Launch the GUI', action='store_true')
|
||||||
parser.add_argument('--jsonout', action='store_true', help='''\
|
parser.add_argument('--jsonout', action='store_true', help='''\
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ difficulties = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def generate_itempool(world, player):
|
def generate_itempool(world, player):
|
||||||
if (world.difficulty not in ['normal', 'hard', 'expert'] or world.goal not in ['ganon', 'pedestal', 'dungeons', 'triforcehunt', 'crystals']
|
if (world.difficulty not in ['normal', 'hard', 'expert'] or world.goal not in ['ganon', 'pedestal', 'dungeons', 'triforcehunt', 'crystals', 'all_items', 'completionist']
|
||||||
or world.mode not in ['open', 'standard', 'inverted'] or world.timer not in ['none', 'display', 'timed', 'timed-ohko', 'ohko', 'timed-countdown'] or world.progressive not in ['on', 'off', 'random']):
|
or world.mode not in ['open', 'standard', 'inverted'] or world.timer not in ['none', 'display', 'timed', 'timed-ohko', 'ohko', 'timed-countdown'] or world.progressive not in ['on', 'off', 'random']):
|
||||||
raise NotImplementedError('Not supported yet')
|
raise NotImplementedError('Not supported yet')
|
||||||
|
|
||||||
|
|||||||
4
Main.py
4
Main.py
@@ -38,6 +38,10 @@ def main(args, seed=None):
|
|||||||
|
|
||||||
if args.securerandom:
|
if args.securerandom:
|
||||||
world.seed = None
|
world.seed = None
|
||||||
|
if world.goal in ['all_items', 'completionist'] and world.accessibility != 'locations':
|
||||||
|
raise Exception("Goals requiring all items must use 'locations' accessibility")
|
||||||
|
if args.huditemcounter:
|
||||||
|
world.item_counter_hud = {player: True for player in range(1, world.players + 1)}
|
||||||
|
|
||||||
world.crystals_needed_for_ganon = random.randint(0, 7) if args.crystals_ganon == 'random' else int(args.crystals_ganon)
|
world.crystals_needed_for_ganon = random.randint(0, 7) if args.crystals_ganon == 'random' else int(args.crystals_ganon)
|
||||||
world.crystals_needed_for_gt = random.randint(0, 7) if args.crystals_gt == 'random' else int(args.crystals_gt)
|
world.crystals_needed_for_gt = random.randint(0, 7) if args.crystals_gt == 'random' else int(args.crystals_gt)
|
||||||
|
|||||||
14
Rom.py
14
Rom.py
@@ -19,7 +19,7 @@ from EntranceShuffle import door_addresses
|
|||||||
|
|
||||||
|
|
||||||
JAP10HASH = '03a63945398191337e896e5771f77173'
|
JAP10HASH = '03a63945398191337e896e5771f77173'
|
||||||
RANDOMIZERBASEHASH = '86370c0770e368b7f863c5b7399d93a6'
|
RANDOMIZERBASEHASH = '3ede1a12d9a8c6a915e45d60da8b4913'
|
||||||
|
|
||||||
|
|
||||||
class JsonRom(object):
|
class JsonRom(object):
|
||||||
@@ -901,6 +901,10 @@ def patch_rom(world, player, rom):
|
|||||||
rom.write_byte(0x18003E, 0x02) # make ganon invincible until all dungeons are beat
|
rom.write_byte(0x18003E, 0x02) # make ganon invincible until all dungeons are beat
|
||||||
elif world.goal in ['crystals']:
|
elif world.goal in ['crystals']:
|
||||||
rom.write_byte(0x18003E, 0x04) # make ganon invincible until all crystals
|
rom.write_byte(0x18003E, 0x04) # make ganon invincible until all crystals
|
||||||
|
elif world.goal in ['all_items']:
|
||||||
|
rom.write_byte(0x18003E, 0x0A) # make ganon invincible until all items
|
||||||
|
elif world.goal in ['completionist']:
|
||||||
|
rom.write_byte(0x18003E, 0x0B) # make ganon invincible until all items and dungeons
|
||||||
else:
|
else:
|
||||||
rom.write_byte(0x18003E, 0x03) # make ganon invincible until all crystals and aga 2 are collected
|
rom.write_byte(0x18003E, 0x03) # make ganon invincible until all crystals and aga 2 are collected
|
||||||
|
|
||||||
@@ -1033,6 +1037,14 @@ def patch_rom(world, player, rom):
|
|||||||
if world.fix_trock_doors:
|
if world.fix_trock_doors:
|
||||||
rom.initial_sram.pre_open_tr_bomb_doors() # preopen bombable exits
|
rom.initial_sram.pre_open_tr_bomb_doors() # preopen bombable exits
|
||||||
|
|
||||||
|
# write total item count and item counter hud mode
|
||||||
|
item_total = len(world.get_filled_locations()) - 18 # minus non-item locations
|
||||||
|
rom.write_int16(0x180196, item_total+1)
|
||||||
|
if world.item_counter_hud[player] and world.goal != 'triforcehunt':
|
||||||
|
rom.write_byte(0x180039, 0x01)
|
||||||
|
else:
|
||||||
|
rom.write_byte(0x180039, 0x00)
|
||||||
|
|
||||||
write_strings(rom, world, player)
|
write_strings(rom, world, player)
|
||||||
|
|
||||||
# write initial sram
|
# write initial sram
|
||||||
|
|||||||
44
Rules.py
44
Rules.py
@@ -290,8 +290,9 @@ def global_rules(world, player):
|
|||||||
set_defeat_dungeon_boss_rule(world.get_location('Tower of Hera - Prize', player))
|
set_defeat_dungeon_boss_rule(world.get_location('Tower of Hera - Prize', player))
|
||||||
for location in ['Tower of Hera - Boss', 'Tower of Hera - Big Chest', 'Tower of Hera - Compass Chest']:
|
for location in ['Tower of Hera - Boss', 'Tower of Hera - Big Chest', 'Tower of Hera - Compass Chest']:
|
||||||
forbid_item(world.get_location(location, player), 'Big Key (Tower of Hera)', player)
|
forbid_item(world.get_location(location, player), 'Big Key (Tower of Hera)', player)
|
||||||
# for location in ['Tower of Hera - Big Key Chest']:
|
if world.accessibility == 'locations':
|
||||||
# forbid_item(world.get_location(location, player), 'Small Key (Tower of Hera)', player)
|
for location in ['Tower of Hera - Big Key Chest']:
|
||||||
|
forbid_item(world.get_location(location, player), 'Small Key (Tower of Hera)', player)
|
||||||
|
|
||||||
set_rule(world.get_entrance('Swamp Palace Moat', player), lambda state: state.has('Flippers', player) and state.has('Open Floodgate', player))
|
set_rule(world.get_entrance('Swamp Palace Moat', player), lambda state: state.has('Flippers', player) and state.has('Open Floodgate', player))
|
||||||
add_rule(world.get_location('Sunken Treasure', player), lambda state: state.has('Open Floodgate', player))
|
add_rule(world.get_location('Sunken Treasure', player), lambda state: state.has('Open Floodgate', player))
|
||||||
@@ -306,6 +307,9 @@ def global_rules(world, player):
|
|||||||
set_defeat_dungeon_boss_rule(world.get_location('Swamp Palace - Prize', player))
|
set_defeat_dungeon_boss_rule(world.get_location('Swamp Palace - Prize', player))
|
||||||
for location in ['Swamp Palace - Entrance']:
|
for location in ['Swamp Palace - Entrance']:
|
||||||
forbid_item(world.get_location(location, player), 'Big Key (Swamp Palace)', player)
|
forbid_item(world.get_location(location, player), 'Big Key (Swamp Palace)', player)
|
||||||
|
if world.accessibility == 'locations':
|
||||||
|
for location in ['Swamp Palace - Big Chest']:
|
||||||
|
forbid_item(world.get_location(location, player), 'Big Key (Swamp Palace)', player)
|
||||||
|
|
||||||
set_rule(world.get_entrance('Thieves Town Big Key Door', player), lambda state: state.has('Big Key (Thieves Town)', player))
|
set_rule(world.get_entrance('Thieves Town Big Key Door', player), lambda state: state.has('Big Key (Thieves Town)', player))
|
||||||
set_rule(world.get_entrance('Blind Fight', player), lambda state: state.has_key('Small Key (Thieves Town)', player))
|
set_rule(world.get_entrance('Blind Fight', player), lambda state: state.has_key('Small Key (Thieves Town)', player))
|
||||||
@@ -319,6 +323,9 @@ def global_rules(world, player):
|
|||||||
forbid_item(world.get_location(location, player), 'Big Key (Thieves Town)', player)
|
forbid_item(world.get_location(location, player), 'Big Key (Thieves Town)', player)
|
||||||
for location in ['Thieves\' Town - Attic', 'Thieves\' Town - Boss']:
|
for location in ['Thieves\' Town - Attic', 'Thieves\' Town - Boss']:
|
||||||
forbid_item(world.get_location(location, player), 'Small Key (Thieves Town)', player)
|
forbid_item(world.get_location(location, player), 'Small Key (Thieves Town)', player)
|
||||||
|
if world.accessibility == 'locations':
|
||||||
|
for location in ['Thieves\' Town - Big Chest']:
|
||||||
|
forbid_item(world.get_location(location, player), 'Small Key (Thieves Town)', player)
|
||||||
|
|
||||||
set_rule(world.get_entrance('Skull Woods First Section South Door', player), lambda state: state.has_key('Small Key (Skull Woods)', player))
|
set_rule(world.get_entrance('Skull Woods First Section South Door', player), lambda state: state.has_key('Small Key (Skull Woods)', player))
|
||||||
set_rule(world.get_entrance('Skull Woods First Section (Right) North Door', player), lambda state: state.has_key('Small Key (Skull Woods)', player))
|
set_rule(world.get_entrance('Skull Woods First Section (Right) North Door', player), lambda state: state.has_key('Small Key (Skull Woods)', player))
|
||||||
@@ -332,6 +339,9 @@ def global_rules(world, player):
|
|||||||
set_defeat_dungeon_boss_rule(world.get_location('Skull Woods - Prize', player))
|
set_defeat_dungeon_boss_rule(world.get_location('Skull Woods - Prize', player))
|
||||||
for location in ['Skull Woods - Boss']:
|
for location in ['Skull Woods - Boss']:
|
||||||
forbid_item(world.get_location(location, player), 'Small Key (Skull Woods)', player)
|
forbid_item(world.get_location(location, player), 'Small Key (Skull Woods)', player)
|
||||||
|
if world.accessibility == 'locations':
|
||||||
|
for location in ['Skull Woods - Big Chest']:
|
||||||
|
forbid_item(world.get_location(location, player), 'Big Key (Skull Woods)', player)
|
||||||
|
|
||||||
set_rule(world.get_entrance('Ice Palace Entrance Room', player), lambda state: state.can_melt_things(player))
|
set_rule(world.get_entrance('Ice Palace Entrance Room', player), lambda state: state.can_melt_things(player))
|
||||||
set_rule(world.get_location('Ice Palace - Big Chest', player), lambda state: state.has('Big Key (Ice Palace)', player))
|
set_rule(world.get_location('Ice Palace - Big Chest', player), lambda state: state.has('Big Key (Ice Palace)', player))
|
||||||
@@ -403,6 +413,9 @@ def global_rules(world, player):
|
|||||||
set_rule(world.get_entrance('Palace of Darkness Maze Door', player), lambda state: state.has_key('Small Key (Palace of Darkness)', player, 6))
|
set_rule(world.get_entrance('Palace of Darkness Maze Door', player), lambda state: state.has_key('Small Key (Palace of Darkness)', player, 6))
|
||||||
set_defeat_dungeon_boss_rule(world.get_location('Palace of Darkness - Boss', player))
|
set_defeat_dungeon_boss_rule(world.get_location('Palace of Darkness - Boss', player))
|
||||||
set_defeat_dungeon_boss_rule(world.get_location('Palace of Darkness - Prize', player))
|
set_defeat_dungeon_boss_rule(world.get_location('Palace of Darkness - Prize', player))
|
||||||
|
if world.accessibility == 'locations':
|
||||||
|
for location in ['Palace of Darkness - Big Key Chest', 'Palace of Darkness - Harmless Hellway']:
|
||||||
|
forbid_item(world.get_location(location, player), 'Small Key (Palace of Darkness)', player)
|
||||||
|
|
||||||
# these key rules are conservative, you might be able to get away with more lenient rules
|
# these key rules are conservative, you might be able to get away with more lenient rules
|
||||||
randomizer_room_chests = ['Ganons Tower - Randomizer Room - Top Left', 'Ganons Tower - Randomizer Room - Top Right', 'Ganons Tower - Randomizer Room - Bottom Left', 'Ganons Tower - Randomizer Room - Bottom Right']
|
randomizer_room_chests = ['Ganons Tower - Randomizer Room - Top Left', 'Ganons Tower - Randomizer Room - Top Right', 'Ganons Tower - Randomizer Room - Bottom Left', 'Ganons Tower - Randomizer Room - Bottom Right']
|
||||||
@@ -415,7 +428,7 @@ def global_rules(world, player):
|
|||||||
set_rule(world.get_entrance('Ganons Tower (Map Room)', player), lambda state: state.has_key('Small Key (Ganons Tower)', player, 4) or (item_name(state, 'Ganons Tower - Map Chest', player) in [('Big Key (Ganons Tower)', player), ('Small Key (Ganons Tower)', player)] and state.has_key('Small Key (Ganons Tower)', player, 3)))
|
set_rule(world.get_entrance('Ganons Tower (Map Room)', player), lambda state: state.has_key('Small Key (Ganons Tower)', player, 4) or (item_name(state, 'Ganons Tower - Map Chest', player) in [('Big Key (Ganons Tower)', player), ('Small Key (Ganons Tower)', player)] and state.has_key('Small Key (Ganons Tower)', player, 3)))
|
||||||
if world.accessibility != 'locations':
|
if world.accessibility != 'locations':
|
||||||
set_always_allow(world.get_location('Ganons Tower - Map Chest', player), lambda state, item: item.name == 'Small Key (Ganons Tower)' and item.player == player and state.has_key('Small Key (Ganons Tower)', player, 3))
|
set_always_allow(world.get_location('Ganons Tower - Map Chest', player), lambda state, item: item.name == 'Small Key (Ganons Tower)' and item.player == player and state.has_key('Small Key (Ganons Tower)', player, 3))
|
||||||
else:
|
elif world.accessibility == 'locations':
|
||||||
forbid_item(world.get_location('Ganons Tower - Map Chest', player), 'Small Key (Ganons Tower)', player)
|
forbid_item(world.get_location('Ganons Tower - Map Chest', player), 'Small Key (Ganons Tower)', player)
|
||||||
|
|
||||||
# It is possible to need more than 2 keys to get through this entrance if you spend keys elsewhere. We reflect this in the chest requirements.
|
# It is possible to need more than 2 keys to get through this entrance if you spend keys elsewhere. We reflect this in the chest requirements.
|
||||||
@@ -685,8 +698,9 @@ def inverted_rules(world, player):
|
|||||||
set_defeat_dungeon_boss_rule(world.get_location('Tower of Hera - Prize', player))
|
set_defeat_dungeon_boss_rule(world.get_location('Tower of Hera - Prize', player))
|
||||||
for location in ['Tower of Hera - Boss', 'Tower of Hera - Big Chest', 'Tower of Hera - Compass Chest']:
|
for location in ['Tower of Hera - Boss', 'Tower of Hera - Big Chest', 'Tower of Hera - Compass Chest']:
|
||||||
forbid_item(world.get_location(location, player), 'Big Key (Tower of Hera)', player)
|
forbid_item(world.get_location(location, player), 'Big Key (Tower of Hera)', player)
|
||||||
# for location in ['Tower of Hera - Big Key Chest']:
|
if world.accessibility == 'locations':
|
||||||
# forbid_item(world.get_location(location, player), 'Small Key (Tower of Hera)', player)
|
for location in ['Tower of Hera - Big Key Chest']:
|
||||||
|
forbid_item(world.get_location(location, player), 'Small Key (Tower of Hera)', player)
|
||||||
|
|
||||||
set_rule(world.get_entrance('Swamp Palace Moat', player), lambda state: state.has('Flippers', player) and state.has('Open Floodgate', player))
|
set_rule(world.get_entrance('Swamp Palace Moat', player), lambda state: state.has('Flippers', player) and state.has('Open Floodgate', player))
|
||||||
add_rule(world.get_location('Sunken Treasure', player), lambda state: state.has('Open Floodgate', player))
|
add_rule(world.get_location('Sunken Treasure', player), lambda state: state.has('Open Floodgate', player))
|
||||||
@@ -701,6 +715,9 @@ def inverted_rules(world, player):
|
|||||||
set_defeat_dungeon_boss_rule(world.get_location('Swamp Palace - Prize', player))
|
set_defeat_dungeon_boss_rule(world.get_location('Swamp Palace - Prize', player))
|
||||||
for location in ['Swamp Palace - Entrance']:
|
for location in ['Swamp Palace - Entrance']:
|
||||||
forbid_item(world.get_location(location, player), 'Big Key (Swamp Palace)', player)
|
forbid_item(world.get_location(location, player), 'Big Key (Swamp Palace)', player)
|
||||||
|
if world.accessibility == 'locations':
|
||||||
|
for location in ['Swamp Palace - Big Chest']:
|
||||||
|
forbid_item(world.get_location(location, player), 'Big Key (Swamp Palace)', player)
|
||||||
|
|
||||||
set_rule(world.get_entrance('Thieves Town Big Key Door', player), lambda state: state.has('Big Key (Thieves Town)', player))
|
set_rule(world.get_entrance('Thieves Town Big Key Door', player), lambda state: state.has('Big Key (Thieves Town)', player))
|
||||||
set_rule(world.get_entrance('Blind Fight', player), lambda state: state.has_key('Small Key (Thieves Town)', player))
|
set_rule(world.get_entrance('Blind Fight', player), lambda state: state.has_key('Small Key (Thieves Town)', player))
|
||||||
@@ -714,6 +731,9 @@ def inverted_rules(world, player):
|
|||||||
forbid_item(world.get_location(location, player), 'Big Key (Thieves Town)', player)
|
forbid_item(world.get_location(location, player), 'Big Key (Thieves Town)', player)
|
||||||
for location in ['Thieves\' Town - Attic', 'Thieves\' Town - Boss']:
|
for location in ['Thieves\' Town - Attic', 'Thieves\' Town - Boss']:
|
||||||
forbid_item(world.get_location(location, player), 'Small Key (Thieves Town)', player)
|
forbid_item(world.get_location(location, player), 'Small Key (Thieves Town)', player)
|
||||||
|
if world.accessibility == 'locations':
|
||||||
|
for location in ['Thieves\' Town - Big Chest']:
|
||||||
|
forbid_item(world.get_location(location, player), 'Small Key (Thieves Town)', player)
|
||||||
|
|
||||||
set_rule(world.get_entrance('Skull Woods First Section South Door', player), lambda state: state.has_key('Small Key (Skull Woods)', player))
|
set_rule(world.get_entrance('Skull Woods First Section South Door', player), lambda state: state.has_key('Small Key (Skull Woods)', player))
|
||||||
set_rule(world.get_entrance('Skull Woods First Section (Right) North Door', player), lambda state: state.has_key('Small Key (Skull Woods)', player))
|
set_rule(world.get_entrance('Skull Woods First Section (Right) North Door', player), lambda state: state.has_key('Small Key (Skull Woods)', player))
|
||||||
@@ -728,6 +748,9 @@ def inverted_rules(world, player):
|
|||||||
set_defeat_dungeon_boss_rule(world.get_location('Skull Woods - Prize', player))
|
set_defeat_dungeon_boss_rule(world.get_location('Skull Woods - Prize', player))
|
||||||
for location in ['Skull Woods - Boss']:
|
for location in ['Skull Woods - Boss']:
|
||||||
forbid_item(world.get_location(location, player), 'Small Key (Skull Woods)', player)
|
forbid_item(world.get_location(location, player), 'Small Key (Skull Woods)', player)
|
||||||
|
if world.accessibility == 'locations':
|
||||||
|
for location in ['Skull Woods - Big Chest']:
|
||||||
|
forbid_item(world.get_location(location, player), 'Big Key (Skull Woods)', player)
|
||||||
|
|
||||||
set_rule(world.get_entrance('Ice Palace Entrance Room', player), lambda state: state.can_melt_things(player))
|
set_rule(world.get_entrance('Ice Palace Entrance Room', player), lambda state: state.can_melt_things(player))
|
||||||
set_rule(world.get_location('Ice Palace - Big Chest', player), lambda state: state.has('Big Key (Ice Palace)', player))
|
set_rule(world.get_location('Ice Palace - Big Chest', player), lambda state: state.has('Big Key (Ice Palace)', player))
|
||||||
@@ -800,6 +823,9 @@ def inverted_rules(world, player):
|
|||||||
set_rule(world.get_entrance('Palace of Darkness Maze Door', player), lambda state: state.has_key('Small Key (Palace of Darkness)', player, 6))
|
set_rule(world.get_entrance('Palace of Darkness Maze Door', player), lambda state: state.has_key('Small Key (Palace of Darkness)', player, 6))
|
||||||
set_defeat_dungeon_boss_rule(world.get_location('Palace of Darkness - Boss', player))
|
set_defeat_dungeon_boss_rule(world.get_location('Palace of Darkness - Boss', player))
|
||||||
set_defeat_dungeon_boss_rule(world.get_location('Palace of Darkness - Prize', player))
|
set_defeat_dungeon_boss_rule(world.get_location('Palace of Darkness - Prize', player))
|
||||||
|
if world.accessibility == 'locations':
|
||||||
|
for location in ['Palace of Darkness - Big Key Chest', 'Palace of Darkness - Harmless Hellway']:
|
||||||
|
forbid_item(world.get_location(location, player), 'Small Key (Palace of Darkness)', player)
|
||||||
|
|
||||||
# these key rules are conservative, you might be able to get away with more lenient rules
|
# these key rules are conservative, you might be able to get away with more lenient rules
|
||||||
randomizer_room_chests = ['Ganons Tower - Randomizer Room - Top Left', 'Ganons Tower - Randomizer Room - Top Right', 'Ganons Tower - Randomizer Room - Bottom Left', 'Ganons Tower - Randomizer Room - Bottom Right']
|
randomizer_room_chests = ['Ganons Tower - Randomizer Room - Top Left', 'Ganons Tower - Randomizer Room - Top Right', 'Ganons Tower - Randomizer Room - Bottom Left', 'Ganons Tower - Randomizer Room - Bottom Right']
|
||||||
@@ -812,7 +838,7 @@ def inverted_rules(world, player):
|
|||||||
set_rule(world.get_entrance('Ganons Tower (Map Room)', player), lambda state: state.has_key('Small Key (Ganons Tower)', player, 4) or (item_name(state, 'Ganons Tower - Map Chest', player) in [('Big Key (Ganons Tower)', player), ('Small Key (Ganons Tower)', player)] and state.has_key('Small Key (Ganons Tower)', player, 3)))
|
set_rule(world.get_entrance('Ganons Tower (Map Room)', player), lambda state: state.has_key('Small Key (Ganons Tower)', player, 4) or (item_name(state, 'Ganons Tower - Map Chest', player) in [('Big Key (Ganons Tower)', player), ('Small Key (Ganons Tower)', player)] and state.has_key('Small Key (Ganons Tower)', player, 3)))
|
||||||
if world.accessibility != 'locations':
|
if world.accessibility != 'locations':
|
||||||
set_always_allow(world.get_location('Ganons Tower - Map Chest', player), lambda state, item: item.name == 'Small Key (Ganons Tower)' and item.player == player and state.has_key('Small Key (Ganons Tower)', player, 3))
|
set_always_allow(world.get_location('Ganons Tower - Map Chest', player), lambda state, item: item.name == 'Small Key (Ganons Tower)' and item.player == player and state.has_key('Small Key (Ganons Tower)', player, 3))
|
||||||
else:
|
elif world.accessibility == 'locations':
|
||||||
forbid_item(world.get_location('Ganons Tower - Map Chest', player), 'Small Key (Ganons Tower)', player)
|
forbid_item(world.get_location('Ganons Tower - Map Chest', player), 'Small Key (Ganons Tower)', player)
|
||||||
|
|
||||||
# It is possible to need more than 2 keys to get through this entance if you spend keys elsewhere. We reflect this in the chest requirements.
|
# It is possible to need more than 2 keys to get through this entance if you spend keys elsewhere. We reflect this in the chest requirements.
|
||||||
@@ -998,7 +1024,9 @@ def standard_rules(world, player):
|
|||||||
|
|
||||||
|
|
||||||
def set_trock_key_rules(world, player):
|
def set_trock_key_rules(world, player):
|
||||||
|
if world.accessibility == 'locations':
|
||||||
|
for location in ['Turtle Rock - Big Key Chest']:
|
||||||
|
forbid_item(world.get_location(location, player), 'Small Key (Turtle Rock)', player)
|
||||||
|
|
||||||
# First set all relevant locked doors to impassible.
|
# First set all relevant locked doors to impassible.
|
||||||
for entrance in ['Turtle Rock Dark Room Staircase', 'Turtle Rock (Chain Chomp Room) (North)', 'Turtle Rock (Chain Chomp Room) (South)', 'Turtle Rock Pokey Room']:
|
for entrance in ['Turtle Rock Dark Room Staircase', 'Turtle Rock (Chain Chomp Room) (North)', 'Turtle Rock (Chain Chomp Room) (South)', 'Turtle Rock Pokey Room']:
|
||||||
@@ -1027,7 +1055,7 @@ def set_trock_key_rules(world, player):
|
|||||||
# No matter what, the Big Key cannot be in the Big Chest or held by Trinexx.
|
# No matter what, the Big Key cannot be in the Big Chest or held by Trinexx.
|
||||||
non_big_key_locations = ['Turtle Rock - Big Chest', 'Turtle Rock - Boss']
|
non_big_key_locations = ['Turtle Rock - Big Chest', 'Turtle Rock - Boss']
|
||||||
|
|
||||||
def tr_big_key_chest_keys_needed(state):
|
def tr_big_key_chest_keys_needed(world, state):
|
||||||
# This function handles the key requirements for the TR Big Chest in the situations it having the Big Key should logically require 2 keys, small key
|
# This function handles the key requirements for the TR Big Chest in the situations it having the Big Key should logically require 2 keys, small key
|
||||||
# should logically require no keys, and anything else should logically require 4 keys.
|
# should logically require no keys, and anything else should logically require 4 keys.
|
||||||
item = item_name(state, 'Turtle Rock - Big Key Chest', player)
|
item = item_name(state, 'Turtle Rock - Big Key Chest', player)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user