Modpack refactor (#4)

Split this mod into a set of sub-mods in a modpack, and in the process did a whole bunch of renovations.

* updated Subterrane's API to allow for more patterned placement of things
* added "warrens"
* clean separation of flooded and non-flooded caverns
* rearranged biomes to make cavern layers more distinct
* added oil layer
* added underworld layer
This commit is contained in:
FaceDeer
2018-12-31 11:46:27 -07:00
committed by GitHub
parent 24c955dbd4
commit 882395ef75
355 changed files with 9514 additions and 5396 deletions

26
df_trees/LICENSE.txt Normal file
View File

@ -0,0 +1,26 @@
Dwarf Fortress is copyright 2018 by Tarn Adams. This mod uses no assets or other copyrighted materials from Dwarf Fortress.
Sounds and textures are under various licenses, see the license.txt file in the /sounds and /textures directories for details.
License for Code
----------------
Copyright (C) 2018 FaceDeer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

44
df_trees/aliases.lua Normal file
View File

@ -0,0 +1,44 @@
minetest.register_alias("dfcaverns:black_cap" , "df_trees:black_cap" )
minetest.register_alias("dfcaverns:black_cap_gills" , "df_trees:black_cap_gills" )
minetest.register_alias("dfcaverns:black_cap_sapling" , "df_trees:black_cap_sapling" )
minetest.register_alias("dfcaverns:black_cap_stem" , "df_trees:black_cap_stem" )
minetest.register_alias("dfcaverns:black_cap_wood" , "df_trees:black_cap_wood" )
minetest.register_alias("dfcaverns:blood_thorn" , "df_trees:blood_thorn" )
minetest.register_alias("dfcaverns:blood_thorn_dead" , "df_trees:blood_thorn_dead" )
minetest.register_alias("dfcaverns:blood_thorn_spike" , "df_trees:blood_thorn_spike" )
minetest.register_alias("dfcaverns:blood_thorn_spike_dead" , "df_trees:blood_thorn_spike_dead" )
minetest.register_alias("dfcaverns:blood_thorn_wood" , "df_trees:blood_thorn_wood" )
minetest.register_alias("dfcaverns:fungiwood" , "df_trees:fungiwood" )
minetest.register_alias("dfcaverns:fungiwood_sapling" , "df_trees:fungiwood_sapling" )
minetest.register_alias("dfcaverns:fungiwood_shelf" , "df_trees:fungiwood_shelf" )
minetest.register_alias("dfcaverns:fungiwood_wood" , "df_trees:fungiwood_wood" )
minetest.register_alias("dfcaverns:goblin_cap" , "df_trees:goblin_cap" )
minetest.register_alias("dfcaverns:goblin_cap_gills" , "df_trees:goblin_cap_gills" )
minetest.register_alias("dfcaverns:goblin_cap_sapling" , "df_trees:goblin_cap_sapling" )
minetest.register_alias("dfcaverns:goblin_cap_stem" , "df_trees:goblin_cap_stem" )
minetest.register_alias("dfcaverns:goblin_cap_stem_wood" , "df_trees:goblin_cap_stem_wood" )
minetest.register_alias("dfcaverns:goblin_cap_wood" , "df_trees:goblin_cap_wood" )
minetest.register_alias("dfcaverns:nether_cap" , "df_trees:nether_cap" )
minetest.register_alias("dfcaverns:nether_cap_gills" , "df_trees:nether_cap_gills" )
minetest.register_alias("dfcaverns:nether_cap_sapling" , "df_trees:nether_cap_sapling" )
minetest.register_alias("dfcaverns:nether_cap_stem" , "df_trees:nether_cap_stem" )
minetest.register_alias("dfcaverns:nether_cap_wood" , "df_trees:nether_cap_wood" )
minetest.register_alias("dfcaverns:spore_tree" , "df_trees:spore_tree" )
minetest.register_alias("dfcaverns:spore_tree_fruiting_body" , "df_trees:spore_tree_fruiting_body" )
minetest.register_alias("dfcaverns:spore_tree_hyphae" , "df_trees:spore_tree_hyphae" )
minetest.register_alias("dfcaverns:spore_tree_ladder" , "df_trees:spore_tree_ladder" )
minetest.register_alias("dfcaverns:spore_tree_sapling" , "df_trees:spore_tree_sapling" )
minetest.register_alias("dfcaverns:spore_tree_wood" , "df_trees:spore_tree_wood" )
minetest.register_alias("dfcaverns:tower_cap" , "df_trees:tower_cap" )
minetest.register_alias("dfcaverns:tower_cap_gills" , "df_trees:tower_cap_gills" )
minetest.register_alias("dfcaverns:tower_cap_sapling" , "df_trees:tower_cap_sapling" )
minetest.register_alias("dfcaverns:tower_cap_stem" , "df_trees:tower_cap_stem" )
minetest.register_alias("dfcaverns:tower_cap_wood" , "df_trees:tower_cap_wood" )
minetest.register_alias("dfcaverns:tunnel_tube" , "df_trees:tunnel_tube" )
minetest.register_alias("dfcaverns:tunnel_tube_fruiting_body" , "df_trees:tunnel_tube_fruiting_body" )
minetest.register_alias("dfcaverns:tunnel_tube_fruiting_body_burning", "df_trees:tunnel_tube_fruiting_body_burning")
minetest.register_alias("dfcaverns:tunnel_tube_sapling" , "df_trees:tunnel_tube_sapling" )
minetest.register_alias("dfcaverns:tunnel_tube_slant_bottom" , "df_trees:tunnel_tube_slant_bottom" )
minetest.register_alias("dfcaverns:tunnel_tube_slant_full" , "df_trees:tunnel_tube_slant_full" )
minetest.register_alias("dfcaverns:tunnel_tube_slant_top" , "df_trees:tunnel_tube_slant_top" )
minetest.register_alias("dfcaverns:tunnel_tube_wood" , "df_trees:tunnel_tube_wood" )

189
df_trees/black_cap.lua Normal file
View File

@ -0,0 +1,189 @@
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--stem
minetest.register_node("df_trees:black_cap_stem", {
description = S("Black Cap Stem"),
_doc_items_longdesc = df_trees.doc.black_cap_desc,
_doc_items_usagehelp = df_trees.doc.black_cap_usage,
tiles = {"dfcaverns_black_cap_top.png","dfcaverns_black_cap_top.png","dfcaverns_black_cap_side.png",},
is_ground_content = true,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
})
--cap
minetest.register_node("df_trees:black_cap", {
description = S("Black Cap"),
_doc_items_longdesc = df_trees.doc.black_cap_desc,
_doc_items_usagehelp = df_trees.doc.black_cap_usage,
tiles = {"dfcaverns_black_cap_top.png","dfcaverns_black_cap_top.png","dfcaverns_black_cap_side.png^[transformR90",},
is_ground_content = true,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
})
--gills
minetest.register_node("df_trees:black_cap_gills", {
description = S("Black Cap Gills"),
_doc_items_longdesc = df_trees.doc.black_cap_desc,
_doc_items_usagehelp = df_trees.doc.black_cap_usage,
tiles = {"dfcaverns_black_cap_gills.png"},
is_ground_content = true,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
sounds = default.node_sound_leaves_defaults(),
drawtype = "plantlike",
paramtype = "light",
drop = {
max_items = 1,
items = {
{
items = {'df_trees:black_cap_sapling', 'df_trees:black_cap_gills'},
rarity = 5,
},
{
items = {'df_trees:black_cap_gills'},
}
}
},
after_place_node = default.after_place_leaves,
})
if default.register_leafdecay then -- default.register_leafdecay is very new, remove this check some time after 0.4.16 is released
default.register_leafdecay({
trunks = {"df_trees:black_cap"}, -- don't need stem nodes here
leaves = {"df_trees:black_cap_gills"},
radius = 1,
})
end
-- Wood
minetest.register_craft({
output = 'df_trees:black_cap_wood 4',
recipe = {
{'df_trees:black_cap'},
}
})
minetest.register_craft({
output = 'df_trees:black_cap_wood 4',
recipe = {
{'df_trees:black_cap_stem'},
}
})
minetest.register_craft({
output = 'default:torch 8',
recipe = {
{'df_trees:black_cap_gills'},
{'group:stick'},
}
})
minetest.register_node("df_trees:black_cap_wood", {
description = S("Black Cap Planks"),
_doc_items_longdesc = df_trees.doc.black_cap_desc,
_doc_items_usagehelp = df_trees.doc.black_cap_usage,
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"dfcaverns_black_cap_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
df_trees.register_all_stairs("black_cap_wood")
minetest.register_craft({
type = "fuel",
recipe = "df_trees:black_cap_wood",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:black_cap",
burntime = 120,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:black_cap_stem",
burntime = 120,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:black_cap_gills",
burntime = 6,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:black_cap_sapling",
burntime = 6,
})
-- sapling
minetest.register_node("df_trees:black_cap_sapling", {
description = S("Black Cap Spawn"),
_doc_items_longdesc = df_trees.doc.black_cap_desc,
_doc_items_usagehelp = df_trees.doc.black_cap_usage,
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"dfcaverns_black_cap_sapling.png"},
inventory_image = "dfcaverns_black_cap_sapling.png",
wield_image = "dfcaverns_black_cap_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
floodable = true,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1, light_sensitive_fungus = 11},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(
df_trees.config.black_cap_delay_multiplier*df_trees.config.tree_min_growth_delay,
df_trees.config.black_cap_delay_multiplier*df_trees.config.tree_max_growth_delay))
end,
on_timer = function(pos)
minetest.set_node(pos, {name="air"})
df_trees.spawn_black_cap(pos)
end,
})
local c_stem = minetest.get_content_id("df_trees:black_cap_stem")
local c_cap = minetest.get_content_id("df_trees:black_cap")
local c_gills = minetest.get_content_id("df_trees:black_cap_gills")
df_trees.spawn_black_cap = function(pos)
local x, y, z = pos.x, pos.y, pos.z
local stem_height = math.random(1,5)
local cap_radius = math.random(2,3)
local maxy = y + stem_height + 3
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map(
{x = x - cap_radius, y = y, z = z - cap_radius},
{x = x + cap_radius, y = maxy + 3, z = z + cap_radius}
)
local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
subterrane.giant_mushroom(area:indexp(pos), area, data, c_stem, c_cap, c_gills, stem_height, cap_radius)
vm:set_data(data)
vm:write_to_map()
vm:update_map()
end
df_trees.spawn_black_cap_vm = function(vi, area, data)
local stem_height = math.random(1,5)
local cap_radius = math.random(2,3)
subterrane.giant_mushroom(vi, area, data, c_stem, c_cap, c_gills, stem_height, cap_radius)
end

295
df_trees/blood_thorn.lua Normal file
View File

