Factorio: only create events for required technologies
This commit is contained in:
		
							parent
							
								
									5fdcd2d7c7
								
							
						
					
					
						commit
						a3a68de341
					
				| 
						 | 
					@ -44,7 +44,7 @@ class Factorio(World):
 | 
				
			||||||
        event = Item("Victory", True, None, player)
 | 
					        event = Item("Victory", True, None, player)
 | 
				
			||||||
        self.world.push_item(location, event, False)
 | 
					        self.world.push_item(location, event, False)
 | 
				
			||||||
        location.event = location.locked = True
 | 
					        location.event = location.locked = True
 | 
				
			||||||
        for ingredient in all_ingredient_names:
 | 
					        for ingredient in self.world.max_science_pack[self.player].get_allowed_packs():
 | 
				
			||||||
            location = Location(player, f"Automate {ingredient}", None, nauvis)
 | 
					            location = Location(player, f"Automate {ingredient}", None, nauvis)
 | 
				
			||||||
            nauvis.locations.append(location)
 | 
					            nauvis.locations.append(location)
 | 
				
			||||||
            event = Item(f"Automated {ingredient}", True, None, player)
 | 
					            event = Item(f"Automated {ingredient}", True, None, player)
 | 
				
			||||||
| 
						 | 
					@ -60,7 +60,7 @@ class Factorio(World):
 | 
				
			||||||
        shapes = get_shapes(self)
 | 
					        shapes = get_shapes(self)
 | 
				
			||||||
        if world.logic[player] != 'nologic':
 | 
					        if world.logic[player] != 'nologic':
 | 
				
			||||||
            from worlds.generic import Rules
 | 
					            from worlds.generic import Rules
 | 
				
			||||||
            for ingredient in all_ingredient_names:
 | 
					            for ingredient in self.world.max_science_pack[self.player].get_allowed_packs():
 | 
				
			||||||
                location = world.get_location(f"Automate {ingredient}", player)
 | 
					                location = world.get_location(f"Automate {ingredient}", player)
 | 
				
			||||||
                location.access_rule = lambda state, ingredient=ingredient: \
 | 
					                location.access_rule = lambda state, ingredient=ingredient: \
 | 
				
			||||||
                    all(state.has(technology.name, player) for technology in required_technologies[ingredient])
 | 
					                    all(state.has(technology.name, player) for technology in required_technologies[ingredient])
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue