Factorio: only create events for required technologies

This commit is contained in:
Fabian Dill 2021-06-26 06:05:38 +02:00
parent 5fdcd2d7c7
commit a3a68de341
1 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ class Factorio(World):
event = Item("Victory", True, None, player)
self.world.push_item(location, event, False)
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)
nauvis.locations.append(location)
event = Item(f"Automated {ingredient}", True, None, player)
@ -60,7 +60,7 @@ class Factorio(World):
shapes = get_shapes(self)
if world.logic[player] != 'nologic':
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.access_rule = lambda state, ingredient=ingredient: \
all(state.has(technology.name, player) for technology in required_technologies[ingredient])