Pangeos/liquids.lua

294 lines
7.0 KiB
Lua

--
-- Liquids (water, river water, lava) were nearly copied from default game with slight modifications
--
minetest.register_node("pangeos:water_source", {
drawtype = "liquid",
paramtype = "light",
tiles = {
{
name = "pangeos_water_source_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
},
special_tiles = {
-- New-style water source material (mostly unused)
{
name = "pangeos_water_source_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
backface_culling = false,
},
},
--
-- Behaviour
--
walkable = false, -- The player can't walk on the water and falls through
pointable = false, -- The player can't highlight the water
diggable = false, -- The player can't dig the water
buildable_to = true, -- Nodes can replace the water
use_texture_alpha = false,
alpha = 191, -- The water is transparent
--
-- Liquid properties
--
drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "pangeos:water_flowing",
liquid_alternative_source = "pangeos:water_source",
liquid_viscosity = 1,
liquid_range = 8,
post_effect_color = {a=64, r=100, g=100, b=200},
-- ^ color of screen when the player is submerged
groups = {water = 3, liquid = 3, not_in_creative_inventory = 1,
cools_lava = 1},
})
minetest.register_node("pangeos:water_flowing", {
description = "Flowing Water",
drawtype = "flowingliquid",
waving = 3,
tiles = {"pangeos_water.png"},
special_tiles = {
{
name = "pangeos_water_flowing_animated.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 0.5,
},
},
{
name = "pangeos_water_flowing_animated.png",
backface_culling = true,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 0.5,
},
},
},
alpha = 191,
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 = "pangeos:water_flowing",
liquid_alternative_source = "pangeos:water_source",
liquid_viscosity = 1,
post_effect_color = {a = 103, r = 30, g = 60, b = 90},
groups = {water = 3, liquid = 3, not_in_creative_inventory = 1,
cools_lava = 1},
--s = pangeos.node_sound_water_pangeoss(),
})
minetest.register_node("pangeos:river_water_source", {
description = "River Water Source",
drawtype = "liquid",
tiles = {
{
name = "pangeos_river_water_source_animated.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
{
name = "pangeos_river_water_source_animated.png",
backface_culling = true,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
},
alpha = 191,
paramtype = "light",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drop = "",
drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "pangeos:river_water_flowing",
liquid_alternative_source = "pangeos:river_water_source",
liquid_viscosity = 1,
-- Not renewable to avoid horizontal spread of water sources in sloping
-- rivers that can cause water to overflow riverbanks and cause floods.
-- River water source is instead made renewable by the 'force renew'
-- option used in the 'bucket' mod by the river water bucket.
liquid_renewable = false,
liquid_range = 2,
post_effect_color = {a = 103, r = 30, g = 76, b = 90},
groups = {water = 3, liquid = 3, cools_lava = 1},
--sounds = pangeos.node_sound_water_pangeoss(),
})
minetest.register_node("pangeos:river_water_flowing", {
description = "Flowing River Water",
drawtype = "flowingliquid",
tiles = {"pangeos_river_water.png"},
special_tiles = {
{
name = "pangeos_river_water_flowing_animated.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 0.5,
},
},
{
name = "pangeos_river_water_flowing_animated.png",
backface_culling = true,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 0.5,
},
},
},
alpha = 191,
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 = "pangeos:river_water_flowing",
liquid_alternative_source = "pangeos:river_water_source",
liquid_viscosity = 1,
liquid_renewable = false,
liquid_range = 2,
post_effect_color = {a = 103, r = 30, g = 76, b = 90},
groups = {water = 3, liquid = 3, not_in_creative_inventory = 1,
cools_lava = 1},
--sounds = pangeos.node_sound_water_pangeoss(),
})
minetest.register_node("pangeos:lava_source", {
description = "Lava Source",
drawtype = "liquid",
tiles = {
{
name = "pangeos_lava_source_animated.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 3.0,
},
},
{
name = "pangeos_lava_source_animated.png",
backface_culling = true,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 3.0,
},
},
},
paramtype = "light",
light_source = 14,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drop = "",
drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "pangeos:lava_flowing",
liquid_alternative_source = "pangeos:lava_source",
liquid_viscosity = 7,
liquid_renewable = false,
damage_per_second = 4 * 2,
post_effect_color = {a = 191, r = 255, g = 64, b = 0},
groups = {lava = 3, liquid = 2, igniter = 1},
})
minetest.register_node("pangeos:lava_flowing", {
description = "Flowing Lava",
drawtype = "flowingliquid",
tiles = {"pangeos_lava.png"},
special_tiles = {
{
name = "pangeos_lava_flowing_animated.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 3.3,
},
},
{
name = "pangeos_lava_flowing_animated.png",
backface_culling = true,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 3.3,
},
},
},
paramtype = "light",
paramtype2 = "flowingliquid",
light_source = 14,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drop = "",
drowning = 1,
liquidtype = "flowing",
liquid_alternative_flowing = "pangeos:lava_flowing",
liquid_alternative_source = "pangeos:lava_source",
liquid_viscosity = 7,
liquid_renewable = false,
damage_per_second = 4 * 2,
post_effect_color = {a = 191, r = 255, g = 64, b = 0},
groups = {lava = 3, liquid = 2, igniter = 1,
not_in_creative_inventory = 1},
})