Code: Select all
if storage.hab_index[i][3].get_fluid_count () >= 1 then
storage.hab_index[i][3].remove_fluid {name="water", amount = 1}
else
storage.hab_index[i][1].custom_status = {diode = defines.entity_status_diode.red, label ="no water"}
end
if storage.hab_index[i][4].get_fluid_count ("oxygen") >= 1 then
storage.hab_index[i][4].remove_fluid {name="oxygen", amount = 1}
else
storage.hab_index[i][1].custom_status = {diode = defines.entity_status_diode.red, label ="no oxygen"}
end
Code: Select all
local oxygenfluid = {
type = "fluid",
name = "oxygen",
subgroup = "fluid",
default_temperature=15,
gas_temperature=0,
base_color={0,0.95,1,0.8},
flow_color={0,0.95,1,0.8},
icon ="__colonization__/graphics/oxygen.png",
icon_size = 64,
}
data:extend{oxygenfluid}
Code: Select all
local hab_pipe_ox= {
type = "pipe",
name = "hab_pipe_ox",
flags = {"get-by-unit-number","not-blueprintable","not-flammable","not-upgradable"},
fluid_box ={
filter="oxygen",
volume=2500,
pipe_connections={
{position={0,0},direction=defines.direction.east},
{position={0,0},direction=defines.direction.west}
},
},
selection_priority=51,
horizontal_window_bounding_box={{-0.5, -0.5}, {0.5,0.5}},
vertical_window_bounding_box={{-0.5, -0.5}, {0.5,0.5}},
collision_box ={{-0.5, -0.5}, {0.5,0.5}},
selection_box ={{-0.5, -0.5}, {0.5,0.5}},
}
data:extend{hab_pipe_ox}
local hab_pipe_aq= {
type = "pipe",
name = "hab_pipe_aq",
flags = {"get-by-unit-number","not-blueprintable","not-flammable","not-upgradable"},
fluid_box ={
filter="water",
volume=2500,
pipe_connections={
{position={0,0},direction=defines.direction.east},
{position={0,0},direction=defines.direction.west}
},
},
selection_priority=51,
horizontal_window_bounding_box={{-0.5, -0.5}, {0.5,0.5}},
vertical_window_bounding_box={{-0.5, -0.5}, {0.5,0.5}},
collision_box ={{-0.5, -0.5}, {0.5,0.5}},
selection_box ={{-0.5, -0.5}, {0.5,0.5}},
}
data:extend{hab_pipe_aq}
