Skip to content

Commit

Permalink
2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
snouz committed Dec 11, 2021
1 parent e9db485 commit 7bee9c7
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/icon/underflow-valve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Flow Control",
"version": "2.1.2",
"version": "2.1.3",
"title": "Flow Control",
"author": "GotLag",
"homepage": "https://forums.factorio.com/viewtopic.php?f=94&t=20645",
Expand Down
5 changes: 4 additions & 1 deletion locale/en/locale.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
[entity-name]
check-valve=Non-return valve
overflow-valve=Overflow valve
underflow-valve=Float valve
express-pump=Express pump
pipe-elbow=Elbow pipe
pipe-junction=T-Junction pipe
pipe-straight=Straight pipe

[item-description]
check-valve=Only allows flow in one direction
overflow-valve=Only allows flow when pipe is over 80% full
overflow-valve=Blocks flow when input is under 80% full
underflow-valve=Blocks flow when output is over 80% full
29 changes: 29 additions & 0 deletions migrations/Flow Control_2.1.3.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-- Reload recipes and technologies
for i, player in ipairs(game.players) do
player.force.reset_recipes()
player.force.reset_technologies()
end

for index, force in pairs(game.forces) do
-- Generate technology and recipe tables
local tech = force.technologies
local recipes = force.recipes

recipes["small-pump"].enabled = true

-- Unlock researched recipes
if tech["fluid-handling"] and tech["fluid-handling"].researched then
if recipes["check-valve"] then
recipes["check-valve"].enabled = true
end
if recipes["overflow-valve"] then
recipes["overflow-valve"].enabled = true
end
if recipes["underflow-valve"] then
recipes["underflow-valve"].enabled = true
end
if recipes["express-pump"] then
recipes["express-pump"].enabled = true
end
end
end
10 changes: 10 additions & 0 deletions prototypes/entities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ overflow_valve.fluid_box.base_level = 0.8
overflow_valve.pictures.picture.sheet.filename =
"__Flow Control__/graphics/entity/overflow-valve/overflow-valve.png"

-- Underflow Valve ***********************************************************************
underflow_valve = util.table.deepcopy(overflow_valve)
underflow_valve.name = "underflow-valve"
underflow_valve.icon = "__Flow Control__/graphics/icon/underflow-valve.png"
underflow_valve.minable.result = "underflow-valve"
underflow_valve.fluid_box.base_level = -0.2
underflow_valve.pictures.picture.sheet.filename =
"__Flow Control__/graphics/entity/underflow-valve/underflow-valve.png"

-- Express Pump **************************************************************************
express_pump = util.table.deepcopy(data.raw["pump"]["small-pump"])
express_pump.name = "express-pump"
Expand Down Expand Up @@ -155,6 +164,7 @@ data:extend(
{
check_valve,
overflow_valve,
underflow_valve,
express_pump,
pipe_elbow,
pipe_junction,
Expand Down
10 changes: 10 additions & 0 deletions prototypes/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ data:extend(
place_result = "overflow-valve",
stack_size = 50
},
{
type = "item",
name = "underflow-valve",
icon = "__Flow Control__/graphics/icon/underflow-valve.png",
flags = {"goes-to-quickbar"},
subgroup = "energy-pipe-distribution",
order = "b[pipe]-c[small-pump]bb",
place_result = "underflow-valve",
stack_size = 50
},
{
type = "item",
name = "express-pump",
Expand Down
14 changes: 14 additions & 0 deletions prototypes/recipes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ data:extend(
},
result = "overflow-valve"
},
{
type = "recipe",
name = "underflow-valve",
energy_required = 2,
enabled = false,
ingredients =
{
{"electronic-circuit", 1},
{"steel-plate", 1},
{"iron-gear-wheel", 1},
{"pipe", 1}
},
result = "underflow-valve"
},
{
type = "recipe",
name = "express-pump",
Expand Down
3 changes: 3 additions & 0 deletions prototypes/technology.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ table.insert(
table.insert(
data.raw["technology"]["fluid-handling"].effects,
{type = "unlock-recipe",recipe = "overflow-valve"})
table.insert(
data.raw["technology"]["fluid-handling"].effects,
{type = "unlock-recipe",recipe = "underflow-valve"})
table.insert(
data.raw["technology"]["fluid-handling"].effects,
{type = "unlock-recipe",recipe = "express-pump"})

0 comments on commit 7bee9c7

Please sign in to comment.