From 17db0805a7fa6757d0862a5a36a7c4862fc9d5ca Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Sat, 9 Jul 2022 03:35:38 -0700 Subject: [PATCH] Allow potentially all rocket-part ingredients to be fluids. (#753) --- worlds/factorio/__init__.py | 4 +- .../data/mod_template/data-final-fixes.lua | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/worlds/factorio/__init__.py b/worlds/factorio/__init__.py index 14304c4b..33f1809c 100644 --- a/worlds/factorio/__init__.py +++ b/worlds/factorio/__init__.py @@ -329,10 +329,8 @@ class Factorio(World): def set_custom_recipes(self): original_rocket_part = recipes["rocket-part"] science_pack_pools = get_science_pack_pools() - valid_pool = sorted(science_pack_pools[self.world.max_science_pack[self.player].get_max_pack()] & stacking_items) + valid_pool = sorted(science_pack_pools[self.world.max_science_pack[self.player].get_max_pack()] & valid_ingredients) self.world.random.shuffle(valid_pool) - while any([valid_pool[x] in fluids for x in range(3)]): - self.world.random.shuffle(valid_pool) self.custom_recipes = {"rocket-part": Recipe("rocket-part", original_rocket_part.category, {valid_pool[x]: 10 for x in range(3)}, original_rocket_part.products, diff --git a/worlds/factorio/data/mod_template/data-final-fixes.lua b/worlds/factorio/data/mod_template/data-final-fixes.lua index 7da4f3a6..29bfa727 100644 --- a/worlds/factorio/data/mod_template/data-final-fixes.lua +++ b/worlds/factorio/data/mod_template/data-final-fixes.lua @@ -1,6 +1,48 @@ {% from "macros.lua" import dict_to_recipe %} -- this file gets written automatically by the Archipelago Randomizer and is in its raw form a Jinja2 Template require('lib') +data.raw["rocket-silo"]["rocket-silo"].fluid_boxes = { + { + production_type = "input", + pipe_picture = assembler2pipepictures(), + pipe_covers = pipecoverspictures(), + base_area = 10, + base_level = -1, + pipe_connections = { + { type = "input", position = { 0, 5 } }, + { type = "input", position = { 0, -5 } }, + { type = "input", position = { 5, 0 } }, + { type = "input", position = { -5, 0 } } + } + }, + { + production_type = "input", + pipe_picture = assembler2pipepictures(), + pipe_covers = pipecoverspictures(), + base_area = 10, + base_level = -1, + pipe_connections = { + { type = "input", position = { -3, 5 } }, + { type = "input", position = { -3, -5 } }, + { type = "input", position = { 5, -3 } }, + { type = "input", position = { -5, -3 } } + } + }, + { + production_type = "input", + pipe_picture = assembler2pipepictures(), + pipe_covers = pipecoverspictures(), + base_area = 10, + base_level = -1, + pipe_connections = { + { type = "input", position = { 3, 5 } }, + { type = "input", position = { 3, -5 } }, + { type = "input", position = { 5, 3 } }, + { type = "input", position = { -5, 3 } } + } + }, + off_when_no_fluid_recipe = true +} {%- for recipe_name, recipe in custom_recipes.items() %} data.raw["recipe"]["{{recipe_name}}"].category = "{{recipe.category}}"