@ -0,0 +1,295 @@
--------------------------------------------------
-- Blood thorn
-- Max trunk height 5
-- red with purple mottling
-- High density wood
-- Depth 3
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local spike_directions = {
{dir={x=0,y=0,z=1}, facedir=2},
{dir={x=0,y=0,z=-1}, facedir=0},
{dir={x=1,y=0,z=0}, facedir=3},
{dir={x=-1,y=0,z=0}, facedir=1}
}
local spikes = {["df_trees:blood_thorn_spike"] = true, ["df_trees:blood_thorn_spike_dead"] = true}
local blood_thorn_after_dig = function(pos, oldnode, oldmetadata, digger)
for _, spike_dir in pairs(spike_directions) do
local loc = vector.add(pos,spike_dir.dir)
local node = minetest.get_node(loc)
if spikes[node.name] and spike_dir.facedir == node.param2 then
minetest.node_dig(loc, node, digger)
end
end
end
minetest.register_node("df_trees:blood_thorn", {
description = S("Blood Thorn Stem"),
_doc_items_longdesc = df_trees.doc.blood_thorn_desc,
_doc_items_usagehelp = df_trees.doc.blood_thorn_usage,
tiles = {"dfcaverns_blood_thorn_top.png", "dfcaverns_blood_thorn_top.png",
"dfcaverns_blood_thorn_side.png", "dfcaverns_blood_thorn_side.png", "dfcaverns_blood_thorn_side.png", "dfcaverns_blood_thorn_side.png"},
paramtype2 = "facedir",
paramtype = "light",
groups = {choppy = 3, tree = 1, flammable = 2, light_sensitive_fungus = 11},
_dfcaverns_dead_node = "df_trees:blood_thorn_dead",
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
after_dig_node = blood_thorn_after_dig,
})
minetest.register_node("df_trees:blood_thorn_dead", {
description = S("Dead Blood Thorn Stem"),
_doc_items_longdesc = df_trees.doc.blood_thorn_desc,
_doc_items_usagehelp = df_trees.doc.blood_thorn_usage,
tiles = {"dfcaverns_blood_thorn_top.png^[multiply:#804000", "dfcaverns_blood_thorn_top.png^[multiply:#804000",
"dfcaverns_blood_thorn_side.png^[multiply:#804000"},
paramtype2 = "facedir",
paramtype = "light",
groups = {choppy = 3, tree = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
after_dig_node = blood_thorn_after_dig,
})
minetest.register_node("df_trees:blood_thorn_spike", {
description = S("Blood Thorn Spike"),
_doc_items_longdesc = df_trees.doc.blood_thorn_spike_desc,
_doc_items_usagehelp = df_trees.doc.blood_thorn_spike_usage,
tiles = {
"dfcaverns_blood_thorn_spike_side.png^[transformR90",
"dfcaverns_blood_thorn_spike_side.png^[transformR270",
"dfcaverns_blood_thorn_spike_side.png",
"dfcaverns_blood_thorn_spike_side.png^[transformR180",
"dfcaverns_blood_thorn_spike_front.png",
"dfcaverns_blood_thorn_spike_front.png"
},
groups = {choppy = 3, flammable = 2, fall_damage_add_percent=100, light_sensitive_fungus = 11},
_dfcaverns_dead_node = "df_trees:blood_thorn_spike_dead",
sounds = default.node_sound_wood_defaults(),
drawtype = "nodebox",
climbable = true,
damage_per_second = 1,
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.1875, -0.1875, 0.1875, 0.1875, 0.1875, 0.5}, -- base
{-0.125, -0.125, -0.125, 0.125, 0.125, 0.1875}, -- mid
{-0.0625, -0.0625, -0.5, 0.0625, 0.0625, -0.125}, -- tip
}
},
})
minetest.register_node("df_trees:blood_thorn_spike_dead", {
description = S("Dead Blood Thorn Spike"),
_doc_items_longdesc = df_trees.doc.blood_thorn_spike_desc,
_doc_items_usagehelp = df_trees.doc.blood_thorn_spike_usage,
tiles = {
"dfcaverns_blood_thorn_spike_side.png^[transformR90^[multiply:#804000",
"dfcaverns_blood_thorn_spike_side.png^[transformR270^[multiply:#804000",
"dfcaverns_blood_thorn_spike_side.png^[multiply:#804000",
"dfcaverns_blood_thorn_spike_side.png^[transformR180^[multiply:#804000",
"dfcaverns_blood_thorn_spike_front.png^[multiply:#804000",
"dfcaverns_blood_thorn_spike_front.png^[multiply:#804000"
},
groups = {choppy = 3, flammable = 2, fall_damage_add_percent=100},
sounds = default.node_sound_wood_defaults(),
drawtype = "nodebox",
climbable = true,
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.1875, -0.1875, 0.1875, 0.1875, 0.1875, 0.5}, -- base
{-0.125, -0.125, -0.125, 0.125, 0.125, 0.1875}, -- mid
{-0.0625, -0.0625, -0.5, 0.0625, 0.0625, -0.125}, -- tip
}
},
})
--Wood
minetest.register_craft({
output = 'df_trees:blood_thorn_wood 4',
recipe = {
{'df_trees:blood_thorn'},
}
})
minetest.register_craft({
output = 'df_trees:blood_thorn_wood 4',
recipe = {
{'df_trees:blood_thorn_dead'},
}
})
minetest.register_node("df_trees:blood_thorn_wood", {
description = S("Blood Thorn Planks"),
_doc_items_longdesc = df_trees.doc.blood_thorn_desc,
_doc_items_usagehelp = df_trees.doc.blood_thorn_usage,
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"dfcaverns_blood_thorn_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
df_trees.register_all_stairs("blood_thorn_wood")
minetest.register_craft({
type = "fuel",
recipe = "df_trees:blood_thorn_wood",
burntime = 40,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:blood_thorn",
burntime = 150,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:blood_thorn_dead",
burntime = 120,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:blood_thorn_spike",
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:blood_thorn_spike_dead",
burntime = 5,
})
-- This ensures consistent random maximum to bloodthorn growth
local max_bloodthorn_height = function(pos)
local next_seed = math.random(1, 1000000000)
math.randomseed(pos.x + pos.z * 2 ^ 8)
local output = math.random(3,6)
math.randomseed(next_seed)
return output
end
function df_trees.grow_blood_thorn(pos, node)
if node.param2 >= 4 then
return
end
pos.y = pos.y - 1
if minetest.get_item_group(minetest.get_node(pos).name, "sand") == 0 then
return
end
pos.y = pos.y + 1
local height = 0
local max_height = max_bloodthorn_height(pos)
while node.name == "df_trees:blood_thorn" and height < max_height do
height = height + 1
pos.y = pos.y + 1
node = minetest.get_node(pos)
end
if height == 7 or node.name ~= "air" then
return
end
minetest.set_node(pos, {name = "df_trees:blood_thorn"})
local dir = spike_directions[math.random(1,4)]
local spike_pos = vector.add(pos, dir.dir)
if minetest.get_node(spike_pos).name == "air" then
minetest.set_node(spike_pos, {name="df_trees:blood_thorn_spike", param2=dir.facedir})
end
dir = spike_directions[math.random(1,4)]
spike_pos = vector.add(pos, dir.dir)
if minetest.get_node(spike_pos).name == "air" then
minetest.set_node(spike_pos, {name="df_trees:blood_thorn_spike", param2=dir.facedir})
end
return true
end
minetest.register_abm({
label = "Grow Blood Thorn",
nodenames = {"df_trees:blood_thorn"},
catch_up = true,
interval = df_trees.config.blood_thorn_growth_interval,
chance = df_trees.config.blood_thorn_growth_chance,
action = function(pos, node)
df_trees.grow_blood_thorn(pos, node)
end
})
function df_trees.spawn_blood_thorn(pos)
local height = max_bloodthorn_height(pos)
local x, y, z = pos.x, pos.y, pos.z
local maxy = y + height -- Trunk top
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map(
{x = x - 1, y = y, z = z - 1},
{x = x + 1, y = maxy, z = z + 1}
)
local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
local data_param2 = vm:get_param2_data()
df_trees.spawn_blood_thorn_vm(area:indexp(pos), area, data, data_param2, height)
vm:set_data(data)
vm:set_param2_data(data_param2)
vm:write_to_map()
vm:update_map()
end
local c_air = minetest.get_content_id("air")
local c_ignore = minetest.get_content_id("ignore")
local c_blood_thorn = minetest.get_content_id("df_trees:blood_thorn")
local c_blood_thorn_spike = minetest.get_content_id("df_trees:blood_thorn_spike")
local facedir_to_increment = function(direction, area)
if direction == 0 then
return -area.zstride
elseif direction == 1 then
return -1
elseif direction == 2 then
return area.zstride
elseif direction == 3 then
return 1
end
end
df_trees.spawn_blood_thorn_vm = function(vi, area, data, data_param2, height)
local pos = area:position(vi)
if height == nil then height = max_bloodthorn_height(pos) end
for i = 1, height do
local node_id = data[vi]
if node_id == c_air or node_id == c_ignore then
data[vi] = c_blood_thorn
for i = 1, 2 do
local facedir = math.random(1,4)-1
local spike_vi = vi + facedir_to_increment(facedir, area)
if data[spike_vi] == c_air or data[spike_vi] == c_ignore then
data[spike_vi] = c_blood_thorn_spike
data_param2[spike_vi] = facedir
end
end
else
break
end
vi = vi + area.ystride
end
end

54
df_trees/config.lua Normal file
View File

@ -0,0 +1,54 @@
local CONFIG_FILE_PREFIX = "dfcaverns_"
df_trees.config = {}
local print_settingtypes = false
local function setting(stype, name, default, description)
local value
if stype == "bool" then
value = minetest.setting_getbool(CONFIG_FILE_PREFIX..name)
elseif stype == "string" then
value = minetest.setting_get(CONFIG_FILE_PREFIX..name)
elseif stype == "int" or stype == "float" then
value = tonumber(minetest.setting_get(CONFIG_FILE_PREFIX..name))
end
if value == nil then
value = default
end
df_trees.config[name] = value
if print_settingtypes then
minetest.debug(CONFIG_FILE_PREFIX..name.." ("..description..") "..stype.." "..tostring(default))
end
end
local trees = {
{name="fungiwood", delay_multiplier = 1},
{name="tunnel_tube", delay_multiplier = 1},
{name="spore_tree", delay_multiplier = 1},
{name="black_cap", delay_multiplier = 1},
{name="nether_cap", delay_multiplier = 1},
{name="goblin_cap", delay_multiplier = 1},
{name="tower_cap", delay_multiplier = 1},
}
--Trees
setting("int", "tree_min_growth_delay", 2400, "Minimum sapling growth delay")
setting("int", "tree_max_growth_delay", 4800, "Maximum sapling growth delay")
for _, tree in pairs(trees) do
setting("float", tree.name.."_delay_multiplier", tree.delay_multiplier, tree.name.." growth delay multiplier")
end
setting("int", "blood_thorn_growth_interval", 12, "blood_thorn growth ABM interval")
setting("int", "blood_thorn_growth_chance", 83, "blood_thorn growth ABM chance")
if minetest.get_modpath("tnt") then
df_trees.config.enable_tnt = minetest.settings:get_bool("enable_tnt")
if df_trees.config.enable_tnt == nil then
-- Default to enabled when in singleplayer
df_trees.config.enable_tnt = minetest.is_singleplayer()
end
end

5
df_trees/depends.txt Normal file
View File

@ -0,0 +1,5 @@
default
intllib?
doc?
moreblocks?
stairs?

1
df_trees/description.txt Normal file
View File

@ -0,0 +1 @@
Adds various types of underground fungal "trees". Light kills their saplings, they only grow in the dark.

43
df_trees/doc.lua Normal file
View File

@ -0,0 +1,43 @@
df_trees.doc = {}
if not minetest.get_modpath("doc") then
return
end
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
-- Trees
df_trees.doc.black_cap_desc = S("The dense black wood of these mushrooms is heavy and hard to work with, and has few remarkable properties.")
df_trees.doc.black_cap_usage = S("Aside from the artistic applications of its particularly dark color, black cap wood is a long-burning fuel source that's as good as coal for some applications. Black cap gills are oily and make for excellent torch fuel.")
df_trees.doc.blood_thorn_desc = S("Blood thorns are the most vicious of underground flora, as befits their harsh environments. Found only in hot, dry caverns with sandy soil far from the surface world's organic bounty, blood thorns seek to supplement their nutrient supply with wickedly barbed hollow spines that actively drain fluids from whatever stray plant or creature they might impale.")
df_trees.doc.blood_thorn_usage = S("When harvested, the central stalk of a blood thorn can be cut into planks and used as wood. It has a purple-red hue that may or may not appeal, depending on one's artistic tastes.")
df_trees.doc.blood_thorn_spike_desc = S("The spikes of a blood thorn can actually remain living long after they're severed from their parent stalk, a testament to their tenacity. As long as they remain alive they will continue to actively drain anything they puncture, though they don't grow.")
df_trees.doc.blood_thorn_spike_usage = S("Living blood thorn spikes remain harmful to creatures that touch them. If killed by bright light, they cause only passive damage to creatures that fall on them (as one would expect from an enormous spike).")
df_trees.doc.fungiwood_desc = S("Thin, irregular layers of spore-producing 'shelves' surround the strong central stalk of the mighty Fungiwood.")
df_trees.doc.fungiwood_usage = S("Fungiwood stalk is strong and very fine-grained, making smooth yellow-tinted lumber when cut. Fungiwood shelf is too fragile to be much use as anything other than fuel.")
df_trees.doc.goblin_cap_desc = S("Massive but squat, mature goblin cap mushrooms are the size of small cottages.")
df_trees.doc.goblin_cap_usage = S("Goblin cap stem and cap material can be cut into wood of two different hues, a subdued cream and a bright orange-red.")
df_trees.doc.nether_cap_desc = S("Nether caps have an unusual biochemistry that allows them to somehow subsist on ambient heat, in violation of all known laws of thermodynamics. They grow deep underground in frigid, icy caverns that should by all rights be volcanic.")
df_trees.doc.nether_cap_usage = S("Nether cap wood, in addition to being a beautiful blue hue, retains the odd heat-draining ability of living nether caps and is able to quickly freeze nearby water solid.")
df_trees.doc.spore_tree_desc = S("Spore trees have a sturdy 'trunk' that supports a large spongy mesh of branching fibers, with embedded fruiting bodies that produce a copious amount of spores that gently rain down around the spore tree's base.")
df_trees.doc.spore_tree_usage = S("Spore tree trunks can be cut into pale woody planks. The branching fibers and fruiting bodies are only useful as fuel.")
df_trees.doc.tower_cap_desc = S("The king of the fungi, tower cap mushrooms grow to immense proportions.")
df_trees.doc.tower_cap_usage = S("Tower caps are an excellent source of wood.")
df_trees.doc.tunnel_tube_desc = S("Tunnel tubes are hollow, curved fungal growths that support a fruiting body.")
if df_trees.config.enable_tnt then
df_trees.doc.tunnel_tube_usage = S("The trunk of a tunnel tube can be cut and processed to produce plywood-like material. The fruiting body accumulates high-energy compounds that, when ignited, produce a vigorous detonation - a unique adaptation for spreading tunnel tube spawn through the still cavern air.")
else
df_trees.doc.tunnel_tube_usage = S("The trunk of a tunnel tube can be cut and processed to produce plywood-like material.")
end
df_trees.doc.torchspine_desc = S("Torchspines are strange organic formations that are alive only in a technical sense. They \"feed\" on volatile flammable vapors vented up through their structure, growing from combustion residue deposited at their tips.")
df_trees.doc.torchspine_usage = S("A torchspine alternates between active and quiescent phases and emits dim light when active. They can be harvested for torches, and their embers sprout into new torchspines when placed on flammable surfaces.")

224
df_trees/fungiwood.lua Normal file
View File

@ -0,0 +1,224 @@
--------------------------------------------------
-- Fungiwood
-- fine grain
-- Max trunk height 8
-- depth 1-2
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
minetest.register_node("df_trees:fungiwood", {
description = S("Fungiwood Stem"),
_doc_items_longdesc = df_trees.doc.fungiwood_desc,
_doc_items_usagehelp = df_trees.doc.fungiwood_usage,
tiles = {"dfcaverns_fungiwood.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
--Wood
minetest.register_craft({
output = 'df_trees:fungiwood_wood 4',
recipe = {
{'df_trees:fungiwood'},
}
})
minetest.register_node("df_trees:fungiwood_wood", {
description = S("Fungiwood Planks"),
_doc_items_longdesc = df_trees.doc.fungiwood_desc,
_doc_items_usagehelp = df_trees.doc.fungiwood_usage,
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"dfcaverns_fungiwood_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
df_trees.register_all_stairs("fungiwood_wood")
minetest.register_craft({
type = "fuel",
recipe = "df_trees:fungiwood_wood",
burntime = 7,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:fungiwood",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:fungiwood_shelf",
burntime = 3,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:fungiwood_sapling",
burntime = 2,
})
minetest.register_node("df_trees:fungiwood_shelf",{
description = S("Fungiwood Shelf"),
_doc_items_longdesc = df_trees.doc.fungiwood_desc,
_doc_items_usagehelp = df_trees.doc.fungiwood_usage,
tiles = {"dfcaverns_fungiwood.png", "dfcaverns_fungiwood_shelf_underside.png", "dfcaverns_fungiwood.png"},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5, 0.375, -0.5, 0.5, 0.5, 0.5}, -- NodeBox1
{-0.5, 0.3125, -0.0625, 0.5, 0.375, 0.0625}, -- NodeBox2
{-0.0625, 0.3125, -0.5, 0.0625, 0.375, 0.5}, -- NodeBox3
}
},
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {"df_trees:fungiwood_sapling"}, rarity = 10},
{items = {"df_trees:fungiwood_shelf"}}
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
})
if default.register_leafdecay then -- default.register_leafdecay is very new, remove this check some time after 0.4.16 is released
default.register_leafdecay({
trunks = {"df_trees:fungiwood"},
leaves = {"df_trees:fungiwood_shelf"},
radius = 5,
})
end
minetest.register_node("df_trees:fungiwood_sapling", {
description = S("Fungiwood Spawn"),
_doc_items_longdesc = df_trees.doc.fungiwood_desc,
_doc_items_usagehelp = df_trees.doc.fungiwood_usage,
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"dfcaverns_fungiwood_sapling.png"},
inventory_image = "dfcaverns_fungiwood_sapling.png",
wield_image = "dfcaverns_fungiwood_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
floodable = true,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1, light_sensitive_fungus = 11},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(
df_trees.config.fungiwood_delay_multiplier*df_trees.config.tree_min_growth_delay,
df_trees.config.fungiwood_delay_multiplier*df_trees.config.tree_max_growth_delay))
end,
on_timer = function(pos)
minetest.set_node(pos, {name="air"})
df_trees.spawn_fungiwood(pos)
end,
})
local c_air = minetest.get_content_id("air")
local c_ignore = minetest.get_content_id("ignore")
local c_fungiwood = minetest.get_content_id("df_trees:fungiwood")
local c_fungiwood_shelf = minetest.get_content_id("df_trees:fungiwood_shelf")
function df_trees.spawn_fungiwood(pos)
local x, y, z = pos.x, pos.y, pos.z
local height = math.random(6, 10)
local maxy = y + height -- Trunk top
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map(
{x = x - 3, y = y, z = z - 3},
{x = x + 3, y = maxy, z = z + 3}
)
local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
df_trees.spawn_fungiwood_vm(area:indexp(pos), area, data, height)
vm:set_data(data)
vm:write_to_map()
vm:update_map()
end
df_trees.spawn_fungiwood_vm = function(vi, area, data, height)
if height == nil then height = math.random(6, 10) end
local pos = area:position(vi)
local x = pos.x
local y = pos.y
local z = pos.z
local maxy = y + height -- Trunk top
-- Upper branches layer
local dev = 3
for yy = maxy - 2, maxy do
for zz = z - dev, z + dev do
local vi = area:index(x - dev, yy, zz)
local via = area:index(x - dev, yy + 1, zz)
for xx = x - dev, x + dev do
if math.random() < 0.95 - dev * 0.05 then
local node_id = data[vi]
if node_id == c_air or node_id == c_ignore then
data[vi] = c_fungiwood_shelf
end
end
vi = vi + 1
via = via + 1
end
end
dev = dev - 1
end
-- Lower branches layer
local my = 0
for i = 1, 20 do -- Random 2x2 squares of shelf
local xi = x + math.random(-3, 2)
local yy = maxy + math.random(-6, -5)
local zi = z + math.random(-3, 2)
if yy > my then
my = yy
end
for zz = zi, zi+1 do
local vi = area:index(xi, yy, zz)
local via = area:index(xi, yy + 1, zz)
for xx = xi, xi + 1 do
local node_id = data[vi]
if node_id == c_air or node_id == c_ignore then
data[vi] = c_fungiwood_shelf
end
vi = vi + 1
via = via + 1
end
end
end
-- Trunk
for yy = y, maxy do
local vi = area:index(x, yy, z)
local node_id = data[vi]
if node_id == c_air or node_id == c_ignore or
node_id == c_fungiwood_shelf then
data[vi] = c_fungiwood
end
end
end

