Add charred trunk and burned branches

master
Wuzzy 2021-08-07 17:19:03 +02:00
parent e672b3a30f
commit 65b0c321f9
10 changed files with 88 additions and 17 deletions

View File

@ -36,6 +36,7 @@ local cuboids = {
{"orange_leaves", "hades_trees:orange_leaves", S("Orange Leaves")},
{"banana_leaves", "hades_trees:banana_leaves", S("Banana Leaves")},
{"canvas_leaves", "hades_trees:canvas_leaves", S("Canvas Leaves")},
{"burned_branches", "hades_trees:burned_branches", S("Burned Branches")},
}
minetest.register_node("hades_flowerpots:flower_pot", {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1,10 +1,19 @@
License:
Sourcecode: MIT License
Graphics: CC0 1.0 with one exception (see below)
Graphics: CC0 1.0 with some exceptions (see below)
The file `hades_trees_coconut.png` by VanessaE
is licensed under
CC BY-SA 4.0 <https://creativecommons.org/licenses/by-sa/4.0/>.
The files
`hades_trees_charred_tree.png`
`hades_trees_burned_branches.png`
were originally created by runs for the [saltd] mod
and modified and recolored by Wuzzy. They are licensed under
CC BY-SA 3.0 <https://creativecommons.org/licenses/by-sa/3.0/>.
See also:
http://minetest.net/

View File

@ -18,7 +18,7 @@ hades_trees.register_trunk = function(id, def)
},
is_ground_content = false,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = hades_sounds.node_sound_wood_defaults(),
sounds = def.sounds or hades_sounds.node_sound_wood_defaults(),
})
end
@ -29,7 +29,7 @@ hades_trees.register_bark = function(id, def)
tiles = {{ name = def.image, align_style = "node" }},
is_ground_content = false,
groups = { bark=1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 2 },
sounds = hades_sounds.node_sound_wood_defaults(),
sounds = def.sounds or hades_sounds.node_sound_wood_defaults(),
})
end
@ -61,21 +61,24 @@ hades_trees.register_sapling = function(id, def)
end
hades_trees.register_leaves = function(id, def)
local drop = {
max_items = 1,
items = {
{
-- player will get sapling with chance of (1/def.drop_rarity)
items = {def.drop_item},
rarity = def.drop_rarity,
},
local drop
if def.drop_item then
drop = {
max_items = 1,
items = {
{
-- player will get leaves only if they get no def.drop_item,
-- this is because max_items is 1
items = {"hades_trees:"..id},
-- player will get def.drop_item with chance of (1/def.drop_rarity)
items = {def.drop_item},
rarity = def.drop_rarity,
},
{
-- player will get leaves only if they get no def.drop_item,
-- this is because max_items is 1
items = {"hades_trees:"..id},
}
}
}
}
end
minetest.register_node("hades_trees:"..id, {
description = def.description,
drawtype = "allfaces_optional",
@ -86,7 +89,7 @@ hades_trees.register_leaves = function(id, def)
place_param2 = 1,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1, ash_fertilizer=def.ash_fertilizer, porous=1},
drop = drop,
sounds = hades_sounds.node_sound_leaves_defaults(),
sounds = def.sounds or hades_sounds.node_sound_leaves_defaults(),
})
end

View File

@ -0,0 +1,53 @@
local S = minetest.get_translator("hades_trees")
hades_trees.register_trunk("charred_tree", {
description = S("Charred Tree Trunk"),
tiles = {
"hades_trees_charred_tree_top.png",
"hades_trees_charred_tree_top.png",
"hades_trees_charred_tree.png",
},
sounds = hades_sounds.node_sound_wood_defaults({pitch=0.8}),
})
hades_trees.register_bark("charred_bark", {
description = S("Charred Bark"),
image = "hades_trees_charred_tree.png",
sounds = hades_sounds.node_sound_wood_defaults({pitch=0.8}),
})
hades_trees.register_leaves("burned_branches", {
description = S("Burned Branches"),
image = "hades_trees_burned_branches.png",
sounds = hades_sounds.node_sound_straw_defaults(),
})
minetest.register_craft({
output = "hades_core:stick 2",
recipe = {{ "hades_trees:burned_branches" }},
})
minetest.register_craft({
output = "hades_trees:charred_wood",
recipe = {{ "hades_trees:charred_tree" }},
})
minetest.register_abm({
label = "Scorch tree trunks and leaves",
nodenames = {"group:tree", "group:leaves"},
neighbors = {"group:lava"},
interval = 20,
chance = 20,
action = function(pos, node)
if minetest.get_item_group(node.name, "tree") ~= 0 then
if node.name ~= "hades_trees:charred_tree" then
node.name = "hades_trees:charred_tree"
minetest.swap_node(pos, node)
end
elseif minetest.get_item_group(node.name, "leaves") ~= 0 then
if node.name ~= "hades_trees:burned_branches" then
node.name = "hades_trees:burned_branches"
minetest.swap_node(pos, node)
end
end
end
})

View File

@ -16,6 +16,7 @@ dofile(minetest.get_modpath("hades_trees").."/orange.lua")
dofile(minetest.get_modpath("hades_trees").."/cocoa.lua")
dofile(minetest.get_modpath("hades_trees").."/coconut.lua")
dofile(minetest.get_modpath("hades_trees").."/canvas.lua")
dofile(minetest.get_modpath("hades_trees").."/charred.lua")
dofile(minetest.get_modpath("hades_trees").."/wood.lua")
dofile(minetest.get_modpath("hades_trees").."/crafting.lua")

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

View File

@ -36,11 +36,15 @@ for p=1, #planks do
if planks[p][4] then
colwood = 1
end
local s_table
if id == "charred_wood" then
s_table = {pitch=0.8}
end
minetest.register_node("hades_trees:"..id, {
description = desc,
tiles = {tile},
groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3,wood=1,colwood=colwood},
is_ground_content = false,
sounds = hades_sounds.node_sound_wood_defaults(),
sounds = hades_sounds.node_sound_wood_defaults(s_table),
})
end