2021-12-23 12:32:16 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  collections  import  namedtuple  
						 
					
						
							
								
									
										
										
										
											2021-12-27 23:13:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  logging  
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-02-13 18:06:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  BaseClasses  import  ItemClassification  
						 
					
						
							
								
									
										
										
										
											2021-12-27 23:13:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  Fill  import  FillError  
						 
					
						
							
								
									
										
										
										
											2023-04-26 10:48:08 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . SubClasses  import  ALttPLocation ,  LTTPRegion ,  LTTPRegionType  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . Shops  import  TakeAny ,  total_shop_slots ,  set_up_shops ,  shuffle_shops ,  create_dynamic_shop_locations  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . Bosses  import  place_bosses  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . Dungeons  import  get_dungeon_item_pool_player  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . EntranceShuffle  import  connect_entrance  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . Items  import  ItemFactory ,  GetBeemizerItem  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . Options  import  smallkey_shuffle ,  compass_shuffle ,  bigkey_shuffle ,  map_shuffle ,  LTTPBosses  
						 
					
						
							
								
									
										
										
										
											2023-03-03 23:23:52 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  . StateHelpers  import  has_triforce_pieces ,  has_melee_weapon  
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 06:22:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# This file sets the item pools for various modes. Timed modes and triforce hunt are enforced first, and then extra items are specified per mode to fill in the remaining space.  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Some basic items that various modes require are placed here, including pendants and crystals. Medallion requirements for the two relevant entrances are also decided.  
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 06:22:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								alwaysitems  =  [ ' Bombos ' ,  ' Book of Mudora ' ,  ' Cane of Somaria ' ,  ' Ether ' ,  ' Fire Rod ' ,  ' Flippers ' ,  ' Flute ' ,  ' Hammer ' ,  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               ' Hookshot ' ,  ' Ice Rod ' ,  ' Lamp ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               ' Cape ' ,  ' Magic Powder ' ,  ' Mushroom ' ,  ' Pegasus Boots ' ,  ' Quake ' ,  ' Shovel ' ,  ' Bug Catching Net ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               ' Cane of Byrna ' ,  ' Blue Boomerang ' ,  ' Red Boomerang ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								progressivegloves  =  [ ' Progressive Glove ' ]  *  2  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								basicgloves  =  [ ' Power Glove ' ,  ' Titans Mitts ' ]  
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								legacyinsanity  =  [ ' Magic Mirror ' ,  ' Moon Pearl ' ]  
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 06:22:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								normalbottles  =  [ ' Bottle ' ,  ' Bottle (Red Potion) ' ,  ' Bottle (Green Potion) ' ,  ' Bottle (Blue Potion) ' ,  ' Bottle (Fairy) ' ,  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 ' Bottle (Bee) ' ,  ' Bottle (Good Bee) ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								hardbottles  =  [ ' Bottle ' ,  ' Bottle (Red Potion) ' ,  ' Bottle (Green Potion) ' ,  ' Bottle (Blue Potion) ' ,  ' Bottle (Bee) ' ,  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								               ' Bottle (Good Bee) ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-04 09:24:48 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								easybaseitems  =  ( [ ' Sanctuary Heart Container ' ,  " Lamp " ]  +  [ ' Rupees (300) ' ]  *  5  +  
						 
					
						
							
								
									
										
										
										
											2020-08-01 16:49:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                 [ ' Boss Heart Container ' ]  *  10  +  [ ' Piece of Heart ' ]  *  24 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								easyfirst15extra  =  [ ' Piece of Heart ' ]  *  12  +  [ ' Rupees (300) ' ]  *  3  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								easysecond15extra  =  [ ' Rupees (100) ' ]  +  [ ' Arrows (10) ' ]  *  7  +  [ ' Bombs (3) ' ]  *  7  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								easythird10extra  =  [ ' Bombs (3) ' ]  *  7  +  [ ' Rupee (1) ' ,  ' Rupees (50) ' ,  ' Bombs (10) ' ]  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								easyfourth5extra  =  [ ' Rupees (50) ' ]  *  2  +  [ ' Bombs (3) ' ]  *  2  +  [ ' Arrows (10) ' ]  
						 
					
						
							
								
									
										
										
										
											2020-08-01 06:22:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								easyfinal25extra  =  [ ' Rupees (50) ' ]  *  4  +  [ ' Rupees (20) ' ]  *  14  +  [ ' Rupee (1) ' ]  +  [ ' Arrows (10) ' ]  *  4  +  [ ' Rupees (5) ' ]  *  2  
						 
					
						
							
								
									
										
										
										
											2017-11-11 20:22:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-04 09:24:48 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								normalbaseitems  =  ( [ ' Single Arrow ' ,  ' Sanctuary Heart Container ' ,  ' Arrows (10) ' ,  ' Bombs (10) ' ]  +  
						 
					
						
							
								
									
										
										
										
											2020-08-04 09:39:43 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                   [ ' Rupees (300) ' ]  *  3  +  [ ' Boss Heart Container ' ]  *  10  +  [ ' Piece of Heart ' ]  *  24 ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 22:51:54 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								normalfirst15extra  =  [ ' Rupees (100) ' ,  ' Rupees (300) ' ,  ' Rupees (50) ' ]  +  [ ' Arrows (10) ' ]  *  6  +  [ ' Bombs (3) ' ]  *  6  
						 
					
						
							
								
									
										
										
										
											2019-08-10 15:30:14 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								normalsecond15extra  =  [ ' Bombs (3) ' ]  *  10  +  [ ' Rupees (50) ' ]  *  2  +  [ ' Arrows (10) ' ]  *  2  +  [ ' Rupee (1) ' ]  
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								normalthird10extra  =  [ ' Rupees (50) ' ]  *  4  +  [ ' Rupees (20) ' ]  *  3  +  [ ' Arrows (10) ' ,  ' Rupee (1) ' ,  ' Rupees (5) ' ]  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								normalfourth5extra  =  [ ' Arrows (10) ' ]  *  2  +  [ ' Rupees (20) ' ]  *  2  +  [ ' Rupees (5) ' ]  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								normalfinal25extra  =  [ ' Rupees (20) ' ]  *  23  +  [ ' Rupees (5) ' ]  *  2  
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Difficulty  =  namedtuple ( ' Difficulty ' ,  
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        [ ' baseitems ' ,  ' bottles ' ,  ' bottle_count ' ,  ' same_bottle ' ,  ' progressiveshield ' , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-04 09:24:48 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                         ' basicshield ' ,  ' progressivearmor ' ,  ' basicarmor ' ,  ' swordless ' ,  ' progressivemagic ' ,  ' basicmagic ' , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-30 23:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                         ' progressivesword ' ,  ' basicsword ' ,  ' progressivebow ' ,  ' basicbow ' ,  ' timedohko ' ,  ' timedother ' , 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                         ' progressiveglove ' ,  ' basicglove ' ,  ' alwaysitems ' ,  ' legacyinsanity ' , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-25 19:45:33 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                         ' universal_keys ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-04 01:06:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                         ' extras ' ,  ' progressive_sword_limit ' ,  ' progressive_shield_limit ' , 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-11 11:41:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                         ' progressive_armor_limit ' ,  ' progressive_bottle_limit ' , 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-10 19:37:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                         ' progressive_bow_limit ' ,  ' heart_piece_limit ' ,  ' boss_heart_container_limit ' ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-15 05:19:29 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								total_items_to_place  =  153  
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								difficulties  =  {  
						 
					
						
							
								
									
										
										
										
											2020-08-01 06:22:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ' easy ' :  Difficulty ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        baseitems = easybaseitems , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bottles = normalbottles , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bottle_count = 8 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        same_bottle = False , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressiveshield = [ ' Progressive Shield ' ]  *  6 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicshield = [ ' Blue Shield ' ,  ' Red Shield ' ,  ' Mirror Shield ' ]  *  2 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-06 17:19:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressivearmor = [ ' Progressive Mail ' ]  *  4 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 06:22:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        basicarmor = [ ' Blue Mail ' ,  ' Red Mail ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        swordless = [ ' Rupees (20) ' ]  *  8 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-04 09:24:48 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressivemagic = [ ' Magic Upgrade (1/2) ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicmagic = [ ' Magic Upgrade (1/2) ' ,  ' Magic Upgrade (1/4) ' ] , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 06:22:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressivesword = [ ' Progressive Sword ' ]  *  8 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicsword = [ ' Master Sword ' ,  ' Tempered Sword ' ,  ' Golden Sword ' ,  ' Fighter Sword ' ]  *  2 , 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-02 14:55:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressivebow = [ " Progressive Bow " ]  *  4 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 06:22:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        basicbow = [ ' Bow ' ,  ' Silver Bow ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedohko = [ ' Green Clock ' ]  *  25 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 16:49:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        timedother = [ ' Green Clock ' ]  *  20  +  [ ' Blue Clock ' ]  *  10  +  [ ' Red Clock ' ]  *  10 , 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressiveglove = progressivegloves , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicglove = basicgloves , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        alwaysitems = alwaysitems , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        legacyinsanity = legacyinsanity , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-20 20:13:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        universal_keys = [ ' Small Key (Universal) ' ]  *  28 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 16:49:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        extras = [ easyfirst15extra ,  easysecond15extra ,  easythird10extra ,  easyfourth5extra ,  easyfinal25extra ] , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 06:22:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_sword_limit = 8 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_shield_limit = 6 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 16:49:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_armor_limit = 4 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 06:22:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_bow_limit = 4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_bottle_limit = 8 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        boss_heart_container_limit = 10 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 16:49:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        heart_piece_limit = 36 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 06:22:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ) , 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ' normal ' :  Difficulty ( 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 06:22:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        baseitems = normalbaseitems , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-30 23:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        bottles = normalbottles , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bottle_count = 4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        same_bottle = False , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressiveshield = [ ' Progressive Shield ' ]  *  3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicshield = [ ' Blue Shield ' ,  ' Red Shield ' ,  ' Mirror Shield ' ] , 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-06 17:19:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressivearmor = [ ' Progressive Mail ' ]  *  2 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-30 23:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        basicarmor = [ ' Blue Mail ' ,  ' Red Mail ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        swordless = [ ' Rupees (20) ' ]  *  4 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-04 09:39:43 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressivemagic = [ ' Magic Upgrade (1/2) ' ,  ' Rupees (300) ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicmagic = [ ' Magic Upgrade (1/2) ' ,  ' Rupees (300) ' ] , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-30 23:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressivesword = [ ' Progressive Sword ' ]  *  4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicsword = [ ' Fighter Sword ' ,  ' Master Sword ' ,  ' Tempered Sword ' ,  ' Golden Sword ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressivebow = [ " Progressive Bow " ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicbow = [ ' Bow ' ,  ' Silver Bow ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedohko = [ ' Green Clock ' ]  *  25 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedother = [ ' Green Clock ' ]  *  20  +  [ ' Blue Clock ' ]  *  10  +  [ ' Red Clock ' ]  *  10 , 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressiveglove = progressivegloves , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicglove = basicgloves , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        alwaysitems = alwaysitems , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        legacyinsanity = legacyinsanity , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-20 20:13:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        universal_keys = [ ' Small Key (Universal) ' ]  *  18  +  [ ' Rupees (20) ' ]  *  10 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-30 23:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        extras = [ normalfirst15extra ,  normalsecond15extra ,  normalthird10extra ,  normalfourth5extra ,  normalfinal25extra ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_sword_limit = 4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_shield_limit = 3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_armor_limit = 2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_bow_limit = 2 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-20 20:13:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_bottle_limit = 4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        boss_heart_container_limit = 10 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        heart_piece_limit = 24 , 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ' hard ' :  Difficulty ( 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-06 17:19:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        baseitems = normalbaseitems , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-30 23:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        bottles = hardbottles , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bottle_count = 4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        same_bottle = False , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressiveshield = [ ' Progressive Shield ' ]  *  3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicshield = [ ' Blue Shield ' ,  ' Red Shield ' ,  ' Red Shield ' ] , 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-06 17:19:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressivearmor = [ ' Progressive Mail ' ]  *  2 , 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-22 12:34:23 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        basicarmor = [ ' Blue Mail ' ,  ' Blue Mail ' ]  *  2 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-30 23:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        swordless = [ ' Rupees (20) ' ]  *  4 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-04 09:39:43 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressivemagic = [ ' Magic Upgrade (1/2) ' ,  ' Rupees (300) ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicmagic = [ ' Magic Upgrade (1/2) ' ,  ' Rupees (300) ' ] , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-30 23:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressivesword = [ ' Progressive Sword ' ]  *  4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicsword = [ ' Fighter Sword ' ,  ' Master Sword ' ,  ' Master Sword ' ,  ' Tempered Sword ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressivebow = [ " Progressive Bow " ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicbow = [ ' Bow ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedohko = [ ' Green Clock ' ]  *  25 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedother = [ ' Green Clock ' ]  *  20  +  [ ' Blue Clock ' ]  *  10  +  [ ' Red Clock ' ]  *  10 , 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressiveglove = progressivegloves , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicglove = basicgloves , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        alwaysitems = alwaysitems , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        legacyinsanity = legacyinsanity , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-20 20:13:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        universal_keys = [ ' Small Key (Universal) ' ]  *  12  +  [ ' Rupees (5) ' ]  *  16 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-30 23:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        extras = [ normalfirst15extra ,  normalsecond15extra ,  normalthird10extra ,  normalfourth5extra ,  normalfinal25extra ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_sword_limit = 3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_shield_limit = 2 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-19 23:39:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_armor_limit = 1 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-30 23:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_bow_limit = 1 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-19 23:39:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_bottle_limit = 4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        boss_heart_container_limit = 6 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        heart_piece_limit = 16 , 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ' expert ' :  Difficulty ( 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-06 17:19:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        baseitems = normalbaseitems , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-30 23:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        bottles = hardbottles , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bottle_count = 4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        same_bottle = False , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressiveshield = [ ' Progressive Shield ' ]  *  3 , 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-22 12:34:23 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        basicshield = [ ' Blue Shield ' ,  ' Blue Shield ' ,  ' Blue Shield ' ] , 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-06 17:19:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressivearmor = [ ' Progressive Mail ' ]  *  2 ,   # neither will count 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-22 12:34:23 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        basicarmor = [ ' Rupees (20) ' ]  *  2 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-30 23:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        swordless = [ ' Rupees (20) ' ]  *  4 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-04 09:39:43 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressivemagic = [ ' Magic Upgrade (1/2) ' ,  ' Rupees (300) ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicmagic = [ ' Magic Upgrade (1/2) ' ,  ' Rupees (300) ' ] , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-30 23:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressivesword = [ ' Progressive Sword ' ]  *  4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicsword = [ ' Fighter Sword ' ,  ' Fighter Sword ' ,  ' Master Sword ' ,  ' Master Sword ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressivebow = [ " Progressive Bow " ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicbow = [ ' Bow ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedohko = [ ' Green Clock ' ]  *  20  +  [ ' Red Clock ' ]  *  5 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedother = [ ' Green Clock ' ]  *  20  +  [ ' Blue Clock ' ]  *  10  +  [ ' Red Clock ' ]  *  10 , 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressiveglove = progressivegloves , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicglove = basicgloves , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        alwaysitems = alwaysitems , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        legacyinsanity = legacyinsanity , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-20 20:13:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        universal_keys = [ ' Small Key (Universal) ' ]  *  12  +  [ ' Rupees (5) ' ]  *  16 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-30 23:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        extras = [ normalfirst15extra ,  normalsecond15extra ,  normalthird10extra ,  normalfourth5extra ,  normalfinal25extra ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_sword_limit = 2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_shield_limit = 1 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_armor_limit = 0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_bow_limit = 1 , 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 16:49:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_bottle_limit = 4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        boss_heart_container_limit = 2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        heart_piece_limit = 8 , 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								ice_rod_hunt_difficulties  =  dict ( )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								for  diff  in  { ' easy ' ,  ' normal ' ,  ' hard ' ,  ' expert ' } :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ice_rod_hunt_difficulties [ diff ]  =  Difficulty ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        baseitems = [ ' Nothing ' ]  *  41 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bottles = [ ' Nothing ' ]  *  4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bottle_count = difficulties [ diff ] . bottle_count , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        same_bottle = difficulties [ diff ] . same_bottle , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressiveshield = [ ' Nothing ' ]  *  3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicshield = [ ' Nothing ' ]  *  3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressivearmor = [ ' Nothing ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicarmor = [ ' Nothing ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        swordless = [ ' Nothing ' ]  *  4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressivemagic = [ ' Nothing ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicmagic = [ ' Nothing ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressivesword = [ ' Nothing ' ]  *  4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicsword = [ ' Nothing ' ]  *  4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressivebow = [ ' Nothing ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicbow = [ ' Nothing ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedohko = difficulties [ diff ] . timedohko , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedother = difficulties [ diff ] . timedother , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressiveglove = [ ' Nothing ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicglove = [ ' Nothing ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        alwaysitems = [ ' Ice Rod ' ]  +  [ ' Nothing ' ]  *  19 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        legacyinsanity = [ ' Nothing ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        universal_keys = [ ' Nothing ' ]  *  28 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        extras = [ [ ' Nothing ' ]  *  15 ,  [ ' Nothing ' ]  *  15 ,  [ ' Nothing ' ]  *  10 ,  [ ' Nothing ' ]  *  5 ,  [ ' Nothing ' ]  *  25 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_sword_limit = difficulties [ diff ] . progressive_sword_limit , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_shield_limit = difficulties [ diff ] . progressive_shield_limit , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_armor_limit = difficulties [ diff ] . progressive_armor_limit , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_bow_limit = difficulties [ diff ] . progressive_bow_limit , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_bottle_limit = difficulties [ diff ] . progressive_bottle_limit , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        boss_heart_container_limit = difficulties [ diff ] . boss_heart_container_limit , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        heart_piece_limit = difficulties [ diff ] . heart_piece_limit , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 16:49:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-22 15:51:50 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  generate_itempool ( world ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    player  =  world . player 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    multiworld  =  world . multiworld 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-23 12:32:16 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  multiworld . difficulty [ player ]  not  in  difficulties : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        raise  NotImplementedError ( f " Diffulty  { multiworld . difficulty [ player ] } " ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  multiworld . goal [ player ]  not  in  { ' ganon ' ,  ' pedestal ' ,  ' bosses ' ,  ' triforcehunt ' ,  ' localtriforcehunt ' ,  ' icerodhunt ' , 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-15 15:24:52 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                  ' ganontriforcehunt ' ,  ' localganontriforcehunt ' ,  ' crystals ' ,  ' ganonpedestal ' } : 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        raise  NotImplementedError ( f " Goal  { multiworld . goal [ player ] }  for player  { player } " ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  multiworld . mode [ player ]  not  in  { ' open ' ,  ' standard ' ,  ' inverted ' } : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        raise  NotImplementedError ( f " Mode  { multiworld . mode [ player ] }  for player  { player } " ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  multiworld . timer [ player ]  not  in  { False ,  ' display ' ,  ' timed ' ,  ' timed-ohko ' ,  ' ohko ' ,  ' timed-countdown ' } : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        raise  NotImplementedError ( f " Timer  { multiworld . mode [ player ] }  for player  { player } " ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  multiworld . timer [ player ]  in  [ ' ohko ' ,  ' timed-ohko ' ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        multiworld . can_take_damage [ player ]  =  False 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  multiworld . goal [ player ]  in  [ ' pedestal ' ,  ' triforcehunt ' ,  ' localtriforcehunt ' ,  ' icerodhunt ' ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        multiworld . push_item ( multiworld . get_location ( ' Ganon ' ,  player ) ,  ItemFactory ( ' Nothing ' ,  player ) ,  False ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-04 17:40:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        multiworld . push_item ( multiworld . get_location ( ' Ganon ' ,  player ) ,  ItemFactory ( ' Triforce ' ,  player ) ,  False ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  multiworld . goal [ player ]  ==  ' icerodhunt ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        multiworld . progression_balancing [ player ] . value  =  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        loc  =  multiworld . get_location ( ' Turtle Rock - Boss ' ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        multiworld . push_item ( loc ,  ItemFactory ( ' Triforce Piece ' ,  player ) ,  False ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        multiworld . treasure_hunt_count [ player ]  =  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  multiworld . boss_shuffle [ player ]  !=  ' none ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  isinstance ( multiworld . boss_shuffle [ player ] . value ,  str )  and  ' turtle rock- '  not  in  multiworld . boss_shuffle [ player ] . value : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                multiworld . boss_shuffle [ player ]  =  LTTPBosses . from_text ( f ' Turtle Rock-Trinexx; { multiworld . boss_shuffle [ player ] . current_key } ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            elif  isinstance ( multiworld . boss_shuffle [ player ] . value ,  int ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                multiworld . boss_shuffle [ player ]  =  LTTPBosses . from_text ( f ' Turtle Rock-Trinexx; { multiworld . boss_shuffle [ player ] . current_key } ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                logging . warning ( f ' Cannot guarantee that Trinexx is the boss of Turtle Rock for player  { player } ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        loc . event  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        loc . locked  =  True 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        itemdiff  =  difficulties [ multiworld . difficulty [ player ] ] 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        itempool  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itempool . extend ( itemdiff . alwaysitems ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itempool . remove ( ' Ice Rod ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 23:04:33 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        itempool . extend ( [ ' Single Arrow ' ,  ' Sanctuary Heart Container ' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itempool . extend ( [ ' Boss Heart Container ' ]  *  itemdiff . boss_heart_container_limit ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itempool . extend ( [ ' Piece of Heart ' ]  *  itemdiff . heart_piece_limit ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        itempool . extend ( itemdiff . bottles ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itempool . extend ( itemdiff . basicbow ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itempool . extend ( itemdiff . basicarmor ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  not  multiworld . swordless [ player ] : 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            itempool . extend ( itemdiff . basicsword ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itempool . extend ( itemdiff . basicmagic ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itempool . extend ( itemdiff . basicglove ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itempool . extend ( itemdiff . basicshield ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itempool . extend ( itemdiff . legacyinsanity ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itempool . extend ( [ ' Rupees (300) ' ]  *  34 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itempool . extend ( [ ' Bombs (10) ' ]  *  5 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itempool . extend ( [ ' Arrows (10) ' ]  *  7 ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  multiworld . smallkey_shuffle [ player ]  ==  smallkey_shuffle . option_universal : 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 23:04:33 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            itempool . extend ( itemdiff . universal_keys ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            itempool . append ( ' Small Key (Universal) ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        for  item  in  itempool : 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            multiworld . push_precollected ( ItemFactory ( item ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  multiworld . goal [ player ]  in  [ ' triforcehunt ' ,  ' localtriforcehunt ' ,  ' icerodhunt ' ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        region  =  multiworld . get_region ( ' Light World ' ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-27 12:14:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        loc  =  ALttPLocation ( player ,  " Murahdahla " ,  parent = region ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-03 23:23:52 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        loc . access_rule  =  lambda  state :  has_triforce_pieces ( state ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-27 12:14:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        region . locations . append ( loc ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        multiworld . clear_location_cache ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-27 12:14:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        multiworld . push_item ( loc ,  ItemFactory ( ' Triforce ' ,  player ) ,  False ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-27 12:14:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        loc . event  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        loc . locked  =  True 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    multiworld . get_location ( ' Ganon ' ,  player ) . event  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    multiworld . get_location ( ' Ganon ' ,  player ) . locked  =  True 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-02 11:24:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    event_pairs  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ( ' Agahnim 1 ' ,  ' Beat Agahnim 1 ' ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ( ' Agahnim 2 ' ,  ' Beat Agahnim 2 ' ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ( ' Dark Blacksmith Ruins ' ,  ' Pick Up Purple Chest ' ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ( ' Frog ' ,  ' Get Frog ' ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ( ' Missing Smith ' ,  ' Return Smith ' ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ( ' Floodgate ' ,  ' Open Floodgate ' ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ( ' Agahnim 1 ' ,  ' Beat Agahnim 1 ' ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ( ' Flute Activation Spot ' ,  ' Activated Flute ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    for  location_name ,  event_name  in  event_pairs : 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        location  =  multiworld . get_location ( location_name ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-02 11:24:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        event  =  ItemFactory ( event_name ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        multiworld . push_item ( location ,  event ,  False ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-02-02 11:24:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        location . event  =  location . locked  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # set up item pool 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-25 19:45:33 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    additional_triforce_pieces  =  0 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  multiworld . custom : 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 06:26:30 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ( pool ,  placed_items ,  precollected_items ,  clock_mode ,  treasure_hunt_count , 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								         treasure_hunt_icon )  =  make_custom_item_pool ( multiworld ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        multiworld . rupoor_cost  =  min ( multiworld . customitemarray [ 67 ] ,  9999 ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-25 19:45:33 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool ,  placed_items ,  precollected_items ,  clock_mode ,  treasure_hunt_count ,  \
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        treasure_hunt_icon ,  additional_triforce_pieces  =  get_pool_core ( multiworld ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-11 11:41:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-08-10 15:30:14 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    for  item  in  precollected_items : 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        multiworld . push_precollected ( ItemFactory ( item ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-11 11:41:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  multiworld . mode [ player ]  ==  ' standard '  and  not  has_melee_weapon ( multiworld . state ,  player ) : 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-30 06:42:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  " Link ' s Uncle "  not  in  placed_items : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            found_sword  =  False 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            found_bow  =  False 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            possible_weapons  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  item  in  pool : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  item  in  [ ' Progressive Sword ' ,  ' Fighter Sword ' ,  ' Master Sword ' ,  ' Tempered Sword ' ,  ' Golden Sword ' ] : 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-09 20:40:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    if  not  found_sword : 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-30 06:42:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        found_sword  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        possible_weapons . append ( item ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  item  in  [ ' Progressive Bow ' ,  ' Bow ' ]  and  not  found_bow : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    found_bow  =  True 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-11 11:41:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    possible_weapons . append ( item ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-30 06:42:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  item  in  [ ' Hammer ' ,  ' Bombs (10) ' ,  ' Fire Rod ' ,  ' Cane of Somaria ' ,  ' Cane of Byrna ' ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  item  not  in  possible_weapons : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        possible_weapons . append ( item ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            starting_weapon  =  multiworld . random . choice ( possible_weapons ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-30 06:42:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            placed_items [ " Link ' s Uncle " ]  =  starting_weapon 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . remove ( starting_weapon ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  placed_items [ " Link ' s Uncle " ]  in  [ ' Bow ' ,  ' Progressive Bow ' ,  ' Bombs (10) ' ,  ' Cane of Somaria ' ,  ' Cane of Byrna ' ]  and  multiworld . enemy_health [ player ]  not  in  [ ' default ' ,  ' easy ' ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            multiworld . escape_assist [ player ] . append ( ' bombs ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-11 11:41:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-10 21:21:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    for  ( location ,  item )  in  placed_items . items ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        multiworld . get_location ( location ,  player ) . place_locked_item ( ItemFactory ( item ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-11 11:41:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-30 20:28:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    items  =  ItemFactory ( pool ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-20 01:00:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # convert one Progressive Bow into Progressive Bow (Alt), in ID only, for ganon silvers hint text 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  multiworld . worlds [ player ] . has_progressive_bows : 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-20 01:00:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        for  item  in  items : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  item . code  ==  0x64 :   # Progressive Bow 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                item . code  =  0x65   # Progressive Bow (Alt) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                break 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-11 11:41:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  clock_mode  is  not  None : 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        multiworld . clock_mode [ player ]  =  clock_mode 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-11 11:41:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  treasure_hunt_count  is  not  None : 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        multiworld . treasure_hunt_count [ player ]  =  treasure_hunt_count  %  999 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  treasure_hunt_icon  is  not  None : 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        multiworld . treasure_hunt_icon [ player ]  =  treasure_hunt_icon 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    dungeon_items  =  [ item  for  item  in  get_dungeon_item_pool_player ( world ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     if  item . name  not  in  multiworld . worlds [ player ] . dungeon_local_item_names ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    dungeon_item_replacements  =  difficulties [ multiworld . difficulty [ player ] ] . extras [ 0 ] \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                +  difficulties [ multiworld . difficulty [ player ] ] . extras [ 1 ] \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                +  difficulties [ multiworld . difficulty [ player ] ] . extras [ 2 ] \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                +  difficulties [ multiworld . difficulty [ player ] ] . extras [ 3 ] \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                +  difficulties [ multiworld . difficulty [ player ] ] . extras [ 4 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    multiworld . random . shuffle ( dungeon_item_replacements ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  multiworld . goal [ player ]  ==  ' icerodhunt ' : 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        for  item  in  dungeon_items : 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            multiworld . itempool . append ( ItemFactory ( GetBeemizerItem ( multiworld ,  player ,  ' Nothing ' ) ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            multiworld . push_precollected ( item ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-28 12:55:13 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        for  x  in  range ( len ( dungeon_items ) - 1 ,  - 1 ,  - 1 ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            item  =  dungeon_items [ x ] 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( ( multiworld . smallkey_shuffle [ player ]  ==  smallkey_shuffle . option_start_with  and  item . type  ==  ' SmallKey ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    or  ( multiworld . bigkey_shuffle [ player ]  ==  bigkey_shuffle . option_start_with  and  item . type  ==  ' BigKey ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    or  ( multiworld . compass_shuffle [ player ]  ==  compass_shuffle . option_start_with  and  item . type  ==  ' Compass ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    or  ( multiworld . map_shuffle [ player ]  ==  map_shuffle . option_start_with  and  item . type  ==  ' Map ' ) ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-28 12:55:13 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                dungeon_items . remove ( item ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                multiworld . push_precollected ( item ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                multiworld . itempool . append ( ItemFactory ( dungeon_item_replacements . pop ( ) ,  player ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        multiworld . itempool . extend ( [ item  for  item  in  dungeon_items ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-06 13:39:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # logic has some branches where having 4 hearts is one possible requirement (of several alternatives) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # rather than making all hearts/heart pieces progression items (which slows down generation considerably) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # We mark one random heart container as an advancement item (or 4 heart pieces in expert mode) 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  multiworld . goal [ player ]  !=  ' icerodhunt '  and  multiworld . difficulty [ player ]  in  [ ' easy ' ,  ' normal ' ,  ' hard ' ]  and  not  ( multiworld . custom  and  multiworld . customitemarray [ 30 ]  ==  0 ) : 
							 
						 
					
						
							
								
									
										
										
										
											2022-06-17 03:23:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        next ( item  for  item  in  items  if  item . name  ==  ' Boss Heart Container ' ) . classification  =  ItemClassification . progression 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  multiworld . goal [ player ]  !=  ' icerodhunt '  and  multiworld . difficulty [ player ]  in  [ ' expert ' ]  and  not  ( multiworld . custom  and  multiworld . customitemarray [ 29 ]  <  4 ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-28 23:10:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        adv_heart_pieces  =  ( item  for  item  in  items  if  item . name  ==  ' Piece of Heart ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  i  in  range ( 4 ) : 
							 
						 
					
						
							
								
									
										
										
										
											2022-06-17 03:23:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            next ( adv_heart_pieces ) . classification  =  ItemClassification . progression 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-06 13:39:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-30 20:28:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-28 23:10:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    progressionitems  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    nonprogressionitems  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    for  item  in  items : 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-30 09:57:25 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  item . advancement  or  item . type : 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-28 23:10:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            progressionitems . append ( item ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            nonprogressionitems . append ( GetBeemizerItem ( multiworld ,  item . player ,  item ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    multiworld . random . shuffle ( nonprogressionitems ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-11 11:53:10 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-25 19:45:33 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  additional_triforce_pieces : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  additional_triforce_pieces  >  len ( nonprogressionitems ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            raise  FillError ( f " Not enough non-progression items to replace with Triforce pieces found for player  " 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            f " { multiworld . get_player_name ( player ) } . " ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-02 14:08:38 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressionitems  + =  [ ItemFactory ( " Triforce Piece " ,  player )  for  _  in  range ( additional_triforce_pieces ) ] 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-25 19:45:33 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        nonprogressionitems . sort ( key = lambda  item :  int ( " Heart "  in  item . name ) )   # try to keep hearts in the pool 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        nonprogressionitems  =  nonprogressionitems [ additional_triforce_pieces : ] 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        multiworld . random . shuffle ( nonprogressionitems ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-11 11:53:10 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    # shuffle medallions 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  multiworld . required_medallions [ player ] [ 0 ]  ==  " random " : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        mm_medallion  =  multiworld . random . choice ( [ ' Ether ' ,  ' Quake ' ,  ' Bombos ' ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-02 23:00:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        mm_medallion  =  multiworld . required_medallions [ player ] [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  multiworld . required_medallions [ player ] [ 1 ]  ==  " random " : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        tr_medallion  =  multiworld . random . choice ( [ ' Ether ' ,  ' Quake ' ,  ' Bombos ' ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-02 23:00:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        tr_medallion  =  multiworld . required_medallions [ player ] [ 1 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    multiworld . required_medallions [ player ]  =  ( mm_medallion ,  tr_medallion ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    place_bosses ( world ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_up_shops ( multiworld ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-17 18:38:54 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  multiworld . shop_shuffle [ player ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        shuffle_shops ( multiworld ,  nonprogressionitems ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    multiworld . itempool  + =  progressionitems  +  nonprogressionitems 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-23 21:38:21 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  multiworld . retro_caves [ player ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_up_take_anys ( multiworld ,  player )   # depends on world.itempool to be set 
							 
						 
					
						
							
								
									
										
										
										
											2023-01-19 16:17:43 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # set_up_take_anys needs to run first 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-20 19:57:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    create_dynamic_shop_locations ( multiworld ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-25 22:49:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-23 15:03:06 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-26 05:09:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								take_any_locations  =  {  
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ' Snitch Lady (East) ' ,  ' Snitch Lady (West) ' ,  ' Bush Covered House ' ,  ' Light World Bomb Hut ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ' Fortune Teller (Light) ' ,  ' Lake Hylia Fortune Teller ' ,  ' Lumberjack House ' ,  ' Bonk Fairy (Light) ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ' Bonk Fairy (Dark) ' ,  ' Lake Hylia Healer Fairy ' ,  ' Swamp Healer Fairy ' ,  ' Desert Healer Fairy ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ' Dark Lake Hylia Healer Fairy ' ,  ' Dark Lake Hylia Ledge Healer Fairy ' ,  ' Dark Desert Healer Fairy ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ' Dark Death Mountain Healer Fairy ' ,  ' Long Fairy Cave ' ,  ' Good Bee Cave ' ,  ' 20 Rupee Cave ' , 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-02 16:23:03 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ' Kakariko Gamble Game ' ,  ' 50 Rupee Cave ' ,  ' Lost Woods Gamble ' ,  ' Hookshot Fairy ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ' Palace of Darkness Hint ' ,  ' East Dark World Hint ' ,  ' Archery Game ' ,  ' Dark Lake Hylia Ledge Hint ' , 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-26 05:09:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ' Dark Lake Hylia Ledge Spike Cave ' ,  ' Fortune Teller (Dark) ' ,  ' Dark Sanctuary Hint ' ,  ' Dark Desert Hint ' } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-15 19:13:22 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								take_any_locations_inverted  =  list ( take_any_locations  -  { " Dark Sanctuary Hint " ,  " Archery Game " } )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								take_any_locations  =  list ( take_any_locations )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# sets are sorted by the element's hash, python's hash is seeded at startup, resulting in different sorting each run  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								take_any_locations_inverted . sort ( )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								take_any_locations . sort ( )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  set_up_take_anys ( world ,  player ) :  
						 
					
						
							
								
									
										
										
										
											2021-01-15 19:13:22 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # these are references, do not modify these lists in-place 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-26 05:09:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . mode [ player ]  ==  ' inverted ' : 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-15 19:13:22 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        take_any_locs  =  take_any_locations_inverted 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-26 05:09:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        take_any_locs  =  take_any_locations 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-11 11:41:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-26 05:09:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    regions  =  world . random . sample ( take_any_locs ,  5 ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-02-13 18:06:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    old_man_take_any  =  LTTPRegion ( " Old Man Sword Cave " ,  LTTPRegionType . Cave ,  ' the sword cave ' ,  player ,  world ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    world . regions . append ( old_man_take_any ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    reg  =  regions . pop ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    entrance  =  world . get_region ( reg ,  player ) . entrances [ 0 ] 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-03 14:37:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    connect_entrance ( world ,  entrance . name ,  old_man_take_any . name ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    entrance . target  =  0x58 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-22 07:08:50 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    old_man_take_any . shop  =  TakeAny ( old_man_take_any ,  0x0112 ,  0xE2 ,  True ,  True ,  total_shop_slots ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    world . shops . append ( old_man_take_any . shop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-16 09:18:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    swords  =  [ item  for  item  in  world . itempool  if  item . player  ==  player  and  item . type  ==  ' Sword ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  swords : 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-14 07:01:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        sword  =  world . random . choice ( swords ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        world . itempool . remove ( sword ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        world . itempool . append ( ItemFactory ( ' Rupees (20) ' ,  player ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-26 19:32:19 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        old_man_take_any . shop . add_inventory ( 0 ,  sword . name ,  0 ,  0 ,  create_location = True ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
									
										
										
										
											2023-01-19 16:17:43 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        old_man_take_any . shop . add_inventory ( 0 ,  ' Rupees (300) ' ,  0 ,  0 ,  create_location = True ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    for  num  in  range ( 4 ) : 
							 
						 
					
						
							
								
									
										
										
										
											2023-02-13 18:06:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        take_any  =  LTTPRegion ( " Take-Any # {} " . format ( num + 1 ) ,  LTTPRegionType . Cave ,  ' a cave of choice ' ,  player ,  world ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        world . regions . append ( take_any ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-14 07:01:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        target ,  room_id  =  world . random . choice ( [ ( 0x58 ,  0x0112 ) ,  ( 0x60 ,  0x010F ) ,  ( 0x46 ,  0x011F ) ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        reg  =  regions . pop ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-18 11:23:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        entrance  =  world . get_region ( reg ,  player ) . entrances [ 0 ] 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-03 14:37:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        connect_entrance ( world ,  entrance . name ,  take_any . name ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        entrance . target  =  target 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-22 07:08:50 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        take_any . shop  =  TakeAny ( take_any ,  room_id ,  0xE3 ,  True ,  True ,  total_shop_slots  +  num  +  1 ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        world . shops . append ( take_any . shop ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-26 19:32:19 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        take_any . shop . add_inventory ( 0 ,  ' Blue Potion ' ,  0 ,  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-01-19 16:17:43 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        take_any . shop . add_inventory ( 1 ,  ' Boss Heart Container ' ,  0 ,  0 ,  create_location = True ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-14 19:19:08 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    world . initialize_regions ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-10 08:00:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-16 11:02:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  get_pool_core ( world ,  player :  int ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    shuffle  =  world . shuffle [ player ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    difficulty  =  world . difficulty [ player ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    timer  =  world . timer [ player ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    goal  =  world . goal [ player ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    mode  =  world . mode [ player ] 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-09 20:40:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    swordless  =  world . swordless [ player ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-06-01 17:29:21 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    retro_bow  =  world . retro_bow [ player ] 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-16 11:02:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    logic  =  world . logic [ player ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    pool  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-10 21:21:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    placed_items  =  { } 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-10 15:30:14 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    precollected_items  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    clock_mode  =  None 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    treasure_hunt_count  =  None 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    treasure_hunt_icon  =  None 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    diff  =  ice_rod_hunt_difficulties [ difficulty ]  if  goal  ==  ' icerodhunt '  else  difficulties [ difficulty ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( diff . alwaysitems ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-10 21:21:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    def  place_item ( loc ,  item ) : 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-26 01:12:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        assert  loc  not  in  placed_items ,  " cannot place item twice " 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-10 21:21:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        placed_items [ loc ]  =  item 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-01-03 01:09:21 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # provide boots to major glitch dependent seeds 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-07 01:19:27 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  logic  in  { ' owglitches ' ,  ' hybridglitches ' ,  ' nologic ' }  and  world . glitch_boots [ player ]  and  goal  !=  ' icerodhunt ' : 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-03 01:09:21 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        precollected_items . append ( ' Pegasus Boots ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . remove ( ' Pegasus Boots ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 16:49:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . append ( ' Rupees (20) ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-09 09:15:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    want_progressives  =  world . progressive [ player ] . want_progressives 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-03 01:09:21 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-09 09:15:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  want_progressives ( world . random ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( diff . progressiveglove ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( diff . basicglove ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 16:49:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # insanity legacy shuffle doesn't have fake LW/DW logic so for now guaranteed Mirror and Moon Pearl at the start 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-04 13:55:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  shuffle  ==  ' insanity_legacy ' : 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        place_item ( ' Link \' s House ' ,  diff . legacyinsanity [ 0 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        place_item ( ' Sanctuary ' ,  diff . legacyinsanity [ 1 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( diff . legacyinsanity ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  timer  ==  ' display ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        clock_mode  =  ' stopwatch ' 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 20:36:42 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  timer  ==  ' ohko ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        clock_mode  =  ' ohko ' 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( diff . baseitems ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # expert+ difficulties produce the same contents for 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # all bottles, since only one bottle is available 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    thisbottle  =  None 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    for  _  in  range ( diff . bottle_count ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  not  diff . same_bottle  or  not  thisbottle : 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-14 07:01:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            thisbottle  =  world . random . choice ( diff . bottles ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . append ( thisbottle ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-09 09:15:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  want_progressives ( world . random ) : 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( diff . progressiveshield ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( diff . basicshield ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-09 09:15:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  want_progressives ( world . random ) : 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( diff . progressivearmor ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( diff . basicarmor ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-09 09:15:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  want_progressives ( world . random ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-04 09:24:48 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( diff . progressivemagic ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( diff . basicmagic ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-09 09:15:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  want_progressives ( world . random ) : 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-30 23:07:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( diff . progressivebow ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-20 01:00:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        world . worlds [ player ] . has_progressive_bows  =  True 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-09 20:40:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  ( swordless  or  logic  ==  ' noglitches ' )  and  goal  !=  ' icerodhunt ' : 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 16:49:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        swordless_bows  =  [ ' Bow ' ,  ' Silver Bow ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  difficulty  ==  " easy " : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            swordless_bows  * =  2 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( swordless_bows ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-07 19:51:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( diff . basicbow ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-10 19:37:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-09 20:40:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  swordless : 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( diff . swordless ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-09 09:15:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_swords  =  want_progressives ( world . random ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-01-24 00:06:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( diff . progressivesword  if  progressive_swords  else  diff . basicsword ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    extraitems  =  total_items_to_place  -  len ( pool )  -  len ( placed_items ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  timer  in  [ ' timed ' ,  ' timed-countdown ' ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( diff . timedother ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        extraitems  - =  len ( diff . timedother ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        clock_mode  =  ' stopwatch '  if  timer  ==  ' timed '  else  ' countdown ' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    elif  timer  ==  ' timed-ohko ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( diff . timedohko ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        extraitems  - =  len ( diff . timedohko ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 20:36:42 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        clock_mode  =  ' countdown-ohko ' 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-25 19:45:33 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    additional_pieces_to_place  =  0 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-26 07:18:53 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  ' triforcehunt '  in  goal : 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-25 19:45:33 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pieces_in_core  =  min ( extraitems ,  world . triforce_pieces_available [ player ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        additional_pieces_to_place  =  world . triforce_pieces_available [ player ]  -  pieces_in_core 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( [ " Triforce Piece " ]  *  pieces_in_core ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        extraitems  - =  pieces_in_core 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-07 15:22:24 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        treasure_hunt_count  =  world . triforce_pieces_required [ player ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        treasure_hunt_icon  =  ' Triforce Piece ' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    for  extra  in  diff . extras : 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 16:49:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  extraitems  > =  len ( extra ) : 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            pool . extend ( extra ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            extraitems  - =  len ( extra ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 16:49:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        elif  extraitems  >  0 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . extend ( world . random . sample ( extra ,  extraitems ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            break 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-25 19:45:33 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            break 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-09 20:40:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  goal  ==  ' pedestal ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-10 21:21:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        place_item ( ' Master Sword Pedestal ' ,  ' Triforce ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 16:49:46 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . remove ( " Rupees (20) " ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-06-01 17:29:21 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  retro_bow : 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-25 20:20:36 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        replace  =  { ' Single Arrow ' ,  ' Arrows (10) ' ,  ' Arrow Upgrade (+5) ' ,  ' Arrow Upgrade (+10) ' } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool  =  [ ' Rupees (5) '  if  item  in  replace  else  item  for  item  in  pool ] 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 09:59:20 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . smallkey_shuffle [ player ]  ==  smallkey_shuffle . option_universal : 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-20 20:13:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( diff . universal_keys ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        item_to_place  =  ' Small Key (Universal) '  if  goal  !=  ' icerodhunt '  else  ' Nothing ' 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  mode  ==  ' standard ' : 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-14 07:01:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            key_location  =  world . random . choice ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                [ ' Secret Passage ' ,  ' Hyrule Castle - Boomerang Chest ' ,  ' Hyrule Castle - Map Chest ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 ' Hyrule Castle - Zelda \' s Chest ' ,  ' Sewers - Dark Cross ' ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            place_item ( key_location ,  item_to_place ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            pool . extend ( [ item_to_place ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-23 12:32:16 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-25 19:45:33 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    return  ( pool ,  placed_items ,  precollected_items ,  clock_mode ,  treasure_hunt_count ,  treasure_hunt_icon , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            additional_pieces_to_place ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-14 07:01:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								def  make_custom_item_pool ( world ,  player ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    shuffle  =  world . shuffle [ player ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    difficulty  =  world . difficulty [ player ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    timer  =  world . timer [ player ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    goal  =  world . goal [ player ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    mode  =  world . mode [ player ] 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-24 02:24:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    customitemarray  =  world . customitemarray 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-14 07:01:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    pool  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-10 21:21:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    placed_items  =  { } 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-10 15:30:14 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    precollected_items  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    clock_mode  =  None 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    treasure_hunt_count  =  None 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    treasure_hunt_icon  =  None 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-12-10 21:21:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    def  place_item ( loc ,  item ) : 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-26 01:12:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        assert  loc  not  in  placed_items ,  " cannot place item twice " 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-10 21:21:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        placed_items [ loc ]  =  item 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Correct for insanely oversized item counts and take initial steps to handle undersized pools. 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-16 18:18:17 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    for  x  in  range ( 0 ,  67 ) : 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  customitemarray [ x ]  >  total_items_to_place : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            customitemarray [ x ]  =  total_items_to_place 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-16 18:18:17 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  customitemarray [ 68 ]  >  total_items_to_place : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        customitemarray [ 68 ]  =  total_items_to_place 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # count all items, except rupoor cost 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    itemtotal  =  0 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-16 18:18:17 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    for  x  in  range ( 0 ,  67 ) : 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        itemtotal  =  itemtotal  +  customitemarray [ x ] 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-15 16:53:42 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    itemtotal  =  itemtotal  +  customitemarray [ 68 ] 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Bow ' ]  *  customitemarray [ 0 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-24 02:24:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    pool . extend ( [ ' Silver Bow ' ]  *  customitemarray [ 1 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    pool . extend ( [ ' Blue Boomerang ' ]  *  customitemarray [ 2 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Red Boomerang ' ]  *  customitemarray [ 3 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Hookshot ' ]  *  customitemarray [ 4 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Mushroom ' ]  *  customitemarray [ 5 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Magic Powder ' ]  *  customitemarray [ 6 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Fire Rod ' ]  *  customitemarray [ 7 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Ice Rod ' ]  *  customitemarray [ 8 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Bombos ' ]  *  customitemarray [ 9 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Ether ' ]  *  customitemarray [ 10 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Quake ' ]  *  customitemarray [ 11 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Lamp ' ]  *  customitemarray [ 12 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Hammer ' ]  *  customitemarray [ 13 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Shovel ' ]  *  customitemarray [ 14 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-02-17 10:08:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    pool . extend ( [ ' Flute ' ]  *  customitemarray [ 15 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    pool . extend ( [ ' Bug Catching Net ' ]  *  customitemarray [ 16 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Book of Mudora ' ]  *  customitemarray [ 17 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Cane of Somaria ' ]  *  customitemarray [ 19 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Cane of Byrna ' ]  *  customitemarray [ 20 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Cape ' ]  *  customitemarray [ 21 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Pegasus Boots ' ]  *  customitemarray [ 23 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Power Glove ' ]  *  customitemarray [ 24 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Titans Mitts ' ]  *  customitemarray [ 25 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Progressive Glove ' ]  *  customitemarray [ 26 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Flippers ' ]  *  customitemarray [ 27 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Piece of Heart ' ]  *  customitemarray [ 29 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Boss Heart Container ' ]  *  customitemarray [ 30 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Sanctuary Heart Container ' ]  *  customitemarray [ 31 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Master Sword ' ]  *  customitemarray [ 33 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Tempered Sword ' ]  *  customitemarray [ 34 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Golden Sword ' ]  *  customitemarray [ 35 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Blue Shield ' ]  *  customitemarray [ 37 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Red Shield ' ]  *  customitemarray [ 38 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Mirror Shield ' ]  *  customitemarray [ 39 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Progressive Shield ' ]  *  customitemarray [ 40 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Blue Mail ' ]  *  customitemarray [ 41 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Red Mail ' ]  *  customitemarray [ 42 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-06 17:19:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    pool . extend ( [ ' Progressive Mail ' ]  *  customitemarray [ 43 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    pool . extend ( [ ' Magic Upgrade (1/2) ' ]  *  customitemarray [ 44 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Magic Upgrade (1/4) ' ]  *  customitemarray [ 45 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Bomb Upgrade (+5) ' ]  *  customitemarray [ 46 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Bomb Upgrade (+10) ' ]  *  customitemarray [ 47 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Arrow Upgrade (+5) ' ]  *  customitemarray [ 48 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Arrow Upgrade (+10) ' ]  *  customitemarray [ 49 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Single Arrow ' ]  *  customitemarray [ 50 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Arrows (10) ' ]  *  customitemarray [ 51 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Single Bomb ' ]  *  customitemarray [ 52 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Bombs (3) ' ]  *  customitemarray [ 53 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Rupee (1) ' ]  *  customitemarray [ 54 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Rupees (5) ' ]  *  customitemarray [ 55 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Rupees (20) ' ]  *  customitemarray [ 56 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Rupees (50) ' ]  *  customitemarray [ 57 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Rupees (100) ' ]  *  customitemarray [ 58 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Rupees (300) ' ]  *  customitemarray [ 59 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Rupoor ' ]  *  customitemarray [ 60 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Blue Clock ' ]  *  customitemarray [ 61 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Green Clock ' ]  *  customitemarray [ 62 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Red Clock ' ]  *  customitemarray [ 63 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-10-23 21:31:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    pool . extend ( [ ' Progressive Bow ' ]  *  customitemarray [ 64 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Bombs (10) ' ]  *  customitemarray [ 65 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-16 18:18:17 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    pool . extend ( [ ' Triforce ' ]  *  customitemarray [ 68 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    diff  =  difficulties [ difficulty ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # expert+ difficulties produce the same contents for 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # all bottles, since only one bottle is available 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    thisbottle  =  None 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    for  _  in  range ( customitemarray [ 18 ] ) : 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-07 12:36:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  not  diff . same_bottle  or  not  thisbottle : 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-14 07:01:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            thisbottle  =  world . random . choice ( diff . bottles ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . append ( thisbottle ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-24 02:24:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  " triforce "  in  world . goal [ player ] : 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-16 12:04:04 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( [ " Triforce Piece " ]  *  world . triforce_pieces_available [ player ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itemtotal  + =  world . triforce_pieces_available [ player ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        treasure_hunt_count  =  world . triforce_pieces_required [ player ] 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        treasure_hunt_icon  =  ' Triforce Piece ' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  timer  in  [ ' display ' ,  ' timed ' ,  ' timed-countdown ' ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        clock_mode  =  ' countdown '  if  timer  ==  ' timed-countdown '  else  ' stopwatch ' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    elif  timer  ==  ' timed-ohko ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        clock_mode  =  ' countdown-ohko ' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    elif  timer  ==  ' ohko ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        clock_mode  =  ' ohko ' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  goal  ==  ' pedestal ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-10 21:21:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        place_item ( ' Master Sword Pedestal ' ,  ' Triforce ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        itemtotal  =  itemtotal  +  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  mode  ==  ' standard ' : 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 09:59:20 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  world . smallkey_shuffle [ player ]  ==  smallkey_shuffle . option_universal : 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-14 07:01:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            key_location  =  world . random . choice ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                [ ' Secret Passage ' ,  ' Hyrule Castle - Boomerang Chest ' ,  ' Hyrule Castle - Map Chest ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 ' Hyrule Castle - Zelda \' s Chest ' ,  ' Sewers - Dark Cross ' ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-10 21:21:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            place_item ( key_location ,  ' Small Key (Universal) ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-24 02:24:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            pool . extend ( [ ' Small Key (Universal) ' ]  *  max ( ( customitemarray [ 66 ]  -  1 ) ,  0 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-24 02:24:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            pool . extend ( [ ' Small Key (Universal) ' ]  *  customitemarray [ 66 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-24 02:24:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( [ ' Small Key (Universal) ' ]  *  customitemarray [ 66 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-08-06 21:36:45 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    pool . extend ( [ ' Fighter Sword ' ]  *  customitemarray [ 32 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Progressive Sword ' ]  *  customitemarray [ 36 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-08-10 15:30:14 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-02-18 14:52:34 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  shuffle  ==  ' insanity_legacy ' : 
							 
						 
					
						
							
								
									
										
										
										
											2019-12-10 21:21:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        place_item ( ' Link \' s House ' ,  ' Magic Mirror ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        place_item ( ' Sanctuary ' ,  ' Moon Pearl ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( [ ' Magic Mirror ' ]  *  max ( ( customitemarray [ 22 ]  - 1  ) ,  0 ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( [ ' Moon Pearl ' ]  *  max ( ( customitemarray [ 28 ]  -  1 ) ,  0 ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( [ ' Magic Mirror ' ]  *  customitemarray [ 22 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( [ ' Moon Pearl ' ]  *  customitemarray [ 28 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-30 09:59:20 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . smallkey_shuffle [ player ]  ==  smallkey_shuffle . option_universal : 
							 
						 
					
						
							
								
									
										
										
										
											2022-06-01 17:29:21 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        itemtotal  =  itemtotal  -  28   # Corrects for small keys not being in item pool in universal mode 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  itemtotal  <  total_items_to_place : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( [ ' Nothing ' ]  *  ( total_items_to_place  -  itemtotal ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-20 20:13:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        logging . warning ( f " Pool was filled up with  { total_items_to_place  -  itemtotal }  Nothing ' s for player  { player } " ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-08-01 06:26:30 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    return  ( pool ,  placed_items ,  precollected_items ,  clock_mode ,  treasure_hunt_count ,  treasure_hunt_icon )