197
df_trees/goblin_cap.lua Normal file
View File

@ -0,0 +1,197 @@
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--stem
minetest.register_node("df_trees:goblin_cap_stem", {
description = S("Goblin Cap Stem"),
_doc_items_longdesc = df_trees.doc.goblin_cap_desc,
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
tiles = {"dfcaverns_goblin_cap_stem.png"},
is_ground_content = true,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
})
--cap
minetest.register_node("df_trees:goblin_cap", {
description = S("Goblin Cap"),
_doc_items_longdesc = df_trees.doc.goblin_cap_desc,
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
tiles = {"dfcaverns_goblin_cap.png"},
is_ground_content = true,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
})
--gills
minetest.register_node("df_trees:goblin_cap_gills", {
description = S("Goblin Cap Gills"),
_doc_items_longdesc = df_trees.doc.goblin_cap_desc,
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
tiles = {"dfcaverns_goblin_cap_gills.png"},
is_ground_content = true,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
sounds = default.node_sound_leaves_defaults(),
drawtype = "plantlike",
paramtype = "light",
drop = {
max_items = 1,
items = {
{
items = {'df_trees:goblin_cap_sapling'},
rarity = 15,
},
{
items = {'df_trees:goblin_cap_gills'},
}
}
},
after_place_node = default.after_place_leaves,
})
if default.register_leafdecay then -- default.register_leafdecay is very new, remove this check some time after 0.4.16 is released
default.register_leafdecay({
trunks = {"df_trees:goblin_cap"}, -- don't need stem nodes here
leaves = {"df_trees:goblin_cap_gills"},
radius = 1,
})
end
--Wood
minetest.register_craft({
output = 'df_trees:goblin_cap_wood 4',
recipe = {
{'df_trees:goblin_cap'},
}
})
minetest.register_craft({
output = 'df_trees:goblin_cap_stem_wood 4',
recipe = {
{'df_trees:goblin_cap_stem'},
}
})
minetest.register_node("df_trees:goblin_cap_wood", {
description = S("Goblin Cap Planks"),
_doc_items_longdesc = df_trees.doc.goblin_cap_desc,
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"dfcaverns_goblin_cap_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("df_trees:goblin_cap_stem_wood", {
description = S("Goblin Cap Stem Planks"),
_doc_items_longdesc = df_trees.doc.goblin_cap_desc,
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"dfcaverns_goblin_cap_stem_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
df_trees.register_all_stairs("goblin_cap_wood")
df_trees.register_all_stairs("goblin_cap_stem_wood")
minetest.register_craft({
type = "fuel",
recipe = "df_trees:goblin_cap_wood",
burntime = 12,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:goblin_cap_stem_wood",
burntime = 7,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:goblin_cap",
burntime = 40,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:goblin_cap_stem",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:goblin_cap_gills",
burntime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:goblin_cap_sapling",
burntime = 2,
})
-- sapling
minetest.register_node("df_trees:goblin_cap_sapling", {
description = S("Goblin Cap Spawn"),
_doc_items_longdesc = df_trees.doc.goblin_cap_desc,
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"dfcaverns_goblin_cap_sapling.png"},
inventory_image = "dfcaverns_goblin_cap_sapling.png",
wield_image = "dfcaverns_goblin_cap_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
floodable = true,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1, light_sensitive_fungus = 11},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(
df_trees.config.goblin_cap_delay_multiplier*df_trees.config.tree_min_growth_delay,
df_trees.config.goblin_cap_delay_multiplier*df_trees.config.tree_max_growth_delay))
end,
on_timer = function(pos)
minetest.set_node(pos, {name="air"})
df_trees.spawn_goblin_cap(pos)
end,
})
local c_stem = minetest.get_content_id("df_trees:goblin_cap_stem")
local c_cap = minetest.get_content_id("df_trees:goblin_cap")
local c_gills = minetest.get_content_id("df_trees:goblin_cap_gills")
df_trees.spawn_goblin_cap = function(pos)
local x, y, z = pos.x, pos.y, pos.z
local stem_height = math.random(1,3)
local cap_radius = math.random(3,6)
local maxy = y + stem_height + 3
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map(
{x = x - cap_radius, y = y, z = z - cap_radius},
{x = x + cap_radius, y = maxy + 3, z = z + cap_radius}
)
local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
subterrane.giant_mushroom(area:indexp(pos), area, data, c_stem, c_cap, c_gills, stem_height, cap_radius)
vm:set_data(data)
vm:write_to_map()
vm:update_map()
end
df_trees.spawn_goblin_cap_vm = function(vi, area, data)
local stem_height = math.random(1,3)
local cap_radius = math.random(3,6)
subterrane.giant_mushroom(vi, area, data, c_stem, c_cap, c_gills, stem_height, cap_radius)
end

66
df_trees/init.lua Normal file
View File

@ -0,0 +1,66 @@
df_trees = {}
--grab a shorthand for the filepath of the mod
local modpath = minetest.get_modpath(minetest.get_current_modname())
--load companion lua files
dofile(modpath.."/config.lua")
dofile(modpath.."/doc.lua")
dofile(modpath.."/aliases.lua")
local S, NS = dofile(modpath.."/intllib.lua")
df_trees.register_all_stairs = function(name, override_def)
local mod = "df_trees"
local node_def = minetest.registered_nodes[mod..":"..name]
override_def = override_def or {}
-- Note that a circular table reference will result in a crash, TODO: guard against that.
-- Unlikely to be needed, though - it'd take a lot of work for users to get into this bit of trouble.
local function deep_copy(table_in)
local table_out = {}
for index, value in pairs(table_in) do
if type(value) == "table" then
table_out[index] = deep_copy(value)
else
table_out[index] = value
end
end
return table_out
end
local node_copy = deep_copy(node_def)
for index, value in pairs(override_def) do
node_copy[index] = value
end
if minetest.get_modpath("stairs") then
stairs.register_stair_and_slab(
name,
mod ..":" .. name,
node_copy.groups,
node_copy.tiles,
S("@1 Stair", node_copy.description),
S("@1 Slab", node_copy.description),
node_copy.sounds
)
end
if minetest.get_modpath("moreblocks") then
stairsplus:register_all(mod, name, mod..":"..name, node_copy)
end
end
dofile(modpath.."/blood_thorn.lua")
dofile(modpath.."/fungiwood.lua")
dofile(modpath.."/tunnel_tube.lua")
dofile(modpath.."/spore_tree.lua")
dofile(modpath.."/black_cap.lua")
dofile(modpath.."/nether_cap.lua")
dofile(modpath.."/goblin_cap.lua")
dofile(modpath.."/tower_cap.lua")
dofile(modpath.."/torchspine.lua")

45
df_trees/intllib.lua Normal file
View File

