1
0
Fork 0
MineClone2/mods/ITEMS/mcl_core/nodes_liquid.lua

195 lines
6.9 KiB
Lua
Raw Normal View History

2017-07-07 14:52:28 +00:00
-- Liquids: Water and lava
local S = minetest.get_translator("mcl_core")
local N = function(s) return s end
2017-07-07 14:52:28 +00:00
local WATER_ALPHA = 179
local WATER_VISC = 1
local LAVA_VISC = 7
2019-03-08 20:59:16 +00:00
local lava_death_messages = {
N("@1 melted in lava."),
N("@1 took a bath in a hot lava tub."),
N("@1 died in lava."),
N("@1 could not survive in lava."),
2019-03-08 20:59:16 +00:00
}
2017-07-07 14:52:28 +00:00
minetest.register_node("mcl_core:water_flowing", {
description = S("Flowing Water"),
2017-07-07 14:52:28 +00:00
_doc_items_create_entry = false,
2017-07-17 10:20:15 +00:00
wield_image = "default_water_flowing_animated.png^[verticalframe:64:0",
2017-07-07 14:52:28 +00:00
drawtype = "flowingliquid",
2017-07-17 10:20:15 +00:00
tiles = {"default_water_flowing_animated.png^[verticalframe:64:0"},
2017-07-07 14:52:28 +00:00
special_tiles = {
{
image="default_water_flowing_animated.png",
backface_culling=false,
2017-07-17 10:20:15 +00:00
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
2017-07-07 14:52:28 +00:00
},
{
image="default_water_flowing_animated.png",
backface_culling=true,
2017-07-17 10:20:15 +00:00
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
2017-07-07 14:52:28 +00:00
},
},
2018-01-12 01:26:12 +00:00
sounds = mcl_sounds.node_sound_water_defaults(),
2017-07-07 14:52:28 +00:00
alpha = WATER_ALPHA,
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 4,
liquidtype = "flowing",
liquid_alternative_flowing = "mcl_core:water_flowing",
liquid_alternative_source = "mcl_core:water_source",
liquid_viscosity = WATER_VISC,
liquid_range = 7,
2019-02-06 07:08:51 +00:00
post_effect_color = {a=209, r=0x03, g=0x3C, b=0x5C},
2017-07-07 14:52:28 +00:00
groups = { water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1, freezes=1, melt_around=1, dig_by_piston=1},
_mcl_blast_resistance = 500,
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
_mcl_hardness = -1,
})
minetest.register_node("mcl_core:water_source", {
description = S("Water Source"),
_doc_items_entry_name = S("Water"),
2017-07-07 14:52:28 +00:00
_doc_items_longdesc =
S("Water is abundant in oceans and also appears in a few springs in the ground. You can swim easily in water, but you need to catch your breath from time to time.").."\n"..
S([[Water interacts with lava in various ways:
When water is directly above or horizontally next to a lava source, the lava turns into obsidian.
2017-07-07 14:52:28 +00:00
When flowing water touches flowing lava either from above or horizontally, the lava turns into cobblestone.
When water is directly below lava, the water turns into stone.]]),
2017-07-07 14:52:28 +00:00
_doc_items_hidden = false,
drawtype = "liquid",
tiles = {
2017-07-17 10:20:15 +00:00
{name="default_water_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0}}
2017-07-07 14:52:28 +00:00
},
special_tiles = {
-- New-style water source material (mostly unused)
{
name="default_water_source_animated.png",
2017-07-17 10:20:15 +00:00
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0},
2017-07-07 14:52:28 +00:00
backface_culling = false,
}
},
2018-01-12 01:26:12 +00:00
sounds = mcl_sounds.node_sound_water_defaults(),
2017-07-07 14:52:28 +00:00
alpha = WATER_ALPHA,
paramtype = "light",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 4,
liquidtype = "source",
liquid_alternative_flowing = "mcl_core:water_flowing",
liquid_alternative_source = "mcl_core:water_source",
liquid_viscosity = WATER_VISC,
liquid_range = 7,
2019-02-06 07:08:51 +00:00
post_effect_color = {a=209, r=0x03, g=0x3C, b=0x5C},
2017-07-07 14:52:28 +00:00
stack_max = 64,
groups = { water=3, liquid=3, puts_out_fire=1, freezes=1, not_in_creative_inventory=1, dig_by_piston=1},
_mcl_blast_resistance = 500,
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
_mcl_hardness = -1,
})
minetest.register_node("mcl_core:lava_flowing", {
description = S("Flowing Lava"),
2017-07-07 14:52:28 +00:00
_doc_items_create_entry = false,
2017-07-17 10:20:15 +00:00
wield_image = "default_lava_flowing_animated.png^[verticalframe:64:0",
2017-07-07 14:52:28 +00:00
drawtype = "flowingliquid",
2017-07-17 10:20:15 +00:00
tiles = {"default_lava_flowing_animated.png^[verticalframe:64:0"},
2017-07-07 14:52:28 +00:00
special_tiles = {
{
image="default_lava_flowing_animated.png",
backface_culling=false,
2017-07-17 10:20:15 +00:00
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=6.6}
2017-07-07 14:52:28 +00:00
},
{
image="default_lava_flowing_animated.png",
backface_culling=true,
2017-07-17 10:20:15 +00:00
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=6.6}
2017-07-07 14:52:28 +00:00
},
},
2019-02-01 05:23:12 +00:00
paramtype = "light",
2017-07-07 14:52:28 +00:00
paramtype2 = "flowingliquid",
-- Real light level: 15 (but Minetest caps at 14)
light_source = 14,
2018-01-12 01:26:12 +00:00
sounds = mcl_sounds.node_sound_lava_defaults(),
2017-07-07 14:52:28 +00:00
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
--[[ Drowning in Minecraft deals 2 damage per second.
In Minetest, drowning damage is dealt every 2 seconds so this
translates to 4 drowning damage ]]
drowning = 4,
liquidtype = "flowing",
liquid_alternative_flowing = "mcl_core:lava_flowing",
liquid_alternative_source = "mcl_core:lava_source",
liquid_viscosity = LAVA_VISC,
liquid_renewable = false,
liquid_range = 3,
damage_per_second = 4*2,
2019-03-08 20:59:16 +00:00
_mcl_node_death_message = lava_death_messages,
2017-07-07 14:52:28 +00:00
post_effect_color = {a=255, r=208, g=73, b=10},
groups = { lava=3, liquid=2, destroys_items=1, not_in_creative_inventory=1, dig_by_piston=1},
_mcl_blast_resistance = 500,
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
_mcl_hardness = -1,
})
minetest.register_node("mcl_core:lava_source", {
description = S("Lava Source"),
2017-07-07 14:52:28 +00:00
_doc_items_entry_name = "Lava",
_doc_items_longdesc =
S("Lava is hot and rather dangerous. Don't touch it, it will hurt you a lot and it is hard to get out.").."\n"..
S("A lava source sets fire to a couple of air blocks above when they're next to a flammable block.").."\n"..
S([[Lava interacts with water various ways:
When a lava source is directly below or horizontally next to water, the lava turns into obsidian.
2017-07-07 14:52:28 +00:00
When flowing water touches flowing lava either from above or horizontally, the lava turns into cobblestone.
When lava is directly above water, the water turns into stone.]]),
2017-07-07 14:52:28 +00:00
drawtype = "liquid",
tiles = {
{name="default_lava_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}}
},
special_tiles = {
-- New-style lava source material (mostly unused)
{
name="default_lava_source_animated.png",
2017-07-17 10:20:15 +00:00
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0},
2017-07-07 14:52:28 +00:00
backface_culling = false,
}
},
-- Real light level: 15 (but Minetest caps at 14)
2019-02-01 05:23:12 +00:00
paramtype = "light",
2017-07-07 14:52:28 +00:00
light_source = 14,
2018-01-12 01:26:12 +00:00
sounds = mcl_sounds.node_sound_lava_defaults(),
2017-07-07 14:52:28 +00:00
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 4,
liquidtype = "source",
liquid_alternative_flowing = "mcl_core:lava_flowing",
liquid_alternative_source = "mcl_core:lava_source",
liquid_viscosity = LAVA_VISC,
liquid_renewable = false,
liquid_range = 3,
damage_per_second = 4*2,
2019-03-08 20:59:16 +00:00
_mcl_node_death_message = lava_death_messages,
2017-07-07 14:52:28 +00:00
post_effect_color = {a=255, r=208, g=73, b=10},
stack_max = 64,
groups = { lava=3, liquid=2, destroys_items=1, not_in_creative_inventory=1, dig_by_piston=1},
_mcl_blast_resistance = 500,
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
_mcl_hardness = -1,
})