diff --git a/data/factorio/mod_template/data-final-fixes.lua b/data/factorio/mod_template/data-final-fixes.lua index 335eca34..58eb4425 100644 --- a/data/factorio/mod_template/data-final-fixes.lua +++ b/data/factorio/mod_template/data-final-fixes.lua @@ -66,7 +66,7 @@ original_tech = technologies["{{original_tech_name}}"] new_tree_copy = table.deepcopy(template_tech) new_tree_copy.name = "ap-{{ tech_table[original_tech_name] }}-"{# use AP ID #} prep_copy(new_tree_copy, original_tech) -{% if tech_cost != 1 %} +{% if tech_cost_scale != 1 %} new_tree_copy.unit.count = math.max(1, math.floor(new_tree_copy.unit.count * {{ tech_cost_scale }})) {% endif %} {%- if item_name in tech_table and visibility -%} diff --git a/worlds/factorio/Mod.py b/worlds/factorio/Mod.py index 7fb6e17b..ef31663d 100644 --- a/worlds/factorio/Mod.py +++ b/worlds/factorio/Mod.py @@ -60,16 +60,17 @@ def generate_mod(world: MultiWorld, player: int): if location.address: locations.append((location.name, location.item.name, location.item.player, location.item.advancement)) mod_name = f"AP-{world.seed_name}-P{player}-{world.player_names[player][0]}" - tech_cost = {0: 0.1, - 1: 0.25, - 2: 0.5, - 3: 1, - 4: 2, - 5: 5, - 6: 10}[world.tech_cost[player].value] + tech_cost_scale = {0: 0.1, + 1: 0.25, + 2: 0.5, + 3: 1, + 4: 2, + 5: 5, + 6: 10}[world.tech_cost[player].value] + template_data = {"locations": locations, "player_names": player_names, "tech_table": tech_table, "mod_name": mod_name, "allowed_science_packs": world.max_science_pack[player].get_allowed_packs(), - "tech_cost_scale": tech_cost, "custom_technologies": world.worlds[player].custom_technologies, + "tech_cost_scale": tech_cost_scale, "custom_technologies": world.worlds[player].custom_technologies, "tech_tree_layout_prerequisites": world.tech_tree_layout_prerequisites[player], "rocket_recipe": rocket_recipes[world.max_science_pack[player].value], "slot_name": world.player_names[player][0], "seed_name": world.seed_name, diff --git a/worlds/factorio/Technologies.py b/worlds/factorio/Technologies.py index 013ace35..4eb01e6e 100644 --- a/worlds/factorio/Technologies.py +++ b/worlds/factorio/Technologies.py @@ -66,7 +66,7 @@ class CustomTechnology(Technology): def __init__(self, origin: Technology, world, allowed_packs: Set[str], player: int): ingredients = origin.ingredients & allowed_packs self.player = player - if world.random_tech_ingredients[player]: + if world.random_tech_ingredients[player] and origin.name not in world.worlds[player].static_nodes: ingredients = list(ingredients) ingredients.sort() # deterministic sample ingredients = world.random.sample(ingredients, world.random.randint(1, len(ingredients))) diff --git a/worlds/factorio/__init__.py b/worlds/factorio/__init__.py index e6858a21..f925f68a 100644 --- a/worlds/factorio/__init__.py +++ b/worlds/factorio/__init__.py @@ -9,11 +9,12 @@ from .Mod import generate_mod class Factorio(World): game: str = "Factorio" - static_nodes = {"automation", "logistics"} + static_nodes = {"automation", "logistics", "rocket-silo"} def generate_basic(self): victory_tech_names = get_rocket_requirements( frozenset(rocket_recipes[self.world.max_science_pack[self.player].value])) + for tech_name, tech_id in tech_table.items(): tech_item = Item(tech_name, tech_name in advancement_technologies or tech_name in victory_tech_names, tech_id, self.player)