Fix bug where you can force non-local triforce pieces on a local triforce hunt.
This commit is contained in:
		
							parent
							
								
									a6d53aafb0
								
							
						
					
					
						commit
						2891d575f0
					
				
							
								
								
									
										5
									
								
								Main.py
								
								
								
								
							
							
						
						
									
										5
									
								
								Main.py
								
								
								
								
							| 
						 | 
					@ -119,6 +119,11 @@ def main(args, seed=None):
 | 
				
			||||||
                                     item.strip() in item_table}
 | 
					                                     item.strip() in item_table}
 | 
				
			||||||
        world.non_local_items[player] = {item.strip() for item in args.non_local_items[player].split(',') if
 | 
					        world.non_local_items[player] = {item.strip() for item in args.non_local_items[player].split(',') if
 | 
				
			||||||
                                         item.strip() in item_table}
 | 
					                                         item.strip() in item_table}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # enforce pre-defined local items.
 | 
				
			||||||
 | 
					        if world.goal[player] in ["localtriforcehunt", "localganontriforcehunt"]:
 | 
				
			||||||
 | 
					            world.local_items[player].add('Triforce Piece')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # items can't be both local and non-local, prefer local
 | 
					        # items can't be both local and non-local, prefer local
 | 
				
			||||||
        world.non_local_items[player] -= world.local_items[player]
 | 
					        world.non_local_items[player] -= world.local_items[player]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								Rules.py
								
								
								
								
							
							
						
						
									
										2
									
								
								Rules.py
								
								
								
								
							| 
						 | 
					@ -173,8 +173,6 @@ def item_name(state, location, player):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def locality_rules(world, player):
 | 
					def locality_rules(world, player):
 | 
				
			||||||
    if world.goal[player] in ["localtriforcehunt", "localganontriforcehunt"]:
 | 
					 | 
				
			||||||
        world.local_items[player].add('Triforce Piece')
 | 
					 | 
				
			||||||
    if world.local_items[player]:
 | 
					    if world.local_items[player]:
 | 
				
			||||||
        for location in world.get_locations():
 | 
					        for location in world.get_locations():
 | 
				
			||||||
            if location.player != player:
 | 
					            if location.player != player:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue