Easier liquid registration, corium

This commit is contained in:
Evert Prants 2019-01-27 18:41:49 +02:00
parent 17579d1e11
commit cc8517580c
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
9 changed files with 226 additions and 527 deletions

View File

@ -127,7 +127,44 @@ minetest.register_craftitem("elepower_dynamics:pcb_blank", {
description = "Printed Circuit Board (PCB) Blank\nUse Etching Acid to etch", description = "Printed Circuit Board (PCB) Blank\nUse Etching Acid to etch",
inventory_image = "elepower_blank_pcb.png", inventory_image = "elepower_blank_pcb.png",
liquids_pointable = true, 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", { minetest.register_craftitem("elepower_dynamics:pcb", {

View File

@ -1,140 +1,29 @@
local etching = {
["elepower_dynamics:pcb_blank"] = {
time = 5,
result = "elepower_dynamics:pcb"
}
}
-- Etching Acid -- Etching Acid
minetest.register_node("elepower_dynamics:etching_acid_source", { ele.helpers.register_liquid("etching_acid", {
description = "Etching Acid Source", description = "Etching Acid",
drawtype = "liquid", tiles = {"elepower_etching_acid.png"},
tiles = {"elepower_etching_acid.png"}, special_tiles = {"elepower_etching_acid.png", "elepower_etching_acid.png"},
alpha = 200, alpha = 200,
paramtype = "light", liquid_viscosity = 4,
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,
damage_per_second = 4, damage_per_second = 4,
post_effect_color = {a = 103, r = 65, g = 8, b = 0}, post_effect_color = {a = 103, r = 65, g = 8, b = 0},
groups = {acid = 1, etching_acid = 1, liquid = 3, tree_fluid = 1}, 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(),
}) })
-- Liquid Lithium -- Liquid Lithium
minetest.register_node("elepower_dynamics:lithium_source", { ele.helpers.register_liquid("lithium", {
description = "Liquid Lithium Source", description = "Liquid Lithium",
drawtype = "liquid", drawtype = "liquid",
tiles = {"elepower_lithium.png"}, tiles = {"elepower_lithium.png"},
alpha = 200, special_tiles = {"elepower_lithium.png", "elepower_lithium.png"},
paramtype = "light", liquid_viscosity = 4,
walkable = false, damage_per_second = 1,
pointable = false, alpha = 200,
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,
post_effect_color = {a = 103, r = 229, g = 227, b = 196}, post_effect_color = {a = 103, r = 229, g = 227, b = 196},
groups = {lithium = 1, liquid = 3}, 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(),
}) })
bucket.register_liquid("elepower_dynamics:etching_acid_source", "elepower_dynamics:etching_acid_flowing", bucket.register_liquid("elepower_dynamics:etching_acid_source", "elepower_dynamics:etching_acid_flowing",

View File

@ -1,240 +1,61 @@
-- Tree Sap -- Tree Sap
minetest.register_node("elepower_farming:tree_sap_source", { ele.helpers.register_liquid("tree_sap", {
description = "Tree Sap Source", description = "Tree Sap",
drawtype = "liquid", tiles = {"elefarming_tree_sap.png"},
tiles = {"elefarming_tree_sap.png"}, special_tiles = {"elefarming_tree_sap.png", "elefarming_tree_sap.png"},
alpha = 200, alpha = 200,
paramtype = "light", liquid_viscosity = 7,
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,
post_effect_color = {a = 103, r = 84, g = 34, b = 0}, post_effect_color = {a = 103, r = 84, g = 34, b = 0},
groups = {tree_sap = 3, liquid = 3, raw_bio = 1, tree_fluid = 1}, 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(),
}) })
-- Tree Resin -- Tree Resin
minetest.register_node("elepower_farming:resin_source", { ele.helpers.register_liquid("resin", {
description = "Resin Source", description = "Resin",
drawtype = "liquid", tiles = {"elefarming_tree_sap.png"},
tiles = {"elefarming_tree_sap.png"}, special_tiles = {"elefarming_tree_sap.png", "elefarming_tree_sap.png"},
alpha = 200, alpha = 200,
paramtype = "light", liquid_viscosity = 8,
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,
post_effect_color = {a = 103, r = 84, g = 34, b = 0}, post_effect_color = {a = 103, r = 84, g = 34, b = 0},
groups = {resin = 3, liquid = 3, raw_bio = 1, tree_fluid = 1}, 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(),
}) })
-- Biomass -- Biomass
minetest.register_node("elepower_farming:biomass_source", { ele.helpers.register_liquid("biomass", {
description = "Biomass Source", description = "Biomass",
drawtype = "liquid", tiles = {"elefarming_biomass.png"},
tiles = {"elefarming_biomass.png"}, special_tiles = {"elefarming_biomass.png", "elefarming_biomass.png"},
alpha = 200, alpha = 200,
paramtype = "light", liquid_viscosity = 7,
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,
post_effect_color = {a = 103, r = 0, g = 42, b = 0}, post_effect_color = {a = 103, r = 0, g = 42, b = 0},
groups = {biomass = 3, liquid = 3}, 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(),
}) })
-- Biofuel -- Biofuel
minetest.register_node("elepower_farming:biofuel_source", { ele.helpers.register_liquid("biofuel", {
description = "Biofuel Source", description = "Biofuel",
drawtype = "liquid", tiles = {"elefarming_biofuel.png"},
tiles = {"elefarming_biofuel.png"}, special_tiles = {"elefarming_biofuel.png", "elefarming_biofuel.png"},
alpha = 200, alpha = 200,
paramtype = "light", liquid_viscosity = 7,
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,
post_effect_color = {a = 103, r = 255, g = 163, b = 0}, post_effect_color = {a = 103, r = 255, g = 163, b = 0},
groups = {biofuel = 3, liquid = 3}, 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(),
}) })
-- Sludge -- Sludge
minetest.register_node("elepower_farming:sludge_source", { ele.helpers.register_liquid("sludge", {
description = "Sludge Source", description = "Sludge",
drawtype = "liquid", tiles = {"elefarming_tar.png"},
tiles = {"elefarming_tar.png"}, special_tiles = {"elefarming_tar.png", "elefarming_tar.png"},
paramtype = "light", liquid_viscosity = 8,
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,
post_effect_color = {a = 50, r = 0, g = 0, b = 0}, post_effect_color = {a = 50, r = 0, g = 0, b = 0},
groups = {sludge = 3, liquid = 3}, 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(),
}) })
if minetest.get_modpath("bucket") ~= nil then if minetest.get_modpath("bucket") ~= nil then

View File

@ -41,10 +41,9 @@ ele.register_gas(nil, "Helium Plasma", "elepower_nuclear:helium_plasma")
------------- -------------
-- Heavy Water -- Heavy Water
minetest.register_node("elepower_nuclear:heavy_water_source", { ele.helpers.register_liquid("heavy_water", {
description = "Heavy Water Source", description = "Heavy Water",
drawtype = "liquid", tiles_source = {
tiles = {
{ {
name = "elenuclear_heavy_water_source_animated.png", name = "elenuclear_heavy_water_source_animated.png",
animation = { animation = {
@ -55,40 +54,7 @@ minetest.register_node("elepower_nuclear:heavy_water_source", {
}, },
}, },
}, },
special_tiles = { tiles_flowing = {"elenuclear_heavy_water.png"},
{
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"},
special_tiles = { special_tiles = {
{ {
name = "elenuclear_heavy_water_flowing_animated.png", name = "elenuclear_heavy_water_flowing_animated.png",
@ -112,171 +78,91 @@ minetest.register_node("elepower_nuclear:heavy_water_flowing", {
}, },
}, },
alpha = 160, 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, liquid_viscosity = 4,
post_effect_color = {a = 103, r = 13, g = 69, b = 121}, post_effect_color = {a = 103, r = 13, g = 69, b = 121},
groups = {heavy_water = 3, liquid = 3, puts_out_fire = 1, groups = {heavy_water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
not_in_creative_inventory = 1, cools_lava = 1},
sounds = default.node_sound_water_defaults(),
}) })
-- Cold coolant -- Cold coolant
minetest.register_node("elepower_nuclear:coolant_source", { ele.helpers.register_liquid("coolant", {
description = "Cold Coolant Source", description = "Cold Coolant",
drawtype = "liquid", tiles = {"elenuclear_cold_coolant.png"},
tiles = {"elenuclear_cold_coolant.png"}, special_tiles = {"elenuclear_cold_coolant.png", "elenuclear_cold_coolant.png"},
alpha = 200, alpha = 200,
paramtype = "light", liquid_viscosity = 2,
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,
post_effect_color = {a = 128, r = 36, g = 150, b = 255}, post_effect_color = {a = 128, r = 36, g = 150, b = 255},
groups = {liquid = 3, coolant = 1}, 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(),
}) })
-- Hot coolant -- Hot coolant
minetest.register_node("elepower_nuclear:hot_coolant_source", { ele.helpers.register_liquid("hot_coolant", {
description = "Hot Coolant Source", description = "Hot Coolant",
drawtype = "liquid", tiles = {"elenuclear_hot_coolant.png"},
tiles = {"elenuclear_hot_coolant.png"}, special_tiles = {"elenuclear_hot_coolant.png", "elenuclear_hot_coolant.png"},
alpha = 200, alpha = 200,
paramtype = "light", liquid_viscosity = 2,
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,
post_effect_color = {a = 128, r = 136, g = 100, b = 158}, post_effect_color = {a = 128, r = 136, g = 100, b = 158},
groups = {liquid = 3, coolant = 1, hot = 1}, 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(),
}) })
-- Brine -- Brine
minetest.register_node("elepower_nuclear:brine_source", { ele.helpers.register_liquid("brine", {
description = "Brine Source", description = "Brine",
drawtype = "liquid", drawtype = "liquid",
tiles = {"elenuclear_brine.png"}, tiles = {"elenuclear_brine.png"},
special_tiles = {"elenuclear_brine.png"}, special_tiles = {"elenuclear_brine.png", "elenuclear_brine.png"},
alpha = 240, alpha = 240,
paramtype = "light", liquid_viscosity = 7,
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,
post_effect_color = {a = 200, r = 215, g = 221, b = 187}, 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}, groups = {brine = 3, saline = 1, liquid = 3, puts_out_fire = 1, cools_lava = 1},
sounds = default.node_sound_water_defaults(),
}) })
minetest.register_node("elepower_nuclear:brine_flowing", { -- Corium
description = "Flowing Brine",
drawtype = "flowingliquid", ele.helpers.register_liquid("corium", {
tiles = {"elenuclear_brine.png"}, description = "Corium",
special_tiles = {"elenuclear_brine.png", "elenuclear_brine.png"}, drawtype = "liquid",
alpha = 240, tiles_source = {
paramtype = "light", {
paramtype2 = "flowingliquid", name = "elenuclear_corium_source_animated.png",
walkable = false, animation = {
pointable = false, type = "vertical_frames",
diggable = false, aspect_w = 16,
buildable_to = true, aspect_h = 16,
is_ground_content = false, length = 2.0,
drop = "", },
drowning = 1, },
liquidtype = "flowing", },
liquid_alternative_flowing = "elepower_nuclear:brine_flowing", tiles_flowing = {"elenuclear_corium.png"},
liquid_alternative_source = "elepower_nuclear:brine_source", special_tiles_flowing = {
liquid_viscosity = 7, {
post_effect_color = {a = 200, r = 215, g = 221, b = 187}, name = "elenuclear_corium_flowing_animated.png",
groups = {brine = 3, saline = 1, liquid = 3, puts_out_fire = 1, backface_culling = false,
not_in_creative_inventory = 1, cools_lava = 1}, animation = {
sounds = default.node_sound_water_defaults(), 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 if minetest.get_modpath("bucket") ~= nil then
@ -301,3 +187,16 @@ if minetest.get_modpath("bucket") ~= nil then
} }
}) })
end 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,
})

View File

@ -307,8 +307,7 @@ local function reactor_core_timer(pos)
end end
if heat >= 100 then if heat >= 100 then
-- TODO: Melt minetest.set_node(pos, {name = "elepower_nuclear:corium_source"})
minetest.set_node(pos, {name = "air"})
return false return false
end end

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -111,3 +111,57 @@ function ele.helpers.state_enabled(meta, pos, state)
return false return false
end 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