@ -0,0 +1,45 @@
-- Fallback functions for when `intllib` is not installed.
-- Code released under Unlicense <http://unlicense.org>.
-- Get the latest version of this file at:
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
local function format(str, ...)
local args = { ... }
local function repl(escape, open, num, close)
if escape == "" then
local replacement = tostring(args[tonumber(num)])
if open == "" then
replacement = replacement..close
end
return replacement
else
return "@"..open..num..close
end
end
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
end
local gettext, ngettext
if minetest.get_modpath("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
gettext, ngettext = intllib.make_gettext_pair()
else
-- Old method using text files.
gettext = intllib.Getter()
end
end
-- Fill in missing functions.
gettext = gettext or function(msgid, ...)
return format(msgid, ...)
end
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
return format(n==1 and msgid or msgid_plural, ...)
end
return gettext, ngettext

347
df_trees/locale/it.po Normal file
View File

@ -0,0 +1,347 @@
# ITALIAN LOCALE FOR THE DFCAVERNS MODULE
# Copyright (C) 2017 FaceDeer <derksenmobile@gmail.com>
# This file is distributed under the same license as the DFCAVERNS package.
# Hamlet <h4mlet@riseup.net>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: dfcaverns module's Italian locale\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-12-23 00:27-0700\n"
"PO-Revision-Date: 2017-08-17 23:01+0100\n"
"Last-Translator: H4mlet <h4mlet@riseup.net>\n"
"Language-Team: ITALIANO\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: df_trees\black_cap.lua:7
msgid "Black Cap Stem"
msgstr "Gambo di cappello nero"
#: df_trees\black_cap.lua:18
msgid "Black Cap"
msgstr "Cappello nero"
#: df_trees\black_cap.lua:29
msgid "Black Cap Gills"
msgstr "Lamelle di cappello nero"
#: df_trees\black_cap.lua:85
msgid "Black Cap Planks"
msgstr "Assi di cappello nero"
#: df_trees\black_cap.lua:126
msgid "Black Cap Spawn"
msgstr "Prole di cappello nero"
#: df_trees\blood_thorn.lua:32
msgid "Blood Thorn Stem"
msgstr "Gambo di spina del sangue"
#: df_trees\blood_thorn.lua:47
msgid "Dead Blood Thorn Stem"
msgstr "Gambo di spina del sangue morta"
#: df_trees\blood_thorn.lua:60
msgid "Blood Thorn Spike"
msgstr "Spuntone di spina del sangue"
#: df_trees\blood_thorn.lua:90
msgid "Dead Blood Thorn Spike"
msgstr "Spuntone di spina del sangue morta"
#: df_trees\blood_thorn.lua:127
msgid "Blood Thorn Planks"
msgstr "Assi di spina del sangue"
#: df_trees\doc.lua:12
msgid ""
"The dense black wood of these mushrooms is heavy and hard to work with, and "
"has few remarkable properties."
msgstr ""
#: df_trees\doc.lua:13
msgid ""
"Aside from the artistic applications of its particularly dark color, black "
"cap wood is a long-burning fuel source that's as good as coal for some "
"applications. Black cap gills are oily and make for excellent torch fuel."
msgstr ""
#: df_trees\doc.lua:15
msgid ""
"Blood thorns are the most vicious of underground flora, as befits their "
"harsh environments. Found only in hot, dry caverns with sandy soil far from "
"the surface world's organic bounty, blood thorns seek to supplement their "
"nutrient supply with wickedly barbed hollow spines that actively drain "
"fluids from whatever stray plant or creature they might impale."
msgstr ""
#: df_trees\doc.lua:16
msgid ""
"When harvested, the central stalk of a blood thorn can be cut into planks "
"and used as wood. It has a purple-red hue that may or may not appeal, "
"depending on one's artistic tastes."
msgstr ""
#: df_trees\doc.lua:17
msgid ""
"The spikes of a blood thorn can actually remain living long after they're "
"severed from their parent stalk, a testament to their tenacity. As long as "
"they remain alive they will continue to actively drain anything they "
"puncture, though they don't grow."
msgstr ""
#: df_trees\doc.lua:18
msgid ""
"Living blood thorn spikes remain harmful to creatures that touch them. If "
"killed by bright light, they cause only passive damage to creatures that "
"fall on them (as one would expect from an enormous spike)."
msgstr ""
#: df_trees\doc.lua:20
msgid ""
"Thin, irregular layers of spore-producing 'shelves' surround the strong "
"central stalk of the mighty Fungiwood."
msgstr ""
#: df_trees\doc.lua:21
msgid ""
"Fungiwood stalk is strong and very fine-grained, making smooth yellow-tinted "
"lumber when cut. Fungiwood shelf is too fragile to be much use as anything "
"other than fuel."
msgstr ""
#: df_trees\doc.lua:23
msgid ""
"Massive but squat, mature goblin cap mushrooms are the size of small "
"cottages."
msgstr ""
#: df_trees\doc.lua:24
msgid ""
"Goblin cap stem and cap material can be cut into wood of two different hues, "
"a subdued cream and a bright orange-red."
msgstr ""
#: df_trees\doc.lua:26
msgid ""
"Nether caps have an unusual biochemistry that allows them to somehow subsist "
"on ambient heat, in violation of all known laws of thermodynamics. They grow "
"deep underground in frigid, icy caverns that should by all rights be "
"volcanic."
msgstr ""
#: df_trees\doc.lua:27
msgid ""
"Nether cap wood, in addition to being a beautiful blue hue, retains the odd "
"heat-draining ability of living nether caps and is able to quickly freeze "
"nearby water solid."
msgstr ""
#: df_trees\doc.lua:29
msgid ""
"Spore trees have a sturdy 'trunk' that supports a large spongy mesh of "
"branching fibers, with embedded fruiting bodies that produce a copious "
"amount of spores that gently rain down around the spore tree's base."
msgstr ""
#: df_trees\doc.lua:30
msgid ""
"Spore tree trunks can be cut into pale woody planks. The branching fibers "
"and fruiting bodies are only useful as fuel."
msgstr ""
#: df_trees\doc.lua:32
msgid "The king of the fungi, tower cap mushrooms grow to immense proportions."
msgstr ""
#: df_trees\doc.lua:33
msgid "Tower caps are an excellent source of wood."
msgstr ""
#: df_trees\doc.lua:35
msgid ""
"Tunnel tubes are hollow, curved fungal growths that support a fruiting body."
msgstr ""
#: df_trees\doc.lua:37
msgid ""
"The trunk of a tunnel tube can be cut and processed to produce plywood-like "
"material. The fruiting body accumulates high-energy compounds that, when "
"ignited, produce a vigorous detonation - a unique adaptation for spreading "
"tunnel tube spawn through the still cavern air."
msgstr ""
#: df_trees\doc.lua:39
msgid ""
"The trunk of a tunnel tube can be cut and processed to produce plywood-like "
"material."
msgstr ""
#: df_trees\doc.lua:42
msgid ""
"Torchspines are strange organic formations that are alive only in a "
"technical sense. They \"feed\" on volatile flammable vapors vented up "
"through their structure, growing from combustion residue deposited at their "
"tips."
msgstr ""
#: df_trees\doc.lua:43
msgid ""
"A torchspine alternates between active and quiescent phases and emits dim "
"light when active. They can be harvested for torches, and their embers "
"sprout into new torchspines when placed on flammable surfaces."
msgstr ""
#: df_trees\fungiwood.lua:13
msgid "Fungiwood Stem"
msgstr "Gambo di fungo di legno"
#: df_trees\fungiwood.lua:34
msgid "Fungiwood Planks"
msgstr "Assi di fungo di legno"
#: df_trees\fungiwood.lua:69
msgid "Fungiwood Shelf"
msgstr "Mensola di fungo di legno"
#: df_trees\fungiwood.lua:107
msgid "Fungiwood Spawn"
msgstr "Prole di fungo di legno"
#: df_trees\goblin_cap.lua:7
msgid "Goblin Cap Stem"
msgstr "Gambo di cappello di folletto"
#: df_trees\goblin_cap.lua:18
msgid "Goblin Cap"
msgstr "Cappello di folletto"
#: df_trees\goblin_cap.lua:29
msgid "Goblin Cap Gills"
msgstr "Lamelle di cappello di folletto"
#: df_trees\goblin_cap.lua:77
msgid "Goblin Cap Planks"
msgstr "Assi di cappello di folletto"
#: df_trees\goblin_cap.lua:89
msgid "Goblin Cap Stem Planks"
msgstr "Assi di gambo di cappello di folletto"
#: df_trees\goblin_cap.lua:136
msgid "Goblin Cap Spawn"
msgstr "Prole di cappello di folletto"
#: df_trees\init.lua:45
msgid "@1 Stair"
msgstr ""
#: df_trees\init.lua:46
msgid "@1 Slab"
msgstr ""
#: df_trees\nether_cap.lua:7
msgid "Nether Cap Stem"
msgstr "Gambo di cappello del Nether"
#: df_trees\nether_cap.lua:18
msgid "Nether Cap"
msgstr "Cappello del Nether"
#: df_trees\nether_cap.lua:29
msgid "Nether Cap Gills"
msgstr "Lamelle di cappello del Nether"
#: df_trees\nether_cap.lua:78
msgid "Nether Cap Planks"
msgstr "Assi di cappello del Nether"
#: df_trees\nether_cap.lua:93
msgid "Nether Cap Spawn"
msgstr "Prole di cappello del Nether"
#: df_trees\spore_tree.lua:14
msgid "Spore Tree Stem"
msgstr "Gambo di albero delle spore"
#: df_trees\spore_tree.lua:35
msgid "Spore Tree Planks"
msgstr "Assi di albero delle spore"
#: df_trees\spore_tree.lua:75
msgid "Spore Tree Hyphae"
msgstr "Ife di albero delle spore"
#: df_trees\spore_tree.lua:101
msgid "Spore Tree Fruiting Body"
msgstr "Corpo fruttifero dell'albero delle spore"
#: df_trees\spore_tree.lua:149
msgid "Spore Tree Spawn"
msgstr "Prole di albero delle spore"
#: df_trees\spore_tree.lua:303
#, fuzzy
msgid "Spore Tree Ladder"
msgstr "Ife di albero delle spore"
#: df_trees\torchspine.lua:58
#: df_trees\torchspine.lua:76
msgid "Torchspine Tip"
msgstr ""
#: df_trees\torchspine.lua:95
#: df_trees\torchspine.lua:121
#: df_trees\torchspine.lua:151
msgid "Torchspine"
msgstr ""
#: df_trees\torchspine.lua:180
msgid "Torchspine Ember"
msgstr ""
#: df_trees\tower_cap.lua:7
msgid "Tower Cap Stem"
msgstr "Gambo di cappello a torre"
#: df_trees\tower_cap.lua:18
msgid "Tower Cap"
msgstr "Cappello a torre"
#: df_trees\tower_cap.lua:29
msgid "Tower Cap Gills"
msgstr "Lamelle di cappello a torre"
#: df_trees\tower_cap.lua:77
msgid "Tower Cap Planks"
msgstr "Assi di cappello a torre"
#: df_trees\tower_cap.lua:118
msgid "Tower Cap Spawn"
msgstr "Prole di cappello a torre"
#: df_trees\tunnel_tube.lua:16
#: df_trees\tunnel_tube.lua:39
#: df_trees\tunnel_tube.lua:69
#: df_trees\tunnel_tube.lua:98
msgid "Tunnel Tube"
msgstr "Tubo di galleria"
#: df_trees\tunnel_tube.lua:135
msgid "Tunnel Tube Plies"
msgstr "Strati di tubo di galleria"
#: df_trees\tunnel_tube.lua:172
#: df_trees\tunnel_tube.lua:228
#: df_trees\tunnel_tube.lua:248
msgid "Tunnel Tube Fruiting Body"
msgstr "Corpo fruttifero del tubo di galleria"
#: df_trees\tunnel_tube.lua:279
msgid "Tunnel Tube Spawn"
msgstr "Prole di tubo di galleria"

View File

@ -0,0 +1,345 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-12-23 00:27-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: df_trees\black_cap.lua:7
msgid "Black Cap Stem"
msgstr ""
#: df_trees\black_cap.lua:18
msgid "Black Cap"
msgstr ""
#: df_trees\black_cap.lua:29
msgid "Black Cap Gills"
msgstr ""
#: df_trees\black_cap.lua:85
msgid "Black Cap Planks"
msgstr ""
#: df_trees\black_cap.lua:126
msgid "Black Cap Spawn"
msgstr ""
#: df_trees\blood_thorn.lua:32
msgid "Blood Thorn Stem"
msgstr ""
#: df_trees\blood_thorn.lua:47
msgid "Dead Blood Thorn Stem"
msgstr ""
#: df_trees\blood_thorn.lua:60
msgid "Blood Thorn Spike"
msgstr ""
#: df_trees\blood_thorn.lua:90
msgid "Dead Blood Thorn Spike"
msgstr ""
#: df_trees\blood_thorn.lua:127
msgid "Blood Thorn Planks"
msgstr ""
#: df_trees\doc.lua:12
msgid ""
"The dense black wood of these mushrooms is heavy and hard to work with, and "
"has few remarkable properties."
msgstr ""
#: df_trees\doc.lua:13
msgid ""
"Aside from the artistic applications of its particularly dark color, black "
"cap wood is a long-burning fuel source that's as good as coal for some "
"applications. Black cap gills are oily and make for excellent torch fuel."
msgstr ""
#: df_trees\doc.lua:15
msgid ""
"Blood thorns are the most vicious of underground flora, as befits their "
"harsh environments. Found only in hot, dry caverns with sandy soil far from "
"the surface world's organic bounty, blood thorns seek to supplement their "
"nutrient supply with wickedly barbed hollow spines that actively drain "
"fluids from whatever stray plant or creature they might impale."
msgstr ""
#: df_trees\doc.lua:16
msgid ""
"When harvested, the central stalk of a blood thorn can be cut into planks "
"and used as wood. It has a purple-red hue that may or may not appeal, "
"depending on one's artistic tastes."
msgstr ""
#: df_trees\doc.lua:17
msgid ""
"The spikes of a blood thorn can actually remain living long after they're "
"severed from their parent stalk, a testament to their tenacity. As long as "
"they remain alive they will continue to actively drain anything they "
"puncture, though they don't grow."
msgstr ""
#: df_trees\doc.lua:18
msgid ""
"Living blood thorn spikes remain harmful to creatures that touch them. If "
"killed by bright light, they cause only passive damage to creatures that "
"fall on them (as one would expect from an enormous spike)."
msgstr ""
#: df_trees\doc.lua:20
msgid ""
"Thin, irregular layers of spore-producing 'shelves' surround the strong "
"central stalk of the mighty Fungiwood."
msgstr ""
#: df_trees\doc.lua:21
msgid ""
"Fungiwood stalk is strong and very fine-grained, making smooth yellow-tinted "
"lumber when cut. Fungiwood shelf is too fragile to be much use as anything "
"other than fuel."
msgstr ""
#: df_trees\doc.lua:23
msgid ""
"Massive but squat, mature goblin cap mushrooms are the size of small "
"cottages."
msgstr ""
#: df_trees\doc.lua:24
msgid ""
"Goblin cap stem and cap material can be cut into wood of two different hues, "
"a subdued cream and a bright orange-red."
msgstr ""
#: df_trees\doc.lua:26
msgid ""
"Nether caps have an unusual biochemistry that allows them to somehow subsist "
"on ambient heat, in violation of all known laws of thermodynamics. They grow "
"deep underground in frigid, icy caverns that should by all rights be "
"volcanic."
msgstr ""
#: df_trees\doc.lua:27
msgid ""
"Nether cap wood, in addition to being a beautiful blue hue, retains the odd "
"heat-draining ability of living nether caps and is able to quickly freeze "
"nearby water solid."
msgstr ""
#: df_trees\doc.lua:29
msgid ""
"Spore trees have a sturdy 'trunk' that supports a large spongy mesh of "
"branching fibers, with embedded fruiting bodies that produce a copious "
"amount of spores that gently rain down around the spore tree's base."
msgstr ""
#: df_trees\doc.lua:30
msgid ""
"Spore tree trunks can be cut into pale woody planks. The branching fibers "
"and fruiting bodies are only useful as fuel."
msgstr ""
#: df_trees\doc.lua:32
msgid "The king of the fungi, tower cap mushrooms grow to immense proportions."
msgstr ""
#: df_trees\doc.lua:33
msgid "Tower caps are an excellent source of wood."
msgstr ""
#: df_trees\doc.lua:35
msgid ""
"Tunnel tubes are hollow, curved fungal growths that support a fruiting body."
msgstr ""
#: df_trees\doc.lua:37
msgid ""
"The trunk of a tunnel tube can be cut and processed to produce plywood-like "
"material. The fruiting body accumulates high-energy compounds that, when "
"ignited, produce a vigorous detonation - a unique adaptation for spreading "
"tunnel tube spawn through the still cavern air."
msgstr ""
#: df_trees\doc.lua:39
msgid ""
"The trunk of a tunnel tube can be cut and processed to produce plywood-like "
"material."
msgstr ""
#: df_trees\doc.lua:42
msgid ""
"Torchspines are strange organic formations that are alive only in a "
"technical sense. They \"feed\" on volatile flammable vapors vented up "
"through their structure, growing from combustion residue deposited at their "
"tips."
msgstr ""
#: df_trees\doc.lua:43
msgid ""
"A torchspine alternates between active and quiescent phases and emits dim "
"light when active. They can be harvested for torches, and their embers "
"sprout into new torchspines when placed on flammable surfaces."
msgstr ""
#: df_trees\fungiwood.lua:13
msgid "Fungiwood Stem"
msgstr ""
#: df_trees\fungiwood.lua:34
msgid "Fungiwood Planks"
msgstr ""
#: df_trees\fungiwood.lua:69
msgid "Fungiwood Shelf"
msgstr ""
#: df_trees\fungiwood.lua:107
msgid "Fungiwood Spawn"
msgstr ""
#: df_trees\goblin_cap.lua:7
msgid "Goblin Cap Stem"
msgstr ""
#: df_trees\goblin_cap.lua:18
msgid "Goblin Cap"
msgstr ""
#: df_trees\goblin_cap.lua:29
msgid "Goblin Cap Gills"
msgstr ""
#: df_trees\goblin_cap.lua:77
msgid "Goblin Cap Planks"
msgstr ""
#: df_trees\goblin_cap.lua:89
msgid "Goblin Cap Stem Planks"
msgstr ""
#: df_trees\goblin_cap.lua:136
msgid "Goblin Cap Spawn"
msgstr ""
#: df_trees\init.lua:45
msgid "@1 Stair"
msgstr ""
#: df_trees\init.lua:46
msgid "@1 Slab"
msgstr ""
#: df_trees\nether_cap.lua:7
msgid "Nether Cap Stem"
msgstr ""
#: df_trees\nether_cap.lua:18
msgid "Nether Cap"
msgstr ""
#: df_trees\nether_cap.lua:29
msgid "Nether Cap Gills"
msgstr ""
#: df_trees\nether_cap.lua:78
msgid "Nether Cap Planks"
msgstr ""
#: df_trees\nether_cap.lua:93
msgid "Nether Cap Spawn"
msgstr ""
#: df_trees\spore_tree.lua:14
msgid "Spore Tree Stem"
msgstr ""
#: df_trees\spore_tree.lua:35
msgid "Spore Tree Planks"
msgstr ""
#: df_trees\spore_tree.lua:75
msgid "Spore Tree Hyphae"
msgstr ""
#: df_trees\spore_tree.lua:101
msgid "Spore Tree Fruiting Body"
msgstr ""
#: df_trees\spore_tree.lua:149
msgid "Spore Tree Spawn"
msgstr ""
#: df_trees\spore_tree.lua:303
msgid "Spore Tree Ladder"
msgstr ""
#: df_trees\torchspine.lua:58
#: df_trees\torchspine.lua:76
msgid "Torchspine Tip"
msgstr ""
#: df_trees\torchspine.lua:95
#: df_trees\torchspine.lua:121
#: df_trees\torchspine.lua:151
msgid "Torchspine"
msgstr ""
#: df_trees\torchspine.lua:180
msgid "Torchspine Ember"
msgstr ""
#: df_trees\tower_cap.lua:7
msgid "Tower Cap Stem"
msgstr ""
#: df_trees\tower_cap.lua:18
msgid "Tower Cap"
msgstr ""
#: df_trees\tower_cap.lua:29
msgid "Tower Cap Gills"
msgstr ""
#: df_trees\tower_cap.lua:77
msgid "Tower Cap Planks"
msgstr ""
#: df_trees\tower_cap.lua:118
msgid "Tower Cap Spawn"
msgstr ""
#: df_trees\tunnel_tube.lua:16
#: df_trees\tunnel_tube.lua:39
#: df_trees\tunnel_tube.lua:69
#: df_trees\tunnel_tube.lua:98
msgid "Tunnel Tube"
msgstr ""
#: df_trees\tunnel_tube.lua:135
msgid "Tunnel Tube Plies"
msgstr ""
#: df_trees\tunnel_tube.lua:172
#: df_trees\tunnel_tube.lua:228
#: df_trees\tunnel_tube.lua:248
msgid "Tunnel Tube Fruiting Body"
msgstr ""
#: df_trees\tunnel_tube.lua:279
msgid "Tunnel Tube Spawn"
msgstr ""

View File

@ -0,0 +1,6 @@
@echo off
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
cd ..
set LIST=
for /r %%X in (*.lua) do set LIST=!LIST! %%X
..\..\intllib\tools\xgettext.bat %LIST%

1
df_trees/mod.conf Normal file
View File

@ -0,0 +1 @@
name = df_trees

View File

@ -0,0 +1 @@
All tunnel tube models were created by FaceDeer and released under both the MIT license and under the Creative Commons CC0 license.

View File

@ -0,0 +1,62 @@
# Blender MTL File: 'tunnel tube base.blend'
# Material Count: 6
newmtl Back
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Bottom
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Front
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Left
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Right
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Top
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

View File

@ -0,0 +1,94 @@
# Blender v2.77 (sub 0) OBJ File: 'tunnel tube base.blend'
# www.blender.org
mtllib tunnel_tube_slant.mtl
o tunnel_tube_slant_Cube.002
v 0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 0.500000
v -0.500000 -0.500000 0.500000
v -0.250000 -0.500000 0.250000
v 0.250000 -0.500000 0.250000
v 0.250000 -0.500000 -0.250000
v -0.250000 -0.500000 -0.250000
v -0.500000 -0.500000 -0.500000
v 0.500000 0.500000 -1.000000
v -0.500000 0.500000 -1.000000
v 0.500000 0.500000 0.000000
v -0.500000 0.500000 -0.000000
v -0.250000 0.500000 -0.250000
v -0.250000 0.500000 -0.750000
v 0.250000 0.500000 -0.750000
v 0.250000 0.500000 -0.250000
vt 1.0000 1.0000
vt 0.0000 1.0000
vt 0.2500 0.7500
vt 0.7500 0.7500
vt 0.7500 0.2500
vt 1.0000 -0.0000
vt -0.0000 0.0000
vt 0.2500 0.2500
vt 1.0000 1.0000
vt 1.0000 0.0000
vt 0.7500 0.2500
vt 0.7500 0.7500
vt 0.2500 0.7500
vt 0.0000 1.0000
vt 0.2500 0.2500
vt -0.0000 0.0000
vt 1.0000 0.0000
vt 1.5000 1.0000
vt 0.5000 1.0000
vt 0.0000 0.0000
vt 1.2500 1.0000
vt 0.7500 1.0000
vt 0.2500 0.0000
vt 0.7500 0.0000
vt 0.5000 1.0000
vt 1.5000 1.0000
vt 1.0000 0.0000
vt 0.7500 1.0000
vt 1.2500 1.0000
vt 0.7500 0.0000
vt 0.2500 0.0000
vt 1.0000 1.0000
vt -0.0000 1.0000
vt 0.7500 1.0000
vt 0.2500 1.0000
vt 0.2500 0.0000
vt 0.0000 0.0000
vt 0.2500 1.0000
vt 0.7500 0.0000
vn 0.0000 1.0000 0.0000
vn 0.0000 -1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 0.4472 0.8944
vn 0.0000 -0.4472 -0.8944
g tunnel_tube_slant_Cube.002_Top
usemtl Top
s off
f 9/1/1 10/2/1 14/3/1 15/4/1
f 9/1/1 15/4/1 16/5/1 11/6/1
f 14/3/1 10/2/1 12/7/1 13/8/1
f 11/6/1 16/5/1 13/8/1 12/7/1
g tunnel_tube_slant_Cube.002_Bottom
usemtl Bottom
f 1/9/2 2/10/2 5/11/2 6/12/2
f 1/9/2 6/12/2 7/13/2 8/14/2
f 8/14/2 7/13/2 4/15/2 3/16/2
f 5/11/2 2/10/2 3/16/2 4/15/2
g tunnel_tube_slant_Cube.002_Right
usemtl Right
f 1/17/3 9/18/3 11/19/3 2/20/3
f 14/21/3 13/22/3 4/23/3 7/24/3
g tunnel_tube_slant_Cube.002_Left
usemtl Left
f 3/16/4 12/25/4 10/26/4 8/27/4
f 16/28/4 15/29/4 6/30/4 5/31/4
g tunnel_tube_slant_Cube.002_Front
usemtl Front
f 2/10/5 11/32/5 12/33/5 3/16/5
f 15/34/5 14/35/5 7/36/5 6/30/5
g tunnel_tube_slant_Cube.002_Back
usemtl Back
f 9/1/6 1/17/6 8/37/6 10/2/6
f 13/38/6 16/28/6 5/39/6 4/23/6

View File

@ -0,0 +1,62 @@
# Blender MTL File: 'tunnel tube base.blend'
# Material Count: 6
newmtl Back
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Bottom
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Front
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Left
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Right
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Top
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

View File

@ -0,0 +1,94 @@
# Blender v2.77 (sub 0) OBJ File: 'tunnel tube base.blend'
# www.blender.org
mtllib tunnel_tube_slant_2.mtl
o tunnel_tube_slant_Cube.002
v 0.500000 -0.500000 0.000000
v 0.500000 -0.500000 1.000000
v -0.500000 -0.500000 1.000000
v -0.250000 -0.500000 0.750000
v 0.250000 -0.500000 0.750000
v 0.250000 -0.500000 0.250000
v -0.250000 -0.500000 0.250000
v -0.500000 -0.500000 -0.000000
v 0.500000 0.500000 -0.500000
v -0.500000 0.500000 -0.500000
v 0.500000 0.500000 0.500000
v -0.500000 0.500000 0.500000
v -0.250000 0.500000 0.250000
v -0.250000 0.500000 -0.250000
v 0.250000 0.500000 -0.250000
v 0.250000 0.500000 0.250000
vt 1.0000 1.0000
vt 0.0000 1.0000
vt 0.2500 0.7500
vt 0.7500 0.7500
vt 0.7500 0.2500
vt 1.0000 -0.0000
vt -0.0000 0.0000
vt 0.2500 0.2500
vt 1.0000 1.0000
vt 1.0000 0.0000
vt 0.7500 0.2500
vt 0.7500 0.7500
vt 0.2500 0.7500
vt 0.0000 1.0000
vt 0.2500 0.2500
vt -0.0000 0.0000
vt 0.5000 0.0000
vt -0.0000 1.0000
vt -0.5000 0.0000
vt 0.7500 1.0000
vt 0.2500 1.0000
vt -0.2500 0.0000
vt 0.2500 0.0000
vt -0.5000 0.0000
vt 0.0000 1.0000
vt 1.0000 1.0000
vt 0.5000 0.0000
vt 0.2500 1.0000
vt 0.7500 1.0000
vt 0.2500 0.0000
vt -0.2500 0.0000
vt 1.0000 1.0000
vt 0.2500 1.0000
vt 0.7500 0.0000
vt 1.0000 0.0000
vt 0.0000 0.0000
vt 0.7500 1.0000
vt 0.7500 0.0000
vt 0.2500 0.0000
vn 0.0000 1.0000 0.0000
vn 0.0000 -1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 0.4472 0.8944
vn 0.0000 -0.4472 -0.8944
g tunnel_tube_slant_Cube.002_Top
usemtl Top
s off
f 9/1/1 10/2/1 14/3/1 15/4/1
f 9/1/1 15/4/1 16/5/1 11/6/1
f 14/3/1 10/2/1 12/7/1 13/8/1
f 11/6/1 16/5/1 13/8/1 12/7/1
g tunnel_tube_slant_Cube.002_Bottom
usemtl Bottom
f 1/9/2 2/10/2 5/11/2 6/12/2
f 1/9/2 6/12/2 7/13/2 8/14/2
f 8/14/2 7/13/2 4/15/2 3/16/2
f 5/11/2 2/10/2 3/16/2 4/15/2
g tunnel_tube_slant_Cube.002_Right
usemtl Right
f 1/17/3 9/1/3 11/18/3 2/19/3
f 14/20/3 13/21/3 4/22/3 7/23/3
g tunnel_tube_slant_Cube.002_Left
usemtl Left
f 3/24/4 12/25/4 10/26/4 8/27/4
f 16/28/4 15/29/4 6/30/4 5/31/4
g tunnel_tube_slant_Cube.002_Front
usemtl Front
f 2/10/5 11/32/5 12/25/5 3/16/5
f 15/29/5 14/33/5 7/23/5 6/34/5
g tunnel_tube_slant_Cube.002_Back
usemtl Back
f 9/1/6 1/35/6 8/36/6 10/2/6
f 13/21/6 16/37/6 5/38/6 4/39/6

View File

@ -0,0 +1,62 @@
# Blender MTL File: 'tunnel tube base.blend'
# Material Count: 6
newmtl Back
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Bottom
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Front
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Left
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Right
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Top
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

View File

@ -0,0 +1,94 @@
# Blender v2.77 (sub 0) OBJ File: 'tunnel tube base.blend'
# www.blender.org
mtllib tunnel_tube_slant_full.mtl
o tunnel_tube_slant_Cube.002
v 0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 0.500000
v -0.500000 -0.500000 0.500000
v -0.250000 -0.500000 0.250000
v 0.250000 -0.500000 0.250000
v 0.250000 -0.500000 -0.250000
v -0.250000 -0.500000 -0.250000
v -0.500000 -0.500000 -0.500000
v 0.500000 0.500000 -1.500000
v -0.500000 0.500000 -1.500000
v 0.500000 0.500000 -0.500000
v -0.500000 0.500000 -0.500000
v -0.250000 0.500000 -0.750000
v -0.250000 0.500000 -1.250000
v 0.250000 0.500000 -1.250000
v 0.250000 0.500000 -0.750000
vt 1.0000 1.0000
vt 0.0000 1.0000
vt 0.2500 0.7500
vt 0.7500 0.7500
vt 0.7500 0.2500
vt 1.0000 -0.0000
vt -0.0000 0.0000
vt 0.2500 0.2500
vt 1.0000 1.0000
vt 1.0000 0.0000
vt 0.7500 0.2500
vt 0.7500 0.7500
vt 0.2500 0.7500
vt 0.0000 1.0000
vt 0.2500 0.2500
vt -0.0000 0.0000
vt 1.0000 0.0000
vt 2.0000 1.0000
vt 1.0000 1.0000
vt 0.0000 0.0000
vt 1.7500 1.0000
vt 1.2500 1.0000
vt 0.2500 0.0000
vt 0.7500 0.0000
vt 1.0000 1.0000
vt 2.0000 1.0000
vt 1.0000 0.0000
vt 1.2500 1.0000
vt 1.7500 1.0000
vt 0.7500 0.0000
vt 0.2500 0.0000
vt -0.0000 1.0000
vt 0.7500 1.2500
vt 0.2500 1.2500
vt 0.2500 0.2500
vt 0.7500 0.2500
vt 0.0000 0.0000
vt 0.2500 1.2500
vt 0.7500 1.2500
vn 0.0000 1.0000 0.0000
vn 0.0000 -1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 0.7071 0.7071
vn 0.0000 -0.7071 -0.7071
g tunnel_tube_slant_Cube.002_Top
usemtl Top
s off
f 9/1/1 10/2/1 14/3/1 15/4/1
f 9/1/1 15/4/1 16/5/1 11/6/1
f 14/3/1 10/2/1 12/7/1 13/8/1
f 11/6/1 16/5/1 13/8/1 12/7/1
g tunnel_tube_slant_Cube.002_Bottom
usemtl Bottom
f 1/9/2 2/10/2 5/11/2 6/12/2
f 1/9/2 6/12/2 7/13/2 8/14/2
f 8/14/2 7/13/2 4/15/2 3/16/2
f 5/11/2 2/10/2 3/16/2 4/15/2
g tunnel_tube_slant_Cube.002_Right
usemtl Right
f 1/17/3 9/18/3 11/19/3 2/20/3
f 14/21/3 13/22/3 4/23/3 7/24/3
g tunnel_tube_slant_Cube.002_Left
usemtl Left
f 3/16/4 12/25/4 10/26/4 8/27/4
f 16/28/4 15/29/4 6/30/4 5/31/4
g tunnel_tube_slant_Cube.002_Front
usemtl Front
f 2/10/5 11/19/5 12/32/5 3/16/5
f 15/33/5 14/34/5 7/35/5 6/36/5
g tunnel_tube_slant_Cube.002_Back
usemtl Back
f 9/1/6 1/17/6 8/37/6 10/2/6
f 13/38/6 16/39/6 5/11/6 4/15/6

178
df_trees/nether_cap.lua Normal file
View File

@ -0,0 +1,178 @@
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--stem
minetest.register_node("df_trees:nether_cap_stem", {
description = S("Nether Cap Stem"),
_doc_items_longdesc = df_trees.doc.nether_cap_desc,
_doc_items_usagehelp = df_trees.doc.nether_cap_usage,
tiles = {"dfcaverns_nether_cap_stem.png"},
is_ground_content = true,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1},
sounds = default.node_sound_wood_defaults(),
})
--cap
minetest.register_node("df_trees:nether_cap", {
description = S("Nether Cap"),
_doc_items_longdesc = df_trees.doc.nether_cap_desc,
_doc_items_usagehelp = df_trees.doc.nether_cap_usage,
tiles = {"dfcaverns_nether_cap.png"},
is_ground_content = true,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1 },
sounds = default.node_sound_wood_defaults(),
})
--gills
minetest.register_node("df_trees:nether_cap_gills", {
description = S("Nether Cap Gills"),
_doc_items_longdesc = df_trees.doc.nether_cap_desc,
_doc_items_usagehelp = df_trees.doc.nether_cap_usage,
tiles = {"dfcaverns_nether_cap_gills.png"},
is_ground_content = true,
light_source = 6,
groups = {snappy = 3, leafdecay = 3, leaves = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1},
sounds = default.node_sound_leaves_defaults(),
drawtype = "plantlike",
paramtype = "light",
drop = {
max_items = 1,
items = {
{
items = {'df_trees:nether_cap_sapling'},
rarity = 5,
},
{
items = {'df_trees:nether_cap_gills'},
}
}
},
after_place_node = default.after_place_leaves,
})
if default.register_leafdecay then -- default.register_leafdecay is very new, remove this check some time after 0.4.16 is released
default.register_leafdecay({
trunks = {"df_trees:nether_cap"}, -- don't need stem nodes here
leaves = {"df_trees:nether_cap_gills"},
radius = 1,
})
end
--Wood
minetest.register_craft({
output = 'df_trees:nether_cap_wood 4',
recipe = {
{'df_trees:nether_cap'},
}
})
minetest.register_craft({
output = 'df_trees:nether_cap_wood 4',
recipe = {
{'df_trees:nether_cap_stem'},
}
})
minetest.register_node("df_trees:nether_cap_wood", {
description = S("Nether Cap Planks"),
_doc_items_longdesc = df_trees.doc.nether_cap_desc,
_doc_items_usagehelp = df_trees.doc.nether_cap_usage,
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"dfcaverns_nether_cap_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, wood = 1, freezes_water = 1},
sounds = default.node_sound_wood_defaults(),
})
df_trees.register_all_stairs("nether_cap_wood")
-- sapling
minetest.register_node("df_trees:nether_cap_sapling", {
description = S("Nether Cap Spawn"),
_doc_items_longdesc = df_trees.doc.nether_cap_desc,
_doc_items_usagehelp = df_trees.doc.nether_cap_usage,
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"dfcaverns_nether_cap_sapling.png"},
inventory_image = "dfcaverns_nether_cap_sapling.png",
wield_image = "dfcaverns_nether_cap_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
floodable = true, -- nether cap spawn aren't tough enough to freeze water yet
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
groups = {snappy = 2, dig_immediate = 3,
attached_node = 1, sapling = 1, light_sensitive_fungus = 11},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(
df_trees.config.nether_cap_delay_multiplier*df_trees.config.tree_min_growth_delay,
df_trees.config.nether_cap_delay_multiplier*df_trees.config.tree_max_growth_delay))
end,
on_timer = function(pos)
minetest.set_node(pos, {name="air"})
df_trees.spawn_nether_cap(pos)
end,
})
local c_stem = minetest.get_content_id("df_trees:nether_cap_stem")
local c_cap = minetest.get_content_id("df_trees:nether_cap")
local c_gills = minetest.get_content_id("df_trees:nether_cap_gills")
df_trees.spawn_nether_cap = function(pos)
local x, y, z = pos.x, pos.y, pos.z
local stem_height = math.random(1,3)
local cap_radius = math.random(2,3)
local maxy = y + stem_height + 3
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map(
{x = x - cap_radius, y = y, z = z - cap_radius},
{x = x + cap_radius, y = maxy + 3, z = z + cap_radius}
)
local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
subterrane.giant_mushroom(area:indexp(pos), area, data, c_stem, c_cap, c_gills, stem_height, cap_radius)
vm:set_data(data)
vm:write_to_map()
vm:update_map()
end
df_trees.spawn_nether_cap_vm = function(vi, area, data)
local stem_height = math.random(1,3)
local cap_radius = math.random(2,3)
subterrane.giant_mushroom(vi, area, data, c_stem, c_cap, c_gills, stem_height, cap_radius)
end
minetest.register_abm{
label = "water freezing",
nodenames = {"default:water_source", "default:river_water_source",},
neighbors = {"group:freezes_water"},
interval = 1,
chance = 5,
catch_up = true,
action = function(pos)
minetest.swap_node(pos, {name="default:ice"})
end,
}
minetest.register_abm{
label = "flowing water freezing",
nodenames = {"default:water_flowing", "default:river_water_flowing"},
neighbors = {"group:freezes_water"},
interval = 1,
chance = 1,
catch_up = true,
action = function(pos)
minetest.swap_node(pos, {name="default:snow"})
end,
}

