@@ -64,20 +64,24 @@ def set_rules(world):
6464
6565 if world .glitches_required [player ] == 'no_glitches' :
6666 no_glitches_rules (world , player )
67+ forbid_bomb_jump_requirements (world , player )
6768 elif world .glitches_required [player ] == 'overworld_glitches' :
6869 # Initially setting no_glitches_rules to set the baseline rules for some
6970 # entrances. The overworld_glitches_rules set is primarily additive.
7071 no_glitches_rules (world , player )
7172 fake_flipper_rules (world , player )
7273 overworld_glitches_rules (world , player )
74+ forbid_bomb_jump_requirements (world , player )
7375 elif world .glitches_required [player ] in ['hybrid_major_glitches' , 'no_logic' ]:
7476 no_glitches_rules (world , player )
7577 fake_flipper_rules (world , player )
7678 overworld_glitches_rules (world , player )
7779 underworld_glitches_rules (world , player )
80+ bomb_jump_requirements (world , player )
7881 elif world .glitches_required [player ] == 'minor_glitches' :
7982 no_glitches_rules (world , player )
8083 fake_flipper_rules (world , player )
84+ forbid_bomb_jump_requirements (world , player )
8185 else :
8286 raise NotImplementedError (f'Not implemented yet: Logic - { world .glitches_required [player ]} ' )
8387
@@ -290,6 +294,9 @@ def global_rules(multiworld: MultiWorld, player: int):
290294 lambda state : state .has ('Hookshot' , player ) or state .has ('Pegasus Boots' , player ))
291295 set_rule (multiworld .get_location ('Hookshot Cave - Bottom Left' , player ), lambda state : state .has ('Hookshot' , player ))
292296
297+ set_rule (multiworld .get_location ('Hyrule Castle - Map Guard Key Drop' , player ),
298+ lambda state : can_kill_most_things (state , player , 1 ))
299+
293300 set_rule (multiworld .get_entrance ('Sewers Door' , player ),
294301 lambda state : state ._lttp_has_key ('Small Key (Hyrule Castle)' , player , 4 ) or (
295302 multiworld .small_key_shuffle [player ] == small_key_shuffle .option_universal and multiworld .mode [
@@ -536,6 +543,8 @@ def global_rules(multiworld: MultiWorld, player: int):
536543 set_rule (multiworld .get_location ('Ganons Tower - Bob\' s Torch' , player ), lambda state : state .has ('Pegasus Boots' , player ))
537544 set_rule (multiworld .get_entrance ('Ganons Tower (Tile Room)' , player ), lambda state : state .has ('Cane of Somaria' , player ))
538545 set_rule (multiworld .get_entrance ('Ganons Tower (Hookshot Room)' , player ), lambda state : state .has ('Hammer' , player ) and (state .has ('Hookshot' , player ) or state .has ('Pegasus Boots' , player )))
546+ if multiworld .pot_shuffle [player ]:
547+ set_rule (multiworld .get_location ('Ganons Tower - Conveyor Cross Pot Key' , player ), lambda state : state .has ('Hammer' , player ) and (state .has ('Hookshot' , player ) or state .has ('Pegasus Boots' , player )))
539548 set_rule (multiworld .get_entrance ('Ganons Tower (Map Room)' , player ), lambda state : state ._lttp_has_key ('Small Key (Ganons Tower)' , player , 8 ) or (
540549 location_item_name (state , 'Ganons Tower - Map Chest' , player ) in [('Big Key (Ganons Tower)' , player )] and state ._lttp_has_key ('Small Key (Ganons Tower)' , player , 6 )))
541550
@@ -900,7 +909,6 @@ def no_glitches_rules(world, player):
900909
901910 add_rule (world .get_entrance ('Ganons Tower (Double Switch Room)' , player ), lambda state : state .has ('Hookshot' , player ))
902911 set_rule (world .get_entrance ('Paradox Cave Push Block Reverse' , player ), lambda state : False ) # no glitches does not require block override
903- forbid_bomb_jump_requirements (world , player )
904912 add_conditional_lamps (world , player )
905913
906914def fake_flipper_rules (world , player ):
@@ -928,12 +936,20 @@ def fake_flipper_rules(world, player):
928936 set_rule (world .get_entrance ('East Dark World River Pier' , player ), lambda state : state .has ('Moon Pearl' , player ))
929937
930938
931- def forbid_bomb_jump_requirements (world , player ):
939+ def bomb_jump_requirements (multiworld , player ):
940+ DMs_room_chests = ['Ganons Tower - DMs Room - Top Left' , 'Ganons Tower - DMs Room - Top Right' , 'Ganons Tower - DMs Room - Bottom Left' , 'Ganons Tower - DMs Room - Bottom Right' ]
941+ for location in DMs_room_chests :
942+ add_rule (multiworld .get_location (location , player ), lambda state : can_use_bombs (state , player ), combine = "or" )
943+ set_rule (multiworld .get_entrance ('Paradox Cave Bomb Jump' , player ), lambda state : can_use_bombs (state , player ))
944+ set_rule (multiworld .get_entrance ('Skull Woods First Section Bomb Jump' , player ), lambda state : can_use_bombs (state , player ))
945+
946+
947+ def forbid_bomb_jump_requirements (multiworld , player ):
932948 DMs_room_chests = ['Ganons Tower - DMs Room - Top Left' , 'Ganons Tower - DMs Room - Top Right' , 'Ganons Tower - DMs Room - Bottom Left' , 'Ganons Tower - DMs Room - Bottom Right' ]
933949 for location in DMs_room_chests :
934- add_rule (world .get_location (location , player ), lambda state : state .has ('Hookshot' , player ))
935- set_rule (world .get_entrance ('Paradox Cave Bomb Jump' , player ), lambda state : False )
936- set_rule (world .get_entrance ('Skull Woods First Section Bomb Jump' , player ), lambda state : False )
950+ add_rule (multiworld .get_location (location , player ), lambda state : state .has ('Hookshot' , player ))
951+ set_rule (multiworld .get_entrance ('Paradox Cave Bomb Jump' , player ), lambda state : False )
952+ set_rule (multiworld .get_entrance ('Skull Woods First Section Bomb Jump' , player ), lambda state : False )
937953
938954
939955DW_Entrances = ['Bumper Cave (Bottom)' ,
@@ -1012,9 +1028,6 @@ def add_conditional_lamp(spot, region, spottype='Location', accessible_torch=Fal
10121028
10131029def open_rules (world , player ):
10141030
1015- set_rule (world .get_location ('Hyrule Castle - Map Guard Key Drop' , player ),
1016- lambda state : can_kill_most_things (state , player , 1 ))
1017-
10181031 def basement_key_rule (state ):
10191032 if location_item_name (state , 'Sewers - Key Rat Key Drop' , player ) == ("Small Key (Hyrule Castle)" , player ):
10201033 return state ._lttp_has_key ("Small Key (Hyrule Castle)" , player , 2 )
@@ -1023,16 +1036,18 @@ def basement_key_rule(state):
10231036
10241037 set_rule (world .get_location ('Hyrule Castle - Boomerang Guard Key Drop' , player ),
10251038 lambda state : basement_key_rule (state ) and can_kill_most_things (state , player , 2 ))
1026- set_rule (world .get_location ('Hyrule Castle - Boomerang Chest' , player ), basement_key_rule )
1039+ set_rule (world .get_location ('Hyrule Castle - Boomerang Chest' , player ), lambda state : basement_key_rule ( state ) and can_kill_most_things ( state , player , 1 ) )
10271040
10281041 set_rule (world .get_location ('Sewers - Key Rat Key Drop' , player ),
10291042 lambda state : state ._lttp_has_key ('Small Key (Hyrule Castle)' , player , 3 ) and can_kill_most_things (state , player , 1 ))
10301043
10311044 set_rule (world .get_location ('Hyrule Castle - Big Key Drop' , player ),
10321045 lambda state : state ._lttp_has_key ('Small Key (Hyrule Castle)' , player , 4 ) and can_kill_most_things (state , player , 1 ))
10331046 set_rule (world .get_location ('Hyrule Castle - Zelda\' s Chest' , player ),
1034- lambda state : state ._lttp_has_key ('Small Key (Hyrule Castle)' , player , 4 ) and
1035- state .has ('Big Key (Hyrule Castle)' , player ))
1047+ lambda state : state ._lttp_has_key ('Small Key (Hyrule Castle)' , player , 4 )
1048+ and state .has ('Big Key (Hyrule Castle)' , player )
1049+ and (world .enemy_health [player ] in ("easy" , "default" )
1050+ or can_kill_most_things (state , player , 1 )))
10361051
10371052
10381053def swordless_rules (world , player ):
@@ -1062,6 +1077,7 @@ def add_connection(parent_name, target_name, entrance_name, world, player):
10621077 parent .exits .append (connection )
10631078 connection .connect (target )
10641079
1080+
10651081def standard_rules (world , player ):
10661082 add_connection ('Menu' , 'Hyrule Castle Secret Entrance' , 'Uncle S&Q' , world , player )
10671083 world .get_entrance ('Uncle S&Q' , player ).hide_path = True
@@ -1073,18 +1089,23 @@ def standard_rules(world, player):
10731089
10741090 if world .small_key_shuffle [player ] != small_key_shuffle .option_universal :
10751091 set_rule (world .get_location ('Hyrule Castle - Boomerang Guard Key Drop' , player ),
1076- lambda state : state ._lttp_has_key ('Small Key (Hyrule Castle)' , player , 1 ))
1092+ lambda state : state ._lttp_has_key ('Small Key (Hyrule Castle)' , player , 1 )
1093+ and can_kill_most_things (state , player , 2 ))
10771094 set_rule (world .get_location ('Hyrule Castle - Boomerang Chest' , player ),
1078- lambda state : state ._lttp_has_key ('Small Key (Hyrule Castle)' , player , 1 ))
1095+ lambda state : state ._lttp_has_key ('Small Key (Hyrule Castle)' , player , 1 )
1096+ and can_kill_most_things (state , player , 1 ))
10791097
10801098 set_rule (world .get_location ('Hyrule Castle - Big Key Drop' , player ),
10811099 lambda state : state ._lttp_has_key ('Small Key (Hyrule Castle)' , player , 2 ))
10821100 set_rule (world .get_location ('Hyrule Castle - Zelda\' s Chest' , player ),
1083- lambda state : state ._lttp_has_key ('Small Key (Hyrule Castle)' , player , 2 ) and
1084- state .has ('Big Key (Hyrule Castle)' , player ))
1101+ lambda state : state ._lttp_has_key ('Small Key (Hyrule Castle)' , player , 2 )
1102+ and state .has ('Big Key (Hyrule Castle)' , player )
1103+ and (world .enemy_health [player ] in ("easy" , "default" )
1104+ or can_kill_most_things (state , player , 1 )))
10851105
10861106 set_rule (world .get_location ('Sewers - Key Rat Key Drop' , player ),
1087- lambda state : state ._lttp_has_key ('Small Key (Hyrule Castle)' , player , 3 ))
1107+ lambda state : state ._lttp_has_key ('Small Key (Hyrule Castle)' , player , 3 )
1108+ and can_kill_most_things (state , player , 1 ))
10881109 else :
10891110 set_rule (world .get_location ('Hyrule Castle - Zelda\' s Chest' , player ),
10901111 lambda state : state .has ('Big Key (Hyrule Castle)' , player ))
0 commit comments