From cc8517580c9810c2f4654f86c1b7d72abc6dc234 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Sun, 27 Jan 2019 18:41:49 +0200 Subject: [PATCH] Easier liquid registration, corium --- elepower_dynamics/craftitems.lua | 39 ++- elepower_dynamics/fluids.lua | 143 ++-------- elepower_farming/fluids.lua | 247 +++------------- elepower_nuclear/fluids.lua | 267 ++++++------------ elepower_nuclear/machines/fission_reactor.lua | 3 +- .../textures/elenuclear_corium.png | Bin 0 -> 898 bytes .../elenuclear_corium_flowing_animated.png | Bin 0 -> 3999 bytes .../elenuclear_corium_source_animated.png | Bin 0 -> 3438 bytes elepower_papi/helpers.lua | 54 ++++ 9 files changed, 226 insertions(+), 527 deletions(-) create mode 100644 elepower_nuclear/textures/elenuclear_corium.png create mode 100644 elepower_nuclear/textures/elenuclear_corium_flowing_animated.png create mode 100644 elepower_nuclear/textures/elenuclear_corium_source_animated.png diff --git a/elepower_dynamics/craftitems.lua b/elepower_dynamics/craftitems.lua index 0de8ffe..48bb853 100644 --- a/elepower_dynamics/craftitems.lua +++ b/elepower_dynamics/craftitems.lua @@ -127,7 +127,44 @@ minetest.register_craftitem("elepower_dynamics:pcb_blank", { description = "Printed Circuit Board (PCB) Blank\nUse Etching Acid to etch", inventory_image = "elepower_blank_pcb.png", liquids_pointable = true, - groups = {blank_board = 1, static_component = 1} + groups = {blank_board = 1, static_component = 1}, + on_place = function (itemstack, placer, pointed_thing) + local pos = pointed_thing.under + if not pos or pointed_thing.type ~= "node" then return itemstack end + + local node = minetest.get_node_or_nil(pos) + if not node or node.name ~= "elepower_dynamics:etching_acid_source" then + return itemstack + end + + local istack = itemstack:get_name() + if not placer or placer:get_player_name() == "" then + return itemstack + end + + local out = ItemStack("elepower_dynamics:pcb") + local inv = placer:get_inventory() + local meta = minetest.get_meta(pos) + local uses = meta:get_int("uses") + + uses = uses + 1 + itemstack:take_item(1) + + if inv:room_for_item("main", out) then + inv:add_item("main", out) + else + minetest.item_drop(out, placer, pos) + end + + -- Limited etchings + if uses == 10 then + minetest.set_node(pos, {name = "default:water_source"}) + else + meta:set_int("uses", uses) + end + + return itemstack + end }) minetest.register_craftitem("elepower_dynamics:pcb", { diff --git a/elepower_dynamics/fluids.lua b/elepower_dynamics/fluids.lua index 752d70c..0e5d89e 100644 --- a/elepower_dynamics/fluids.lua +++ b/elepower_dynamics/fluids.lua @@ -1,140 +1,29 @@ -local etching = { - ["elepower_dynamics:pcb_blank"] = { - time = 5, - result = "elepower_dynamics:pcb" - } -} - -- Etching Acid -minetest.register_node("elepower_dynamics:etching_acid_source", { - description = "Etching Acid Source", - drawtype = "liquid", - tiles = {"elepower_etching_acid.png"}, - alpha = 200, - paramtype = "light", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "source", - liquid_alternative_source = "elepower_dynamics:etching_acid_source", - liquid_alternative_flowing = "elepower_dynamics:etching_acid_flowing", - liquid_viscosity = 4, +ele.helpers.register_liquid("etching_acid", { + description = "Etching Acid", + tiles = {"elepower_etching_acid.png"}, + special_tiles = {"elepower_etching_acid.png", "elepower_etching_acid.png"}, + alpha = 200, + liquid_viscosity = 4, damage_per_second = 4, post_effect_color = {a = 103, r = 65, g = 8, b = 0}, - groups = {acid = 1, etching_acid = 1, liquid = 3, tree_fluid = 1}, - sounds = default.node_sound_water_defaults(), - on_rightclick = function (pos, node, clicker, itemstack, pointed_thing) - local istack = itemstack:get_name() - if not clicker or clicker:get_player_name() == "" then - return itemstack - end - - if not etching[istack] then - return itemstack - end - - local recipe = etching[istack] - local out = ItemStack(recipe.result) - local inv = clicker:get_inventory() - local meta = minetest.get_meta(pos) - local uses = meta:get_int("uses") - - if inv:room_for_item("main", out) then - inv:add_item("main", out) - itemstack:take_item(1) - uses = uses + 1 - end - - -- Limited etchings - if uses == 10 then - minetest.set_node(pos, {name = "default:water_source"}) - else - meta:set_int("uses", uses) - end - - return itemstack - end -}) - -minetest.register_node("elepower_dynamics:etching_acid_flowing", { - description = "Flowing Etching Acid", - drawtype = "flowingliquid", - tiles = {"elepower_etching_acid.png"}, - special_tiles = {"elepower_etching_acid.png", "elepower_etching_acid.png"}, - alpha = 200, - paramtype = "light", - paramtype2 = "flowingliquid", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "flowing", - liquid_alternative_flowing = "elepower_dynamics:etching_acid_flowing", - liquid_alternative_source = "elepower_dynamics:etching_acid_source", - liquid_viscosity = 4, - damage_per_second = 4, - post_effect_color = {a = 103, r = 65, g = 8, b = 0}, - groups = {acid = 1, etching_acid = 1, liquid = 3, not_in_creative_inventory = 1}, - sounds = default.node_sound_water_defaults(), + groups = {acid = 1, etching_acid = 1, liquid = 3, tree_fluid = 1}, }) -- Liquid Lithium -minetest.register_node("elepower_dynamics:lithium_source", { - description = "Liquid Lithium Source", - drawtype = "liquid", - tiles = {"elepower_lithium.png"}, - alpha = 200, - paramtype = "light", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "source", - liquid_alternative_source = "elepower_dynamics:lithium_source", - liquid_alternative_flowing = "elepower_dynamics:lithium_flowing", - liquid_viscosity = 4, - damage_per_second = 4, +ele.helpers.register_liquid("lithium", { + description = "Liquid Lithium", + drawtype = "liquid", + tiles = {"elepower_lithium.png"}, + special_tiles = {"elepower_lithium.png", "elepower_lithium.png"}, + liquid_viscosity = 4, + damage_per_second = 1, + alpha = 200, post_effect_color = {a = 103, r = 229, g = 227, b = 196}, - groups = {lithium = 1, liquid = 3}, - sounds = default.node_sound_water_defaults(), -}) - -minetest.register_node("elepower_dynamics:lithium_flowing", { - description = "Flowing Liquid Lithium", - drawtype = "flowingliquid", - tiles = {"elepower_lithium.png"}, - special_tiles = {"elepower_lithium.png", "elepower_lithium.png"}, - alpha = 200, - paramtype = "light", - paramtype2 = "flowingliquid", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "flowing", - liquid_alternative_flowing = "elepower_dynamics:lithium_flowing", - liquid_alternative_source = "elepower_dynamics:lithium_source", - liquid_viscosity = 4, - damage_per_second = 4, - post_effect_color = {a = 103, r = 229, g = 227, b = 196}, - groups = {lithium = 1, liquid = 3, not_in_creative_inventory = 1}, - sounds = default.node_sound_water_defaults(), + groups = {lithium = 1, liquid = 3}, }) bucket.register_liquid("elepower_dynamics:etching_acid_source", "elepower_dynamics:etching_acid_flowing", diff --git a/elepower_farming/fluids.lua b/elepower_farming/fluids.lua index 893e73f..9270097 100644 --- a/elepower_farming/fluids.lua +++ b/elepower_farming/fluids.lua @@ -1,240 +1,61 @@ -- Tree Sap -minetest.register_node("elepower_farming:tree_sap_source", { - description = "Tree Sap Source", - drawtype = "liquid", - tiles = {"elefarming_tree_sap.png"}, - alpha = 200, - paramtype = "light", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "source", - liquid_alternative_source = "elepower_farming:tree_sap_source", - liquid_alternative_flowing = "elepower_farming:tree_sap_flowing", - liquid_viscosity = 7, +ele.helpers.register_liquid("tree_sap", { + description = "Tree Sap", + tiles = {"elefarming_tree_sap.png"}, + special_tiles = {"elefarming_tree_sap.png", "elefarming_tree_sap.png"}, + alpha = 200, + liquid_viscosity = 7, post_effect_color = {a = 103, r = 84, g = 34, b = 0}, - groups = {tree_sap = 3, liquid = 3, raw_bio = 1, tree_fluid = 1}, - sounds = default.node_sound_water_defaults(), -}) - -minetest.register_node("elepower_farming:tree_sap_flowing", { - description = "Flowing Tree Sap", - drawtype = "flowingliquid", - tiles = {"elefarming_tree_sap.png"}, - special_tiles = {"elefarming_tree_sap.png", "elefarming_tree_sap.png"}, - alpha = 200, - paramtype = "light", - paramtype2 = "flowingliquid", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "flowing", - liquid_alternative_flowing = "elepower_farming:tree_sap_flowing", - liquid_alternative_source = "elepower_farming:tree_sap_source", - liquid_viscosity = 7, - post_effect_color = {a = 103, r = 84, g = 34, b = 0}, - groups = {tree_sap = 3, liquid = 3, not_in_creative_inventory = 1}, - sounds = default.node_sound_water_defaults(), + groups = {tree_sap = 3, liquid = 3, raw_bio = 1, tree_fluid = 1}, }) -- Tree Resin -minetest.register_node("elepower_farming:resin_source", { - description = "Resin Source", - drawtype = "liquid", - tiles = {"elefarming_tree_sap.png"}, - alpha = 200, - paramtype = "light", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "source", - liquid_alternative_source = "elepower_farming:resin_source", - liquid_alternative_flowing = "elepower_farming:resin_flowing", - liquid_viscosity = 8, +ele.helpers.register_liquid("resin", { + description = "Resin", + tiles = {"elefarming_tree_sap.png"}, + special_tiles = {"elefarming_tree_sap.png", "elefarming_tree_sap.png"}, + alpha = 200, + liquid_viscosity = 8, post_effect_color = {a = 103, r = 84, g = 34, b = 0}, - groups = {resin = 3, liquid = 3, raw_bio = 1, tree_fluid = 1}, - sounds = default.node_sound_water_defaults(), -}) - -minetest.register_node("elepower_farming:resin_flowing", { - description = "Flowing Resin", - drawtype = "flowingliquid", - tiles = {"elefarming_tree_sap.png"}, - special_tiles = {"elefarming_tree_sap.png", "elefarming_tree_sap.png"}, - alpha = 200, - paramtype = "light", - paramtype2 = "flowingliquid", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "flowing", - liquid_alternative_source = "elepower_farming:resin_source", - liquid_alternative_flowing = "elepower_farming:resin_flowing", - liquid_viscosity = 8, - post_effect_color = {a = 103, r = 84, g = 34, b = 0}, - groups = {resin = 3, liquid = 3, not_in_creative_inventory = 1}, - sounds = default.node_sound_water_defaults(), + groups = {resin = 3, liquid = 3, raw_bio = 1, tree_fluid = 1}, }) -- Biomass -minetest.register_node("elepower_farming:biomass_source", { - description = "Biomass Source", - drawtype = "liquid", - tiles = {"elefarming_biomass.png"}, - alpha = 200, - paramtype = "light", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "source", - liquid_alternative_source = "elepower_farming:biomass_source", - liquid_alternative_flowing = "elepower_farming:biomass_flowing", - liquid_viscosity = 7, +ele.helpers.register_liquid("biomass", { + description = "Biomass", + tiles = {"elefarming_biomass.png"}, + special_tiles = {"elefarming_biomass.png", "elefarming_biomass.png"}, + alpha = 200, + liquid_viscosity = 7, post_effect_color = {a = 103, r = 0, g = 42, b = 0}, - groups = {biomass = 3, liquid = 3}, - sounds = default.node_sound_water_defaults(), -}) - -minetest.register_node("elepower_farming:biomass_flowing", { - description = "Flowing Biomass", - drawtype = "flowingliquid", - tiles = {"elefarming_biomass.png"}, - special_tiles = {"elefarming_biomass.png", "elefarming_biomass.png"}, - alpha = 200, - paramtype = "light", - paramtype2 = "flowingliquid", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "flowing", - liquid_alternative_flowing = "elepower_farming:biomass_flowing", - liquid_alternative_source = "elepower_farming:biomass_source", - liquid_viscosity = 7, - post_effect_color = {a = 103, r = 0, g = 42, b = 0}, - groups = {biomass = 3, liquid = 3, not_in_creative_inventory = 1}, - sounds = default.node_sound_water_defaults(), + groups = {biomass = 3, liquid = 3}, }) -- Biofuel -minetest.register_node("elepower_farming:biofuel_source", { - description = "Biofuel Source", - drawtype = "liquid", - tiles = {"elefarming_biofuel.png"}, - alpha = 200, - paramtype = "light", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "source", - liquid_alternative_source = "elepower_farming:biofuel_source", - liquid_alternative_flowing = "elepower_farming:biofuel_flowing", - liquid_viscosity = 7, +ele.helpers.register_liquid("biofuel", { + description = "Biofuel", + tiles = {"elefarming_biofuel.png"}, + special_tiles = {"elefarming_biofuel.png", "elefarming_biofuel.png"}, + alpha = 200, + liquid_viscosity = 7, post_effect_color = {a = 103, r = 255, g = 163, b = 0}, - groups = {biofuel = 3, liquid = 3}, - sounds = default.node_sound_water_defaults(), -}) - -minetest.register_node("elepower_farming:biofuel_flowing", { - description = "Flowing Biofuel", - drawtype = "flowingliquid", - tiles = {"elefarming_biofuel.png"}, - special_tiles = {"elefarming_biofuel.png", "elefarming_biofuel.png"}, - alpha = 200, - paramtype = "light", - paramtype2 = "flowingliquid", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "flowing", - liquid_alternative_flowing = "elepower_farming:biofuel_flowing", - liquid_alternative_source = "elepower_farming:biofuel_source", - liquid_viscosity = 7, - post_effect_color = {a = 103, r = 255, g = 163, b = 0}, - groups = {biofuel = 3, liquid = 3, not_in_creative_inventory = 1}, - sounds = default.node_sound_water_defaults(), + groups = {biofuel = 3, liquid = 3}, }) -- Sludge -minetest.register_node("elepower_farming:sludge_source", { - description = "Sludge Source", - drawtype = "liquid", - tiles = {"elefarming_tar.png"}, - paramtype = "light", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "source", - liquid_alternative_source = "elepower_farming:sludge_source", - liquid_alternative_flowing = "elepower_farming:sludge_flowing", - liquid_viscosity = 8, +ele.helpers.register_liquid("sludge", { + description = "Sludge", + tiles = {"elefarming_tar.png"}, + special_tiles = {"elefarming_tar.png", "elefarming_tar.png"}, + liquid_viscosity = 8, post_effect_color = {a = 50, r = 0, g = 0, b = 0}, - groups = {sludge = 3, liquid = 3}, - sounds = default.node_sound_water_defaults(), -}) - -minetest.register_node("elepower_farming:sludge_flowing", { - description = "Flowing Sludge", - drawtype = "flowingliquid", - tiles = {"elefarming_tar.png"}, - special_tiles = {"elefarming_tar.png", "elefarming_tar.png"}, - paramtype = "light", - paramtype2 = "flowingliquid", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "flowing", - liquid_alternative_flowing = "elepower_farming:sludge_flowing", - liquid_alternative_source = "elepower_farming:sludge_source", - liquid_viscosity = 8, - post_effect_color = {a = 50, r = 0, g = 0, b = 0}, - groups = {sludge = 3, liquid = 3, not_in_creative_inventory = 1}, - sounds = default.node_sound_water_defaults(), + groups = {sludge = 3, liquid = 3}, }) if minetest.get_modpath("bucket") ~= nil then diff --git a/elepower_nuclear/fluids.lua b/elepower_nuclear/fluids.lua index d5d9b7e..54bf606 100644 --- a/elepower_nuclear/fluids.lua +++ b/elepower_nuclear/fluids.lua @@ -41,10 +41,9 @@ ele.register_gas(nil, "Helium Plasma", "elepower_nuclear:helium_plasma") ------------- -- Heavy Water -minetest.register_node("elepower_nuclear:heavy_water_source", { - description = "Heavy Water Source", - drawtype = "liquid", - tiles = { +ele.helpers.register_liquid("heavy_water", { + description = "Heavy Water", + tiles_source = { { name = "elenuclear_heavy_water_source_animated.png", animation = { @@ -55,40 +54,7 @@ minetest.register_node("elepower_nuclear:heavy_water_source", { }, }, }, - special_tiles = { - { - name = "elenuclear_heavy_water_source_animated.png", - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 2.0, - }, - backface_culling = false, - }, - }, - alpha = 160, - paramtype = "light", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "source", - liquid_alternative_flowing = "elepower_nuclear:heavy_water_flowing", - liquid_alternative_source = "elepower_nuclear:heavy_water_source", - liquid_viscosity = 4, - post_effect_color = {a = 103, r = 13, g = 69, b = 121}, - groups = {heavy_water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1}, - sounds = default.node_sound_water_defaults(), -}) - -minetest.register_node("elepower_nuclear:heavy_water_flowing", { - description = "Flowing Heavy Water", - drawtype = "flowingliquid", - tiles = {"elenuclear_heavy_water.png"}, + tiles_flowing = {"elenuclear_heavy_water.png"}, special_tiles = { { name = "elenuclear_heavy_water_flowing_animated.png", @@ -112,171 +78,91 @@ minetest.register_node("elepower_nuclear:heavy_water_flowing", { }, }, alpha = 160, - paramtype = "light", - paramtype2 = "flowingliquid", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "flowing", - liquid_alternative_flowing = "elepower_nuclear:heavy_water_flowing", - liquid_alternative_source = "elepower_nuclear:heavy_water_source", liquid_viscosity = 4, post_effect_color = {a = 103, r = 13, g = 69, b = 121}, - groups = {heavy_water = 3, liquid = 3, puts_out_fire = 1, - not_in_creative_inventory = 1, cools_lava = 1}, - sounds = default.node_sound_water_defaults(), + groups = {heavy_water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1}, }) -- Cold coolant -minetest.register_node("elepower_nuclear:coolant_source", { - description = "Cold Coolant Source", - drawtype = "liquid", - tiles = {"elenuclear_cold_coolant.png"}, - alpha = 200, - paramtype = "light", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "source", - liquid_alternative_source = "elepower_nuclear:coolant_source", - liquid_alternative_flowing = "elepower_nuclear:coolant_flowing", - liquid_viscosity = 2, +ele.helpers.register_liquid("coolant", { + description = "Cold Coolant", + tiles = {"elenuclear_cold_coolant.png"}, + special_tiles = {"elenuclear_cold_coolant.png", "elenuclear_cold_coolant.png"}, + alpha = 200, + liquid_viscosity = 2, post_effect_color = {a = 128, r = 36, g = 150, b = 255}, - groups = {liquid = 3, coolant = 1}, - sounds = default.node_sound_water_defaults(), -}) - -minetest.register_node("elepower_nuclear:coolant_flowing", { - description = "Cold Coolant Flowing", - drawtype = "flowingliquid", - tiles = {"elenuclear_cold_coolant.png"}, - special_tiles = {"elenuclear_cold_coolant.png", "elenuclear_cold_coolant.png"}, - alpha = 200, - paramtype = "light", - paramtype2 = "flowingliquid", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "flowing", - liquid_alternative_flowing = "elepower_nuclear:coolant_flowing", - liquid_alternative_source = "elepower_nuclear:coolant_source", - liquid_viscosity = 2, - post_effect_color = {a = 128, r = 36, g = 150, b = 255}, - groups = {coolant = 3, liquid = 3, not_in_creative_inventory = 1}, - sounds = default.node_sound_water_defaults(), + groups = {liquid = 3, coolant = 1}, }) -- Hot coolant -minetest.register_node("elepower_nuclear:hot_coolant_source", { - description = "Hot Coolant Source", - drawtype = "liquid", - tiles = {"elenuclear_hot_coolant.png"}, - alpha = 200, - paramtype = "light", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - damage_per_second = 4 * 2, - drop = "", - drowning = 1, - liquidtype = "source", - liquid_alternative_source = "elepower_nuclear:hot_coolant_source", - liquid_alternative_flowing = "elepower_nuclear:hot_coolant_flowing", - liquid_viscosity = 2, +ele.helpers.register_liquid("hot_coolant", { + description = "Hot Coolant", + tiles = {"elenuclear_hot_coolant.png"}, + special_tiles = {"elenuclear_hot_coolant.png", "elenuclear_hot_coolant.png"}, + alpha = 200, + liquid_viscosity = 2, post_effect_color = {a = 128, r = 136, g = 100, b = 158}, - groups = {liquid = 3, coolant = 1, hot = 1}, - sounds = default.node_sound_water_defaults(), -}) - -minetest.register_node("elepower_nuclear:hot_coolant_flowing", { - description = "Hot Coolant Flowing", - drawtype = "flowingliquid", - tiles = {"elenuclear_hot_coolant.png"}, - special_tiles = {"elenuclear_hot_coolant.png", "elenuclear_hot_coolant.png"}, - alpha = 200, - paramtype = "light", - paramtype2 = "flowingliquid", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - damage_per_second = 4 * 2, - drop = "", - drowning = 1, - liquidtype = "flowing", - liquid_alternative_flowing = "elepower_nuclear:hot_coolant_flowing", - liquid_alternative_source = "elepower_nuclear:hot_coolant_source", - liquid_viscosity = 2, - post_effect_color = {a = 128, r = 136, g = 100, b = 158}, - groups = {coolant = 3, liquid = 3, not_in_creative_inventory = 1, hot = 1}, - sounds = default.node_sound_water_defaults(), + groups = {liquid = 3, coolant = 1, hot = 1}, }) -- Brine -minetest.register_node("elepower_nuclear:brine_source", { - description = "Brine Source", - drawtype = "liquid", - tiles = {"elenuclear_brine.png"}, - special_tiles = {"elenuclear_brine.png"}, - alpha = 240, - paramtype = "light", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "source", - liquid_alternative_flowing = "elepower_nuclear:brine_flowing", - liquid_alternative_source = "elepower_nuclear:brine_source", - liquid_viscosity = 7, +ele.helpers.register_liquid("brine", { + description = "Brine", + drawtype = "liquid", + tiles = {"elenuclear_brine.png"}, + special_tiles = {"elenuclear_brine.png", "elenuclear_brine.png"}, + alpha = 240, + liquid_viscosity = 7, post_effect_color = {a = 200, r = 215, g = 221, b = 187}, - groups = {brine = 3, saline = 1, liquid = 3, puts_out_fire = 1, cools_lava = 1}, - sounds = default.node_sound_water_defaults(), + groups = {brine = 3, saline = 1, liquid = 3, puts_out_fire = 1, cools_lava = 1}, }) -minetest.register_node("elepower_nuclear:brine_flowing", { - description = "Flowing Brine", - drawtype = "flowingliquid", - tiles = {"elenuclear_brine.png"}, - special_tiles = {"elenuclear_brine.png", "elenuclear_brine.png"}, - alpha = 240, - paramtype = "light", - paramtype2 = "flowingliquid", - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "flowing", - liquid_alternative_flowing = "elepower_nuclear:brine_flowing", - liquid_alternative_source = "elepower_nuclear:brine_source", - liquid_viscosity = 7, - post_effect_color = {a = 200, r = 215, g = 221, b = 187}, - groups = {brine = 3, saline = 1, liquid = 3, puts_out_fire = 1, - not_in_creative_inventory = 1, cools_lava = 1}, - sounds = default.node_sound_water_defaults(), +-- Corium + +ele.helpers.register_liquid("corium", { + description = "Corium", + drawtype = "liquid", + tiles_source = { + { + name = "elenuclear_corium_source_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 2.0, + }, + }, + }, + tiles_flowing = {"elenuclear_corium.png"}, + special_tiles_flowing = { + { + name = "elenuclear_corium_flowing_animated.png", + backface_culling = false, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 0.8, + }, + }, + { + name = "elenuclear_corium_flowing_animated.png", + backface_culling = true, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 0.8, + }, + }, + }, + liquid_viscosity = 7, + damage_per_second = 10, + post_effect_color = {a = 50, r = 155, g = 255, b = 12}, + groups = {corium = 3, radioactive = 1, liquid = 3, igniter = 1}, }) if minetest.get_modpath("bucket") ~= nil then @@ -301,3 +187,16 @@ if minetest.get_modpath("bucket") ~= nil then } }) end + +-- Corium effects + +minetest.register_abm({ + label = "Corium: boil water", + nodenames = {"group:water"}, + neighbors = {"elepower_nuclear:corium_flowing", "elepower_nuclear:corium_source"}, + interval = 1, + chance = 1, + action = function(pos, node) + minetest.remove_node(pos) + end, +}) diff --git a/elepower_nuclear/machines/fission_reactor.lua b/elepower_nuclear/machines/fission_reactor.lua index 178d4bc..841ab4f 100644 --- a/elepower_nuclear/machines/fission_reactor.lua +++ b/elepower_nuclear/machines/fission_reactor.lua @@ -307,8 +307,7 @@ local function reactor_core_timer(pos) end if heat >= 100 then - -- TODO: Melt - minetest.set_node(pos, {name = "air"}) + minetest.set_node(pos, {name = "elepower_nuclear:corium_source"}) return false end diff --git a/elepower_nuclear/textures/elenuclear_corium.png b/elepower_nuclear/textures/elenuclear_corium.png new file mode 100644 index 0000000000000000000000000000000000000000..aa2ae1438d8af2ab2da6269188b0fe073417aa43 GIT binary patch literal 898 zcmV-|1AY97P)Px#32;bRa{vG?BLDy{BLR4&KXw2B00(qQO+^Re0UHn-2`aGa>;M1&9cffpbVF}# zZDnqB0000007G(RVRU6=Aa`kWXdp*PO;BVmWd{HN0_#acK~y-)J=6Vb)CB;?@z;It zZs*-?cWYZZr&Fg9xC$R4HB$>qTm@21um?2AP=Dx$`XOaOp^FL?68k~RC`1g*9~M@u zd}xOBpdv~6IKd4f(k|a-P`ASjV2lI;x1!74mrw|GeM2M_xVXEZ@bh+uYYbUw!`eoB9o>C_5_pfuh&k%`` z%Tma(;c!e$+VOq8g7#Lf7uuY+!+TBF6!IlWsqDXdxe2yEJ2m+ek zB4^Y$zwQ;U6bI+w*u7C3wGtT)=zlBS58XzHBnB9N#gQN?IKb5})8@t8FaH_7N% zRlm!@^>lWewYz<-h~%9KYqp&dgrii|q&>TxcqJE)j!T%V#vHXCv9NrzaFm{_m*nMTCDdwf<;c%_T=BWcmSYpm zvRZcJxI~(5N0thU$;rqWQB+XdSn|~8g1a=z=V))`%A#Sxj+MQB$Zj+?z=E}utCw-x z-%jdx#W}5V8R99zV(Kij<(D#x*K@I*VCWW~u4dsn);+&TN`p=Z?A*6mr~Q8XY|yzw zCCP2OJEh%gg+uBdV5E;ovYLULlqIN8FQE=0gS~8BbsFTy`Dq`|?If;7QC`FB8WU2t zgllKpT3%fOOnS6S!ML=0OkXzW#3y|+LyZ1MW{A!Xmc5cRs>jje-}&o2p?S@U>ksqM z69i!%T*J$+zTmb$v@E(LJIwePg?#BqL6meYp@8f#L7~9yZdy7f5#r1N26Rc9EKy0S z)}4%x5e}EWQY;XwAc&Ol?K@1i)SJhuG&WITh6>ZY_I)56 literal 0 HcmV?d00001 diff --git a/elepower_nuclear/textures/elenuclear_corium_flowing_animated.png b/elepower_nuclear/textures/elenuclear_corium_flowing_animated.png new file mode 100644 index 0000000000000000000000000000000000000000..9386d71bf7f4b3dcf9f20c38da79c8546a28aada GIT binary patch literal 3999 zcmV;Q4`A?#P)EK|00001b5ch_0Itp) z=>Px#32;bRa{vG?BLDy{BLR4&KXw2B00(qQO+^Re0UHn;0c$Gs82|tP9cffpbVF}# zZDnqB0000007G(RVRU6=Aa`kWXdp*PO;BVmWd{HN4+u#_K~#9!?b`W&)%BIf@n^nw z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RwW+zt<;~>2gqf?nSChKL{fTxK7O|_g{`|nR{Db7~%MZJkmF&V#qjUZF9 z9hHCqryhr$RA(Y;h#(y{l7IP}!f!SnuURiXx0l{5^0r`&;?*Bhb(rt`V3mN=jWdZl zP6udHgZ%P2dzT=t8B5`nnVx34=i(&2jjEd*Z07Q=n)!gvh=?wgsn72tYXVn~Ky(@z zW4Qk%4rzHOwAVh@^y8QEr4~1NCH-bFX$AMc#4YXD8tv$_yRk+i+hb{{ASDMU_gF|0 zkv&a;72|FJK`&>wGkgJh>?+~3VHj;lvFX_30UTqC!gwRej>|1Q^hwy$L`NgOR<55S zXSUbFU)#SrQeTdcJ&6g+_&N_!=AK;Uyg9C#L+|wP_}dBk&{XsaqD(|*1OZqoa z4!q6W^8h_!#`Rnxd#K&DrTEkqs?YQ8$wUFsMsh4e#w}hZ%6eSM^qYanLB$E8=-ZVU zS@aGXkk!#0L3D`-qk>VoLU_lKL!t039 zU*6C9mrD-sKOsK6iX7#2PcznNX74~o`EL(Fha0__YsH$+69|VWJ;Z_KNHu1S% zlJ}|^{0vzWxc?=3jHgWdwp`mbX$1x|vNekO3L=t;B-=?k?CNM>!!&?^hx%*uewaIM zB=tdWMv6?q;YN^96HC;@bMZ0B&WyU^FYz|vX~NsWUzf;S@JA~ZKYVt+trj7DBm?u< z^DdH%yC-uuMOR$8y=o*uFCia*Y($iBbwZTzG$X1ZT5s{lS_FY>#oVg7?MlKLjs3qq zgnWoHvK}>zB?2iSi`Ksw{fgPuCD?S6`)1i~xWnU*N3}4{F8n7f3jlxv@~p3 Qo&W#<07*qoM6N<$g48N`WdHyG literal 0 HcmV?d00001 diff --git a/elepower_papi/helpers.lua b/elepower_papi/helpers.lua index 98dd06d..5b1ed3c 100644 --- a/elepower_papi/helpers.lua +++ b/elepower_papi/helpers.lua @@ -111,3 +111,57 @@ function ele.helpers.state_enabled(meta, pos, state) return false end + +function ele.helpers.register_liquid(liquid, def) + local mod = minetest.get_current_modname() + for _,state in pairs({"source", "flowing"}) do + local def_base = { + drawtype = "liquid", + paramtype = "light", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + is_ground_content = false, + drop = "", + drowning = 1, + liquidtype = state, + liquid_alternative_source = mod..":"..liquid.."_source", + liquid_alternative_flowing = mod..":"..liquid.."_flowing", + sounds = default.node_sound_water_defaults(), + } + + for key,val in pairs(def) do + if type(val) == "table" then + def_base[key] = table.copy(val) + else + def_base[key] = val + end + end + + if not def_base.groups then + def_base.groups = {liquid = 3} + end + + if state == "flowing" then + def_base.description = "Flowing " .. def_base.description + def_base.paramtype2 = "flowingliquid" + def_base.drawtype = "flowingliquid" + def_base.groups.not_in_creative_inventory = 1 + else + def_base.description = def_base.description .. " Source" + end + + if def["tiles_"..state] then + def_base.tiles = table.copy(def["tiles_"..state]) + def_base["tiles_"..state] = nil + end + + if def["special_tiles_"..state] then + def_base.special_tiles = table.copy(def["special_tiles_"..state]) + def_base["special_tiles_"..state] = nil + end + + minetest.register_node(mod..":"..liquid.."_"..state, def_base) + end +end