11
df_trees/settingtypes.txt Normal file
View File

@ -0,0 +1,11 @@
dfcaverns_tree_min_growth_delay (Minimum sapling growth delay) int 2400
dfcaverns_tree_max_growth_delay (Maximum sapling growth delay) int 4800
dfcaverns_fungiwood_delay_multiplier (fungiwood growth delay multiplier) float 1
dfcaverns_tunnel_tube_delay_multiplier (tunnel_tube growth delay multiplier) float 1
dfcaverns_spore_tree_delay_multiplier (spore_tree growth delay multiplier) float 1
dfcaverns_black_cap_delay_multiplier (black_cap growth delay multiplier) float 1
dfcaverns_nether_cap_delay_multiplier (nether_cap growth delay multiplier) float 1
dfcaverns_goblin_cap_delay_multiplier (goblin_cap growth delay multiplier) float 1
dfcaverns_tower_cap_delay_multiplier (tower_cap growth delay multiplier) float 1
dfcaverns_blood_thorn_growth_interval (blood_thorn growth ABM interval) int 12
dfcaverns_blood_thorn_growth_chance (blood_thorn growth ABM chance) int 83

324
df_trees/spore_tree.lua Normal file
View File

@ -0,0 +1,324 @@
--------------------------------------------------
-- Spore Tree
-- Teal
-- raining spores
-- Max trunk height 5
-- depth 2-3
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
minetest.register_node("df_trees:spore_tree", {
description = S("Spore Tree Stem"),
_doc_items_longdesc = df_trees.doc.spore_tree_desc,
_doc_items_usagehelp = df_trees.doc.spore_tree_usage,
tiles = {"dfcaverns_spore_tree_top.png", "dfcaverns_spore_tree_top.png", "dfcaverns_spore_tree.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
})
--Wood
minetest.register_craft({
output = "df_trees:spore_tree_wood 4",
recipe = {
{"df_trees:spore_tree"},
}
})
minetest.register_node("df_trees:spore_tree_wood", {
description = S("Spore Tree Planks"),
_doc_items_longdesc = df_trees.doc.spore_tree_desc,
_doc_items_usagehelp = df_trees.doc.spore_tree_usage,
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"dfcaverns_spore_tree_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
df_trees.register_all_stairs("spore_tree_wood")
minetest.register_craft({
type = "fuel",
recipe = "df_trees:spore_tree_wood",
burntime = 6,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:spore_tree",
burntime = 20,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:spore_tree_hyphae",
burntime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:spore_tree_fruiting_body",
burntime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:spore_tree_sapling",
burntime = 1,
})
minetest.register_node("df_trees:spore_tree_hyphae", {
description = S("Spore Tree Hyphae"),
_doc_items_longdesc = df_trees.doc.spore_tree_desc,
_doc_items_usagehelp = df_trees.doc.spore_tree_usage,
waving = 1,
tiles = {"dfcaverns_spore_tree.png"},
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, spore_tree_hyphae = 1},
walkable = false,
climbable = true,
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.0625, -0.5, -0.0625, 0.0625, 0.5, 0.0625},
{-0.0625, -0.0625, -0.5, 0.0625, 0.0625, 0.5},
{-0.5, -0.0625, -0.0625, 0.5, 0.0625, 0.0625},
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
})
minetest.register_node("df_trees:spore_tree_fruiting_body", {
description = S("Spore Tree Fruiting Body"),
_doc_items_longdesc = df_trees.doc.spore_tree_desc,
_doc_items_usagehelp = df_trees.doc.spore_tree_usage,
waving = 1,
tiles = {"dfcaverns_spore_tree.png"},
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, spore_tree_hyphae = 1},
walkable = false,
climbable = true,
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.0625, -0.5, -0.0625, 0.0625, 0.5, 0.0625},
{-0.0625, -0.0625, -0.5, 0.0625, 0.0625, 0.5},
{-0.5, -0.0625, -0.0625, 0.5, 0.0625, 0.0625},
{-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
}
},
drop = {
max_items = 1,
items = {
{
items = {'df_trees:spore_tree_sapling'},
rarity = 10,
},
{
items = {'df_trees:spore_tree_hyphae'},
}
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
})
if default.register_leafdecay then -- default.register_leafdecay is very new, remove this check some time after 0.4.16 is released
default.register_leafdecay({
trunks = {"df_trees:spore_tree"},
leaves = {"df_trees:spore_tree_hyphae", "df_trees:spore_tree_fruiting_body"},
radius = 3,
})
end
minetest.register_node("df_trees:spore_tree_sapling", {
description = S("Spore Tree Spawn"),
_doc_items_longdesc = df_trees.doc.spore_tree_desc,
_doc_items_usagehelp = df_trees.doc.spore_tree_usage,
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"dfcaverns_spore_tree_sapling.png"},
inventory_image = "dfcaverns_spore_tree_sapling.png",
wield_image = "dfcaverns_spore_tree_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
floodable = true,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1, light_sensitive_fungus = 11},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(
df_trees.config.spore_tree_delay_multiplier*df_trees.config.tree_min_growth_delay,
df_trees.config.spore_tree_delay_multiplier*df_trees.config.tree_max_growth_delay))
end,
on_timer = function(pos)
minetest.set_node(pos, {name="air"})
df_trees.spawn_spore_tree(pos)
end,
})
local c_air = minetest.get_content_id("air")
local c_ignore = minetest.get_content_id("ignore")
local c_spore_pod = minetest.get_content_id("df_trees:spore_tree_fruiting_body")
local c_tree = minetest.get_content_id("df_trees:spore_tree")
local c_spore_frond = minetest.get_content_id("df_trees:spore_tree_hyphae")
df_trees.spawn_spore_tree_vm = function(vi, area, data, height, size, iters, has_fruiting_bodies)
if height == nil then height = math.random(3,6) end
if size == nil then size = 2 end
if iters == nil then iters = 10 end
if has_fruiting_bodies == nil then has_fruiting_bodies = math.random() < 0.5 end
local pos = area:position(vi)
local x, y, z = pos.x, pos.y, pos.z
local has_fruiting_bodies = true
-- Trunk
for yy = y, y + height - 1 do
local vi = area:index(x, yy, z)
local node_id = data[vi]
if node_id == c_air or node_id == c_ignore or node_id == c_spore_frond or node_id == c_spore_pod then
data[vi] = c_tree
end
end
-- Force leaves near the trunk
for z_dist = -1, 1 do
for y_dist = -size, 1 do
local vi = area:index(x - 1, y + height + y_dist, z + z_dist)
for x_dist = -1, 1 do
if data[vi] == c_air or data[vi] == c_ignore then
if has_fruiting_bodies and math.random() < 0.3 then
data[vi] = c_spore_pod
else
data[vi] = c_spore_frond
end
end
vi = vi + 1
end
end
end
-- Randomly add fronds in 2x2x2 clusters.
for i = 1, iters do
local clust_x = x + math.random(-size, size - 1)
local clust_y = y + height + math.random(-size, 0)
local clust_z = z + math.random(-size, size - 1)
for xi = 0, 1 do
for yi = 0, 1 do
for zi = 0, 1 do
local vi = area:index(clust_x + xi, clust_y + yi, clust_z + zi)
if data[vi] == c_air or data[vi] == c_ignore then
if has_fruiting_bodies and math.random() < 0.3 then
data[vi] = c_spore_pod
else
data[vi] = c_spore_frond
end
end
end
end
end
end
end
df_trees.spawn_spore_tree = function(pos)
local x, y, z = pos.x, pos.y, pos.z
local height = math.random(4, 5)
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map(
{x = x - 2, y = y, z = z - 2},
{x = x + 2, y = y + height + 1, z = z + 2}
)
local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
df_trees.spawn_spore_tree_vm(area:indexp(pos), area, data)
vm:set_data(data)
vm:write_to_map()
vm:update_map()
end
minetest.register_abm{
label = "spore tree raining spores",
nodenames = {"df_trees:spore_tree_fruiting_body"},
interval = 1,
chance = 30,
catch_up = false,
action = function(pos)
minetest.add_particle({
pos = pos,
velocity = {x=math.random() * 0.2 - 0.1, y=-1, z=math.random() * 0.2 - 0.1},
acceleration = {x=0, y=0, z=0},
expirationtime = 3,
size = 10,
collisiondetection = false,
vertical = false,
texture = "dfcaverns_spore_tree_spores.png",
})
end,
}
minetest.register_craft({
output = 'df_trees:spore_tree_ladder 2',
recipe = {
{'group:spore_tree_hyphae'},
}
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:spore_tree_ladder",
burntime = 1,
})
minetest.register_node("df_trees:spore_tree_ladder", {
description = S("Spore Tree Ladder"),
drawtype = "signlike",
tiles = {"dfcaverns_spore_tree_ladder.png"},
inventory_image = "dfcaverns_spore_tree_ladder.png",
wield_image = "dfcaverns_spore_tree_ladder.png",
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = false,
climbable = true,
is_ground_content = false,
selection_box = {
type = "wallmounted",
--wall_top = = <default>
--wall_bottom = = <default>
--wall_side = = <default>
},
groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
legacy_wallmounted = true,
sounds = default.node_sound_wood_defaults(),
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 883 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

View File

@ -0,0 +1,10 @@
All textures not specifically listed here are created by FaceDeer and released under both the MIT license and under the Creative Commons CC0 license.
dfcaverns_blood_thorn - derived from default cactus
dfcaverns_black_cap - derived from default coal block
dfcaverns_goblin_cap - derived from default red coral
dfcaverns_nether_cap_stem - derived from default red coral
dfcaverns_tower_cap - derived from default dead coral
dfcaverns_tunnel_tube - derived from moretrees palm tree bark
dfcaverns_tower_cap_gills - from caverealms mushroom gills
dfcaverns_spore_tree_spores - derived from farming wheat seed

332
df_trees/torchspine.lua Normal file
View File

@ -0,0 +1,332 @@
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
-- Rather than make this whole mod depend on subterrane just for this, I copied and pasted a chunk of stalactite code.
local x_disp = 0.125
local z_disp = 0.125
local stal_on_place = function(itemstack, placer, pointed_thing)
local pt = pointed_thing
-- check if pointing at a node
if not pt then
return itemstack
end
if pt.type ~= "node" then
return itemstack
end
local under = minetest.get_node(pt.under)
local above = minetest.get_node(pt.above)
if minetest.is_protected(pt.above, placer:get_player_name()) then
minetest.record_protection_violation(pt.above, placer:get_player_name())
return
end
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] or not minetest.registered_nodes[above.name] then
return itemstack
end
-- check if you can replace the node above the pointed node
if not minetest.registered_nodes[above.name].buildable_to then
return itemstack
end
local new_param2
-- check if pointing at an existing stalactite
if minetest.get_item_group(under.name, "subterrane_stal_align") ~= 0 then
new_param2 = under.param2
else
new_param2 = math.random(0,3)
end
-- add the node and remove 1 item from the itemstack
minetest.add_node(pt.above, {name = itemstack:get_name(), param2 = new_param2})
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack
end
local stal_box_1 = {{-0.0625+x_disp, -0.5, -0.0625+z_disp, 0.0625+x_disp, 0.5, 0.0625+z_disp}}
local stal_box_2 = {{-0.125+x_disp, -0.5, -0.125+z_disp, 0.125+x_disp, 0.5, 0.125+z_disp}}
local stal_box_3 = {{-0.25+x_disp, -0.5, -0.25+z_disp, 0.25+x_disp, 0.5, 0.25+z_disp}}
local stal_box_4 = {{-0.375+x_disp, -0.5, -0.375+z_disp, 0.375+x_disp, 0.5, 0.375+z_disp}}
minetest.register_node("df_trees:torchspine_1", {
description = S("Torchspine Tip"),
_doc_items_longdesc = df_trees.doc.torchspine_desc,
_doc_items_usagehelp = df_trees.doc.torchspine_usage,
tiles = {"dfcaverns_torchspine_0.5.png", "dfcaverns_torchspine_1.5.png", "dfcaverns_torchspine_1.png"},
groups = {oddly_breakable_by_hand = 1, subterrane_stal_align = 1, flow_through = 1, fall_damage_add_percent = 100},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
drops = "default:torch",
node_box = {
type = "fixed",
fixed = stal_box_1,
},
on_place = stal_on_place,
})
minetest.register_node("df_trees:torchspine_1_lit", {
description = S("Torchspine Tip"),
_doc_items_longdesc = df_trees.doc.torchspine_desc,
_doc_items_usagehelp = df_trees.doc.torchspine_usage,
tiles = {"default_gold_block.png", "dfcaverns_torchspine_1.5.png", "dfcaverns_torchspine_1_lit.png"},
groups = {oddly_breakable_by_hand = 1, subterrane_stal_align = 1, flow_through = 1, torch = 1, fall_damage_add_percent = 150},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
light_source = 6,
is_ground_content = true,
drops = "default:torch 2",
node_box = {
type = "fixed",
fixed = stal_box_1,
},
on_place = stal_on_place,
})
minetest.register_node("df_trees:torchspine_2", {
description = S("Torchspine"),
_doc_items_longdesc = df_trees.doc.torchspine_desc,
_doc_items_usagehelp = df_trees.doc.torchspine_usage,
tiles = {"dfcaverns_torchspine_1.5.png", "dfcaverns_torchspine_2.5.png", "dfcaverns_torchspine_2.png"},
groups = {oddly_breakable_by_hand = 1, subterrane_stal_align = 1, flow_through = 1, fall_damage_add_percent = 50},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
node_box = {
type = "fixed",
fixed = stal_box_2,
},
drop = {
max_items = 1,
items = {
{
items = {"df_trees:torchspine_ember"}, -- Items to drop
rarity = 2, -- Probability of dropping is 1 / rarity
},
},
},
on_place = stal_on_place,
})
minetest.register_node("df_trees:torchspine_3", {
description = S("Torchspine"),
_doc_items_longdesc = df_trees.doc.torchspine_desc,
_doc_items_usagehelp = df_trees.doc.torchspine_usage,
tiles = {"dfcaverns_torchspine_2.5.png", "dfcaverns_torchspine_3.5.png", "dfcaverns_torchspine_3.png"},
groups = {oddly_breakable_by_hand = 1, subterrane_stal_align = 1, flow_through = 1},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
node_box = {
type = "fixed",
fixed = stal_box_3,
},
drop = {
max_items = 1,
items = {
{
items = {"df_trees:torchspine_ember"}, -- Items to drop
rarity = 2, -- Probability of dropping is 1 / rarity
},
{
items = {"df_trees:torchspine_ember 2"}, -- Items to drop
rarity = 2, -- Probability of dropping is 1 / rarity
},
},
},
on_place = stal_on_place,
})
minetest.register_node("df_trees:torchspine_4", {
description = S("Torchspine"),
_doc_items_longdesc = df_trees.doc.torchspine_desc,
_doc_items_usagehelp = df_trees.doc.torchspine_usage,
tiles = {"dfcaverns_torchspine_3.5.png", "dfcaverns_torchspine_4.5.png", "dfcaverns_torchspine_4.png"},
groups = {oddly_breakable_by_hand = 1, subterrane_stal_align = 1, flow_through = 1},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
node_box = {
type = "fixed",
fixed = stal_box_4,
},
drop = {
max_items = 1,
items = {
{
items = {"df_trees:torchspine_ember 2"}, -- Items to drop
rarity = 2, -- Probability of dropping is 1 / rarity
},
{
items = {"df_trees:torchspine_ember"}, -- Items to drop
rarity = 1, -- Probability of dropping is 1 / rarity
},
},
}, on_place = stal_on_place,
})
minetest.register_node("df_trees:torchspine_ember", {
description = S("Torchspine Ember"),
_doc_items_longdesc = df_trees.doc.torchspine_desc,
_doc_items_usagehelp = df_trees.doc.torchspine_usage,
tiles = {"dfcaverns_torchspine_0.5.png",},
groups = {oddly_breakable_by_hand = 1, subterrane_stal_align = 1, flow_through = 1},
drawtype = "nodebox",
paramtype = "light",
light_source = 2,
paramtype2 = "facedir",
walkable = false,
floodable = true,
node_box = {
type = "fixed",
fixed = {
{-0.0625 + x_disp, -0.5, -0.125 + z_disp, 0.125 + x_disp, -0.375, 0.0625 + z_disp},
}
},
on_place = stal_on_place,
})
df_trees.spawn_torchspine = function(pos)
local x, y, z = pos.x, pos.y, pos.z
local stem_height = math.random(1,4)
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map(
{x = x, y = y, z = z},
{x = x, y = y+height-1, z = z}
)
local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
local data_param2 = vm:get_param2_data()
df_trees.spawn_torchspine_vm(vi, area, data, data_param2, height)
vm:set_data(data)
vm:write_to_map()
vm:update_map()
end
local torchspine_c =
{
minetest.get_content_id("df_trees:torchspine_1"),
minetest.get_content_id("df_trees:torchspine_2"),
minetest.get_content_id("df_trees:torchspine_3"),
minetest.get_content_id("df_trees:torchspine_4")
}
local torchspine_lit_c =
{
minetest.get_content_id("df_trees:torchspine_1_lit"),
minetest.get_content_id("df_trees:torchspine_2"),
minetest.get_content_id("df_trees:torchspine_3"),
minetest.get_content_id("df_trees:torchspine_4")
}
df_trees.spawn_torchspine_vm = function(vi, area, data, data_param2, height, lit)
if height == nil then height = math.random(1,4) end
if lit == nil then lit = math.random() < 0.3 end
local param2 = math.random(0,3)
local list
if lit then list = torchspine_lit_c else list = torchspine_c end
for i = 0, height-1 do
if not minetest.registered_nodes[minetest.get_name_from_content_id(data[vi + area.ystride*i])].buildable_to then
height = i
break
end
end
for i = 0, height-1 do
local index = vi + area.ystride*i
data[index] = list[height-i]
data_param2[index] = param2
end
end
-- overriding node groups using override_item doesn't appear to work with ABMs:
-- https://github.com/minetest/minetest/issues/5518
local coal_def = minetest.registered_nodes["default:stone_with_coal"]
local coal_block_def = minetest.registered_nodes["default:coalblock"]
coal_def.groups.coal = 1
coal_block_def.groups.coal = 1
coal_block_def.groups.flammable = coal_block_def.groups.flammable or 1
minetest.register_node(":default:stone_with_coal", coal_def)
minetest.register_node(":default:coalblock", coal_block_def)
minetest.register_abm{
label = "torchspine germinating",
nodenames = {"df_trees:torchspine_ember"},
neighbors = {"group:flammable", "group:coal"},
interval = 30,
chance = 10,
catch_up = true,
action = function(pos)
local below_name = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
if minetest.get_item_group(below_name, "flammable") > 0 or minetest.get_item_group(below_name, "coal") > 0 then
minetest.swap_node(pos, {name="df_trees:torchspine_1", param2=minetest.get_node(pos).param2})
end
end,
}
minetest.register_abm{
label = "torchspine lighting",
nodenames = {"df_trees:torchspine_1"},
interval = 57,
chance = 10,
catch_up = true,
action = function(pos)
local above_def = minetest.registered_nodes[minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z})]
if above_def and above_def.buildable_to then
minetest.swap_node(pos, {name="df_trees:torchspine_1_lit", param2=minetest.get_node(pos).param2})
end
end,
}
local torchspine_list = {"df_trees:torchspine_1","df_trees:torchspine_2","df_trees:torchspine_3","df_trees:torchspine_4"}
minetest.register_abm{
label = "torchspine growing",
nodenames = {"df_trees:torchspine_1_lit"},
interval = 30,
chance = 10,
catch_up = true,
action = function(pos)
local height = 0
local param2 = minetest.get_node(pos).param2
local dest_list = {{x=pos.x, y=pos.y+1, z=pos.z},pos,{x=pos.x, y=pos.y-1, z=pos.z},{x=pos.x, y=pos.y-2, z=pos.z},{x=pos.x, y=pos.y-3, z=pos.z}}
local source_list = {
minetest.get_node(dest_list[1]).name,
minetest.get_node(dest_list[2]).name,
minetest.get_node(dest_list[3]).name,
minetest.get_node(dest_list[4]).name,
minetest.get_node(dest_list[5]).name
}
local target_def = minetest.registered_nodes[source_list[1]]
if target_def and target_def.buildable_to then
for i = 2,4 do
if minetest.get_item_group(source_list[i+1], "flammable") > 0 or minetest.get_item_group(source_list[i+1], "coal") > 0 then
height = i
break
elseif source_list[i+1] ~= torchspine_list[i] then
height = 0
break
end
end
end
if height == 0 then
minetest.swap_node(pos, {name="df_trees:torchspine_1", param2=param2})
return
end
for i = 1, height do
minetest.swap_node(dest_list[i], {name=torchspine_list[i], param2=param2})
end
end,
}

