2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  collections  import  namedtuple  
						 
					
						
							
								
									
										
										
										
											2018-01-27 16:21:32 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  logging  
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								import  random  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  BaseClasses  import  Region ,  RegionType ,  Shop ,  ShopType ,  Location  
						 
					
						
							
								
									
										
										
										
											2018-09-26 13:12:20 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  Bosses  import  place_bosses  
						 
					
						
							
								
									
										
										
										
											2018-01-02 20:01:16 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  Dungeons  import  get_dungeon_item_pool  
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  EntranceShuffle  import  connect_entrance  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  Fill  import  FillError ,  fill_restrictive  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  Items  import  ItemFactory  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06: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.  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								alwaysitems  =  [ ' Bombos ' ,  ' Book of Mudora ' ,  ' Bow ' ,  ' Cane of Somaria ' ,  ' Ether ' ,  ' Fire Rod ' ,  ' Flippers ' ,  ' Ocarina ' ,  ' Hammer ' ,  ' Hookshot ' ,  ' Ice Rod ' ,  ' Lamp ' ,  
						 
					
						
							
								
									
										
										
										
											2018-03-14 13:30:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								               ' 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 ' ]  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 20:56:45 -05: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) ' ]  
						 
					
						
							
								
									
										
										
										
											2017-11-11 20:22:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-22 22:51:54 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								normalbaseitems  =  ( [ ' Silver Arrows ' ,  ' Magic Upgrade (1/2) ' ,  ' Single Arrow ' ,  ' Sanctuary Heart Container ' ,  ' Arrows (10) ' ,  ' Bombs (3) ' ]  +  
						 
					
						
							
								
									
										
										
										
											2018-03-14 13:30:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                   [ ' Rupees (300) ' ]  *  4  +  [ ' 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  
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								normalsecond15extra  =  [ ' Bombs (3) ' ]  *  9  +  [ ' Rupees (50) ' ]  *  2  +  [ ' Arrows (10) ' ]  *  2  +  [ ' Rupee (1) ' ]  +  [ ' Bombs (10) ' ]  
						 
					
						
							
								
									
										
										
										
											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 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-14 13:30:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								easybaseitems  =  ( [ ' Sanctuary Heart Container ' ]  +  [ ' Rupees (300) ' ]  *  4  +  [ ' Magic Upgrade (1/2) ' ]  *  2  +  [ ' Lamp ' ]  *  2  +  [ ' Silver Arrows ' ]  *  2  +  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 [ ' Boss Heart Container ' ]  *  10  +  [ ' Piece of Heart ' ]  *  12 ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								easyextra  =  [ ' Piece of Heart ' ]  *  12  +  [ ' Rupees (300) ' ]  
						 
					
						
							
								
									
										
										
										
											2017-12-02 02:30:48 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								easylimitedextra  =  [ ' Boss Heart Container ' ]  *  3  # collapsing down the 12 pieces of heart  
						 
					
						
							
								
									
										
										
										
											2018-09-22 22:51:54 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								easyfirst15extra  =  [ ' Rupees (100) ' ]  +  [ ' Arrows (10) ' ]  *  7  +  [ ' Bombs (3) ' ]  *  7  
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								easysecond10extra  =  [ ' Bombs (3) ' ]  *  7  +  [ ' Rupee (1) ' ,  ' Rupees (50) ' ,  ' Bombs (10) ' ]  
						 
					
						
							
								
									
										
										
										
											2017-12-14 15:05:10 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								easythird5extra  =  [ ' Rupees (50) ' ]  *  2  +  [ ' Bombs (3) ' ]  *  2  +  [ ' Arrows (10) ' ]  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								easyfinal25extra  =  [ ' Rupees (50) ' ]  *  4  +  [ ' Rupees (20) ' ]  *  14  +  [ ' Rupee (1) ' ]  +  [ ' Arrows (10) ' ]  *  4  +  [ ' Rupees (5) ' ]  *  2  
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								easytimedotherextra  =  [ ' Red Clock ' ]  *  5  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								hardbaseitems  =  [ ' Silver Arrows ' ,  ' Single Arrow ' ,  ' Bombs (10) ' ]  +  [ ' Rupees (300) ' ]  *  4  +  [ ' Boss Heart Container ' ]  *  6  +  [ ' Piece of Heart ' ]  *  20  +  [ ' Rupees (5) ' ]  *  7  +  [ ' Bombs (3) ' ]  *  4  
						 
					
						
							
								
									
										
										
										
											2018-03-14 13:30:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								hardfirst20extra  =  [ ' Rupees (100) ' ,  ' Rupees (300) ' ,  ' Rupees (50) ' ]  +  [ ' Bombs (3) ' ]  *  5  +  [ ' Rupees (5) ' ]  *  10  +  [ ' Arrows (10) ' ,  ' Rupee (1) ' ]  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								hardsecond10extra  =  [ ' Rupees (5) ' ]  *  5  +  [ ' Rupees (50) ' ]  *  2  +  [ ' Arrows (10) ' ]  *  2  +  [ ' Rupee (1) ' ]  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								hardthird10extra  =  [ ' Rupees (50) ' ]  *  4  +  [ ' Rupees (20) ' ]  *  3  +  [ ' Rupees (5) ' ]  *  3  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								hardfourth10extra  =  [ ' Arrows (10) ' ]  *  2  +  [ ' Rupees (20) ' ]  *  7  +  [ ' Rupees (5) ' ]  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								hardfinal20extra  =  [ ' Rupees (20) ' ]  *  18  +  [ ' Rupees (5) ' ]  *  2  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								expertbaseitems  =  ( [ ' Rupees (300) ' ]  *  4  +  [ ' Single Arrow ' ,  ' Silver Arrows ' ,  ' Boss Heart Container ' ,  ' Rupee (1) ' ,  ' Bombs (10) ' ]  +  [ ' Piece of Heart ' ]  *  20  +  [ ' Rupees (5) ' ]  *  2  +  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   [ ' Bombs (3) ' ]  *  9  +  [ ' Rupees (50) ' ]  *  2  +  [ ' Arrows (10) ' ]  *  2  +  [ ' Rupees (20) ' ]  *  2 ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-14 13:30:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								expertfirst15extra  =  [ ' Rupees (100) ' ,  ' Rupees (300) ' ,  ' Rupees (50) ' ]  +  [ ' Rupees (5) ' ]  *  12  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								expertsecond15extra  =  [ ' Rupees (5) ' ]  *  10  +  [ ' Rupees (20) ' ]  *  5  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								expertthird10extra  =  [ ' Rupees (50) ' ]  *  4  +  [ ' Rupees (5) ' ]  *  2  +  [ ' Arrows (10) ' ]  *  3  +  [ ' Rupee (1) ' ]  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								expertfourth5extra  =  [ ' Rupees (5) ' ]  *  5  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								expertfinal25extra  =  [ ' Rupees (20) ' ]  *  23  +  [ ' Rupees (5) ' ]  *  2  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								insanebaseitems  =  [ ' Rupees (300) ' ]  *  4  +  [ ' Single Arrow ' ,  ' Bombs (10) ' ,  ' Rupee (1) ' ]  +  [ ' Rupees (5) ' ]  *  24  +  [ ' Bombs (3) ' ]  *  9  +  [ ' Rupees (50) ' ]  *  2  +  [ ' Arrows (10) ' ]  *  2  +  [ ' Rupees (20) ' ]  *  5  
						 
					
						
							
								
									
										
										
										
											2018-03-14 13:30:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								insanefirst15extra  =  [ ' Rupees (100) ' ,  ' Rupees (300) ' ,  ' Rupees (50) ' ]  +  [ ' Rupees (5) ' ]  *  12  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								insanesecond15extra  =  [ ' Rupees (5) ' ]  *  10  +  [ ' Rupees (20) ' ]  *  5  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								insanethird10extra  =  [ ' Rupees (50) ' ]  *  4  +  [ ' Rupees (5) ' ]  *  2  +  [ ' Arrows (10) ' ]  *  3  +  [ ' Rupee (1) ' ]  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								insanefourth5extra  =  [ ' Rupees (5) ' ]  *  5  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								insanefinal25extra  =  [ ' 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 ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         ' basicshield ' ,  ' progressivearmor ' ,  ' basicarmor ' ,  ' swordless ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         ' progressivesword ' ,  ' basicsword ' ,  ' timedohko ' ,  ' timedother ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-15 16:23:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                         ' triforcehunt ' ,  ' triforce_pieces_required ' ,  ' retro ' ,  ' conditional_extras ' , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-04 01:06:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                         ' extras ' ,  ' progressive_sword_limit ' ,  ' progressive_shield_limit ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         ' progressive_armor_limit ' ,  ' progressive_bottle_limit ' ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								total_items_to_place  =  153  
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  easy_conditional_extras ( timer ,  _goal ,  _mode ,  pool ,  placed_items ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    extraitems  =  total_items_to_place  -  len ( pool )  -  len ( placed_items ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  extraitems  <  len ( easyextra ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  easylimitedextra 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  timer  in  [ ' timed ' ,  ' timed-countdown ' ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  easytimedotherextra 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-15 16:23:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  no_conditional_extras ( * _args ) :  
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    return  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-01-04 01:06:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								difficulties  =  {  
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ' normal ' :  Difficulty ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        baseitems  =  normalbaseitems , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bottles  =  normalbottles , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bottle_count  =  4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        same_bottle  =  False , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressiveshield  =  [ ' Progressive Shield ' ]  *  3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicshield  =  [ ' Blue Shield ' ,  ' Red Shield ' ,  ' Mirror Shield ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressivearmor  =  [ ' Progressive Armor ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicarmor  =  [ ' Blue Mail ' ,  ' Red Mail ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        swordless  =  [ ' Rupees (20) ' ]  *  4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressivesword  =  [ ' Progressive Sword ' ]  *  3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicsword  =  [ ' Master Sword ' ,  ' Tempered Sword ' ,  ' Golden Sword ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedohko  =  [ ' Green Clock ' ]  *  25 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedother  =  [ ' Green Clock ' ]  *  20  +  [ ' Blue Clock ' ]  *  10  +  [ ' Red Clock ' ]  *  10 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        triforcehunt  =  [ ' Triforce Piece ' ]  *  30 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        triforce_pieces_required  =  20 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        retro  =  [ ' Small Key (Universal) ' ]  *  17  +  [ ' Rupees (20) ' ]  *  10 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-15 16:23:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        conditional_extras  =  no_conditional_extras , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-04 01:06:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        extras  =  [ normalfirst15extra ,  normalsecond15extra ,  normalthird10extra ,  normalfourth5extra ,  normalfinal25extra ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_sword_limit  =  4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_shield_limit  =  3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_armor_limit  =  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_bottle_limit  =  4 , 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05: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 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressivearmor  =  [ ' Progressive Armor ' ]  *  4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicarmor  =  [ ' Blue Mail ' ,  ' Red Mail ' ]  *  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        swordless  =  [ ' Rupees (20) ' ]  *  8 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressivesword  =  [ ' Progressive Sword ' ]  *  7 , 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        basicsword  =  [ ' Master Sword ' ,  ' Tempered Sword ' ,  ' Golden Sword ' ]  * 2  +  [ ' Fighter Sword ' ] , 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        timedohko  =  [ ' Green Clock ' ]  *  25 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedother  =  [ ' Green Clock ' ]  *  20  +  [ ' Blue Clock ' ]  *  10  +  [ ' Red Clock ' ]  *  5 ,  # +5 more Red Clocks if there is room 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        triforcehunt  =  [ ' Triforce Piece ' ]  *  30 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-29 15:40:19 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        triforce_pieces_required  =  20 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        retro  =  [ ' Small Key (Universal) ' ]  *  27 , 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        conditional_extras  =  easy_conditional_extras , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        extras  =  [ easyextra ,  easyfirst15extra ,  easysecond10extra ,  easythird5extra ,  easyfinal25extra ] , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-04 01:06:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_sword_limit  =  4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_shield_limit  =  3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_armor_limit  =  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_bottle_limit  =  4 , 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ' hard ' :  Difficulty ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        baseitems  =  hardbaseitems , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bottles  =  hardbottles , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bottle_count  =  4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        same_bottle  =  False , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressiveshield  =  [ ' Progressive Shield ' ]  *  3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicshield  =  [ ' Blue Shield ' ,  ' Red Shield ' ,  ' Red Shield ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressivearmor  =  [ ' Progressive Armor ' ]  *  2 , 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-02 02:30:48 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        basicarmor  =  [ ' Progressive Armor ' ]  *  2 ,  #only the first one will upgrade, making this equivalent to two blue mail 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        swordless  =   [ ' Rupees (20) ' ]  *  4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressivesword  =   [ ' Progressive Sword ' ]  *  3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicsword  =  [ ' Master Sword ' ,  ' Master Sword ' ,  ' Tempered Sword ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedohko  =  [ ' Green Clock ' ]  *  20 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedother  =  [ ' Green Clock ' ]  *  20  +  [ ' Blue Clock ' ]  *  10  +  [ ' Red Clock ' ]  *  10 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-29 15:40:19 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        triforcehunt  =  [ ' Triforce Piece ' ]  *  30 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        triforce_pieces_required  =  20 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        retro  =  [ ' Small Key (Universal) ' ]  *  12  +  [ ' Rupees (5) ' ]  *  15 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-15 16:23:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        conditional_extras  =  no_conditional_extras , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-29 15:40:19 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        extras  =  [ hardfirst20extra ,  hardsecond10extra ,  hardthird10extra ,  hardfourth10extra ,  hardfinal20extra ] , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-04 01:06:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_sword_limit  =  3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_shield_limit  =  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_armor_limit  =  1 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-14 13:30:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_bottle_limit  =  4 , 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ' expert ' :  Difficulty ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        baseitems  =  expertbaseitems , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bottles  =  hardbottles , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bottle_count  =  4 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-14 13:30:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        same_bottle  =  False , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressiveshield  =  [ ' Progressive Shield ' ]  *  3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicshield  =  [ ' Progressive Shield ' ]  *  3 ,   #only the first one will upgrade, making this equivalent to two blue shields 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressivearmor  =  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicarmor  =  [ ] , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        swordless  =  [ ' Rupees (20) ' ]  *  4 , 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressivesword  =  [ ' Progressive Sword ' ]  *  3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicsword  =  [ ' Fighter Sword ' ,  ' Master Sword ' ,  ' Master Sword ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedohko  =  [ ' Green Clock ' ]  *  20  +  [ ' Red Clock ' ]  *  5 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedother  =  [ ' Green Clock ' ]  *  20  +  [ ' Blue Clock ' ]  *  10  +  [ ' Red Clock ' ]  *  10 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-29 15:40:19 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        triforcehunt  =  [ ' Triforce Piece ' ]  *  30 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        triforce_pieces_required  =  20 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        retro  =  [ ' Small Key (Universal) ' ]  *  12  +  [ ' Rupees (5) ' ]  *  15 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-15 16:23:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        conditional_extras  =  no_conditional_extras , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-29 15:40:19 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        extras  =  [ expertfirst15extra ,  expertsecond15extra ,  expertthird10extra ,  expertfourth5extra ,  expertfinal25extra ] , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-04 01:06:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_sword_limit  =  2 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-14 13:30:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_shield_limit  =  1 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-04 01:06:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_armor_limit  =  0 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-14 13:30:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_bottle_limit  =  4 , 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ' insane ' :  Difficulty ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        baseitems  =  insanebaseitems , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bottles  =  hardbottles , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bottle_count  =  4 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-14 13:30:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        same_bottle  =  False , 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressiveshield  =  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicshield  =  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressivearmor  =  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicarmor  =  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        swordless  =  [ ' Rupees (20) ' ]  *  3  +  [ ' Silver Arrows ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressivesword  =  [ ' Progressive Sword ' ]  *  3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        basicsword  =  [ ' Fighter Sword ' ,  ' Master Sword ' ,  ' Master Sword ' ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedohko  =  [ ' Green Clock ' ]  *  20  +  [ ' Red Clock ' ]  *  5 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        timedother  =  [ ' Green Clock ' ]  *  20  +  [ ' Blue Clock ' ]  *  10  +  [ ' Red Clock ' ]  *  10 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-29 15:40:19 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        triforcehunt  =  [ ' Triforce Piece ' ]  *  30 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        triforce_pieces_required  =  20 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        retro  =  [ ' Small Key (Universal) ' ]  *  12  +  [ ' Rupees (5) ' ]  *  15 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-15 16:23:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        conditional_extras  =  no_conditional_extras , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-29 15:40:19 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        extras  =  [ insanefirst15extra ,  insanesecond15extra ,  insanethird10extra ,  insanefourth5extra ,  insanefinal25extra ] , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-04 01:06:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_sword_limit  =  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_shield_limit  =  0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressive_armor_limit  =  0 , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-14 13:30:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        progressive_bottle_limit  =  4 , 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								def  generate_itempool ( world ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  ( world . difficulty  not  in  [ ' easy ' ,  ' normal ' ,  ' hard ' ,  ' expert ' ,  ' insane ' ]  or  world . goal  not  in  [ ' ganon ' ,  ' pedestal ' ,  ' dungeons ' ,  ' triforcehunt ' ,  ' crystals ' ] 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            or  world . mode  not  in  [ ' open ' ,  ' standard ' ,  ' swordless ' ]  or  world . timer  not  in  [ ' none ' ,  ' display ' ,  ' timed ' ,  ' timed-ohko ' ,  ' ohko ' ,  ' timed-countdown ' ]  or  world . progressive  not  in  [ ' on ' ,  ' off ' ,  ' random ' ] ) : 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        raise  NotImplementedError ( ' Not supported yet ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 00:39:53 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . timer  in  [ ' ohko ' ,  ' timed-ohko ' ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        world . can_take_damage  =  False 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    world . push_item ( ' Ganon ' ,  ItemFactory ( ' Triforce ' ) ,  False ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . get_location ( ' Ganon ' ) . event  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . push_item ( ' Agahnim 1 ' ,  ItemFactory ( ' Beat Agahnim 1 ' ) ,  False ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . get_location ( ' Agahnim 1 ' ) . event  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . push_item ( ' Agahnim 2 ' ,  ItemFactory ( ' Beat Agahnim 2 ' ) ,  False ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . get_location ( ' Agahnim 2 ' ) . event  =  True 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-18 01:36:45 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    world . push_item ( ' Dark Blacksmith Ruins ' ,  ItemFactory ( ' Pick Up Purple Chest ' ) ,  False ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . get_location ( ' Dark Blacksmith Ruins ' ) . event  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . push_item ( ' Frog ' ,  ItemFactory ( ' Get Frog ' ) ,  False ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . get_location ( ' Frog ' ) . event  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . push_item ( ' Missing Smith ' ,  ItemFactory ( ' Return Smith ' ) ,  False ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . get_location ( ' Missing Smith ' ) . event  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . push_item ( ' Floodgate ' ,  ItemFactory ( ' Open Floodgate ' ) ,  False ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . get_location ( ' Floodgate ' ) . event  =  True 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # set up item pool 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . custom : 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-15 16:53:42 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ( pool ,  placed_items ,  clock_mode ,  treasure_hunt_count ,  treasure_hunt_icon ,  lamps_needed_for_dark_rooms )  =  make_custom_item_pool ( world . progressive ,  world . shuffle ,  world . difficulty ,  world . timer ,  world . goal ,  world . mode ,  world . retro ,  world . customitemarray ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        world . rupoor_cost  =  min ( world . customitemarray [ 67 ] ,  9999 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-15 16:23:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ( pool ,  placed_items ,  clock_mode ,  treasure_hunt_count ,  treasure_hunt_icon ,  lamps_needed_for_dark_rooms )  =  get_pool_core ( world . progressive ,  world . shuffle ,  world . difficulty ,  world . timer ,  world . goal ,  world . mode ,  world . retro ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    world . itempool  =  ItemFactory ( pool ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    for  ( location ,  item )  in  placed_items : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        world . push_item ( location ,  ItemFactory ( item ) ,  False ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        world . get_location ( location ) . event  =  True 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-24 16:16:50 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    world . lamps_needed_for_dark_rooms  =  lamps_needed_for_dark_rooms 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  clock_mode  is  not  None : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        world . clock_mode  =  clock_mode 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  treasure_hunt_count  is  not  None : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        world . treasure_hunt_count  =  treasure_hunt_count 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  treasure_hunt_icon  is  not  None : 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-02 02:30:48 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        world . treasure_hunt_icon  =  treasure_hunt_icon 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 20:01:16 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . keysanity : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        world . itempool . extend ( get_dungeon_item_pool ( world ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											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) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  world . difficulty  in  [ ' easy ' ,  ' normal ' ,  ' hard ' ]  and  not  ( world . custom  and  world . customitemarray [ 30 ]  ==  0 ) : 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-06 13:39:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        [ item  for  item  in  world . itempool  if  item . name  ==  ' Boss Heart Container ' ] [ 0 ] . advancement  =  True 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    elif  world . difficulty  in  [ ' expert ' ]  and  not  ( world . custom  and  world . customitemarray [ 29 ]  <  4 ) : 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-06 13:39:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        adv_heart_pieces  =  [ item  for  item  in  world . itempool  if  item . name  ==  ' Piece of Heart ' ] [ 0 : 4 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  hp  in  adv_heart_pieces : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            hp . advancement  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    # shuffle medallions 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    mm_medallion  =  [ ' Ether ' ,  ' Quake ' ,  ' Bombos ' ] [ random . randint ( 0 ,  2 ) ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    tr_medallion  =  [ ' Ether ' ,  ' Quake ' ,  ' Bombos ' ] [ random . randint ( 0 ,  2 ) ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . required_medallions  =  ( mm_medallion ,  tr_medallion ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-26 13:12:20 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    place_bosses ( world ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-17 18:38:54 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set_up_shops ( world ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . retro : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set_up_take_anys ( world ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    create_dynamic_shop_locations ( world ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								take_any_locations  =  [  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ' 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 ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ' Kakariko Gamble Game ' ,  ' Capacity Upgrade ' ,  ' 50 Rupee Cave ' ,  ' Lost Woods Gamble ' ,  ' Hookshot Fairy ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ' Palace of Darkness Hint ' ,  ' East Dark World Hint ' ,  ' Archery Game ' ,  ' Dark Lake Hylia Ledge Hint ' , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ' Dark Lake Hylia Ledge Spike Cave ' ,  ' Fortune Teller (Dark) ' ,  ' Dark Sanctuary Hint ' ,  ' Dark Desert Hint ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								def  set_up_take_anys ( world ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    regions  =  random . sample ( take_any_locations ,  5 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-22 05:59:46 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    old_man_take_any  =  Region ( " Old Man Sword Cave " ,  RegionType . Cave ,  ' the sword cave ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    world . regions . append ( old_man_take_any ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . dynamic_regions . append ( old_man_take_any ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    reg  =  regions . pop ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    entrance  =  world . get_region ( reg ) . entrances [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    connect_entrance ( world ,  entrance ,  old_man_take_any ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    entrance . target  =  0x58 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    old_man_take_any . shop  =  Shop ( old_man_take_any ,  0x0112 ,  ShopType . TakeAny ,  0xE2 ,  True ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . shops . append ( old_man_take_any . shop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    old_man_take_any . shop . active  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    swords  =  [ item  for  item  in  world . itempool  if  item . type  ==  ' Sword ' ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  swords : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        sword  =  random . choice ( swords ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        world . itempool . remove ( sword ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        world . itempool . append ( ItemFactory ( ' Rupees (20) ' ) ) 
							 
						 
					
						
							
								
									
										
										
										
											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 : 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-26 19:32:19 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        old_man_take_any . shop . add_inventory ( 0 ,  ' Rupees (300) ' ,  0 ,  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    for  num  in  range ( 4 ) : 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-22 05:59:46 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        take_any  =  Region ( " Take-Any # {} " . format ( num + 1 ) ,  RegionType . Cave ,  ' a cave of choice ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        world . regions . append ( take_any ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        world . dynamic_regions . append ( take_any ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        target ,  room_id  =  random . choice ( [ ( 0x58 ,  0x0112 ) ,  ( 0x60 ,  0x010F ) ,  ( 0x46 ,  0x011F ) ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        reg  =  regions . pop ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        entrance  =  world . get_region ( reg ) . entrances [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        connect_entrance ( world ,  entrance ,  take_any ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        entrance . target  =  target 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-23 01:21:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        take_any . shop  =  Shop ( take_any ,  room_id ,  ShopType . TakeAny ,  0xE3 ,  True ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        world . shops . append ( take_any . shop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        take_any . shop . active  =  True 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-26 19:32:19 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        take_any . shop . add_inventory ( 0 ,  ' Blue Potion ' ,  0 ,  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        take_any . shop . add_inventory ( 1 ,  ' Boss Heart Container ' ,  0 ,  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-22 23:18:40 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    world . intialize_regions ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								def  create_dynamic_shop_locations ( world ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    for  shop  in  world . shops : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  i ,  item  in  enumerate ( shop . inventory ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  item  is  None : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  item [ ' create_location ' ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                loc  =  Location ( " {}  Item  {} " . format ( shop . region . name ,  i + 1 ) ,  parent = shop . region ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                shop . region . locations . append ( loc ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                world . dynamic_locations . append ( loc ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                world . clear_location_cache ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                world . push_item ( loc ,  ItemFactory ( item [ ' item ' ] ) ,  False ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                loc . event  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-01-27 16:21:32 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  fill_prizes ( world ,  attempts = 15 ) :  
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    crystals  =  ItemFactory ( [ ' Red Pendant ' ,  ' Blue Pendant ' ,  ' Green Pendant ' ,  ' Crystal 1 ' ,  ' Crystal 2 ' ,  ' Crystal 3 ' ,  ' Crystal 4 ' ,  ' Crystal 7 ' ,  ' Crystal 5 ' ,  ' Crystal 6 ' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    crystal_locations  =  [ world . get_location ( ' Turtle Rock - Prize ' ) ,  world . get_location ( ' Eastern Palace - Prize ' ) ,  world . get_location ( ' Desert Palace - Prize ' ) ,  world . get_location ( ' Tower of Hera - Prize ' ) ,  world . get_location ( ' Palace of Darkness - Prize ' ) , 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-26 17:34:15 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                         world . get_location ( ' Thieves \'  Town - Prize ' ) ,  world . get_location ( ' Skull Woods - Prize ' ) ,  world . get_location ( ' Swamp Palace - Prize ' ) ,  world . get_location ( ' Ice Palace - Prize ' ) , 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                         world . get_location ( ' Misery Mire - Prize ' ) ] 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-27 16:21:32 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    placed_prizes  =  [ loc . item . name  for  loc  in  crystal_locations  if  loc . item  is  not  None ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    unplaced_prizes  =  [ crystal  for  crystal  in  crystals  if  crystal . name  not  in  placed_prizes ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    empty_crystal_locations  =  [ loc  for  loc  in  crystal_locations  if  loc . item  is  None ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    while  attempts : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        attempts  - =  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        try : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            prizepool  =  list ( unplaced_prizes ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            prize_locs  =  list ( empty_crystal_locations ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            random . shuffle ( prizepool ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            random . shuffle ( prize_locs ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            fill_restrictive ( world ,  world . get_all_state ( keys = True ) ,  prize_locs ,  prizepool ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        except  FillError : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            logging . getLogger ( ' ' ) . info ( " Failed to place dungeon prizes. Will retry  %s  more times " ,  attempts ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  location  in  empty_crystal_locations : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                location . item  =  None 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        break 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        raise  FillError ( ' Unable to place dungeon prizes ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-02-17 18:38:54 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  set_up_shops ( world ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # Changes to basic Shops 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # TODO: move hard+ mode changes for sheilds here, utilizing the new shops 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-26 17:34:15 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    for  shop  in  world . shops : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        shop . active  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-02-17 18:38:54 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  world . retro : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        rss  =  world . get_region ( ' Red Shield Shop ' ) . shop 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        rss . active  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        rss . add_inventory ( 2 ,  ' Single Arrow ' ,  80 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # Randomized changes to Shops 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  world . retro : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  shop  in  random . sample ( [ s  for  s  in  world . shops  if  s . replaceable ] ,  5 ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            shop . active  =  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            shop . add_inventory ( 0 ,  ' Single Arrow ' ,  80 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            shop . add_inventory ( 1 ,  ' Small Key (Universal) ' ,  100 ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-23 23:01:55 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            shop . add_inventory ( 2 ,  ' Bombs (10) ' ,  50 ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-10 04:15:45 -06:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-02-17 18:38:54 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    #special shop types 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-15 16:23:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  get_pool_core ( progressive ,  shuffle ,  difficulty ,  timer ,  goal ,  mode ,  retro ) :  
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    pool  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    placed_items  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    clock_mode  =  None 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    treasure_hunt_count  =  None 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    treasure_hunt_icon  =  None 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( alwaysitems ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    def  want_progressives ( ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  random . choice ( [ True ,  False ] )  if  progressive  ==  ' random '  else  progressive  ==  ' on ' 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  want_progressives ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( progressivegloves ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( basicgloves ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-02-24 16:16:50 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    lamps_needed_for_dark_rooms  =  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  difficulty  ==  ' easy ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        lamps_needed_for_dark_rooms  =  3 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # insanity shuffle doesn't have fake LW/DW logic so for now guaranteed Mirror and Moon Pearl at the start 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-18 14:52:34 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if   shuffle  ==  ' insanity_legacy ' : 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        placed_items . append ( ( ' Link \' s House ' ,  ' Magic Mirror ' ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        placed_items . append ( ( ' Sanctuary ' ,  ' Moon Pearl ' ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( [ ' Magic Mirror ' ,  ' Moon Pearl ' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    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 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    diff  =  difficulties [ difficulty ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( diff . baseitems ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # expert+ difficulties produce the same contents for 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # all bottles, since only one bottle is available 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  diff . same_bottle : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        thisbottle  =  random . choice ( diff . bottles ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    for  _  in  range ( diff . bottle_count ) : 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  not  diff . same_bottle : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            thisbottle  =  random . choice ( diff . bottles ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . append ( thisbottle ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  want_progressives ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( diff . progressiveshield ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( diff . basicshield ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  want_progressives ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( diff . progressivearmor ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( diff . basicarmor ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  mode  ==  ' swordless ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( diff . swordless ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    elif  mode  ==  ' standard ' : 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  want_progressives ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            placed_items . append ( ( ' Link \' s Uncle ' ,  ' Progressive Sword ' ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . extend ( diff . progressivesword ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            placed_items . append ( ( ' Link \' s Uncle ' ,  ' Fighter Sword ' ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . extend ( diff . basicsword ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  want_progressives ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            pool . extend ( diff . progressivesword ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . extend ( [ ' Progressive Sword ' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . extend ( diff . basicsword ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . extend ( [ ' Fighter Sword ' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											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 ' 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  goal  ==  ' triforcehunt ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( diff . triforcehunt ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        extraitems  - =  len ( diff . triforcehunt ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        treasure_hunt_count  =  diff . triforce_pieces_required 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        treasure_hunt_icon  =  ' Triforce Piece ' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    cond_extras  =  diff . conditional_extras ( timer ,  goal ,  mode ,  pool ,  placed_items ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( cond_extras ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    extraitems  - =  len ( cond_extras ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    for  extra  in  diff . extras : 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  extraitems  >  0 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . extend ( extra ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            extraitems  - =  len ( extra ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  goal  ==  ' pedestal ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        placed_items . append ( ( ' Master Sword Pedestal ' ,  ' Triforce ' ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-15 16:23:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  retro : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool  =  [ item . replace ( ' Single Arrow ' , ' Rupees (5) ' )  for  item  in  pool ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool  =  [ item . replace ( ' Arrows (10) ' , ' Rupees (5) ' )  for  item  in  pool ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool  =  [ item . replace ( ' Arrow Upgrade (+5) ' , ' Rupees (5) ' )  for  item  in  pool ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool  =  [ item . replace ( ' Arrow Upgrade (+10) ' , ' Rupees (5) ' )  for  item  in  pool ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( diff . retro ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  mode  ==  ' standard ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            key_location  =  random . choice ( [ ' Secret Passage ' ,  ' Hyrule Castle - Boomerang Chest ' ,  ' Hyrule Castle - Map Chest ' ,  ' Hyrule Castle - Zelda \' s Chest ' ,  ' Sewers - Dark Cross ' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            placed_items . append ( ( key_location ,  ' Small Key (Universal) ' ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . extend ( [ ' Small Key (Universal) ' ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-24 16:16:50 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    return  ( pool ,  placed_items ,  clock_mode ,  treasure_hunt_count ,  treasure_hunt_icon ,  lamps_needed_for_dark_rooms ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-15 16:53:42 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  make_custom_item_pool ( progressive ,  shuffle ,  difficulty ,  timer ,  goal ,  mode ,  retro ,  customitemarray ) :  
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    pool  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    placed_items  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    clock_mode  =  None 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    treasure_hunt_count  =  None 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    treasure_hunt_icon  =  None 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # Correct for insanely oversized item counts and take initial steps to handle undersized pools. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    for  x  in  range ( 0 ,  64 ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  customitemarray [ x ]  >  total_items_to_place : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            customitemarray [ x ]  =  total_items_to_place 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  customitemarray [ 66 ]  >  total_items_to_place : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        customitemarray [ 66 ]  =  total_items_to_place 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    itemtotal  =  0 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-11 03:50:24 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    for  x  in  range ( 0 ,  65 ) : 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        itemtotal  =  itemtotal  +  customitemarray [ x ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    itemtotal  =  itemtotal  +  customitemarray [ 66 ] 
							 
						 
					
						
							
								
									
										
										
										
											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 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Silver Arrows ' ] *  customitemarray [ 1 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    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 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Ocarina ' ]  *  customitemarray [ 15 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    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 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Progressive Armor ' ]  *  customitemarray [ 43 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    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 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Triforce Piece ' ]  *  customitemarray [ 64 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pool . extend ( [ ' Triforce ' ]  *  customitemarray [ 66 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    diff  =  difficulties [ difficulty ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-02-24 16:16:50 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    lamps_needed_for_dark_rooms  =  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  difficulty  ==  ' easy ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        lamps_needed_for_dark_rooms  =  customitemarray [ 12 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # expert+ difficulties produce the same contents for 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # all bottles, since only one bottle is available 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  diff . same_bottle : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        thisbottle  =  random . choice ( diff . bottles ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    for  _  in  range ( customitemarray [ 18 ] ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  not  diff . same_bottle : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            thisbottle  =  random . choice ( diff . bottles ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . append ( thisbottle ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  customitemarray [ 64 ]  >  0  or  customitemarray [ 65 ]  >  0 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        treasure_hunt_count  =  max ( min ( customitemarray [ 65 ] ,  99 ) ,  1 )  #To display, count must be between 1 and 99. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        treasure_hunt_icon  =  ' Triforce Piece ' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Ensure game is always possible to complete here, force sufficient pieces if the player is unwilling. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( customitemarray [ 64 ]  <  treasure_hunt_count )  and  ( goal  ==  ' triforcehunt ' )  and  ( customitemarray [ 66 ]  ==  0 ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            extrapieces  =  treasure_hunt_count  -  customitemarray [ 64 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . extend ( [ ' Triforce Piece ' ]  *  extrapieces ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            itemtotal  =  itemtotal  +  extrapieces 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    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 ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        placed_items . append ( ( ' Master Sword Pedestal ' ,  ' Triforce ' ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itemtotal  =  itemtotal  +  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  mode  ==  ' standard ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  progressive  ==  ' off ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            placed_items . append ( ( ' Link \' s Uncle ' ,  ' Fighter Sword ' ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . extend ( [ ' Fighter Sword ' ]  *  max ( ( customitemarray [ 32 ]  -  1 ) ,  0 ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . extend ( [ ' Progressive Sword ' ]  *  customitemarray [ 36 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            placed_items . append ( ( ' Link \' s Uncle ' ,  ' Progressive Sword ' ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . extend ( [ ' Fighter Sword ' ]  *  customitemarray [ 32 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . extend ( [ ' Progressive Sword ' ]  *  max ( ( customitemarray [ 36 ]  -  1 ) ,  0 ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  retro : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            key_location  =  random . choice ( [ ' Secret Passage ' ,  ' Hyrule Castle - Boomerang Chest ' ,  ' Hyrule Castle - Map Chest ' ,  ' Hyrule Castle - Zelda \' s Chest ' ,  ' Sewers - Dark Cross ' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            placed_items . append ( ( key_location ,  ' Small Key (Universal) ' ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . extend ( [ ' Small Key (Universal) ' ]  *  max ( ( customitemarray [ 68 ]  -  1 ) ,  0 ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            pool . extend ( [ ' Small Key (Universal) ' ]  *  customitemarray [ 68 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( [ ' Fighter Sword ' ]  *  customitemarray [ 32 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( [ ' Progressive Sword ' ]  *  customitemarray [ 36 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-16 12:26:14 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        pool . extend ( [ ' Small Key (Universal) ' ]  *  customitemarray [ 68 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-02-18 14:52:34 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  shuffle  ==  ' insanity_legacy ' : 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        placed_items . append ( ( ' Link \' s House ' ,  ' Magic Mirror ' ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        placed_items . append ( ( ' Sanctuary ' ,  ' Moon Pearl ' ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        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 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-15 16:53:42 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  retro : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itemtotal  =  itemtotal  -  28  # Corrects for small keys not being in item pool in Retro Mode 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  itemtotal  <  total_items_to_place : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        pool . extend ( [ ' Nothing ' ]  *  ( total_items_to_place  -  itemtotal ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-02-24 16:16:50 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    return  ( pool ,  placed_items ,  clock_mode ,  treasure_hunt_count ,  treasure_hunt_icon ,  lamps_needed_for_dark_rooms ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-21 20:43:44 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# A quick test to ensure all combinations generate the correct amount of items.  
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  test ( ) :  
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    for  difficulty  in  [ ' easy ' ,  ' normal ' ,  ' hard ' ,  ' expert ' ,  ' insane ' ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  goal  in  [ ' ganon ' ,  ' triforcehunt ' ,  ' pedestal ' ] : 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 20:36:42 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            for  timer  in  [ ' none ' ,  ' display ' ,  ' timed ' ,  ' timed-ohko ' ,  ' ohko ' ,  ' timed-countdown ' ] : 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-18 18:21:31 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                for  mode  in  [ ' open ' ,  ' standard ' ,  ' swordless ' ] : 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    for  progressive  in  [ ' on ' ,  ' off ' ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        for  shuffle  in  [ ' full ' ,  ' insane ' ] : 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-17 18:38:54 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            for  retro  in  [ True ,  False ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                out  =  get_pool_core ( progressive ,  shuffle ,  difficulty ,  timer ,  goal ,  mode ,  retro ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                count  =  len ( out [ 0 ] )  +  len ( out [ 1 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                correct_count  =  total_items_to_place 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                if  goal  in  [ ' pedestal ' ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                    # pedestal goals generate one extra item 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                    correct_count  + =  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                if  retro : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                    correct_count  + =  28 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                assert  count  ==  correct_count ,  " expected  {0}  items but found  {1}  items for  {2} " . format ( correct_count ,  count ,  ( progressive ,  shuffle ,  difficulty ,  timer ,  goal ,  mode ,  retro ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-17 00:25:46 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if  __name__  ==  ' __main__ ' :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    test ( )