Skip to content

Commit

Permalink
2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
snouz committed Dec 11, 2021
1 parent 65130b6 commit 46bca79
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 89 deletions.
5 changes: 2 additions & 3 deletions control.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
script.on_event(defines.events.on_built_entity, function(event)
local player = game.players[event.player_index]
if event.created_entity.name == "pipe-elbow"
or event.created_entity.name == "pipe-junction"
or event.created_entity.name == "pipe-straight" then
player.rotate_for_build()
player.rotate_for_build()
game.players[event.player_index].rotate_for_build()
game.players[event.player_index].rotate_for_build()
end
end)
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.0.0",
"version": "2.1.0",
"title": "Flow Control",
"author": "GotLag",
"homepage": "https://forums.factorio.com/viewtopic.php?f=94&t=20645",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ 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
Expand Down
89 changes: 8 additions & 81 deletions prototypes/entities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,10 @@ check_valve =
name = "check-valve",
icon = "__Flow Control__/graphics/icon/check-valve.png",
flags = {"placeable-player", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.5, result = "check-valve"},
minable = {mining_time = 1, result = "check-valve"},
max_health = 80,
corpse = "small-remnants",
resistances =
{
{
type = "fire",
percent = 70
}
},
resistances = data.raw["pump"]["small-pump"].resistances,
fast_replaceable_group = "pipe",
collision_box = {{-0.29, -0.29}, {0.29, 0.29}},
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
Expand All @@ -24,10 +18,8 @@ check_valve =
pipe_covers = pipecoverspictures(),
pipe_connections =
{
-- { position = {0, 1}, type="output"},
{ position = {0, 1} },
{ position = {0, -1}, type="input"}
-- { position = {0, -1} }
{ position = {0, 1}, type="output" },
{ position = {0, -1} }
},
},
window_bounding_box = {{-0.125, 0.6875}, {0.1875, 1.1875}},
Expand Down Expand Up @@ -68,70 +60,10 @@ check_valve =
}
},
flow_length_in_ticks = 360,
vehicle_impact_sound =
{
filename = "__base__/sound/car-metal-impact.ogg",
volume = 0.65
},
circuit_wire_connection_points =
{
{
shadow =
{
red = {0.171875, 0.140625},
green = {0.171875, 0.265625},
},
wire =
{
red = {-0.53125, -0.15625},
green = {-0.53125, 0},
}
},
{
shadow =
{
red = {0.890625, 0.703125},
green = {0.75, 0.75},
},
wire =
{
red = {0.34375, 0.28125},
green = {0.34375, 0.4375},
}
},
{
shadow =
{
red = {0.15625, 0.0625},
green = {0.09375, 0.125},
},
wire =
{
red = {-0.53125, -0.09375},
green = {-0.53125, 0.03125},
}
},
{
shadow =
{
red = {0.796875, 0.703125},
green = {0.625, 0.75},
},
wire =
{
red = {0.40625, 0.28125},
green = {0.40625, 0.4375},
}
}
},
circuit_connector_sprites =
{
get_circuit_connector_sprites({-0.40625, -0.3125}, nil, 24),
get_circuit_connector_sprites({0.125, 0.21875}, {0.34375, 0.40625}, 18),
get_circuit_connector_sprites({-0.40625, -0.25}, nil, 24),
get_circuit_connector_sprites({0.203125, 0.203125}, {0.25, 0.40625}, 18),
},
circuit_wire_max_distance = 7.5
vehicle_impact_sound = data.raw["pump"]["small-pump"].vehicle_impact_sound,
circuit_wire_connection_points = data.raw["pump"]["small-pump"].circuit_wire_connection_points,
circuit_connector_sprites = data.raw["pump"]["small-pump"].circuit_connector_sprites,
circuit_wire_max_distance = data.raw["pump"]["small-pump"].circuit_wire_max_distance
}

-- Overflow Valve ************************************************************************
Expand All @@ -140,11 +72,6 @@ overflow_valve.name = "overflow-valve"
overflow_valve.icon = "__Flow Control__/graphics/icon/overflow-valve.png"
overflow_valve.minable.result = "overflow-valve"
overflow_valve.fluid_box.base_level = 0.8
overflow_valve.fluid_box.pipe_connections =
{
{ position = {0, 1}, type="output"},
{ position = {0, -1} }
}
overflow_valve.pictures.picture.sheet.filename =
"__Flow Control__/graphics/entity/overflow-valve/overflow-valve.png"

Expand Down
14 changes: 11 additions & 3 deletions prototypes/recipes.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
data.raw["recipe"]["small-pump"].enabled = true
data.raw["recipe"]["small-pump"].ingredients =
{
{"electronic-circuit", 2},
{"pipe", 1},
{"iron-gear-wheel", 1}
}

data:extend(
{
{
Expand Down Expand Up @@ -34,9 +42,9 @@ data:extend(
enabled = false,
ingredients =
{
{"small-pump", 3},
{"steel-plate", 4},
{"pipe", 1}
{"electric-engine-unit", 1},
{"steel-plate", 1},
{"small-pump", 1}
},
result= "express-pump"
},
Expand Down
6 changes: 6 additions & 0 deletions prototypes/technology.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
for i,e in pairs(data.raw["technology"]["fluid-handling"].effects) do
if e["recipe"] == "small-pump" then
data.raw["technology"]["fluid-handling"].effects[i] = nil
end
end

table.insert(
data.raw["technology"]["fluid-handling"].effects,
{type = "unlock-recipe",recipe = "check-valve"})
Expand Down

0 comments on commit 46bca79

Please sign in to comment.