make Factorio rocket silo a static (and therefore local) node
This commit is contained in:
parent
8d08b55e69
commit
d9824d26d2
|
@ -66,7 +66,7 @@ original_tech = technologies["{{original_tech_name}}"]
|
||||||
new_tree_copy = table.deepcopy(template_tech)
|
new_tree_copy = table.deepcopy(template_tech)
|
||||||
new_tree_copy.name = "ap-{{ tech_table[original_tech_name] }}-"{# use AP ID #}
|
new_tree_copy.name = "ap-{{ tech_table[original_tech_name] }}-"{# use AP ID #}
|
||||||
prep_copy(new_tree_copy, original_tech)
|
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 }}))
|
new_tree_copy.unit.count = math.max(1, math.floor(new_tree_copy.unit.count * {{ tech_cost_scale }}))
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{%- if item_name in tech_table and visibility -%}
|
{%- if item_name in tech_table and visibility -%}
|
||||||
|
|
|
@ -60,16 +60,17 @@ def generate_mod(world: MultiWorld, player: int):
|
||||||
if location.address:
|
if location.address:
|
||||||
locations.append((location.name, location.item.name, location.item.player, location.item.advancement))
|
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]}"
|
mod_name = f"AP-{world.seed_name}-P{player}-{world.player_names[player][0]}"
|
||||||
tech_cost = {0: 0.1,
|
tech_cost_scale = {0: 0.1,
|
||||||
1: 0.25,
|
1: 0.25,
|
||||||
2: 0.5,
|
2: 0.5,
|
||||||
3: 1,
|
3: 1,
|
||||||
4: 2,
|
4: 2,
|
||||||
5: 5,
|
5: 5,
|
||||||
6: 10}[world.tech_cost[player].value]
|
6: 10}[world.tech_cost[player].value]
|
||||||
|
|
||||||
template_data = {"locations": locations, "player_names": player_names, "tech_table": tech_table,
|
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(),
|
"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],
|
"tech_tree_layout_prerequisites": world.tech_tree_layout_prerequisites[player],
|
||||||
"rocket_recipe": rocket_recipes[world.max_science_pack[player].value],
|
"rocket_recipe": rocket_recipes[world.max_science_pack[player].value],
|
||||||
"slot_name": world.player_names[player][0], "seed_name": world.seed_name,
|
"slot_name": world.player_names[player][0], "seed_name": world.seed_name,
|
||||||
|
|
|
@ -66,7 +66,7 @@ class CustomTechnology(Technology):
|
||||||
def __init__(self, origin: Technology, world, allowed_packs: Set[str], player: int):
|
def __init__(self, origin: Technology, world, allowed_packs: Set[str], player: int):
|
||||||
ingredients = origin.ingredients & allowed_packs
|
ingredients = origin.ingredients & allowed_packs
|
||||||
self.player = player
|
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 = list(ingredients)
|
||||||
ingredients.sort() # deterministic sample
|
ingredients.sort() # deterministic sample
|
||||||
ingredients = world.random.sample(ingredients, world.random.randint(1, len(ingredients)))
|
ingredients = world.random.sample(ingredients, world.random.randint(1, len(ingredients)))
|
||||||
|
|
|
@ -9,11 +9,12 @@ from .Mod import generate_mod
|
||||||
|
|
||||||
class Factorio(World):
|
class Factorio(World):
|
||||||
game: str = "Factorio"
|
game: str = "Factorio"
|
||||||
static_nodes = {"automation", "logistics"}
|
static_nodes = {"automation", "logistics", "rocket-silo"}
|
||||||
|
|
||||||
def generate_basic(self):
|
def generate_basic(self):
|
||||||
victory_tech_names = get_rocket_requirements(
|
victory_tech_names = get_rocket_requirements(
|
||||||
frozenset(rocket_recipes[self.world.max_science_pack[self.player].value]))
|
frozenset(rocket_recipes[self.world.max_science_pack[self.player].value]))
|
||||||
|
|
||||||
for tech_name, tech_id in tech_table.items():
|
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_item = Item(tech_name, tech_name in advancement_technologies or tech_name in victory_tech_names,
|
||||||
tech_id, self.player)
|
tech_id, self.player)
|
||||||
|
|
Loading…
Reference in New Issue