179
df_trees/tower_cap.lua Normal file
View File

@ -0,0 +1,179 @@
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--stem
minetest.register_node("df_trees:tower_cap_stem", {
description = S("Tower Cap Stem"),
_doc_items_longdesc = df_trees.doc.tower_cap_desc,
_doc_items_usagehelp = df_trees.doc.tower_cap_usage,
tiles = {"dfcaverns_tower_cap.png"},
is_ground_content = true,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
})
--cap
minetest.register_node("df_trees:tower_cap", {
description = S("Tower Cap"),
_doc_items_longdesc = df_trees.doc.tower_cap_desc,
_doc_items_usagehelp = df_trees.doc.tower_cap_usage,
tiles = {"dfcaverns_tower_cap.png"},
is_ground_content = true,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
})
--gills
minetest.register_node("df_trees:tower_cap_gills", {
description = S("Tower Cap Gills"),
_doc_items_longdesc = df_trees.doc.tower_cap_desc,
_doc_items_usagehelp = df_trees.doc.tower_cap_usage,
tiles = {"dfcaverns_tower_cap_gills.png"},
is_ground_content = true,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
sounds = default.node_sound_leaves_defaults(),
drawtype = "plantlike",
paramtype = "light",
drop = {
max_items = 1,
items = {
{
items = {'df_trees:tower_cap_sapling'},
rarity = 5,
},
{
items = {'df_trees:tower_cap_gills'},
}
}
},
after_place_node = default.after_place_leaves,
})
if default.register_leafdecay then -- default.register_leafdecay is very new, remove this check some time after 0.4.16 is released
default.register_leafdecay({
trunks = {"df_trees:tower_cap"}, -- don't need stem nodes here
leaves = {"df_trees:tower_cap_gills"},
radius = 1,
})
end
--Wood
minetest.register_craft({
output = 'df_trees:tower_cap_wood 4',
recipe = {
{'df_trees:tower_cap'},
}
})
minetest.register_craft({
output = 'df_trees:tower_cap_wood 4',
recipe = {
{'df_trees:tower_cap_stem'},
}
})
minetest.register_node("df_trees:tower_cap_wood", {
description = S("Tower Cap Planks"),
_doc_items_longdesc = df_trees.doc.tower_cap_desc,
_doc_items_usagehelp = df_trees.doc.tower_cap_usage,
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"dfcaverns_tower_cap_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
df_trees.register_all_stairs("tower_cap_wood")
minetest.register_craft({
type = "fuel",
recipe = "df_trees:tower_cap_wood",
burntime = 7,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:tower_cap",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:tower_cap_stem",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:tower_cap_gills",
burntime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:tower_cap_sapling",
burntime = 2,
})
-- sapling
minetest.register_node("df_trees:tower_cap_sapling", {
description = S("Tower Cap Spawn"),
_doc_items_longdesc = df_trees.doc.tower_cap_desc,
_doc_items_usagehelp = df_trees.doc.tower_cap_usage,
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"dfcaverns_tower_cap_sapling.png"},
inventory_image = "dfcaverns_tower_cap_sapling.png",
wield_image = "dfcaverns_tower_cap_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
floodable = true,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1, light_sensitive_fungus = 11},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(
df_trees.config.tower_cap_delay_multiplier*df_trees.config.tree_min_growth_delay,
df_trees.config.tower_cap_delay_multiplier*df_trees.config.tree_max_growth_delay))
end,
on_timer = function(pos)
minetest.set_node(pos, {name="air"})
df_trees.spawn_tower_cap(pos)
end,
})
local c_stem = minetest.get_content_id("df_trees:tower_cap_stem")
local c_cap = minetest.get_content_id("df_trees:tower_cap")
local c_gills = minetest.get_content_id("df_trees:tower_cap_gills")
df_trees.spawn_tower_cap = function(pos)
local x, y, z = pos.x, pos.y, pos.z
local stem_height = math.random(4,10)
local cap_radius = math.random(4,6)
local maxy = y + stem_height + 3
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map(
{x = x - cap_radius, y = y, z = z - cap_radius},
{x = x + cap_radius, y = maxy + 3, z = z + cap_radius}
)
local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
subterrane.giant_mushroom(area:indexp(pos), area, data, c_stem, c_cap, c_gills, stem_height, cap_radius)
vm:set_data(data)
vm:write_to_map()
vm:update_map()
end
df_trees.spawn_tower_cap_vm = function(vi, area, data)
local stem_height = math.random(4,10)
local cap_radius = math.random(4,6)
subterrane.giant_mushroom(vi, area, data, c_stem, c_cap, c_gills, stem_height, cap_radius)
end

