From 60d6f91bdebf4a1944ca7e0d83918f3128ddc8db Mon Sep 17 00:00:00 2001 From: npc-strider Date: Wed, 1 Aug 2018 19:08:49 +0800 Subject: [PATCH] Coolant pipes 1 --- Refinery_overhaul_0.1.0/control.lua | 19 +++++ .../prototypes/coolant_pipe.lua | 70 +++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 Refinery_overhaul_0.1.0/control.lua create mode 100644 Refinery_overhaul_0.1.0/prototypes/coolant_pipe.lua diff --git a/Refinery_overhaul_0.1.0/control.lua b/Refinery_overhaul_0.1.0/control.lua new file mode 100644 index 0000000..f91aa8e --- /dev/null +++ b/Refinery_overhaul_0.1.0/control.lua @@ -0,0 +1,19 @@ + +--[[function build_heat_interface(event) + local entity = event.entity + if entity.name == "fluid-condenser" then + + end +end + +function remove_heat_interface(event) + +end + +function add_heat() + +end + +script.on_event(defines.events.on_built_entity, function(build_heat_interface)) +script.on_event(defines.events.on_player_mined_entity, function(remove_heat_interface)) +script.on_event(defines.events.on_tick,function(add_heat))]] \ No newline at end of file diff --git a/Refinery_overhaul_0.1.0/prototypes/coolant_pipe.lua b/Refinery_overhaul_0.1.0/prototypes/coolant_pipe.lua new file mode 100644 index 0000000..e7c0579 --- /dev/null +++ b/Refinery_overhaul_0.1.0/prototypes/coolant_pipe.lua @@ -0,0 +1,70 @@ + +--pipe connection coordinates. +--no. of connections = +pipe_connections = { + [0] = { position = {0,1}, position = {0,-1}, position = {-1,0}, position = {1,0} }, + + [1] = { position = {0,1}, position = {-1,0}, position = {0,1} }, + [2] = { position = {0,1}, position = {0,-1}, position = {0,1} }, + [3] = { position = {-1,0}, position = {1,0}, position = {0,1} }, + [4] = { position = {1,0}, position = {-1,0}, position = {0,1} }, + + [5] = { position = {0,-1}, position = {0,1} }, + [6] = { position = {-1,0}, position = {1,0} }, + + [7] = { position = {0,1}, position = {1,0} }, + [8] = { position = {0,-1}, position = {1,0} }, + [9] = { position = {0,-1}, position = {-1,0} }, + [10] = { position = {0,1}, position = {-1,0} } +} + +--todo: fix indentation +for k, v in pairs(pipe_connections) do + local entity = { + type = "pipe", + name = "thermal-pipe" .. k, + icon = "__base__/graphics/icons/pipe.png", + icon_size = 32, + flags = {"placeable-neutral", "player-creation"}, + minable = {hardness = 0.2, mining_time = 0.5, result = "thermal-pipe" .. k}, + max_health = 100, + corpse = "small-remnants", + resistances = + { + { + type = "fire", + percent = 80 + }, + { + type = "impact", + percent = 30 + } + }, + --fast_replaceable_group = "pipe", + collision_box = {{-0.29, -0.29}, {0.29, 0.29}}, + selection_box = {{-0.5, -0.5}, {0.5, 0.5}}, + fluid_box = + { + base_area = 1, + pipe_connections = + }, + vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 }, + pictures = pipepictures(), + working_sound = + { + sound = + { + { + filename = "__base__/sound/pipe.ogg", + volume = 0.85 + } + }, + match_volume_to_activity = true, + max_sounds_per_type = 3 + }, + + horizontal_window_bounding_box = {{-0.25, -0.28125}, {0.25, 0.15625}}, + vertical_window_bounding_box = {{-0.28125, -0.5}, {0.03125, 0.125}} + } + data:extend({entity}) +end \ No newline at end of file