2018-01-27 17:17:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  collections  
						 
					
						
							
								
									
										
										
										
											2017-05-20 14:04:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  logging  
						 
					
						
							
								
									
										
										
										
											2020-10-24 05:38:56 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  worlds . alttp  import  OverworldGlitchRules  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  BaseClasses  import  RegionType ,  MultiWorld ,  Entrance  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  worlds . alttp . Items  import  ItemFactory ,  progression_items ,  item_name_groups  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  worlds . alttp . OverworldGlitchRules  import  overworld_glitches_rules ,  no_logic_rules  
						 
					
						
							
								
									
										
										
										
											2021-06-07 20:19:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  worlds . alttp . UnderworldGlitchRules  import  underworld_glitches_rules  
						 
					
						
							
								
									
										
										
										
											2020-10-24 05:38:56 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  worlds . alttp . Bosses  import  GanonDefeatRule  
						 
					
						
							
								
									
										
										
										
											2021-02-24 00:36:37 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  worlds . generic . Rules  import  set_rule ,  add_rule ,  forbid_item ,  add_item_rule ,  item_in_locations ,  \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    item_name 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 09:59:20 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  worlds . alttp . Options  import  smallkey_shuffle  
						 
					
						
							
								
									
										
										
										
											2017-05-20 14:04:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-22 15:51:50 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  set_rules ( world ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    player  =  world . player 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world  =  world . world 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-16 13:26:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . logic [ player ]  ==  ' nologic ' : 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-05 16:51:23 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        logging . info ( 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-19 03:01:23 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ' WARNING! Seeds generated under this logic often require major glitches and may be impossible! ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-22 11:18:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-12 20:19:45 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  world . players  ==  1 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            world . get_region ( ' Menu ' ,  player ) . can_reach_private  =  lambda  state :  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            no_logic_rules ( world ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  exit  in  world . get_region ( ' Menu ' ,  player ) . exits : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                exit . hide_path  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            # Set access rules according to max glitches for multiworld progression. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # Set accessibility to none, and shuffle assuming the no logic players can always win 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-12 20:19:45 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            world . accessibility [ player ]  =  ' none ' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            world . progression_balancing [ player ]  =  False 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-19 03:01:23 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-02-22 11:18:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        world . completion_condition [ player ]  =  lambda  state :  state . has ( ' Triforce ' ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    global_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-03 17:16:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    dungeon_boss_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-19 03:01:23 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-16 16:54:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . mode [ player ]  !=  ' inverted ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        default_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-04 14:23:57 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-16 16:54:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . mode [ player ]  ==  ' open ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        open_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-16 16:54:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  world . mode [ player ]  ==  ' standard ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        standard_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-16 16:54:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  world . mode [ player ]  ==  ' inverted ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        open_rules ( world ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        inverted_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-16 21:23:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-05 14:51:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        raise  NotImplementedError ( f ' World state  { world . mode [ player ] }  is not implemented yet ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-16 21:23:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-16 13:26:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . logic [ player ]  ==  ' noglitches ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        no_glitches_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-07 01:19:27 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  world . logic [ player ]  ==  ' owglitches ' : 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-10 01:02:27 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # Initially setting no_glitches_rules to set the baseline rules for some 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # entrances. The overworld_glitches_rules set is primarily additive. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        no_glitches_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:07:53 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        fake_flipper_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-31 19:44:58 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        overworld_glitches_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-07 01:19:27 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  world . logic [ player ]  in  [ ' hybridglitches ' ,  ' nologic ' ] :  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        no_glitches_rules ( world ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        fake_flipper_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-31 19:44:58 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        overworld_glitches_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-07 01:19:27 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        underworld_glitches_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-16 13:26:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  world . logic [ player ]  ==  ' minorglitches ' : 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-10 03:24:19 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        no_glitches_rules ( world ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        fake_flipper_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-18 22:46:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-17 20:50:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        raise  NotImplementedError ( f ' Not implemented yet: Logic -  { world . logic [ player ] } ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-18 22:46:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-03-14 08:38:02 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . goal [ player ]  ==  ' bosses ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # require all bosses to beat ganon 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-25 18:25:14 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_location ( ' Ganon ' ,  player ) ,  lambda  state :  state . can_reach ( ' Master Sword Pedestal ' ,  ' Location ' ,  player )  and  state . has ( ' Beat Agahnim 1 ' ,  player )  and  state . has ( ' Beat Agahnim 2 ' ,  player )  and  state . has_crystals ( 7 ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-16 15:27:20 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  world . goal [ player ]  ==  ' ganon ' : 
							 
						 
					
						
							
								
									
										
										
										
											2017-08-01 19:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # require aga2 to beat ganon 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_location ( ' Ganon ' ,  player ) ,  lambda  state :  state . has ( ' Beat Agahnim 2 ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-16 16:54:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . mode [ player ]  !=  ' inverted ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_big_bomb_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-14 22:10:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  world . logic [ player ]  in  { ' owglitches ' ,  ' hybridglitches ' ,  ' nologic ' }  and  world . shuffle [ player ]  not  in  { ' insanity ' ,  ' insanity_legacy ' ,  ' madness ' } : 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-08 19:32:04 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            path_to_courtyard  =  mirrorless_path_to_castle_courtyard ( world ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . world . get_entrance ( ' Dark Death Mountain Offset Mirror ' ,  player ) . can_reach ( state )  and  all ( rule ( state )  for  rule  in  path_to_courtyard ) ,  ' or ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_inverted_big_bomb_rules ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-20 14:04:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # if swamp and dam have not been moved we require mirror for swamp palace 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-07 01:19:27 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # however there is mirrorless swamp in hybrid MG, so we don't necessarily want this. HMG handles this requirement itself.  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  not  world . swamp_patch_required [ player ]  and  world . logic [ player ]  not  in  [ ' hybridglitches ' ,  ' nologic ' ] : 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Swamp Palace Moat ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-20 14:04:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 23:46:34 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # GT Entrance may be required for Turtle Rock for OWG and < 7 required 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-15 20:24:18 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ganons_tower  =  world . get_entrance ( ' Inverted Ganons Tower '  if  world . mode [ player ]  ==  ' inverted '  else  ' Ganons Tower ' ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-14 22:10:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . crystals_needed_for_gt [ player ]  ==  7  and  not  ( world . logic [ player ]  in  [ ' owglitches ' ,  ' hybridglitches ' ,  ' nologic ' ]  and  world . mode [ player ]  !=  ' inverted ' ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 23:46:34 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( ganons_tower ,  lambda  state :  False ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-15 20:24:18 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_trock_key_rules ( world ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-03-14 22:59:41 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( ganons_tower ,  lambda  state :  state . has_crystals ( state . world . crystals_needed_for_gt [ player ] ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-14 22:10:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . mode [ player ]  !=  ' inverted '  and  world . logic [ player ]  in  [ ' owglitches ' ,  ' hybridglitches ' ,  ' nologic ' ] : 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 01:34:30 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Ganons Tower ' ,  player ) ,  lambda  state :  state . world . get_entrance ( ' Ganons Tower Ascent ' ,  player ) . can_reach ( state ) ,  ' or ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-15 20:24:18 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_bunny_rules ( world ,  player ,  world . mode [ player ]  ==  ' inverted ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 16:31:56 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-05-15 20:28:04 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-08 19:32:04 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  mirrorless_path_to_castle_courtyard ( world ,  player ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # If Agahnim is defeated then the courtyard needs to be accessible without using the mirror for the mirror offset glitch. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # Only considering the secret passage for now (in non-insanity shuffle).  Basically, if it's Ganon you need the master sword. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    start  =  world . get_entrance ( ' Hyrule Castle Secret Entrance Drop ' ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    target  =  world . get_region ( ' Hyrule Castle Courtyard ' ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    seen  =  { start . parent_region ,  start . connected_region } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    queue  =  collections . deque ( [ ( start . connected_region ,  [ ] ) ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    while  queue : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ( current ,  path )  =  queue . popleft ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  entrance  in  current . exits : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  entrance . connected_region  not  in  seen : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                new_path  =  path  +  [ entrance . access_rule ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  entrance . connected_region  ==  target : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    return  new_path 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    queue . append ( ( entrance . connected_region ,  new_path ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-09 09:15:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    raise  Exception ( f " Could not find mirrorless path to castle courtyard for Player  { player }  ( { world . get_player_name ( player ) } ) " ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-19 15:20:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-05-15 20:28:04 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-26 13:12:20 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  set_defeat_dungeon_boss_rule ( location ) :  
						 
					
						
							
								
									
										
										
										
											2020-08-28 23:10:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Lambda required to defer evaluation of dungeon.boss since it will change later if boss shuffle is used 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-26 13:12:20 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( location ,  lambda  state :  location . parent_region . dungeon . boss . can_defeat ( state ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 00:39:53 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  set_always_allow ( spot ,  rule ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    spot . always_allow  =  rule 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-05-15 20:28:04 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-24 05:38:56 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  add_lamp_requirement ( world :  MultiWorld ,  spot ,  player :  int ,  has_accessible_torch :  bool  =  False ) :  
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . dark_room_logic [ player ]  ==  " lamp " : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        add_rule ( spot ,  lambda  state :  state . has ( ' Lamp ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 20:19:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  world . dark_room_logic [ player ]  ==  " torches " :   # implicitly lamp as well 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  has_accessible_torch : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            add_rule ( spot ,  lambda  state :  state . has ( ' Lamp ' ,  player )  or  state . has ( ' Fire Rod ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            add_rule ( spot ,  lambda  state :  state . has ( ' Lamp ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    elif  world . dark_room_logic [ player ]  ==  " none " : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pass 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        raise  ValueError ( f " Unknown Dark Room Logic:  { world . dark_room_logic [ player ] } " ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-20 15:47:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-09 16:36:10 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								non_crossover_items  =  ( item_name_groups [ " Small Keys " ]  |  item_name_groups [ " Big Keys " ]  |  progression_items )  -  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " Small Key (Universal) " } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-03 17:16:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  dungeon_boss_rules ( world ,  player ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    boss_locations  =  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Agahnim 1 ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Tower of Hera - Boss ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Tower of Hera - Prize ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Swamp Palace - Boss ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Swamp Palace - Prize ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Thieves \'  Town - Boss ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Thieves \'  Town - Prize ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Skull Woods - Boss ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Skull Woods - Prize ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Ice Palace - Boss ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Ice Palace - Prize ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Misery Mire - Boss ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Misery Mire - Prize ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Turtle Rock - Boss ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Turtle Rock - Prize ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Palace of Darkness - Boss ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ' Palace of Darkness - Prize ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    for  location  in  boss_locations : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_defeat_dungeon_boss_rule ( world . get_location ( location ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-06-19 01:31:32 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  global_rules ( world ,  player ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # ganon can only carry triforce 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_item_rule ( world . get_location ( ' Ganon ' ,  player ) ,  lambda  item :  item . name  ==  ' Triforce '  and  item . player  ==  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-10 19:27:13 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # determines which S&Q locations are available - hide from paths since it isn't an in-game location 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . get_region ( ' Menu ' ,  player ) . can_reach_private  =  lambda  state :  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    for  exit  in  world . get_region ( ' Menu ' ,  player ) . exits : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        exit . hide_path  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Old Man S&Q ' ,  player ) ,  lambda  state :  state . can_reach ( ' Old Man ' ,  ' Location ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-20 15:47:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Sunken Treasure ' ,  player ) ,  lambda  state :  state . has ( ' Open Floodgate ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Dark Blacksmith Ruins ' ,  player ) ,  lambda  state :  state . has ( ' Return Smith ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-03 02:19:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Purple Chest ' ,  player ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             lambda  state :  state . has ( ' Pick Up Purple Chest ' ,  player ) )   # Can S&Q with chest 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Ether Tablet ' ,  player ) ,  lambda  state :  state . can_retrieve_tablet ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Master Sword Pedestal ' ,  player ) ,  lambda  state :  state . has ( ' Red Pendant ' ,  player )  and  state . has ( ' Blue Pendant ' ,  player )  and  state . has ( ' Green Pendant ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Missing Smith ' ,  player ) ,  lambda  state :  state . has ( ' Get Frog ' ,  player )  and  state . can_reach ( ' Blacksmiths Hut ' ,  ' Region ' ,  player ) )  # Can't S&Q with smith 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Blacksmith ' ,  player ) ,  lambda  state :  state . has ( ' Return Smith ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Magic Bat ' ,  player ) ,  lambda  state :  state . has ( ' Magic Powder ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-21 09:45:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Sick Kid ' ,  player ) ,  lambda  state :  state . has_group ( " Bottles " ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Library ' ,  player ) ,  lambda  state :  state . has ( ' Pegasus Boots ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Mimic Cave ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Sahasrahla ' ,  player ) ,  lambda  state :  state . has ( ' Green Pendant ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Spike Cave ' ,  player ) ,  lambda  state : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             state . has ( ' Hammer ' ,  player )  and  state . can_lift_rocks ( player )  and 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             ( ( state . has ( ' Cape ' ,  player )  and  state . can_extend_magic ( player ,  16 ,  True ) )  or 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-24 16:22:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								              ( state . has ( ' Cane of Byrna ' ,  player )  and 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               ( state . can_extend_magic ( player ,  12 ,  True )  or 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ( state . world . can_take_damage [ player ]  and  ( state . has ( ' Pegasus Boots ' ,  player )  or  state . has_hearts ( player ,  4 ) ) ) ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-24 16:22:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-06 13:39:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Hookshot Cave - Top Right ' ,  player ) ,  lambda  state :  state . has ( ' Hookshot ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Hookshot Cave - Top Left ' ,  player ) ,  lambda  state :  state . has ( ' Hookshot ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-24 16:22:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Hookshot Cave - Bottom Right ' ,  player ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             lambda  state :  state . has ( ' Hookshot ' ,  player )  or  state . has ( ' Pegasus Boots ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Hookshot Cave - Bottom Left ' ,  player ) ,  lambda  state :  state . has ( ' Hookshot ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-15 20:28:04 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-06-24 16:22:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Sewers Door ' ,  player ) , 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             lambda  state :  state . _lttp_has_key ( ' Small Key (Hyrule Castle) ' ,  player )  or  ( 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 09:59:20 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                         world . smallkey_shuffle [ player ]  ==  smallkey_shuffle . option_universal  and  world . mode [ 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-20 20:13:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                     player ]  ==  ' standard ' ) )   # standard universal small keys cannot access the shop 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-24 16:22:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Sewers Back Door ' ,  player ) , 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             lambda  state :  state . _lttp_has_key ( ' Small Key (Hyrule Castle) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-24 16:22:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Agahnim 1 ' ,  player ) , 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             lambda  state :  state . has_sword ( player )  and  state . _lttp_has_key ( ' Small Key (Agahnims Tower) ' ,  player ,  2 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-03 17:16:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 01:34:30 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Castle Tower - Room 03 ' ,  player ) ,  lambda  state :  state . can_kill_most_things ( player ,  8 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-24 16:22:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Castle Tower - Dark Maze ' ,  player ) , 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             lambda  state :  state . can_kill_most_things ( player ,  8 )  and  state . _lttp_has_key ( ' Small Key (Agahnims Tower) ' , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-24 16:22:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                                                                   player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Eastern Palace - Big Chest ' ,  player ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             lambda  state :  state . has ( ' Big Key (Eastern Palace) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-17 01:55:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ep_boss  =  world . get_location ( ' Eastern Palace - Boss ' ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( ep_boss ,  lambda  state :  state . has ( ' Big Key (Eastern Palace) ' ,  player )  and 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                    ep_boss . parent_region . dungeon . boss . can_defeat ( state ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ep_prize  =  world . get_location ( ' Eastern Palace - Prize ' ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( ep_prize ,  lambda  state :  state . has ( ' Big Key (Eastern Palace) ' ,  player )  and 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                     ep_prize . parent_region . dungeon . boss . can_defeat ( state ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  not  world . enemy_shuffle [ player ] : 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-17 01:55:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( ep_boss ,  lambda  state :  state . can_shoot_arrows ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-24 00:36:37 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( ep_prize ,  lambda  state :  state . can_shoot_arrows ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-15 20:28:04 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Desert Palace - Big Chest ' ,  player ) ,  lambda  state :  state . has ( ' Big Key (Desert Palace) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Desert Palace - Torch ' ,  player ) ,  lambda  state :  state . has ( ' Pegasus Boots ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Desert Palace East Wing ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Desert Palace) ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Desert Palace - Prize ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Desert Palace) ' ,  player )  and  state . has ( ' Big Key (Desert Palace) ' ,  player )  and  state . has_fire_source ( player )  and  state . world . get_location ( ' Desert Palace - Prize ' ,  player ) . parent_region . dungeon . boss . can_defeat ( state ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Desert Palace - Boss ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Desert Palace) ' ,  player )  and  state . has ( ' Big Key (Desert Palace) ' ,  player )  and  state . has_fire_source ( player )  and  state . world . get_location ( ' Desert Palace - Boss ' ,  player ) . parent_region . dungeon . boss . can_defeat ( state ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 18:11:58 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # logic patch to prevent placing a crystal in Desert that's required to reach the required keys 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 18:00:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  not  ( world . smallkey_shuffle [ player ]  and  world . bigkey_shuffle [ player ] ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-10 19:27:13 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_location ( ' Desert Palace - Prize ' ,  player ) ,  lambda  state :  state . world . get_region ( ' Desert Palace Main (Outer) ' ,  player ) . can_reach ( state ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 18:11:58 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Tower of Hera Small Key Door ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Tower of Hera) ' ,  player )  or  item_name ( state ,  ' Tower of Hera - Big Key Chest ' ,  player )  ==  ( ' Small Key (Tower of Hera) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Tower of Hera Big Key Door ' ,  player ) ,  lambda  state :  state . has ( ' Big Key (Tower of Hera) ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Tower of Hera - Big Chest ' ,  player ) ,  lambda  state :  state . has ( ' Big Key (Tower of Hera) ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Tower of Hera - Big Key Chest ' ,  player ) ,  lambda  state :  state . has_fire_source ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-17 12:14:29 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . accessibility [ player ]  !=  ' locations ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-04 17:40:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_always_allow ( world . get_location ( ' Tower of Hera - Big Key Chest ' ,  player ) ,  lambda  state ,  item :  item . name  ==  ' Small Key (Tower of Hera) '  and  item . player  ==  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Swamp Palace Moat ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player )  and  state . has ( ' Open Floodgate ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Swamp Palace Small Key Door ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Swamp Palace) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Swamp Palace (Center) ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Swamp Palace - Big Chest ' ,  player ) ,  lambda  state :  state . has ( ' Big Key (Swamp Palace) ' ,  player )  or  item_name ( state ,  ' Swamp Palace - Big Chest ' ,  player )  ==  ( ' Big Key (Swamp Palace) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-17 12:14:29 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . accessibility [ player ]  !=  ' locations ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-04 17:40:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_always_allow ( world . get_location ( ' Swamp Palace - Big Chest ' ,  player ) ,  lambda  state ,  item :  item . name  ==  ' Big Key (Swamp Palace) '  and  item . player  ==  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Swamp Palace (North) ' ,  player ) ,  lambda  state :  state . has ( ' Hookshot ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 18:00:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  not  world . smallkey_shuffle [ player ]  and  world . logic [ player ]  !=  ' nologic ' : 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-16 18:59:23 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        forbid_item ( world . get_location ( ' Swamp Palace - Entrance ' ,  player ) ,  ' Big Key (Swamp Palace) ' ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Thieves Town Big Key Door ' ,  player ) ,  lambda  state :  state . has ( ' Big Key (Thieves Town) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Blind Fight ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Thieves Town) ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Thieves \'  Town - Big Chest ' ,  player ) ,  lambda  state :  ( state . _lttp_has_key ( ' Small Key (Thieves Town) ' ,  player )  or  item_name ( state ,  ' Thieves \'  Town - Big Chest ' ,  player )  ==  ( ' Small Key (Thieves Town) ' ,  player ) )  and  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-17 12:14:29 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . accessibility [ player ]  !=  ' locations ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-04 17:40:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_always_allow ( world . get_location ( ' Thieves \'  Town - Big Chest ' ,  player ) ,  lambda  state ,  item :  item . name  ==  ' Small Key (Thieves Town) '  and  item . player  ==  player  and  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Thieves \'  Town - Attic ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Thieves Town) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Skull Woods First Section South Door ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Skull Woods) ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Skull Woods First Section (Right) North Door ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Skull Woods) ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Skull Woods First Section West Door ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Skull Woods) ' ,  player ,  2 ) )   # ideally would only be one key, but we may have spent thst key already on escaping the right section 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Skull Woods First Section (Left) Door to Exit ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Skull Woods) ' ,  player ,  2 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Skull Woods - Big Chest ' ,  player ) ,  lambda  state :  state . has ( ' Big Key (Skull Woods) ' ,  player )  or  item_name ( state ,  ' Skull Woods - Big Chest ' ,  player )  ==  ( ' Big Key (Skull Woods) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-17 12:14:29 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . accessibility [ player ]  !=  ' locations ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-04 17:40:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_always_allow ( world . get_location ( ' Skull Woods - Big Chest ' ,  player ) ,  lambda  state ,  item :  item . name  ==  ' Big Key (Skull Woods) '  and  item . player  ==  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Skull Woods Torch Room ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Skull Woods) ' ,  player ,  3 )  and  state . has ( ' Fire Rod ' ,  player )  and  state . has_sword ( player ) )   # sword required for curtain 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-15 20:28:04 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ice Palace Entrance Room ' ,  player ) ,  lambda  state :  state . can_melt_things ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Ice Palace - Big Chest ' ,  player ) ,  lambda  state :  state . has ( ' Big Key (Ice Palace) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ice Palace (Kholdstare) ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player )  and  state . has ( ' Hammer ' ,  player )  and  state . has ( ' Big Key (Ice Palace) ' ,  player )  and  ( state . _lttp_has_key ( ' Small Key (Ice Palace) ' ,  player ,  2 )  or  ( state . has ( ' Cane of Somaria ' ,  player )  and  state . _lttp_has_key ( ' Small Key (Ice Palace) ' ,  player ,  1 ) ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-24 00:36:37 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ice Palace (East) ' ,  player ) ,  lambda  state :  ( state . has ( ' Hookshot ' ,  player )  or  ( 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                item_in_locations ( state ,  ' Big Key (Ice Palace) ' ,  player ,  [ ( ' Ice Palace - Spike Room ' ,  player ) ,  ( ' Ice Palace - Big Key Chest ' ,  player ) ,  ( ' Ice Palace - Map Chest ' ,  player ) ] )  and  state . _lttp_has_key ( ' Small Key (Ice Palace) ' ,  player ) ) )  and  ( state . world . can_take_damage [ player ]  or  state . has ( ' Hookshot ' ,  player )  or  state . has ( ' Cape ' ,  player )  or  state . has ( ' Cane of Byrna ' ,  player ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ice Palace (East Top) ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player )  and  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-15 20:28:04 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Misery Mire Entrance Gap ' ,  player ) ,  lambda  state :  ( state . has ( ' Pegasus Boots ' ,  player )  or  state . has ( ' Hookshot ' ,  player ) )  and  ( state . has_sword ( player )  or  state . has ( ' Fire Rod ' ,  player )  or  state . has ( ' Ice Rod ' ,  player )  or  state . has ( ' Hammer ' ,  player )  or  state . has ( ' Cane of Somaria ' ,  player )  or  state . can_shoot_arrows ( player ) ) )   # need to defeat wizzrobes, bombs don't work ... 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Misery Mire - Big Chest ' ,  player ) ,  lambda  state :  state . has ( ' Big Key (Misery Mire) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-04 11:13:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Misery Mire - Spike Chest ' ,  player ) ,  lambda  state :  ( state . world . can_take_damage [ player ]  and  state . has_hearts ( player ,  4 ) )  or  state . has ( ' Cane of Byrna ' ,  player )  or  state . has ( ' Cape ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Misery Mire Big Key Door ' ,  player ) ,  lambda  state :  state . has ( ' Big Key (Misery Mire) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-17 13:15:37 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # you can squander the free small key from the pot by opening the south door to the north west switch room, locking you out of accessing a color switch ... 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-24 18:49:50 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # big key gives backdoor access to that from the teleporter in the north west 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Misery Mire - Map Chest ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Misery Mire) ' ,  player ,  1 )  or  state . has ( ' Big Key (Misery Mire) ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Misery Mire - Main Lobby ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Misery Mire) ' ,  player ,  1 )  or  state . _lttp_has_key ( ' Big Key (Misery Mire) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-15 20:28:04 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    # we can place a small key in the West wing iff it also contains/blocks the Big Key, as we cannot reach and softlock with the basement key door yet 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Misery Mire (West) ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Misery Mire) ' ,  player ,  2 )  if  ( ( 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-24 00:36:37 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                                                                                                                                 item_name ( state ,  ' Misery Mire - Compass Chest ' ,  player )  in  [ ( ' Big Key (Misery Mire) ' ,  player ) ] )  or 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                                                                                                                     ( 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                                                                                                                                 item_name ( state ,  ' Misery Mire - Big Key Chest ' ,  player )  in  [ ( ' Big Key (Misery Mire) ' ,  player ) ] ) )  else  state . _lttp_has_key ( ' Small Key (Misery Mire) ' ,  player ,  3 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Misery Mire - Compass Chest ' ,  player ) ,  lambda  state :  state . has_fire_source ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Misery Mire - Big Key Chest ' ,  player ) ,  lambda  state :  state . has_fire_source ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Misery Mire (Vitreous) ' ,  player ) ,  lambda  state :  state . has ( ' Cane of Somaria ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Turtle Rock Entrance Gap ' ,  player ) ,  lambda  state :  state . has ( ' Cane of Somaria ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Turtle Rock Entrance Gap Reverse ' ,  player ) ,  lambda  state :  state . has ( ' Cane of Somaria ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Turtle Rock - Compass Chest ' ,  player ) ,  lambda  state :  state . has ( ' Cane of Somaria ' ,  player ) )   # We could get here from the middle section without Cane as we don't cross the entrance gap! 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Turtle Rock - Roller Room - Left ' ,  player ) ,  lambda  state :  state . has ( ' Cane of Somaria ' ,  player )  and  state . has ( ' Fire Rod ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Turtle Rock - Roller Room - Right ' ,  player ) ,  lambda  state :  state . has ( ' Cane of Somaria ' ,  player )  and  state . has ( ' Fire Rod ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Turtle Rock - Big Chest ' ,  player ) ,  lambda  state :  state . has ( ' Big Key (Turtle Rock) ' ,  player )  and  ( state . has ( ' Cane of Somaria ' ,  player )  or  state . has ( ' Hookshot ' ,  player ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Turtle Rock (Big Chest) (North) ' ,  player ) ,  lambda  state :  state . has ( ' Cane of Somaria ' ,  player )  or  state . has ( ' Hookshot ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Turtle Rock Big Key Door ' ,  player ) ,  lambda  state :  state . has ( ' Big Key (Turtle Rock) ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Turtle Rock (Dark Room) (North) ' ,  player ) ,  lambda  state :  state . has ( ' Cane of Somaria ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Turtle Rock (Dark Room) (South) ' ,  player ) ,  lambda  state :  state . has ( ' Cane of Somaria ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Turtle Rock - Eye Bridge - Bottom Left ' ,  player ) ,  lambda  state :  state . has ( ' Cane of Byrna ' ,  player )  or  state . has ( ' Cape ' ,  player )  or  state . has ( ' Mirror Shield ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Turtle Rock - Eye Bridge - Bottom Right ' ,  player ) ,  lambda  state :  state . has ( ' Cane of Byrna ' ,  player )  or  state . has ( ' Cape ' ,  player )  or  state . has ( ' Mirror Shield ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Turtle Rock - Eye Bridge - Top Left ' ,  player ) ,  lambda  state :  state . has ( ' Cane of Byrna ' ,  player )  or  state . has ( ' Cape ' ,  player )  or  state . has ( ' Mirror Shield ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Turtle Rock - Eye Bridge - Top Right ' ,  player ) ,  lambda  state :  state . has ( ' Cane of Byrna ' ,  player )  or  state . has ( ' Cape ' ,  player )  or  state . has ( ' Mirror Shield ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Turtle Rock (Trinexx) ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Turtle Rock) ' ,  player ,  4 )  and  state . has ( ' Big Key (Turtle Rock) ' ,  player )  and  state . has ( ' Cane of Somaria ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  not  world . enemy_shuffle [ player ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Palace of Darkness Bonk Wall ' ,  player ) ,  lambda  state :  state . can_shoot_arrows ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Palace of Darkness Hammer Peg Drop ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Palace of Darkness Bridge Room ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Palace of Darkness) ' ,  player ,  1 ) )   # If we can reach any other small key door, we already have back door access to this area 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Palace of Darkness Big Key Door ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Palace of Darkness) ' ,  player ,  6 )  and  state . has ( ' Big Key (Palace of Darkness) ' ,  player )  and  state . can_shoot_arrows ( player )  and  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Palace of Darkness (North) ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Palace of Darkness) ' ,  player ,  4 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Palace of Darkness - Big Chest ' ,  player ) ,  lambda  state :  state . has ( ' Big Key (Palace of Darkness) ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Palace of Darkness Big Key Chest Staircase ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Palace of Darkness) ' ,  player ,  6 )  or  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                item_name ( state ,  ' Palace of Darkness - Big Key Chest ' ,  player )  in  [ ( ' Small Key (Palace of Darkness) ' ,  player ) ]  and  state . _lttp_has_key ( ' Small Key (Palace of Darkness) ' ,  player ,  3 ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-17 12:14:29 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . accessibility [ player ]  !=  ' locations ' : 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_always_allow ( world . get_location ( ' Palace of Darkness - Big Key Chest ' ,  player ) ,  lambda  state ,  item :  item . name  ==  ' Small Key (Palace of Darkness) '  and  item . player  ==  player  and  state . _lttp_has_key ( ' Small Key (Palace of Darkness) ' ,  player ,  5 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Palace of Darkness Spike Statue Room Door ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Palace of Darkness) ' ,  player ,  6 )  or  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                item_name ( state ,  ' Palace of Darkness - Harmless Hellway ' ,  player )  in  [ ( ' Small Key (Palace of Darkness) ' ,  player ) ]  and  state . _lttp_has_key ( ' Small Key (Palace of Darkness) ' ,  player ,  4 ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-17 12:14:29 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . accessibility [ player ]  !=  ' locations ' : 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_always_allow ( world . get_location ( ' Palace of Darkness - Harmless Hellway ' ,  player ) ,  lambda  state ,  item :  item . name  ==  ' Small Key (Palace of Darkness) '  and  item . player  ==  player  and  state . _lttp_has_key ( ' Small Key (Palace of Darkness) ' ,  player ,  5 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-04 17:40:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Palace of Darkness Maze Door ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Palace of Darkness) ' ,  player ,  6 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-15 20:28:04 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # these key rules are conservative, you might be able to get away with more lenient rules 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-08 22:13:36 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    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 ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    compass_room_chests  =  [ ' Ganons Tower - Compass Room - Top Left ' ,  ' Ganons Tower - Compass Room - Top Right ' ,  ' Ganons Tower - Compass Room - Bottom Left ' ,  ' Ganons Tower - Compass Room - Bottom Right ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 20:43:37 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Ganons Tower - Bob \' s Torch ' ,  player ) ,  lambda  state :  state . has ( ' Pegasus Boots ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ganons Tower (Tile Room) ' ,  player ) ,  lambda  state :  state . has ( ' Cane of Somaria ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ganons Tower (Hookshot Room) ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player )  and  ( state . has ( ' Hookshot ' ,  player )  or  state . has ( ' Pegasus Boots ' ,  player ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ganons Tower (Map Room) ' ,  player ) ,  lambda  state :  state . _lttp_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 . _lttp_has_key ( ' Small Key (Ganons Tower) ' ,  player ,  3 ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-17 12:14:29 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . accessibility [ player ]  !=  ' locations ' : 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        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 . _lttp_has_key ( ' Small Key (Ganons Tower) ' ,  player ,  3 )  and  state . can_reach ( ' Ganons Tower (Hookshot Room) ' ,  ' region ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 00:39:53 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # 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. 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 00:39:53 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # However we need to leave these at the lower values to derive that with 3 keys it is always possible to reach Bob and Ice Armos. 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ganons Tower (Double Switch Room) ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Ganons Tower) ' ,  player ,  2 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-08 22:13:36 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # It is possible to need more than 3 keys .... 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ganons Tower (Firesnake Room) ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Ganons Tower) ' ,  player ,  3 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 20:43:37 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-08 22:13:36 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    #The actual requirements for these rooms to avoid key-lock 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Ganons Tower - Firesnake Room ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Ganons Tower) ' ,  player ,  3 )  or  ( ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                                                                                                                                             item_in_locations ( state ,  ' Big Key (Ganons Tower) ' ,  player ,  zip ( randomizer_room_chests ,  [ player ]  *  len ( randomizer_room_chests ) ) )  or  item_in_locations ( state ,  ' Small Key (Ganons Tower) ' ,  player ,  [ ( ' Ganons Tower - Firesnake Room ' ,  player ) ] ) )  and  state . _lttp_has_key ( ' Small Key (Ganons Tower) ' ,  player ,  2 ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-08 22:13:36 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    for  location  in  randomizer_room_chests : 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_location ( location ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Ganons Tower) ' ,  player ,  4 )  or  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    item_in_locations ( state ,  ' Big Key (Ganons Tower) ' ,  player ,  zip ( randomizer_room_chests ,  [ player ]  *  len ( randomizer_room_chests ) ) )  and  state . _lttp_has_key ( ' Small Key (Ganons Tower) ' ,  player ,  3 ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 20:43:37 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-08 22:13:36 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Once again it is possible to need more than 3 keys... 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ganons Tower (Tile Room) Key Door ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Ganons Tower) ' ,  player ,  3 )  and  state . has ( ' Fire Rod ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-08 22:13:36 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Actual requirements 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    for  location  in  compass_room_chests : 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_location ( location ,  player ) ,  lambda  state :  state . has ( ' Fire Rod ' ,  player )  and  ( state . _lttp_has_key ( ' Small Key (Ganons Tower) ' ,  player ,  4 )  or  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    item_in_locations ( state ,  ' Big Key (Ganons Tower) ' ,  player ,  zip ( compass_room_chests ,  [ player ]  *  len ( compass_room_chests ) ) )  and  state . _lttp_has_key ( ' Small Key (Ganons Tower) ' ,  player ,  3 ) ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 20:43:37 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Ganons Tower - Big Chest ' ,  player ) ,  lambda  state :  state . has ( ' Big Key (Ganons Tower) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-26 13:12:20 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Ganons Tower - Big Key Room - Left ' ,  player ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             lambda  state :  state . world . get_location ( ' Ganons Tower - Big Key Room - Left ' ,  player ) . parent_region . dungeon . bosses [ ' bottom ' ] . can_defeat ( state ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Ganons Tower - Big Key Chest ' ,  player ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             lambda  state :  state . world . get_location ( ' Ganons Tower - Big Key Chest ' ,  player ) . parent_region . dungeon . bosses [ ' bottom ' ] . can_defeat ( state ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Ganons Tower - Big Key Room - Right ' ,  player ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             lambda  state :  state . world . get_location ( ' Ganons Tower - Big Key Room - Right ' ,  player ) . parent_region . dungeon . bosses [ ' bottom ' ] . can_defeat ( state ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  world . enemy_shuffle [ player ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Ganons Tower Big Key Door ' ,  player ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 lambda  state :  state . has ( ' Big Key (Ganons Tower) ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Ganons Tower Big Key Door ' ,  player ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 lambda  state :  state . has ( ' Big Key (Ganons Tower) ' ,  player )  and  state . can_shoot_arrows ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ganons Tower Torch Rooms ' ,  player ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             lambda  state :  state . has_fire_source ( player )  and  state . world . get_entrance ( ' Ganons Tower Torch Rooms ' ,  player ) . parent_region . dungeon . bosses [ ' middle ' ] . can_defeat ( state ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Ganons Tower - Pre-Moldorm Chest ' ,  player ) , 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             lambda  state :  state . _lttp_has_key ( ' Small Key (Ganons Tower) ' ,  player ,  3 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ganons Tower Moldorm Door ' ,  player ) , 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             lambda  state :  state . _lttp_has_key ( ' Small Key (Ganons Tower) ' ,  player ,  4 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ganons Tower Moldorm Gap ' ,  player ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             lambda  state :  state . has ( ' Hookshot ' ,  player )  and  state . world . get_entrance ( ' Ganons Tower Moldorm Gap ' ,  player ) . parent_region . dungeon . bosses [ ' top ' ] . can_defeat ( state ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_defeat_dungeon_boss_rule ( world . get_location ( ' Agahnim 2 ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ganon  =  world . get_location ( ' Ganon ' ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( ganon ,  lambda  state :  GanonDefeatRule ( state ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-26 07:18:53 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . goal [ player ]  in  [ ' ganontriforcehunt ' ,  ' localganontriforcehunt ' ] : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-14 22:59:41 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( ganon ,  lambda  state :  state . has_triforce_pieces ( state . world . treasure_hunt_count [ player ] ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-15 15:24:52 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  world . goal [ player ]  ==  ' ganonpedestal ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        add_rule ( world . get_location ( ' Ganon ' ,  player ) ,  lambda  state :  state . can_reach ( ' Master Sword Pedestal ' ,  ' Location ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-26 07:18:53 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-14 22:59:41 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( ganon ,  lambda  state :  state . has_crystals ( state . world . crystals_needed_for_ganon [ player ] ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ganon Drop ' ,  player ) ,  lambda  state :  state . has_beam_sword ( player ) )   # need to damage ganon to get tiles to drop 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-15 20:28:04 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-02-02 11:24:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Flute Activation Spot ' ,  player ) ,  lambda  state :  state . has ( ' Flute ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-09-21 21:59:16 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  default_rules ( world ,  player ) :  
						 
					
						
							
								
									
										
										
										
											2020-12-05 14:51:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    """ Default world rules when world state is not inverted. """ 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # overworld requirements 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Kings Grave ' ,  player ) ,  lambda  state :  state . has ( ' Pegasus Boots ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Kings Grave Outer Rocks ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Kings Grave Inner Rocks ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Kings Grave Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Caution: If king's grave is releaxed at all to account for reaching it via a two way cave's exit in insanity mode, then the bomb shop logic will need to be updated (that would involve create a small ledge-like Region for it) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bonk Fairy (Light) ' ,  player ) ,  lambda  state :  state . has ( ' Pegasus Boots ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Lumberjack Tree Tree ' ,  player ) ,  lambda  state :  state . has ( ' Pegasus Boots ' ,  player )  and  state . has ( ' Beat Agahnim 1 ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bonk Rock Cave ' ,  player ) ,  lambda  state :  state . has ( ' Pegasus Boots ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Desert Palace Stairs ' ,  player ) ,  lambda  state :  state . has ( ' Book of Mudora ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Sanctuary Grave ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' 20 Rupee Cave ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' 50 Rupee Cave ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Death Mountain Entrance Rock ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bumper Cave Entrance Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-02 11:24:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Flute Spot 1 ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Lake Hylia Central Island Teleporter ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-02 11:24:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Desert Teleporter ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player )  and  state . can_lift_heavy_rocks ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' East Hyrule Teleporter ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player )  and  state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) )  # bunny cannot use hammer 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' South Hyrule Teleporter ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player )  and  state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) )  # bunny cannot use hammer 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Kakariko Teleporter ' ,  player ) ,  lambda  state :  ( ( state . has ( ' Hammer ' ,  player )  and  state . can_lift_rocks ( player ) )  or  state . can_lift_heavy_rocks ( player ) )  and  state . has ( ' Moon Pearl ' ,  player ) )  # bunny cannot lift bushes 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Flute Spot ' ,  player ) ,  lambda  state :  state . has ( ' Shovel ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 01:34:30 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bat Cave Drop Ledge ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Zora \' s Ledge ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:58:57 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Waterfall of Wishing ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Frog ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player ) )  # will get automatic moon pearl requirement 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Potion Shop ' ,  player ) ,  lambda  state :  state . has ( ' Mushroom ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Desert Palace Entrance (North) Rocks ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Desert Ledge Return Rocks ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player ) )   # should we decide to place something that is not a dungeon end up there at some point 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Checkerboard Cave ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    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 ( ' Top of Pyramid ' ,  player ) ,  lambda  state :  state . has ( ' Beat Agahnim 1 ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Old Man Cave Exit (West) ' ,  player ) ,  lambda  state :  False )   # drop cannot be climbed up 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Broken Bridge (West) ' ,  player ) ,  lambda  state :  state . has ( ' Hookshot ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Broken Bridge (East) ' ,  player ) ,  lambda  state :  state . has ( ' Hookshot ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' East Death Mountain Teleporter ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Fairy Ascension Rocks ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Paradox Cave Push Block Reverse ' ,  player ) ,  lambda  state :  state . has ( ' Mirror ' ,  player ) )   # can erase block 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Death Mountain (Top) ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Turtle Rock Teleporter ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player )  and  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' East Death Mountain (Top) ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-10 23:54:35 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Catfish Exit Rock ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Catfish Entrance Rock ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Northeast Dark World Broken Bridge Pass ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  ( state . can_lift_rocks ( player )  or  state . has ( ' Hammer ' ,  player )  or  state . has ( ' Flippers ' ,  player ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' East Dark World Broken Bridge Pass ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  ( state . can_lift_rocks ( player )  or  state . has ( ' Hammer ' ,  player ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' South Dark World Bridge ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bonk Fairy (Dark) ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Pegasus Boots ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' West Dark World Gap ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Hookshot ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Palace of Darkness ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) )  # kiki needs pearl 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Hyrule Castle Ledge Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Hyrule Castle Main Gate ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Lake Hylia Drop (East) ' ,  player ) ,  lambda  state :  ( state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Flippers ' ,  player )  or  state . has ( ' Magic Mirror ' ,  player ) ) )   # Overworld Bunny Revival 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Bombos Tablet ' ,  player ) ,  lambda  state :  state . can_retrieve_tablet ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Lake Hylia Drop (South) ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Flippers ' ,  player ) )   # ToDo any fake flipper set up? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Lake Hylia Ledge Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) )  # bomb required 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Lake Hylia Ledge Spike Cave ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Lake Hylia Teleporter ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Village of Outcasts Heavy Rock ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . can_lift_heavy_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Hype Cave ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) )  # bomb required 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Brewery ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) )  # bomb required 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Thieves Town ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) )  # bunny cannot pull 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Skull Woods First Section Hole (North) ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) )  # bunny cannot lift bush 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Skull Woods Second Section Hole ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) )  # bunny cannot lift bush 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Maze Race Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Cave 45 Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bombos Tablet Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' East Dark World Bridge ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Lake Hylia Island Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Magic Mirror ' ,  player )  and  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Lake Hylia Central Island Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' East Dark World River Pier ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Graveyard Ledge Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bumper Cave Entrance Rock ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . can_lift_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bumper Cave Ledge Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bat Cave Drop Ledge Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark World Hammer Peg Cave ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Village of Outcasts Eastern Rocks ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . can_lift_heavy_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Peg Area Rocks ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . can_lift_heavy_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Village of Outcasts Pegs ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Grassy Lawn Pegs ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bumper Cave Exit (Top) ' ,  player ) ,  lambda  state :  state . has ( ' Cape ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bumper Cave Exit (Bottom) ' ,  player ) ,  lambda  state :  state . has ( ' Cape ' ,  player )  or  state . has ( ' Hookshot ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Skull Woods Final Section ' ,  player ) ,  lambda  state :  state . has ( ' Fire Rod ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) )  # bunny cannot use fire rod 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Misery Mire ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has_sword ( player )  and  state . has_misery_mire_medallion ( player ) )   # sword required to cast magic (!) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Desert Ledge (Northeast) Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Desert Ledge Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Desert Palace Stairs Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Desert Palace Entrance (North) Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Spectacle Rock Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Hookshot Cave ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' East Death Mountain (Top) Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Mimic Cave Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Spiral Cave Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Fairy Ascension Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) )   # need to lift flowers 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Isolated Ledge Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Superbunny Cave Exit (Bottom) ' ,  player ) ,  lambda  state :  False )   # Cannot get to bottom exit from top. Just exists for shuffling 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Floating Island Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Turtle Rock ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has_sword ( player )  and  state . has_turtle_rock_medallion ( player )  and  state . can_reach ( ' Turtle Rock (Top) ' ,  ' Region ' ,  player ) )   # sword required to cast magic (!) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-16 19:09:15 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Pyramid Hole ' ,  player ) ,  lambda  state :  state . has ( ' Beat Agahnim 2 ' ,  player )  or  world . open_pyramid [ player ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-15 19:17:44 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-09 20:40:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . swordless [ player ] : 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-11 14:24:56 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        swordless_rules ( world ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-10 23:54:35 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  inverted_rules ( world ,  player ) :  
						 
					
						
							
								
									
										
										
										
											2020-05-10 19:27:13 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # s&q regions. 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Castle Ledge S&Q ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player )  and  state . has ( ' Beat Agahnim 1 ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-21 21:59:16 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # overworld requirements  
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Maze Race ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Mini Moldorm Cave ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ice Rod Cave ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Light Hype Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Potion Shop Pier ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Light World Pier ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Kings Grave ' ,  player ) ,  lambda  state :  state . has ( ' Pegasus Boots ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Kings Grave Outer Rocks ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Kings Grave Inner Rocks ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Potion Shop Inner Bushes ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Potion Shop Outer Bushes ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Potion Shop Outer Rock ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Potion Shop Inner Rock ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Graveyard Cave Inner Bushes ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Graveyard Cave Outer Bushes ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Secret Passage Inner Bushes ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Secret Passage Outer Bushes ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bonk Fairy (Light) ' ,  player ) ,  lambda  state :  state . has ( ' Pegasus Boots ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bat Cave Drop Ledge ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Lumberjack Tree Tree ' ,  player ) ,  lambda  state :  state . has ( ' Pegasus Boots ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Beat Agahnim 1 ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bonk Rock Cave ' ,  player ) ,  lambda  state :  state . has ( ' Pegasus Boots ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Desert Palace Stairs ' ,  player ) ,  lambda  state :  state . has ( ' Book of Mudora ' ,  player ) )   # bunny can use book 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Sanctuary Grave ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' 20 Rupee Cave ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' 50 Rupee Cave ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Death Mountain Entrance Rock ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bumper Cave Entrance Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Lake Hylia Central Island Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Lake Hylia Central Island Teleporter ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-02 11:24:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Desert Teleporter ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player )  and  state . can_lift_heavy_rocks ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' East Dark World Teleporter ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player )  and  state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) )  # bunny cannot use hammer 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' South Dark World Teleporter ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player )  and  state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) )  # bunny cannot use hammer 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' West Dark World Teleporter ' ,  player ) ,  lambda  state :  ( ( state . has ( ' Hammer ' ,  player )  and  state . can_lift_rocks ( player ) )  or  state . can_lift_heavy_rocks ( player ) )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Flute Spot ' ,  player ) ,  lambda  state :  state . has ( ' Shovel ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Zora \' s Ledge ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Waterfall of Wishing Cave ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Northeast Light World Return ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Frog ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player )  and  ( state . has ( ' Moon Pearl ' ,  player )  or  state . has ( ' Beat Agahnim 1 ' ,  player ) )  or  ( state . can_reach ( ' Light World ' ,  ' Region ' ,  player )  and  state . has ( ' Magic Mirror ' ,  player ) ) )  # Need LW access using Mirror or Portal 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Missing Smith ' ,  player ) ,  lambda  state :  state . has ( ' Get Frog ' ,  player )  and  state . can_reach ( ' Blacksmiths Hut ' ,  ' Region ' ,  player ) )  # Can't S&Q with smith 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Blacksmith ' ,  player ) ,  lambda  state :  state . has ( ' Return Smith ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Magic Bat ' ,  player ) ,  lambda  state :  state . has ( ' Magic Powder ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-21 09:45:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Sick Kid ' ,  player ) ,  lambda  state :  state . has_group ( " Bottles " ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Mushroom ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) )  # need pearl to pick up bushes 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bush Covered Lawn Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bush Covered Lawn Inner Bushes ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bush Covered Lawn Outer Bushes ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bomb Hut Inner Bushes ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bomb Hut Outer Bushes ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Light World Bomb Hut ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) )  # need bomb 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' North Fairy Cave Drop ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Lost Woods Hideout Drop ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Potion Shop ' ,  player ) ,  lambda  state :  state . has ( ' Mushroom ' ,  player )  and  ( state . can_reach ( ' Potion Shop Area ' ,  ' Region ' ,  player ) ) )  # new inverted region, need pearl for bushes or access to potion shop door/waterfall fairy 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Desert Palace Entrance (North) Rocks ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Desert Ledge Return Rocks ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) )   # should we decide to place something that is not a dungeon end up there at some point 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Checkerboard Cave ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Hyrule Castle Secret Entrance Drop ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Old Man Cave Exit (West) ' ,  player ) ,  lambda  state :  False )   # drop cannot be climbed up 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Broken Bridge (West) ' ,  player ) ,  lambda  state :  state . has ( ' Hookshot ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Broken Bridge (East) ' ,  player ) ,  lambda  state :  state . has ( ' Hookshot ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Death Mountain Teleporter (East Bottom) ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Fairy Ascension Rocks ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Paradox Cave Push Block Reverse ' ,  player ) ,  lambda  state :  state . has ( ' Mirror ' ,  player ) )   # can erase block 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Death Mountain (Top) ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Death Mountain Teleporter (East) ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player )  and  state . has ( ' Hammer ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) )   # bunny cannot use hammer 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' East Death Mountain (Top) ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) )   # bunny can not use hammer 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 01:34:30 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Catfish Entrance Rock ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Northeast Dark World Broken Bridge Pass ' ,  player ) ,  lambda  state :  ( ( state . can_lift_rocks ( player )  or  state . has ( ' Hammer ' ,  player ) )  or  state . has ( ' Flippers ' ,  player ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' East Dark World Broken Bridge Pass ' ,  player ) ,  lambda  state :  ( state . can_lift_rocks ( player )  or  state . has ( ' Hammer ' ,  player ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' South Dark World Bridge ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bonk Fairy (Dark) ' ,  player ) ,  lambda  state :  state . has ( ' Pegasus Boots ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' West Dark World Gap ' ,  player ) ,  lambda  state :  state . has ( ' Hookshot ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Lake Hylia Drop (East) ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Bombos Tablet ' ,  player ) ,  lambda  state :  state . can_retrieve_tablet ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Lake Hylia Drop (South) ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player ) )   # ToDo any fake flipper set up? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Lake Hylia Ledge Pier ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Lake Hylia Ledge Spike Cave ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-08 19:54:33 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Lake Hylia Teleporter ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player ) )   # Fake Flippers 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Lake Hylia Shallows ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Village of Outcasts Heavy Rock ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' East Dark World Bridge ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Lake Hylia Central Island Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-05 14:51:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' East Dark World River Pier ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bumper Cave Entrance Rock ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bumper Cave Ledge Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Hammer Peg Area Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark World Hammer Peg Cave ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Village of Outcasts Eastern Rocks ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Peg Area Rocks ' ,  player ) ,  lambda  state :  state . can_lift_heavy_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Village of Outcasts Pegs ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Grassy Lawn Pegs ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bumper Cave Exit (Top) ' ,  player ) ,  lambda  state :  state . has ( ' Cape ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bumper Cave Exit (Bottom) ' ,  player ) ,  lambda  state :  state . has ( ' Cape ' ,  player )  or  state . has ( ' Hookshot ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Skull Woods Final Section ' ,  player ) ,  lambda  state :  state . has ( ' Fire Rod ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Misery Mire ' ,  player ) ,  lambda  state :  state . has_sword ( player )  and  state . has_misery_mire_medallion ( player ) )   # sword required to cast magic (!) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Hookshot Cave ' ,  player ) ,  lambda  state :  state . can_lift_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' East Death Mountain Mirror Spot (Top) ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Death Mountain (Top) Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' East Death Mountain Mirror Spot (Bottom) ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Death Mountain Ledge Mirror Spot (East) ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Death Mountain Ledge Mirror Spot (West) ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Laser Bridge Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Floating Island Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Turtle Rock ' ,  player ) ,  lambda  state :  state . has_sword ( player )  and  state . has_turtle_rock_medallion ( player )  and  state . can_reach ( ' Turtle Rock (Top) ' ,  ' Region ' ,  player ) )  # sword required to cast magic (!) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # new inverted spots 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Post Aga Teleporter ' ,  player ) ,  lambda  state :  state . has ( ' Beat Agahnim 1 ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Mire Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Desert Palace Stairs Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Death Mountain Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' East Dark World Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' West Dark World Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' South Dark World Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Catfish Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Potion Shop Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Shopping Mall Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Maze Race Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Desert Palace North Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Death Mountain (Top) Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Graveyard Cave Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Bomb Hut Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Skull Woods Mirror Spot ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # inverted flute spots 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-02-02 11:24:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' DDM Flute ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' NEDW Flute ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' WDW Flute ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' SDW Flute ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' EDW Flute ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' DLHL Flute ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' DD Flute ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' EDDM Flute ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Dark Grassy Lawn Flute ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Hammer Peg Area Flute ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-16 19:09:15 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Inverted Pyramid Hole ' ,  player ) ,  lambda  state :  state . has ( ' Beat Agahnim 2 ' ,  player )  or  world . open_pyramid [ player ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-09 20:40:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . swordless [ player ] : 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-11 14:24:56 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        swordless_rules ( world ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  no_glitches_rules ( world ,  player ) :  
						 
					
						
							
								
									
										
										
										
											2020-12-05 14:51:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    """ """ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  world . mode [ player ]  ==  ' inverted ' : 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Zoras River ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  ( state . has ( ' Flippers ' ,  player )  or  state . can_lift_rocks ( player ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Lake Hylia Central Island Pier ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Flippers ' ,  player ) )   # can be fake flippered to 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Lake Hylia Island Pier ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Flippers ' ,  player ) )   # can be fake flippered to 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Lake Hylia Warp ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Flippers ' ,  player ) )   # can be fake flippered to 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Northeast Light World Warp ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Flippers ' ,  player ) )   # can be fake flippered to 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Hobo Bridge ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Dark Lake Hylia Drop (East) ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:07:53 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Dark Lake Hylia Teleporter ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Dark Lake Hylia Ledge Drop ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-05 19:20:29 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' East Dark World Pier ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-05 14:51:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Zoras River ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player )  or  state . can_lift_rocks ( player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Lake Hylia Central Island Pier ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player ) )   # can be fake flippered to 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Hobo Bridge ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Dark Lake Hylia Drop (East) ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Dark Lake Hylia Teleporter ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Dark Lake Hylia Ledge Drop ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    add_rule ( world . get_entrance ( ' Ganons Tower (Double Switch Room) ' ,  player ) ,  lambda  state :  state . has ( ' Hookshot ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Paradox Cave Push Block Reverse ' ,  player ) ,  lambda  state :  False )   # no glitches does not require block override 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-10 09:55:06 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    forbid_bomb_jump_requirements ( world ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_conditional_lamps ( world ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:07:53 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  fake_flipper_rules ( world ,  player ) :  
						 
					
						
							
								
									
										
										
										
											2020-12-05 14:51:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . mode [ player ]  ==  ' inverted ' : 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Zoras River ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Lake Hylia Central Island Pier ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Lake Hylia Island Pier ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Lake Hylia Warp ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Northeast Light World Warp ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Hobo Bridge ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:07:53 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Dark Lake Hylia Drop (East) ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Dark Lake Hylia Teleporter ' ,  player ) ,  lambda  state :  True ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Dark Lake Hylia Ledge Drop ' ,  player ) ,  lambda  state :  True ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-08 19:54:33 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' East Dark World Pier ' ,  player ) ,  lambda  state :  True ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-05 14:51:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        #qirn jump 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' East Dark World River Pier ' ,  player ) ,  lambda  state :  True ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Zoras River ' ,  player ) ,  lambda  state :  True ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Lake Hylia Central Island Pier ' ,  player ) ,  lambda  state :  True ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Hobo Bridge ' ,  player ) ,  lambda  state :  True ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Dark Lake Hylia Drop (East) ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Flippers ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Dark Lake Hylia Teleporter ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Dark Lake Hylia Ledge Drop ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-05 14:51:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        #qirn jump 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' East Dark World River Pier ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:07:53 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-10 09:55:06 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								def  forbid_bomb_jump_requirements ( world ,  player ) :  
						 
					
						
							
								
									
										
										
										
											2019-04-18 16:30:08 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    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 ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    for  location  in  DMs_room_chests : 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_location ( location ,  player ) ,  lambda  state :  state . has ( ' Hookshot ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Paradox Cave Bomb Jump ' ,  player ) ,  lambda  state :  False ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Skull Woods First Section Bomb Jump ' ,  player ) ,  lambda  state :  False ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-17 22:20:03 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-02 23:59:28 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-03 18:43:50 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								DW_Entrances  =  [ ' Bumper Cave (Bottom) ' ,  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ' Superbunny Cave (Top) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ' Superbunny Cave (Bottom) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ' Hookshot Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ' Bumper Cave (Top) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ' Hookshot Cave Back Entrance ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ' Dark Death Mountain Ledge (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ' Turtle Rock Isolated Ledge Entrance ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ' Thieves Town ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ' Skull Woods Final Section ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ' Ice Palace ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ' Misery Mire ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ' Palace of Darkness ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ' Swamp Palace ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ' Turtle Rock ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ' Dark Death Mountain Ledge (West) ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								def  check_is_dark_world ( region ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    for  entrance  in  region . entrances : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  entrance . name  in  DW_Entrances : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  False 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-02 23:59:28 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  add_conditional_lamps ( world ,  player ) :  
						 
					
						
							
								
									
										
										
										
											2017-05-20 15:47:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Light cones in standard depend on which world we actually are in, not which one the location would normally be 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # We add Lamp requirements only to those locations which lie in the dark world (or everything if open 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    def  add_conditional_lamp ( spot ,  region ,  spottype = ' Location ' ,  accessible_torch = False ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( not  world . dark_world_light_cone  and  check_is_dark_world ( world . get_region ( region ,  player ) ) )  or  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                not  world . light_world_light_cone  and  not  check_is_dark_world ( world . get_region ( region ,  player ) ) ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  spottype  ==  ' Location ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                spot  =  world . get_location ( spot ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                spot  =  world . get_entrance ( spot ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            add_lamp_requirement ( world ,  spot ,  player ,  accessible_torch ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-20 15:47:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Misery Mire (Vitreous) ' ,  ' Misery Mire (Entrance) ' ,  ' Entrance ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Turtle Rock (Dark Room) (North) ' ,  ' Turtle Rock (Entrance) ' ,  ' Entrance ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Turtle Rock (Dark Room) (South) ' ,  ' Turtle Rock (Entrance) ' ,  ' Entrance ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-28 23:42:35 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Palace of Darkness Big Key Door ' ,  ' Palace of Darkness (Entrance) ' ,  ' Entrance ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Palace of Darkness Maze Door ' ,  ' Palace of Darkness (Entrance) ' ,  ' Entrance ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Palace of Darkness - Dark Basement - Left ' ,  ' Palace of Darkness (Entrance) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         ' Location ' ,  True ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Palace of Darkness - Dark Basement - Right ' ,  ' Palace of Darkness (Entrance) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         ' Location ' ,  True ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-16 16:54:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . mode [ player ]  !=  ' inverted ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_conditional_lamp ( ' Agahnim 1 ' ,  ' Agahnims Tower ' ,  ' Entrance ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_conditional_lamp ( ' Castle Tower - Dark Maze ' ,  ' Agahnims Tower ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        add_conditional_lamp ( ' Agahnim 1 ' ,  ' Inverted Agahnims Tower ' ,  ' Entrance ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_conditional_lamp ( ' Castle Tower - Dark Maze ' ,  ' Inverted Agahnims Tower ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Old Man ' ,  ' Old Man Cave ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-20 15:47:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Old Man Cave Exit (East) ' ,  ' Old Man Cave ' ,  ' Entrance ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Death Mountain Return Cave Exit (East) ' ,  ' Death Mountain Return Cave ' ,  ' Entrance ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Death Mountain Return Cave Exit (West) ' ,  ' Death Mountain Return Cave ' ,  ' Entrance ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Old Man House Front to Back ' ,  ' Old Man House ' ,  ' Entrance ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Old Man House Back to Front ' ,  ' Old Man House ' ,  ' Entrance ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Eastern Palace - Big Key Chest ' ,  ' Eastern Palace ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Eastern Palace - Boss ' ,  ' Eastern Palace ' ,  ' Location ' ,  True ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    add_conditional_lamp ( ' Eastern Palace - Prize ' ,  ' Eastern Palace ' ,  ' Location ' ,  True ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-20 15:47:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-10 06:36:06 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  not  world . mode [ player ]  ==  " standard " : 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_lamp_requirement ( world ,  world . get_location ( ' Sewers - Dark Cross ' ,  player ) ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        add_lamp_requirement ( world ,  world . get_entrance ( ' Sewers Back Door ' ,  player ) ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        add_lamp_requirement ( world ,  world . get_entrance ( ' Throne Room ' ,  player ) ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-16 21:23:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  open_rules ( world ,  player ) :  
						 
					
						
							
								
									
										
										
										
											2017-08-05 17:50:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # softlock protection as you can reach the sewers small key door with a guard drop key 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-24 16:22:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Hyrule Castle - Boomerang Chest ' ,  player ) , 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             lambda  state :  state . _lttp_has_key ( ' Small Key (Hyrule Castle) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-24 16:22:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_location ( ' Hyrule Castle - Zelda \' s Chest ' ,  player ) , 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             lambda  state :  state . _lttp_has_key ( ' Small Key (Hyrule Castle) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-16 21:23:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  swordless_rules ( world ,  player ) :  
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Agahnim 1 ' ,  player ) ,  lambda  state :  ( state . has ( ' Hammer ' ,  player )  or  state . has ( ' Fire Rod ' ,  player )  or  state . can_shoot_arrows ( player )  or  state . has ( ' Cane of Somaria ' ,  player ) )  and  state . _lttp_has_key ( ' Small Key (Agahnims Tower) ' ,  player ,  2 ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Skull Woods Torch Room ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Skull Woods) ' ,  player ,  3 )  and  state . has ( ' Fire Rod ' ,  player ) )   # no curtain 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ice Palace Entrance Room ' ,  player ) ,  lambda  state :  state . has ( ' Fire Rod ' ,  player )  or  state . has ( ' Bombos ' ,  player ) )  #in swordless mode bombos pads are present in the relevant parts of ice palace 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Ganon Drop ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player ) )   # need to damage ganon to get tiles to drop 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-16 16:54:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . mode [ player ]  !=  ' inverted ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-25 00:54:08 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        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 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Turtle Rock ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has_turtle_rock_medallion ( player )  and  state . can_reach ( ' Turtle Rock (Top) ' ,  ' Region ' ,  player ) )    # sword not required to use medallion for opening in swordless (!) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Misery Mire ' ,  player ) ,  lambda  state :  state . has ( ' Moon Pearl ' ,  player )  and  state . has_misery_mire_medallion ( player ) )   # sword not required to use medallion for opening in swordless (!) 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-25 00:54:08 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # only need ddm access for aga tower in inverted 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Turtle Rock ' ,  player ) ,  lambda  state :  state . has_turtle_rock_medallion ( player )  and  state . can_reach ( ' Turtle Rock (Top) ' ,  ' Region ' ,  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 (!) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-08-06 21:36:45 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-10 19:27:13 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  add_connection ( parent_name ,  target_name ,  entrance_name ,  world ,  player ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    parent  =  world . get_region ( parent_name ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    target  =  world . get_region ( target_name ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    connection  =  Entrance ( player ,  entrance_name ,  parent ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    parent . exits . append ( connection ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    connection . connect ( target ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-11 11:41:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  standard_rules ( world ,  player ) :  
						 
					
						
							
								
									
										
										
										
											2020-05-10 19:27:13 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    add_connection ( ' Menu ' ,  ' Hyrule Castle Secret Entrance ' ,  ' Uncle S&Q ' ,  world ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . get_entrance ( ' Uncle S&Q ' ,  player ) . hide_path  =  True 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-06 21:36:45 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Hyrule Castle Exit (East) ' ,  player ) ,  lambda  state :  state . can_reach ( ' Sanctuary ' ,  ' Region ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Hyrule Castle Exit (West) ' ,  player ) ,  lambda  state :  state . can_reach ( ' Sanctuary ' ,  ' Region ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-10 19:27:13 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Links House S&Q ' ,  player ) ,  lambda  state :  state . can_reach ( ' Sanctuary ' ,  ' Region ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Sanctuary S&Q ' ,  player ) ,  lambda  state :  state . can_reach ( ' Sanctuary ' ,  ' Region ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-06 21:36:45 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-11 18:49:24 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  toss_junk_item ( world ,  player ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    items  =  [ ' Rupees (20) ' ,  ' Bombs (3) ' ,  ' Arrows (10) ' ,  ' Rupees (5) ' ,  ' Rupee (1) ' ,  ' Bombs (10) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             ' Single Arrow ' ,  ' Rupees (50) ' ,  ' Rupees (100) ' ,  ' Single Bomb ' ,  ' Bee ' ,  ' Bee Trap ' , 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-26 07:06:33 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             ' Rupees (300) ' ,  ' Nothing ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-11 18:49:24 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    for  item  in  items : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        big20  =  next ( ( i  for  i  in  world . itempool  if  i . name  ==  item  and  i . player  ==  player ) ,  None ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  big20 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            world . itempool . remove ( big20 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    raise  Exception ( " Unable to find a junk item to toss to make room for a TR small key " ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-05-16 21:23:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  set_trock_key_rules ( world ,  player ) :  
						 
					
						
							
								
									
										
										
										
											2019-04-15 19:17:44 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # First set all relevant locked doors to impassible. 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-26 13:02:59 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    for  entrance  in  [ ' Turtle Rock Dark Room Staircase ' ,  ' Turtle Rock (Chain Chomp Room) (North) ' ,  ' Turtle Rock (Chain Chomp Room) (South) ' ,  ' Turtle Rock Pokey Room ' ,  ' Turtle Rock Big Key Door ' ] : 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( entrance ,  player ) ,  lambda  state :  False ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-23 21:32:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-09-01 14:01:54 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    all_state  =  world . get_all_state ( use_cache = False ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:43:48 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    all_state . reachable_regions [ player ]  =  set ( )   # wipe reachable regions so that the locked doors actually work 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-31 20:07:23 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    all_state . stale [ player ]  =  True 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-15 19:17:44 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Check if each of the four main regions of the dungoen can be reached. The previous code section prevents key-costing moves within the dungeon. 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-18 20:45:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    can_reach_back  =  all_state . can_reach ( world . get_region ( ' Turtle Rock (Eye Bridge) ' ,  player ) )  if  world . can_access_trock_eyebridge [ player ]  is  None  else  world . can_access_trock_eyebridge [ player ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . can_access_trock_eyebridge [ player ]  =  can_reach_back 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    can_reach_front  =  all_state . can_reach ( world . get_region ( ' Turtle Rock (Entrance) ' ,  player ) )  if  world . can_access_trock_front [ player ]  is  None  else  world . can_access_trock_front [ player ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . can_access_trock_front [ player ]  =  can_reach_front 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    can_reach_big_chest  =  all_state . can_reach ( world . get_region ( ' Turtle Rock (Big Chest) ' ,  player ) )  if  world . can_access_trock_big_chest [ player ]  is  None  else  world . can_access_trock_big_chest [ player ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . can_access_trock_big_chest [ player ]  =  can_reach_big_chest 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    can_reach_middle  =  all_state . can_reach ( world . get_region ( ' Turtle Rock (Second Section) ' ,  player ) )  if  world . can_access_trock_middle [ player ]  is  None  else  world . can_access_trock_middle [ player ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . can_access_trock_middle [ player ]  =  can_reach_middle 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-15 19:17:44 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 08:48:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # If you can't enter from the back, the door to the front of TR requires only 2 small keys if the big key is in one of these chests since 2 key doors are locked behind the big key door. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # If you can only enter from the middle, this includes all locations that can only be reached by exiting the front.  This can include Laser Bridge and Crystaroller if the front and back connect via Dark DM Ledge! 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    front_locked_locations  =  { ( ' Turtle Rock - Compass Chest ' ,  player ) ,  ( ' Turtle Rock - Roller Room - Left ' ,  player ) ,  ( ' Turtle Rock - Roller Room - Right ' ,  player ) } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  can_reach_middle  and  not  can_reach_back  and  not  can_reach_front : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        normal_regions  =  all_state . reachable_regions [ player ] . copy ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Turtle Rock (Chain Chomp Room) (South) ' ,  player ) ,  lambda  state :  True ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        all_state . update_reachable_regions ( player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        front_locked_regions  =  all_state . reachable_regions [ player ] . difference ( normal_regions ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        front_locked_locations  =  set ( ( location . name ,  player )  for  region  in  front_locked_regions  for  location  in  region . locations ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 23:46:34 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # The following represent the common key rules. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-26 13:02:59 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Big key door requires the big key, obviously. We removed this rule in the previous section to flag front_locked_locations correctly, 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # otherwise crystaroller room might not be properly marked as reachable through the back. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Turtle Rock Big Key Door ' ,  player ) ,  lambda  state :  state . has ( ' Big Key (Turtle Rock) ' ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-15 19:17:44 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # No matter what, the key requirement for going from the middle to the bottom should be three keys. 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Turtle Rock Dark Room Staircase ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Turtle Rock) ' ,  player ,  3 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-23 21:32:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-15 19:17:44 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Now we need to set rules based on which entrances we have access to. The most important point is whether we have back access. If we have back access, we 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # might open all the locked doors in any order so we need maximally restrictive rules. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  can_reach_back : 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_location ( ' Turtle Rock - Big Key Chest ' ,  player ) ,  lambda  state :  ( state . _lttp_has_key ( ' Small Key (Turtle Rock) ' ,  player ,  4 )  or  item_name ( state ,  ' Turtle Rock - Big Key Chest ' ,  player )  ==  ( ' Small Key (Turtle Rock) ' ,  player ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Turtle Rock (Chain Chomp Room) (South) ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Turtle Rock) ' ,  player ,  4 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 23:46:34 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # Only consider wasting the key on the Trinexx door for going from the front entrance to middle section.  If other key doors are accessible, then these doors can be avoided 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Turtle Rock (Chain Chomp Room) (North) ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Turtle Rock) ' ,  player ,  3 ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Turtle Rock Pokey Room ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Turtle Rock) ' ,  player ,  2 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 23:46:34 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Middle to front requires 2 keys if the back is locked, otherwise 4 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Turtle Rock (Chain Chomp Room) (South) ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Turtle Rock) ' ,  player ,  2 ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 08:48:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  item_in_locations ( state ,  ' Big Key (Turtle Rock) ' ,  player ,  front_locked_locations ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                else  state . _lttp_has_key ( ' Small Key (Turtle Rock) ' ,  player ,  4 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 23:46:34 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Front to middle requires 2 keys (if the middle is accessible then these doors can be avoided, otherwise no keys can be wasted) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Turtle Rock (Chain Chomp Room) (North) ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Turtle Rock) ' ,  player ,  2 ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Turtle Rock Pokey Room ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Turtle Rock) ' ,  player ,  1 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 23:46:34 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 19:11:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_rule ( world . get_location ( ' Turtle Rock - Big Key Chest ' ,  player ) ,  lambda  state :  state . _lttp_has_key ( ' Small Key (Turtle Rock) ' ,  player ,  tr_big_key_chest_keys_needed ( state ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 23:46:34 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        def  tr_big_key_chest_keys_needed ( 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 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # should logically require no keys, and anything else should logically require 4 keys. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            item  =  item_name ( state ,  ' Turtle Rock - Big Key Chest ' ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  item  in  [ ( ' Small Key (Turtle Rock) ' ,  player ) ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                return  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  item  in  [ ( ' Big Key (Turtle Rock) ' ,  player ) ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                return  2 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return  4 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # If TR is only accessible from the middle, the big key must be further restricted to prevent softlock potential 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 18:00:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  not  can_reach_front  and  not  world . smallkey_shuffle [ player ] : 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-30 00:06:30 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            # Must not go in the Big Key Chest - only 1 other chest available and 2+ keys required for all other chests 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-16 18:59:23 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            forbid_item ( world . get_location ( ' Turtle Rock - Big Key Chest ' ,  player ) ,  ' Big Key (Turtle Rock) ' ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 23:46:34 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  not  can_reach_big_chest : 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-30 00:06:30 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                # Must not go in the Chain Chomps chest - only 2 other chests available and 3+ keys required for all other chests 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-16 18:59:23 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                forbid_item ( world . get_location ( ' Turtle Rock - Chain Chomps ' ,  player ) ,  ' Big Key (Turtle Rock) ' ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-26 07:06:33 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  world . accessibility [ player ]  ==  ' locations '  and  world . goal [ player ]  !=  ' icerodhunt ' : 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 18:00:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  world . bigkey_shuffle [ player ]  and  can_reach_big_chest : 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-30 00:06:30 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    # Must not go in the dungeon - all 3 available chests (Chomps, Big Chest, Crystaroller) must be keys to access laser bridge, and the big key is required first 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-20 20:13:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    for  location  in  [ ' Turtle Rock - Chain Chomps ' ,  ' Turtle Rock - Compass Chest ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                     ' Turtle Rock - Roller Room - Left ' ,  ' Turtle Rock - Roller Room - Right ' ] : 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-16 18:59:23 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        forbid_item ( world . get_location ( location ,  player ) ,  ' Big Key (Turtle Rock) ' ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-21 15:34:42 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                else : 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-30 12:10:28 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    # A key is required in the Big Key Chest to prevent a possible softlock.  Place an extra key to ensure 100% locations still works 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-12 09:45:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    item  =  ItemFactory ( ' Small Key (Turtle Rock) ' ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    item . world  =  world 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    world . push_item ( world . get_location ( ' Turtle Rock - Big Key Chest ' ,  player ) ,  item ,  False ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-30 12:10:28 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    world . get_location ( ' Turtle Rock - Big Key Chest ' ,  player ) . event  =  True 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-11 18:49:24 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    toss_junk_item ( world ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 23:46:34 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-30 12:10:28 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . accessibility [ player ]  !=  ' locations ' : 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 23:46:34 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        set_always_allow ( world . get_location ( ' Turtle Rock - Big Key Chest ' ,  player ) ,  lambda  state ,  item :  item . name  ==  ' Small Key (Turtle Rock) '  and  item . player  ==  player 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-09 10:00:41 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                and  state . can_reach ( state . world . get_region ( ' Turtle Rock (Second Section) ' ,  player ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-23 21:32:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-05-20 14:04:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  set_big_bomb_rules ( world ,  player ) :  
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # this is a mess 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    bombshop_entrance  =  world . get_region ( ' Big Bomb Shop ' ,  player ) . entrances [ 0 ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-28 23:42:35 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Normal_LW_entrances  =  [ ' Blinds Hideout ' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                           ' Bonk Fairy (Light) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Lake Hylia Fairy ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-02 19:05:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                           ' Light Hype Fairy ' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                           ' Desert Fairy ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Chicken House ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Aginahs Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Sahasrahlas Hut ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Cave Shop (Lake Hylia) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Blacksmiths Hut ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Sick Kids House ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Lost Woods Gamble ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Fortune Teller (Light) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Snitch Lady (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Snitch Lady (West) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Bush Covered House ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Tavern (Front) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Light World Bomb Hut ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Kakariko Shop ' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-03 14:19:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                           ' Mini Moldorm Cave ' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                           ' Long Fairy Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Good Bee Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' 20 Rupee Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' 50 Rupee Cave ' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-28 23:42:35 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                           ' Ice Rod Cave ' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                           ' Bonk Rock Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Library ' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-28 23:42:35 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                           ' Potion Shop ' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                           ' Dam ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Lumberjack House ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Lake Hylia Fortune Teller ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-18 14:53:39 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                           ' Eastern Palace ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                           ' Kakariko Gamble Game ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Kakariko Well Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Bat Cave Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Elder House (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Elder House (West) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' North Fairy Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Lost Woods Hideout Stump ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Lumberjack Tree Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Two Brothers House (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Sanctuary ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Hyrule Castle Entrance (South) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Hyrule Castle Secret Entrance Stairs ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    LW_walkable_entrances  =  [ ' Dark Lake Hylia Ledge Fairy ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark Lake Hylia Ledge Spike Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark Lake Hylia Ledge Hint ' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-28 23:42:35 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Mire Shed ' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Dark Desert Hint ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark Desert Fairy ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Misery Mire ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-28 23:42:35 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Northern_DW_entrances  =  [ ' Brewery ' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' C-Shaped House ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Chest Game ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark World Hammer Peg Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Red Shield Shop ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark Sanctuary Hint ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Fortune Teller (Dark) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark World Shop ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark World Lumberjack Shop ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Thieves Town ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Skull Woods First Section Door ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-06 23:07:13 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Skull Woods Second Section Door (East) ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-11 18:03:42 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Southern_DW_entrances  =  [ ' Hype Cave ' , 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Bonk Fairy (Dark) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Archery Game ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Big Bomb Shop ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark Lake Hylia Shop ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Swamp Palace ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Isolated_DW_entrances  =  [ ' Spike Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Cave Shop (Dark Death Mountain) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark Death Mountain Fairy ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Mimic Cave ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-18 14:53:39 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Skull Woods Second Section Door (West) ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Skull Woods Final Section ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Ice Palace ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Turtle Rock ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark Death Mountain Ledge (West) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark Death Mountain Ledge (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Bumper Cave (Top) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Superbunny Cave (Top) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Superbunny Cave (Bottom) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Hookshot Cave ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-08 04:40:16 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Ganons Tower ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Turtle Rock Isolated Ledge Entrance ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Hookshot Cave Back Entrance ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-04 14:23:57 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Isolated_LW_entrances  =  [ ' Capacity Upgrade ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Tower of Hera ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Death Mountain Return Cave (West) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Paradox Cave (Top) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Fairy Ascension Cave (Top) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Spiral Cave ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-08 04:40:16 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Desert Palace Entrance (East) ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    West_LW_DM_entrances  =  [ ' Old Man Cave (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            ' Old Man House (Bottom) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            ' Old Man House (Top) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            ' Death Mountain Return Cave (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            ' Spectacle Rock Cave Peak ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            ' Spectacle Rock Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            ' Spectacle Rock Cave (Bottom) ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    East_LW_DM_entrances  =  [ ' Paradox Cave (Bottom) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            ' Paradox Cave (Middle) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            ' Hookshot Fairy ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            ' Spiral Cave (Bottom) ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Mirror_from_SDW_entrances  =  [ ' Two Brothers House (West) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                 ' Cave 45 ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Castle_ledge_entrances  =  [ ' Hyrule Castle Entrance (West) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                              ' Hyrule Castle Entrance (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                              ' Agahnims Tower ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Desert_mirrorable_ledge_entrances  =  [ ' Desert Palace Entrance (West) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                         ' Desert Palace Entrance (North) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                         ' Desert Palace Entrance (South) ' , 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                         ' Checkerboard Cave ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . can_reach ( ' East Dark World ' ,  ' Region ' ,  player )  and  state . can_reach ( ' Big Bomb Shop ' ,  ' Region ' ,  player )  and  state . has ( ' Crystal 5 ' ,  player )  and  state . has ( ' Crystal 6 ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-28 16:56:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    #crossing peg bridge starting from the southern dark world 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  cross_peg_bridge ( state ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        return  state . has ( ' Hammer ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-28 16:56:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # returning via the eastern and southern teleporters needs the same items, so we use the southern teleporter for out routing. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # crossing preg bridge already requires hammer so we just add the gloves to the requirement 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  southern_teleporter ( state ) : 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        return  state . can_lift_rocks ( player )  and  cross_peg_bridge ( state ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-28 16:56:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # the basic routes assume you can reach eastern light world with the bomb. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # you can then use the southern teleporter, or (if you have beaten Aga1) the hyrule castle gate warp 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  basic_routes ( state ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-10 19:27:13 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        return  southern_teleporter ( state )  or  state . has ( ' Beat Agahnim 1 ' ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-28 16:56:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Key for below abbreviations: 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # P = pearl 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # A = Aga1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # H = hammer 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # M = Mirror 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # G = Glove 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  bombshop_entrance . name  in  Normal_LW_entrances : 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-28 16:56:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        #1. basic routes 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #2. Can reach Eastern dark world some other way, mirror, get bomb, return to mirror spot, walk to pyramid: Needs mirror 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # -> M or BR 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  basic_routes ( state )  or  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  LW_walkable_entrances : 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-28 16:56:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        #1. Mirror then basic routes 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # -> M and BR 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player )  and  basic_routes ( state ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  Northern_DW_entrances : 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-28 16:56:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        #1. Mirror and basic routes 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #2. Go to south DW and then cross peg bridge: Need Mitts and hammer and moon pearl 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-06 23:07:13 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # -> (Mitts and CPB) or (M and BR) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  ( state . can_lift_heavy_rocks ( player )  and  cross_peg_bridge ( state ) )  or  ( state . has ( ' Magic Mirror ' ,  player )  and  basic_routes ( state ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-06 23:07:13 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Bumper Cave (Bottom) ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #1. Mirror and Lift rock and basic_routes 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #2. Mirror and Flute and basic routes (can make difference if accessed via insanity or w/ mirror from connector, and then via hyrule castle gate, because no gloves are needed in that case) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #3. Go to south DW and then cross peg bridge: Need Mitts and hammer and moon pearl 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # -> (Mitts and CPB) or (((G or Flute) and M) and BR)) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  ( state . can_lift_heavy_rocks ( player )  and  cross_peg_bridge ( state ) )  or  ( ( ( state . can_lift_rocks ( player )  or  state . has ( ' Flute ' ,  player ) )  and  state . has ( ' Magic Mirror ' ,  player ) )  and  basic_routes ( state ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  Southern_DW_entrances : 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-13 09:51:53 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        #1. Mirror and enter via gate: Need mirror and Aga1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #2. cross peg bridge: Need hammer and moon pearl 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-28 16:56:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # -> CPB or (M and A) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  cross_peg_bridge ( state )  or  ( state . has ( ' Magic Mirror ' ,  player )  and  state . has ( ' Beat Agahnim 1 ' ,  player ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  Isolated_DW_entrances : 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-28 16:56:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # 1. mirror then flute then basic routes 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # -> M and Flute and BR 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player )  and  state . has ( ' Activated Flute ' ,  player )  and  basic_routes ( state ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  Isolated_LW_entrances : 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # 1. flute then basic routes 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-13 09:51:53 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # Prexisting mirror spot is not permitted, because mirror might have been needed to reach these isolated locations. 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-28 16:56:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # -> Flute and BR 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-02 11:24:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player )  and  basic_routes ( state ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-08 04:40:16 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  West_LW_DM_entrances : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # 1. flute then basic routes or mirror 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Prexisting mirror spot is permitted, because flute can be used to reach west DM directly. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # -> Flute and (M or BR) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player )  and  ( state . has ( ' Magic Mirror ' ,  player )  or  basic_routes ( state ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-08 04:40:16 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  East_LW_DM_entrances : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # 1. flute then basic routes or mirror and hookshot 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Prexisting mirror spot is permitted, because flute can be used to reach west DM directly and then east DM via Hookshot 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # -> Flute and ((M and Hookshot) or BR) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player )  and  ( ( state . has ( ' Magic Mirror ' ,  player )  and  state . has ( ' Hookshot ' ,  player ) )  or  basic_routes ( state ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-08 04:40:16 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Fairy Ascension Cave (Bottom) ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Same as East_LW_DM_entrances except navigation without BR requires Mitts 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # -> Flute and ((M and Hookshot and Mitts) or BR) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player )  and  ( ( state . has ( ' Magic Mirror ' ,  player )  and  state . has ( ' Hookshot ' ,  player )  and  state . can_lift_heavy_rocks ( player ) )  or  basic_routes ( state ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  Castle_ledge_entrances : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # 1. mirror on pyramid to castle ledge, grab bomb, return through mirror spot: Needs mirror 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # 2. flute then basic routes 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # -> M or (Flute and BR) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player )  or  ( state . has ( ' Activated Flute ' ,  player )  and  basic_routes ( state ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  Desert_mirrorable_ledge_entrances : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Cases when you have mire access: Mirror to reach locations, return via mirror spot, move to center of desert, mirror anagin and: 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # 1. Have mire access, Mirror to reach locations, return via mirror spot, move to center of desert, mirror again and then basic routes 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # 2. flute then basic routes 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # -> (Mire access and M) or Flute) and BR 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  ( ( state . can_reach ( ' Dark Desert ' ,  ' Region ' ,  player )  and  state . has ( ' Magic Mirror ' ,  player ) )  or  state . has ( ' Activated Flute ' ,  player ) )  and  basic_routes ( state ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Old Man Cave (West) ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # 1. Lift rock then basic_routes 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-06 23:07:13 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # 2. flute then basic_routes 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # -> (Flute or G) and BR 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-02 11:24:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  ( state . has ( ' Activated Flute ' ,  player )  or  state . can_lift_rocks ( player ) )  and  basic_routes ( state ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Graveyard Cave ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # 1. flute then basic routes 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-06 23:07:13 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # 2. (has west dark world access) use existing mirror spot (required Pearl), mirror again off ledge 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # -> (Flute or (M and P and West Dark World access) and BR 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  ( state . has ( ' Activated Flute ' ,  player )  or  ( state . can_reach ( ' West Dark World ' ,  ' Region ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Magic Mirror ' ,  player ) ) )  and  basic_routes ( state ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-20 16:36:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  Mirror_from_SDW_entrances : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # 1. flute then basic routes 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # 2. (has South dark world access) use existing mirror spot, mirror again off ledge 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # -> (Flute or (M and South Dark World access) and BR 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  ( state . has ( ' Activated Flute ' ,  player )  or  ( state . can_reach ( ' South Dark World ' ,  ' Region ' ,  player )  and  state . has ( ' Magic Mirror ' ,  player ) ) )  and  basic_routes ( state ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Dark World Potion Shop ' : 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-13 09:51:53 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # 1. walk down by lifting rock: needs gloves and pearl` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # 2. walk down by hammering peg: needs hammer and pearl 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-28 16:56:55 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # 3. mirror and basic routes 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # -> (P and (H or Gloves)) or (M and BR) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  ( state . has ( ' Moon Pearl ' ,  player )  and  ( state . has ( ' Hammer ' ,  player )  or  state . can_lift_rocks ( player ) ) )  or  ( state . has ( ' Magic Mirror ' ,  player )  and  basic_routes ( state ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-02 21:56:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Kings Grave ' : 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-13 09:51:53 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # same as the Normal_LW_entrances case except that the pre-existing mirror is only possible if you have mitts 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # (because otherwise mirror was used to reach the grave, so would cancel a pre-existing mirror spot) 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-19 20:30:56 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # to account for insanity, must consider a way to escape without a cave for basic_routes 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # -> (M and Mitts) or ((Mitts or Flute or (M and P and West Dark World access)) and BR) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  ( state . can_lift_heavy_rocks ( player )  and  state . has ( ' Magic Mirror ' ,  player ) )  or  ( ( state . can_lift_heavy_rocks ( player )  or  state . has ( ' Activated Flute ' ,  player )  or  ( state . can_reach ( ' West Dark World ' ,  ' Region ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Magic Mirror ' ,  player ) ) )  and  basic_routes ( state ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Waterfall of Wishing ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # same as the Normal_LW_entrances case except in insanity it's possible you could be here without Flippers which 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # means you need an escape route of either Flippers or Flute 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  ( state . has ( ' Flippers ' ,  player )  or  state . has ( ' Activated Flute ' ,  player ) )  and  ( basic_routes ( state )  or  state . has ( ' Magic Mirror ' ,  player ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-13 09:51:53 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  set_inverted_big_bomb_rules ( world ,  player ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    bombshop_entrance  =  world . get_region ( ' Inverted Big Bomb Shop ' ,  player ) . entrances [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Normal_LW_entrances  =  [ ' Blinds Hideout ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Bonk Fairy (Light) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Lake Hylia Fairy ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Light Hype Fairy ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Desert Fairy ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Chicken House ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Aginahs Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Sahasrahlas Hut ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Cave Shop (Lake Hylia) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Blacksmiths Hut ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Sick Kids House ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Lost Woods Gamble ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Fortune Teller (Light) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Snitch Lady (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Snitch Lady (West) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Tavern (Front) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Kakariko Shop ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Mini Moldorm Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Long Fairy Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Good Bee Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' 20 Rupee Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' 50 Rupee Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Ice Rod Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Bonk Rock Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Library ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Potion Shop ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Dam ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Lumberjack House ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Lake Hylia Fortune Teller ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Eastern Palace ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Kakariko Gamble Game ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Kakariko Well Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Bat Cave Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Elder House (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Elder House (West) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' North Fairy Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Lost Woods Hideout Stump ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Lumberjack Tree Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Two Brothers House (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Sanctuary ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Hyrule Castle Entrance (South) ' , 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                           ' Hyrule Castle Secret Entrance Stairs ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Hyrule Castle Entrance (West) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Hyrule Castle Entrance (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Inverted Ganons Tower ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Cave 45 ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Checkerboard Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                           ' Inverted Big Bomb Shop ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Isolated_LW_entrances  =  [ ' Old Man Cave (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Old Man House (Bottom) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Old Man House (Top) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Death Mountain Return Cave (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Spectacle Rock Cave Peak ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Tower of Hera ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Death Mountain Return Cave (West) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Paradox Cave (Top) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Fairy Ascension Cave (Top) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Spiral Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Paradox Cave (Bottom) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Paradox Cave (Middle) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Hookshot Fairy ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Spiral Cave (Bottom) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Mimic Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Fairy Ascension Cave (Bottom) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Desert Palace Entrance (West) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Desert Palace Entrance (North) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Desert Palace Entrance (South) ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Eastern_DW_entrances  =  [ ' Palace of Darkness ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            ' Palace of Darkness Hint ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            ' Dark Lake Hylia Fairy ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            ' East Dark World Hint ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Northern_DW_entrances  =  [ ' Brewery ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' C-Shaped House ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Chest Game ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark World Hammer Peg Cave ' , 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Inverted Dark Sanctuary ' , 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Fortune Teller (Dark) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark World Lumberjack Shop ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Thieves Town ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Skull Woods First Section Door ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Skull Woods Second Section Door (East) ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Southern_DW_entrances  =  [ ' Hype Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Bonk Fairy (Dark) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Archery Game ' , 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Inverted Links House ' , 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Dark Lake Hylia Shop ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Swamp Palace ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Isolated_DW_entrances  =  [ ' Spike Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Cave Shop (Dark Death Mountain) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark Death Mountain Fairy ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Skull Woods Second Section Door (West) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Skull Woods Final Section ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Turtle Rock ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark Death Mountain Ledge (West) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark Death Mountain Ledge (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Bumper Cave (Top) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Superbunny Cave (Top) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Superbunny Cave (Bottom) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Hookshot Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Turtle Rock Isolated Ledge Entrance ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Hookshot Cave Back Entrance ' , 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-21 21:59:16 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                             ' Inverted Agahnims Tower ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    LW_walkable_entrances  =  [ ' Dark Lake Hylia Ledge Fairy ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark Lake Hylia Ledge Spike Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark Lake Hylia Ledge Hint ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Mire Shed ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark Desert Hint ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Dark Desert Fairy ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Misery Mire ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             ' Red Shield Shop ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    LW_bush_entrances  =  [ ' Bush Covered House ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         ' Light World Bomb Hut ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         ' Graveyard Cave ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    LW_inaccessible_entrances  =  [ ' Desert Palace Entrance (East) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                 ' Spectacle Rock Cave ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                 ' Spectacle Rock Cave (Bottom) ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             lambda  state :  state . can_reach ( ' East Dark World ' ,  ' Region ' ,  player )  and  state . can_reach ( ' Inverted Big Bomb Shop ' ,  ' Region ' ,  player )  and  state . has ( ' Crystal 5 ' ,  player )  and  state . has ( ' Crystal 6 ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # Key for below abbreviations: 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # P = pearl 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # A = Aga1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # H = hammer 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # M = Mirror 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # G = Glove 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  bombshop_entrance . name  in  Eastern_DW_entrances : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Just walk to the pyramid 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pass 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  Normal_LW_entrances : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Just walk to the castle and mirror. 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  Isolated_LW_entrances : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # For these entrances, you cannot walk to the castle/pyramid and thus must use Mirror and then Flute. 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player )  and  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  Northern_DW_entrances : 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # You can just fly with the Flute, you can take a long walk with Mitts and Hammer, 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # or you can leave a Mirror portal nearby and then walk to the castle to Mirror again. 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player )  or  ( state . can_lift_heavy_rocks ( player )  and  state . has ( ' Hammer ' ,  player ) )  or  ( state . has ( ' Magic Mirror ' ,  player )  and  state . can_reach ( ' Light World ' ,  ' Region ' ,  player ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  Southern_DW_entrances : 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # This is the same as north DW without the Mitts rock present. 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Hammer ' ,  player )  or  state . has ( ' Activated Flute ' ,  player )  or  ( state . has ( ' Magic Mirror ' ,  player )  and  state . can_reach ( ' Light World ' ,  ' Region ' ,  player ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  Isolated_DW_entrances : 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # There's just no way to escape these places with the bomb and no Flute. 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-02 11:24:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  LW_walkable_entrances : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # You can fly with the flute, or leave a mirror portal and walk through the light world 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player )  or  ( state . has ( ' Magic Mirror ' ,  player )  and  state . can_reach ( ' Light World ' ,  ' Region ' ,  player ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  LW_bush_entrances : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # These entrances are behind bushes in LW so you need either Pearl or the tools to solve NDW bomb shop locations. 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player )  and  ( state . has ( ' Activated Flute ' ,  player )  or  state . has ( ' Moon Pearl ' ,  player )  or  ( state . can_lift_heavy_rocks ( player )  and  state . has ( ' Hammer ' ,  player ) ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Dark World Shop ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # This is mostly the same as NDW but the Mirror path requires the Pearl, or using the Hammer 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player )  or  ( state . can_lift_heavy_rocks ( player )  and  state . has ( ' Hammer ' ,  player ) )  or  ( state . has ( ' Magic Mirror ' ,  player )  and  state . can_reach ( ' Light World ' ,  ' Region ' ,  player )  and  ( state . has ( ' Moon Pearl ' ,  player )  or  state . has ( ' Hammer ' ,  player ) ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Bumper Cave (Bottom) ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # This is mostly the same as NDW but the Mirror path requires being able to lift a rock. 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player )  or  ( state . can_lift_heavy_rocks ( player )  and  state . has ( ' Hammer ' ,  player ) )  or  ( state . has ( ' Magic Mirror ' ,  player )  and  state . can_lift_rocks ( player )  and  state . can_reach ( ' Light World ' ,  ' Region ' ,  player ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Old Man Cave (West) ' : 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # The three paths back are Mirror and DW walk, Mirror and Flute, or LW walk and then Mirror. 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Magic Mirror ' ,  player )  and  ( ( state . can_lift_heavy_rocks ( player )  and  state . has ( ' Hammer ' ,  player ) )  or  ( state . can_lift_rocks ( player )  and  state . has ( ' Moon Pearl ' ,  player ) )  or  state . has ( ' Activated Flute ' ,  player ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Dark World Potion Shop ' : 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # You either need to Flute to 5 or cross the rock/hammer choice pass to the south. 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-02 11:24:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Activated Flute ' ,  player )  or  state . has ( ' Hammer ' ,  player )  or  state . can_lift_rocks ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Kings Grave ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-01 03:17:40 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # Either lift the rock and walk to the castle to Mirror or Mirror immediately and Flute. 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  ( state . has ( ' Activated Flute ' ,  player )  or  state . can_lift_heavy_rocks ( player ) )  and  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-04 09:16:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Waterfall of Wishing ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # You absolutely must be able to swim to return it from here. 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player )  and  state . has ( ' Moon Pearl ' ,  player )  and  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-04 09:16:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Ice Palace ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # You can swim to the dock or use the Flute to get off the island. 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-02 11:24:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  state . has ( ' Flippers ' ,  player )  or  state . has ( ' Activated Flute ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-04 09:16:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Capacity Upgrade ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # You must Mirror but then can use either Ice Palace return path. 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  ( state . has ( ' Flippers ' ,  player )  or  state . has ( ' Activated Flute ' ,  player ) )  and  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Two Brothers House (West) ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # First you must Mirror. Then you can either Flute, cross the peg bridge, or use the Agah 1 portal to Mirror again. 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  ( state . has ( ' Activated Flute ' ,  player )  or  state . has ( ' Hammer ' ,  player )  or  state . has ( ' Beat Agahnim 1 ' ,  player ) )  and  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-19 18:49:41 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  in  LW_inaccessible_entrances : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # You can't get to the pyramid from these entrances without bomb duping. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        raise  Exception ( ' No valid path to open Pyramid Fairy. (Could not route from  %s ) '  %  bombshop_entrance . name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    elif  bombshop_entrance . name  ==  ' Pyramid Fairy ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Self locking.  The shuffles don't put the bomb shop here, but doesn't lock anything important. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_rule ( world . get_entrance ( ' Pyramid Fairy ' ,  player ) ,  lambda  state :  False ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        raise  Exception ( ' No logic found for routing from  %s  to the pyramid. '  %  bombshop_entrance . name ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-24 05:38:56 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  set_bunny_rules ( world :  MultiWorld ,  player :  int ,  inverted :  bool ) :  
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # regions for the exits of multi-entrance caves/drops that bunny cannot pass 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # Note spiral cave and two brothers house are passable in superbunny state for glitch logic with extra requirements. 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-13 09:51:53 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    bunny_impassable_caves  =  [ ' Bumper Cave ' ,  ' Two Brothers House ' ,  ' Hookshot Cave ' ,  ' Skull Woods First Section (Right) ' ,  ' Skull Woods First Section (Left) ' ,  ' Skull Woods First Section (Top) ' ,  ' Turtle Rock (Entrance) ' ,  ' Turtle Rock (Second Section) ' ,  ' Turtle Rock (Big Chest) ' ,  ' Skull Woods Second Section (Drop) ' , 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-22 16:41:33 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                              ' Turtle Rock (Eye Bridge) ' ,  ' Sewers ' ,  ' Pyramid ' ,  ' Spiral Cave (Top) ' ,  ' Desert Palace Main (Inner) ' ,  ' Fairy Ascension Cave (Drop) ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-13 09:51:53 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-23 18:10:58 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    bunny_accessible_locations  =  [ ' Link \' s Uncle ' ,  ' Sahasrahla ' ,  ' Sick Kid ' ,  ' Lost Woods Hideout ' ,  ' Lumberjack Tree ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                  ' Checkerboard Cave ' ,  ' Potion Shop ' ,  ' Spectacle Rock Cave ' ,  ' Pyramid ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                  ' Hype Cave - Generous Guy ' ,  ' Peg Cave ' ,  ' Bumper Cave Ledge ' ,  ' Dark Blacksmith Ruins ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                  ' Spectacle Rock ' ,  ' Bombos Tablet ' ,  ' Ether Tablet ' ,  ' Purple Chest ' ,  ' Blacksmith ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                  ' Missing Smith ' ,  ' Master Sword Pedestal ' ,  ' Bottle Merchant ' ,  ' Sunken Treasure ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                  ' Desert Ledge ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-13 09:51:53 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-01-27 17:17:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    def  path_to_access_rule ( path ,  entrance ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-23 18:10:58 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        return  lambda  state :  state . can_reach ( entrance . name ,  ' Entrance ' ,  entrance . player )  and  all ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            rule ( state )  for  rule  in  path ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-27 17:17:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  options_to_access_rule ( options ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  lambda  state :  any ( rule ( state )  for  rule  in  options ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Helper functions to determine if the moon pearl is required 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-23 18:10:58 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  inverted : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        def  is_bunny ( region ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            return  region . is_light_world 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-11 13:01:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-23 18:10:58 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        def  is_link ( region ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            return  region . is_dark_world 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-23 18:10:58 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        def  is_bunny ( region ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return  region . is_dark_world 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        def  is_link ( region ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            return  region . is_light_world 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-02-18 20:28:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    def  get_rule_to_add ( region ,  location  =  None ,  connecting_entrance  =  None ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-19 19:06:48 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # In OWG, a location can potentially be superbunny-mirror accessible or 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # bunny revival accessible. 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-14 22:10:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  world . logic [ player ]  in  [ ' minorglitches ' ,  ' owglitches ' ,  ' hybridglitches ' ,  ' nologic ' ] : 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-12 20:19:45 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  region . name  ==  ' Swamp Palace (Entrance) ' :   # Need to 0hp revive - not in logic 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                return  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-12 20:05:18 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  region . name  ==  ' Tower of Hera (Bottom) ' :   # Need to hit the crystal switch 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                return  lambda  state :  state . has ( ' Magic Mirror ' ,  player )  and  state . has_sword ( player )  or  state . has ( ' Moon Pearl ' ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:07:53 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  region . name  in  OverworldGlitchRules . get_invalid_bunny_revival_dungeons ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                return  lambda  state :  state . has ( ' Magic Mirror ' ,  player )  or  state . has ( ' Moon Pearl ' ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 01:34:30 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  region . type  ==  RegionType . Dungeon : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                return  lambda  state :  True 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:07:53 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( ( ( location  is  None  or  location . name  not  in  OverworldGlitchRules . get_superbunny_accessible_locations ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    or  ( connecting_entrance  is  not  None  and  connecting_entrance . name  in  OverworldGlitchRules . get_invalid_bunny_revival_dungeons ( ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    and  not  is_link ( region ) ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                return  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-12 19:48:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  not  is_link ( region ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                return  lambda  state :  state . has ( ' Moon Pearl ' ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # in this case we are mixed region. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # we collect possible options. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # The base option is having the moon pearl 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        possible_options  =  [ lambda  state :  state . has ( ' Moon Pearl ' ,  player ) ] 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # We will search entrances recursively until we find 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # one that leads to an exclusively link state region 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # for each such entrance a new option is added that consist of: 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #    a) being able to reach it, and 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #    b) being able to access all entrances from there to `region` 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-23 18:10:58 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        seen  =  { region } 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        queue  =  collections . deque ( [ ( region ,  [ ] ) ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        while  queue : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ( current ,  path )  =  queue . popleft ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  entrance  in  current . entrances : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                new_region  =  entrance . parent_region 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  new_region  in  seen : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                new_path  =  path  +  [ entrance . access_rule ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                seen . add ( new_region ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  not  is_link ( new_region ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-12 20:19:45 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    # For glitch rulesets, establish superbunny and revival rules. 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-14 22:10:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    if  world . logic [ player ]  in  [ ' minorglitches ' ,  ' owglitches ' ,  ' hybridglitches ' ,  ' nologic ' ]  and  entrance . name  not  in  OverworldGlitchRules . get_invalid_bunny_revival_dungeons ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:07:53 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        if  region . name  in  OverworldGlitchRules . get_sword_required_superbunny_mirror_regions ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            possible_options . append ( lambda  state :  path_to_access_rule ( new_path ,  entrance )  and  state . has ( ' Magic Mirror ' ,  player )  and  state . has_sword ( player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:07:53 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        elif  ( region . name  in  OverworldGlitchRules . get_boots_required_superbunny_mirror_regions ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-24 05:38:56 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                              or  location  is  not  None  and  location . name  in  OverworldGlitchRules . get_boots_required_superbunny_mirror_locations ( ) ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            possible_options . append ( lambda  state :  path_to_access_rule ( new_path ,  entrance )  and  state . has ( ' Magic Mirror ' ,  player )  and  state . has ( ' Pegasus Boots ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:07:53 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        elif  location  is  not  None  and  location . name  in  OverworldGlitchRules . get_superbunny_accessible_locations ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 01:34:30 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            if  new_region . name  ==  ' Superbunny Cave (Bottom) '  or  region . name  ==  ' Kakariko Well (top) ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                possible_options . append ( lambda  state :  path_to_access_rule ( new_path ,  entrance ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            else : 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-27 17:11:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                possible_options . append ( lambda  state :  path_to_access_rule ( new_path ,  entrance )  and  state . has ( ' Magic Mirror ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 01:34:30 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        if  new_region . type  !=  RegionType . Cave : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            continue 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-06 14:46:15 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        continue 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  is_bunny ( new_region ) : 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    queue . append ( ( new_region ,  new_path ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                else : 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    # we have reached pure link state, so we have a new possible option 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    possible_options . append ( path_to_access_rule ( new_path ,  entrance ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  options_to_access_rule ( possible_options ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Add requirements for bunny-impassible caves if link is a bunny in them 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    for  region  in  [ world . get_region ( name ,  player )  for  name  in  bunny_impassable_caves ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  not  is_bunny ( region ) : 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        rule  =  get_rule_to_add ( region ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  exit  in  region . exits : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            add_rule ( exit ,  rule ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    paradox_shop  =  world . get_region ( ' Light World Death Mountain Shop ' ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  is_bunny ( paradox_shop ) : 
							 
						 
					
						
							
								
									
										
										
										
											2019-07-27 09:13:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        add_rule ( paradox_shop . entrances [ 0 ] ,  get_rule_to_add ( paradox_shop ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Add requirements for all locations that are actually in the dark world, except those available to the bunny, including dungeon revival 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-18 20:28:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    for  entrance  in  world . get_entrances ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  entrance . player  ==  player  and  is_bunny ( entrance . connected_region ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-14 22:10:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  world . logic [ player ]  in  [ ' minorglitches ' ,  ' owglitches ' ,  ' hybridglitches ' ,  ' nologic ' ]  : 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-18 20:28:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  entrance . connected_region . type  ==  RegionType . Dungeon : 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 18:07:53 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    if  entrance . parent_region . type  !=  RegionType . Dungeon  and  entrance . connected_region . name  in  OverworldGlitchRules . get_invalid_bunny_revival_dungeons ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-18 20:28:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        add_rule ( entrance ,  get_rule_to_add ( entrance . connected_region ,  None ,  entrance ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  entrance . connected_region . name  ==  ' Turtle Rock (Entrance) ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    add_rule ( world . get_entrance ( ' Turtle Rock Entrance Gap ' ,  player ) ,  get_rule_to_add ( entrance . connected_region ,  None ,  entrance ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  location  in  entrance . connected_region . locations : 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-14 22:10:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  world . logic [ player ]  in  [ ' minorglitches ' ,  ' owglitches ' ,  ' hybridglitches ' ,  ' nologic ' ]  and  entrance . name  in  OverworldGlitchRules . get_invalid_mirror_bunny_entrances ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-18 20:28:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  location . name  in  bunny_accessible_locations : 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-07 20:00:29 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                add_rule ( location ,  get_rule_to_add ( entrance . connected_region ,  location ) )