399
df_trees/tunnel_tube.lua Normal file
View File

@ -0,0 +1,399 @@
--------------------------------------------------
-- Tunnel tube
-- Magenta
-- curving trunk
-- Max trunk height 8
-- depth 2-3
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
minetest.register_node("df_trees:tunnel_tube", {
description = S("Tunnel Tube"),
_doc_items_longdesc = df_trees.doc.tunnel_tube_desc,
_doc_items_usagehelp = df_trees.doc.tunnel_tube_usage,
tiles = {"dfcaverns_tunnel_tube.png"},
paramtype2 = "facedir",
drawtype = "nodebox",
paramtype = "light",
groups = {choppy = 3, tree = 1, oddly_breakable_by_hand=1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
node_box = {
type = "fixed",
fixed = {
{-8/16,-8/16,-8/16,-4/16,8/16,8/16},
{4/16,-8/16,-8/16,8/16,8/16,8/16},
{-4/16,-8/16,-8/16,4/16,8/16,-4/16},
{-4/16,-8/16,8/16,4/16,8/16,4/16},
},
},
})
minetest.register_node("df_trees:tunnel_tube_slant_bottom", {
description = S("Tunnel Tube"),
_doc_items_longdesc = df_trees.doc.tunnel_tube_desc,
_doc_items_usagehelp = df_trees.doc.tunnel_tube_usage,
tiles = {"dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png"},
paramtype2 = "facedir",
drawtype = "mesh",
mesh = "tunnel_tube_slant.obj",
paramtype = "light",
drop = "df_trees:tunnel_tube",
groups = {choppy = 3, tree = 1, oddly_breakable_by_hand=1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.625, 0.5, 0.0, 0.375},
{-0.5, 0.0, -0.875, 0.5, 0.5, 0.125},
},
},
collision_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.625, 0.5, 0.0, 0.375},
{-0.5, 0.0, -0.875, 0.5, 0.5, 0.125},
},
},
})
minetest.register_node("df_trees:tunnel_tube_slant_top", {
description = S("Tunnel Tube"),
_doc_items_longdesc = df_trees.doc.tunnel_tube_desc,
_doc_items_usagehelp = df_trees.doc.tunnel_tube_usage,
tiles = {"dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png"},
paramtype2 = "facedir",
drawtype = "mesh",
mesh = "tunnel_tube_slant_2.obj",
paramtype = "light",
drop = "df_trees:tunnel_tube",
groups = {choppy = 3, tree = 1, oddly_breakable_by_hand=1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.125, 0.5, 0.0, 0.875},
{-0.5, 0.0, -0.375, 0.5, 0.5, 0.625},
},
},
collision_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.125, 0.5, 0.0, 0.875},
{-0.5, 0.0, -0.375, 0.5, 0.5, 0.625},
},
},
})
minetest.register_node("df_trees:tunnel_tube_slant_full", {
description = S("Tunnel Tube"),
_doc_items_longdesc = df_trees.doc.tunnel_tube_desc,
_doc_items_usagehelp = df_trees.doc.tunnel_tube_usage,
tiles = {"dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png", "dfcaverns_tunnel_tube.png"},
paramtype2 = "facedir",
drawtype = "mesh",
mesh = "tunnel_tube_slant_full.obj",
paramtype = "light",
drop = "df_trees:tunnel_tube",
groups = {choppy = 3, tree = 1, oddly_breakable_by_hand=1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.75, 0.5, 0, 0.25},
{-0.5, 0, -1.25, 0.5, 0.5, -0.25},
},
},
collision_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.75, 0.5, 0, 0.25},
{-0.5, 0, -1.25, 0.5, 0.5, -0.25},
},
},
})
--Wood
minetest.register_craft({
output = 'df_trees:tunnel_tube_wood 4',
recipe = {
{'df_trees:tunnel_tube'},
}
})
minetest.register_node("df_trees:tunnel_tube_wood", {
description = S("Tunnel Tube Plies"),
_doc_items_longdesc = df_trees.doc.tunnel_tube_desc,
_doc_items_usagehelp = df_trees.doc.tunnel_tube_usage,
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"dfcaverns_tunnel_tube_wood_top.png", "dfcaverns_tunnel_tube_wood_top.png", "dfcaverns_tunnel_tube_wood_side.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
df_trees.register_all_stairs("tunnel_tube_wood")
minetest.register_craft({
type = "fuel",
recipe = "df_trees:tunnel_tube_wood",
burntime = 9,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:tunnel_tube",
burntime = 36,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:tunnel_tube_sapling",
burntime = 3,
})
-- TNT
-----------------------------------------------------------------------------------------------------------
if df_trees.config.enable_tnt then
local tnt_radius = tonumber(minetest.settings:get("tnt_radius") or 3) * 2/3
local tnt_def = {radius = tnt_radius, damage_radius = tnt_radius * 2}
minetest.register_node("df_trees:tunnel_tube_fruiting_body", {
description = S("Tunnel Tube Fruiting Body"),
_doc_items_longdesc = df_trees.doc.tunnel_tube_desc,
_doc_items_usagehelp = df_trees.doc.tunnel_tube_usage,
tiles = {"dfcaverns_tunnel_tube.png^[multiply:#b09090"},
paramtype2 = "facedir",
groups = {choppy = 3, oddly_breakable_by_hand=1, flammable = 2, tnt = 1,},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
drop = {
max_items = 3,
items = {
{
items = {'df_trees:tunnel_tube_sapling'},
rarity = 2,
},
{
items = {'df_trees:tunnel_tube_sapling', 'tnt:gunpowder'},
rarity = 2,
},
{
items = {'df_trees:tunnel_tube_sapling', 'tnt:gunpowder 2'},
rarity = 2,
},
},
},
on_punch = function(pos, node, puncher)
if puncher:get_wielded_item():get_name() == "default:torch" then
minetest.swap_node(pos, {name = "df_trees:tunnel_tube_fruiting_body_burning"})
minetest.registered_nodes["df_trees:tunnel_tube_fruiting_body_burning"].on_construct(pos)
minetest.log("action", puncher:get_player_name() .. " ignites " .. node.name .. " at " .. minetest.pos_to_string(pos))
end
end,
on_blast = function(pos, intensity)
minetest.after(0.1, function()
tnt.boom(pos, tnt_def)
end)
end,
mesecons = {effector =
{action_on =
function(pos)
tnt.boom(pos, tnt_def)
end
}
},
on_burn = function(pos)
minetest.swap_node(pos, {name = "df_trees:tunnel_tube_fruiting_body_burning"})
minetest.registered_nodes["df_trees:tunnel_tube_fruiting_body_burning"].on_construct(pos)
end,
on_ignite = function(pos, igniter)
minetest.swap_node(pos, {name = "df_trees:tunnel_tube_fruiting_body_burning"})
minetest.registered_nodes["df_trees:tunnel_tube_fruiting_body_burning"].on_construct(pos)
end,
})
minetest.register_node("df_trees:tunnel_tube_fruiting_body_burning", {
description = S("Tunnel Tube Fruiting Body"),
_doc_items_longdesc = df_trees.doc.tunnel_tube_desc,
_doc_items_usagehelp = df_trees.doc.tunnel_tube_usage,
tiles = {"dfcaverns_tunnel_tube.png^[multiply:#b09090"},
groups = {not_in_creative_inventory = 1,},
light_source = 5,
drop = "",
sounds = default.node_sound_wood_defaults(),
on_timer = function(pos, elapsed)
tnt.boom(pos, tnt_def)
end,
-- unaffected by explosions
on_blast = function() end,
on_construct = function(pos)
minetest.sound_play("tnt_ignite", {pos = pos})
minetest.get_node_timer(pos):start(4)
end,
})
else
minetest.register_node("df_trees:tunnel_tube_fruiting_body", {
description = S("Tunnel Tube Fruiting Body"),
_doc_items_longdesc = df_trees.doc.tunnel_tube_desc,
_doc_items_usagehelp = df_trees.doc.tunnel_tube_usage,
tiles = {"dfcaverns_tunnel_tube.png^[multiply:#b09090"},
paramtype2 = "facedir",
groups = {choppy = 3, oddly_breakable_by_hand=1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
drop = {
max_items = 3,
items = {
{
items = {'df_trees:tunnel_tube_sapling'},
rarity = 2,
},
{
items = {'df_trees:tunnel_tube_sapling'},
rarity = 2,
},
{
items = {'df_trees:tunnel_tube_sapling'},
rarity = 2,
},
},
},
})
end
-----------------------------------------------------------------------------------------------------------
minetest.register_node("df_trees:tunnel_tube_sapling", {
description = S("Tunnel Tube Spawn"),
_doc_items_longdesc = df_trees.doc.tunnel_tube_desc,
_doc_items_usagehelp = df_trees.doc.tunnel_tube_usage,
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"dfcaverns_tunnel_tube_sapling.png"},
inventory_image = "dfcaverns_tunnel_tube_sapling.png",
wield_image = "dfcaverns_tunnel_tube_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
floodable = true,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1, light_sensitive_fungus = 11},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(
df_trees.config.tunnel_tube_delay_multiplier*df_trees.config.tree_min_growth_delay,
df_trees.config.tunnel_tube_delay_multiplier*df_trees.config.tree_max_growth_delay))
end,
on_timer = function(pos)
minetest.set_node(pos, {name="air"})
df_trees.spawn_tunnel_tube(pos)
end,
})
local tunnel_tube_directions = {
[0] = {x=0,y=0,z=-1},
[1] = {x=-1,y=0,z=0},
[2] = {x=0,y=0,z=1},
[3] = {x=1,y=0,z=0},
}
local tunnel_tube_displacement =
{
[4] = 1,
[5] = 1,
[6] = 2,
[7] = 2,
[8] = 3,
[9] = 3,
}
df_trees.spawn_tunnel_tube = function(pos)
local direction = math.random(1,4)-1 -- serves as both the facedir and the lookup in the direction table
local height = math.random(4,9)
local top_pos = vector.add(pos, vector.multiply(tunnel_tube_directions[direction], tunnel_tube_displacement[height]))
top_pos.y = pos.y + height - 1
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map(pos, top_pos)
local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
local param2_data = vm:get_param2_data()
df_trees.spawn_tunnel_tube_vm(area:indexp(pos), area, data, param2_data, height, direction)
vm:set_data(data)
vm:set_param2_data(param2_data)
vm:write_to_map()
vm:update_map()
end
local c_air = minetest.get_content_id("air")
local c_ignore = minetest.get_content_id("ignore")
local c_tunnel_tube = minetest.get_content_id("df_trees:tunnel_tube")
local c_tunnel_tube_bottom = minetest.get_content_id("df_trees:tunnel_tube_slant_bottom")
local c_tunnel_tube_top = minetest.get_content_id("df_trees:tunnel_tube_slant_top")
local c_tunnel_tube_full = minetest.get_content_id("df_trees:tunnel_tube_slant_full")
local c_tunnel_tube_fruiting_body = minetest.get_content_id("df_trees:tunnel_tube_fruiting_body")
-- was simplest to just hardcode these patterns for each height from 4 to 9
-- pattern is displacement, node
local tunnel_tube_patterns =
{
[4] = {{0, c_tunnel_tube}, {0, c_tunnel_tube_bottom}, {1, c_tunnel_tube_top}, {1, c_tunnel_tube_fruiting_body}},
[5] = {{0, c_tunnel_tube}, {0, c_tunnel_tube}, {0, c_tunnel_tube_bottom}, {1, c_tunnel_tube_top}, {1, c_tunnel_tube_fruiting_body}},
[6] = {{0, c_tunnel_tube}, {0, c_tunnel_tube}, {0, c_tunnel_tube_bottom}, {1, c_tunnel_tube_top}, {1, c_tunnel_tube_full}, {2, c_tunnel_tube_fruiting_body}},
[7] = {{0, c_tunnel_tube}, {0, c_tunnel_tube}, {0, c_tunnel_tube}, {0, c_tunnel_tube_bottom}, {1, c_tunnel_tube_top}, {1, c_tunnel_tube_full}, {2, c_tunnel_tube_fruiting_body}},
[8] = {{0, c_tunnel_tube}, {0, c_tunnel_tube}, {0, c_tunnel_tube}, {0, c_tunnel_tube_bottom}, {1, c_tunnel_tube_top}, {1, c_tunnel_tube_full}, {2, c_tunnel_tube_full}, {3, c_tunnel_tube_fruiting_body}},
[9] = {{0, c_tunnel_tube}, {0, c_tunnel_tube}, {0, c_tunnel_tube}, {0, c_tunnel_tube}, {0, c_tunnel_tube_bottom}, {1, c_tunnel_tube_top}, {1, c_tunnel_tube_full}, {2, c_tunnel_tube_full}, {3, c_tunnel_tube_fruiting_body}},
}
df_trees.spawn_tunnel_tube_vm = function(vi, area, data, param2_data, height, direction)
if height == nil then height = math.random(4,9) end
if direction == nil then direction = math.random(1,4)-1 end
local increment
if direction == 0 then
increment = -area.zstride
elseif direction == 1 then
increment = -1
elseif direction == 2 then
increment = area.zstride
elseif direction == 3 then
increment = 1
else
return
end
local previous_vi = vi
local pattern = tunnel_tube_patterns[height]
for i, nodepattern in ipairs(pattern) do
local current_vi = vi + nodepattern[1] * increment
if data[current_vi] == c_air or data[current_vi] == c_ignore then
previous_vi = current_vi
data[current_vi] = nodepattern[2]
param2_data[current_vi] = direction
else
data[previous_vi] = c_tunnel_tube_fruiting_body
param2_data[previous_vi] = direction
break
end
vi = vi + area.ystride
end
end