Small stuff (#8)

* cave pearls and spindleshrooms (name subject to change) now are things. Not in mapgen yet.

* add the wandering "gas wisp" to light up some of the gas-filled caverns

* make wisps rarely spawned by gas explosions

* revamp spindlestems into a sort of mineral detector, add glowing extract bottles

* optimize pngs

* add gas wisps to mapgen

* add spindlestems to cavern level 1, most level 1 warrens are now lit up

* update internal names, adjust mineral detection range

* add cave pearls to some level 2 warrens and tunnels

* switch experimental simplecrafting_lib support to crafting mod

* Pearls don't grow on falling nodes

* put spindlestems with goblin caps, make them always grow red when near those

* bunch of documentation

* add castle coral to replace cave coral, which has been repurposed into column decoration

* documentation for cave coral, update some locale text

* add a recipe for cooking oil into paraffin

* add old bones to the underworld

* MIT license for bones_loot

* also cook black cap gills into paraffin, they're oily

* add salt crystals to the bloodthorn caverns, illuminating the floor

* documentation for salt crystals

* auto-generate minetestmapper colors.

need to update the spindlestem colours manually

* add spindlestem to fungiwood caverns too, and increase warren coverage

* in anticipation of eventually adding stuff below the Slade, making glowing pit erosion self-limiting.

* add a bit of displacement to the underside of the slade layer

* Unique images and names for cooking recipes.

* revamp bones loot

* add softer footsteps for some fungus types

* update mapgen_helper

* update cave coral screenshot

* mention glowing salts in bloodthorn caverns
This commit is contained in:
FaceDeer
2019-08-18 22:20:07 -05:00
committed by GitHub
parent 5e113ec200
commit 12919e9a16
184 changed files with 2787 additions and 521 deletions

View File

@ -81,6 +81,15 @@ minetest.register_craft({
}
})
if minetest.get_modpath("basic_materials") then
minetest.register_craft({
type = "cooking",
output = "basic_materials:paraffin",
recipe = "df_trees:black_cap_gills",
cooktime = 5,
})
end
minetest.register_node("df_trees:black_cap_wood", {
description = S("Black Cap Planks"),
_doc_items_longdesc = df_trees.doc.black_cap_desc,

View File

@ -2,4 +2,6 @@ default
intllib?
doc?
moreblocks?
stairs?
stairs?
vessels?
basic_materials?

View File

@ -40,4 +40,32 @@ else
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.")
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.")
df_trees.doc.spindlestem_desc = S("Spindlestems are too big to easily pluck by hand but too small to be called a proper tree. Nevertheless, they are a common and useful resource for underground travelers - particularly their glowing caps.")
df_trees.doc.spindlestem_usage = S("The stem of a Spindlestem is surprisingly sturdy, and despite their thinness they can grow quite tall. They can be used as a wood substitute in many crafting recipes.")
df_trees.doc.spindlestem_cap_white_desc = S("The cap of a Spindlestem, uncontaminated by any symbiotic luminescent microorganisms.")
df_trees.doc.spindlestem_cap_white_usage = S("These things are useless except as weak fuel for a fire.")
df_trees.doc.spindlestem_cap_red_desc = S("The cap of a Spindlestem, glowing a weak red due to symbiotic microorganisms.")
df_trees.doc.spindlestem_cap_red_usage = S("Red Spindlestems are a sign of nearby iron deposits - or perhaps Goblin Caps. Their glowing symbiotes can be extracted as a long-lived light source, though the glow is weak.")
df_trees.doc.spindlestem_cap_green_desc = S("The cap of a Spindlestem, glowing a soft green due to symbiotic microorganisms.")
df_trees.doc.spindlestem_cap_green_usage = S("Green Spindlestems are a sign of nearby copper deposits. Their glowing symbiotes can be extracted as a long-lived light source, though the glow is not strong.")
df_trees.doc.spindlestem_cap_cyan_desc = S("The cap of a Spindlestem, glowing a strong cyan due to symbiotic microorganisms.")
df_trees.doc.spindlestem_cap_cyan_usage = S("Cyan Spindlestems are a sign of both copper and iron deposits nearby. Their glowing symbiotes can be extracted as a long-lived light source.")
df_trees.doc.spindlestem_cap_golden_desc = S("The cap of a Spindlestem, glowing a brilliant yellow due to symbiotic microorganisms.")
df_trees.doc.spindlestem_cap_golden_usage = S("Golden Spindlestems are a sign of rare and magical mineral deposits nearby. Their glowing symbiotes can be extracted as a strong and long-lived light source.")
df_trees.doc.spindlestem_extract_red_desc = S("Living extract from the cap of a red Spindlestem.")
df_trees.doc.spindlestem_extract_red_usage = df_trees.doc.spindlestem_cap_red_usage
df_trees.doc.spindlestem_extract_green_desc = S("Living extract from the cap of a green Spindlestem.")
df_trees.doc.spindlestem_extract_green_usage = df_trees.doc.spindlestem_cap_green_usage
df_trees.doc.spindlestem_extract_cyan_desc = S("Living extract from the cap of a cyan Spindlestem.")
df_trees.doc.spindlestem_extract_cyan_usage = df_trees.doc.spindlestem_cap_cyan_usage
df_trees.doc.spindlestem_extract_golden_desc = S("Living extract from the cap of a yellow Spindlestem.")
df_trees.doc.spindlestem_extract_golden_usage = df_trees.doc.spindlestem_cap_golden_usage

View File

@ -125,9 +125,12 @@ minetest.register_node("df_trees:fungiwood_sapling", {
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))
local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0}))
if minetest.get_item_group(below_node.name, "soil") > 0 then
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
end,
on_timer = function(pos)

View File

@ -9,8 +9,8 @@ minetest.register_node("df_trees:goblin_cap_stem", {
_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(),
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, goblin_cap = 1},
sounds = df_trees.node_sound_tree_soft_fungus_defaults(),
})
--cap
@ -20,8 +20,8 @@ minetest.register_node("df_trees:goblin_cap", {
_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(),
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, goblin_cap = 1},
sounds = df_trees.node_sound_tree_soft_fungus_defaults(),
})
--gills
@ -31,7 +31,7 @@ minetest.register_node("df_trees:goblin_cap_gills", {
_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},
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, goblin_cap = 1},
sounds = default.node_sound_leaves_defaults(),
drawtype = "plantlike",
paramtype = "light",
@ -154,9 +154,12 @@ minetest.register_node("df_trees:goblin_cap_sapling", {
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))
local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0}))
if minetest.get_item_group(below_node.name, "soil") > 0 then
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
end,
on_timer = function(pos)

View File

@ -1,5 +1,13 @@
df_trees = {}
df_trees.node_sound_tree_soft_fungus_defaults = function(table)
table = table or {}
table.footstep = table.footstep or
{name = "dfcaverns_fungus_footstep", gain = 0.3}
default.node_sound_wood_defaults(table)
return table
end
--grab a shorthand for the filepath of the mod
local modpath = minetest.get_modpath(minetest.get_current_modname())
@ -62,5 +70,5 @@ dofile(modpath.."/goblin_cap.lua")
dofile(modpath.."/tower_cap.lua")
dofile(modpath.."/torchspine.lua")
dofile(modpath.."/spindlestem.lua")

View File

@ -7,7 +7,7 @@ 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"
"POT-Creation-Date: 2019-08-05 20:30-0600\n"
"PO-Revision-Date: 2017-08-17 23:01+0100\n"
"Last-Translator: H4mlet <h4mlet@riseup.net>\n"
"Language-Team: ITALIANO\n"
@ -46,15 +46,15 @@ msgstr "Gambo di spina del sangue"
msgid "Dead Blood Thorn Stem"
msgstr "Gambo di spina del sangue morta"
#: df_trees\blood_thorn.lua:60
#: df_trees\blood_thorn.lua:61
msgid "Blood Thorn Spike"
msgstr "Spuntone di spina del sangue"
#: df_trees\blood_thorn.lua:90
#: df_trees\blood_thorn.lua:91
msgid "Dead Blood Thorn Spike"
msgstr "Spuntone di spina del sangue morta"
#: df_trees\blood_thorn.lua:127
#: df_trees\blood_thorn.lua:134
msgid "Blood Thorn Planks"
msgstr "Assi di spina del sangue"
@ -197,6 +197,96 @@ msgid ""
"sprout into new torchspines when placed on flammable surfaces."
msgstr ""
#: df_trees\doc.lua:45
msgid ""
"Spindlestems are too big to easily pluck by hand but too small to be called "
"a proper tree. Nevertheless, they are a common and useful resource for "
"underground travelers - particularly their glowing caps."
msgstr ""
#: df_trees\doc.lua:46
msgid ""
"The stem of a Spindlestem is surprisingly sturdy, and despite their thinness "
"they can grow quite tall. They can be used as a wood substitute in many "
"crafting recipes."
msgstr ""
#: df_trees\doc.lua:48
msgid ""
"The cap of a Spindlestem, uncontaminated by any symbiotic luminescent "
"microorganisms."
msgstr ""
#: df_trees\doc.lua:49
msgid "These things are useless except as weak fuel for a fire."
msgstr ""
#: df_trees\doc.lua:51
msgid ""
"The cap of a Spindlestem, glowing a weak red due to symbiotic microorganisms."
msgstr ""
#: df_trees\doc.lua:52
msgid ""
"Red Spindlestems are a sign of nearby iron deposits - or perhaps Goblin "
"Caps. Their glowing symbiotes can be extracted as a long-lived light source, "
"though the glow is weak."
msgstr ""
#: df_trees\doc.lua:54
msgid ""
"The cap of a Spindlestem, glowing a soft green due to symbiotic "
"microorganisms."
msgstr ""
#: df_trees\doc.lua:55
msgid ""
"Green Spindlestems are a sign of nearby copper deposits. Their glowing "
"symbiotes can be extracted as a long-lived light source, though the glow is "
"not strong."
msgstr ""
#: df_trees\doc.lua:57
msgid ""
"The cap of a Spindlestem, glowing a strong cyan due to symbiotic "
"microorganisms."
msgstr ""
#: df_trees\doc.lua:58
msgid ""
"Cyan Spindlestems are a sign of both copper and iron deposits nearby. Their "
"glowing symbiotes can be extracted as a long-lived light source."
msgstr ""
#: df_trees\doc.lua:60
msgid ""
"The cap of a Spindlestem, glowing a brilliant yellow due to symbiotic "
"microorganisms."
msgstr ""
#: df_trees\doc.lua:61
msgid ""
"Golden Spindlestems are a sign of rare and magical mineral deposits nearby. "
"Their glowing symbiotes can be extracted as a strong and long-lived light "
"source."
msgstr ""
#: df_trees\doc.lua:64
msgid "Living extract from the cap of a red Spindlestem."
msgstr ""
#: df_trees\doc.lua:66
msgid "Living extract from the cap of a green Spindlestem."
msgstr ""
#: df_trees\doc.lua:68
msgid "Living extract from the cap of a cyan Spindlestem."
msgstr ""
#: df_trees\doc.lua:70
msgid "Living extract from the cap of a yellow Spindlestem."
msgstr ""
#: df_trees\fungiwood.lua:13
msgid "Fungiwood Stem"
msgstr "Gambo di fungo di legno"
@ -265,6 +355,43 @@ msgstr "Assi di cappello del Nether"
msgid "Nether Cap Spawn"
msgstr "Prole di cappello del Nether"
#: df_trees\spindlestem.lua:64
msgid "Spindlestem"
msgstr ""
#: df_trees\spindlestem.lua:97
msgid "@1 Spindlestem Cap"
msgstr ""
#: df_trees\spindlestem.lua:186
msgid "@1 Spindlestem Extract"
msgstr ""
#: df_trees\spindlestem.lua:234
#, fuzzy
msgid "Spindlestem Spawn"
msgstr "Prole di albero delle spore"
#: df_trees\spindlestem.lua:273
msgid "White"
msgstr ""
#: df_trees\spindlestem.lua:274
msgid "Red"
msgstr ""
#: df_trees\spindlestem.lua:275
msgid "Green"
msgstr ""
#: df_trees\spindlestem.lua:276
msgid "Cyan"
msgstr ""
#: df_trees\spindlestem.lua:277
msgid "Golden"
msgstr ""
#: df_trees\spore_tree.lua:14
msgid "Spore Tree Stem"
msgstr "Gambo di albero delle spore"
@ -285,7 +412,7 @@ msgstr "Corpo fruttifero dell'albero delle spore"
msgid "Spore Tree Spawn"
msgstr "Prole di albero delle spore"
#: df_trees\spore_tree.lua:303
#: df_trees\spore_tree.lua:306
#, fuzzy
msgid "Spore Tree Ladder"
msgstr "Ife di albero delle spore"
@ -325,23 +452,23 @@ msgstr "Assi di cappello a torre"
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
#: df_trees\tunnel_tube.lua:14
#: df_trees\tunnel_tube.lua:37
#: df_trees\tunnel_tube.lua:67
#: df_trees\tunnel_tube.lua:96
msgid "Tunnel Tube"
msgstr "Tubo di galleria"
#: df_trees\tunnel_tube.lua:135
#: df_trees\tunnel_tube.lua:133
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
#: df_trees\tunnel_tube.lua:170
#: df_trees\tunnel_tube.lua:226
#: df_trees\tunnel_tube.lua:246
msgid "Tunnel Tube Fruiting Body"
msgstr "Corpo fruttifero del tubo di galleria"
#: df_trees\tunnel_tube.lua:279
#: df_trees\tunnel_tube.lua:277
msgid "Tunnel Tube Spawn"
msgstr "Prole di tubo di galleria"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-12-23 00:27-0700\n"
"POT-Creation-Date: 2019-08-05 20:30-0600\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"
@ -45,15 +45,15 @@ msgstr ""
msgid "Dead Blood Thorn Stem"
msgstr ""
#: df_trees\blood_thorn.lua:60
#: df_trees\blood_thorn.lua:61
msgid "Blood Thorn Spike"
msgstr ""
#: df_trees\blood_thorn.lua:90
#: df_trees\blood_thorn.lua:91
msgid "Dead Blood Thorn Spike"
msgstr ""
#: df_trees\blood_thorn.lua:127
#: df_trees\blood_thorn.lua:134
msgid "Blood Thorn Planks"
msgstr ""
@ -196,6 +196,96 @@ msgid ""
"sprout into new torchspines when placed on flammable surfaces."
msgstr ""
#: df_trees\doc.lua:45
msgid ""
"Spindlestems are too big to easily pluck by hand but too small to be called "
"a proper tree. Nevertheless, they are a common and useful resource for "
"underground travelers - particularly their glowing caps."
msgstr ""
#: df_trees\doc.lua:46
msgid ""
"The stem of a Spindlestem is surprisingly sturdy, and despite their thinness "
"they can grow quite tall. They can be used as a wood substitute in many "
"crafting recipes."
msgstr ""
#: df_trees\doc.lua:48
msgid ""
"The cap of a Spindlestem, uncontaminated by any symbiotic luminescent "
"microorganisms."
msgstr ""
#: df_trees\doc.lua:49
msgid "These things are useless except as weak fuel for a fire."
msgstr ""
#: df_trees\doc.lua:51
msgid ""
"The cap of a Spindlestem, glowing a weak red due to symbiotic microorganisms."
msgstr ""
#: df_trees\doc.lua:52
msgid ""
"Red Spindlestems are a sign of nearby iron deposits - or perhaps Goblin "
"Caps. Their glowing symbiotes can be extracted as a long-lived light source, "
"though the glow is weak."
msgstr ""
#: df_trees\doc.lua:54
msgid ""
"The cap of a Spindlestem, glowing a soft green due to symbiotic "
"microorganisms."
msgstr ""
#: df_trees\doc.lua:55
msgid ""
"Green Spindlestems are a sign of nearby copper deposits. Their glowing "
"symbiotes can be extracted as a long-lived light source, though the glow is "
"not strong."
msgstr ""
#: df_trees\doc.lua:57
msgid ""
"The cap of a Spindlestem, glowing a strong cyan due to symbiotic "
"microorganisms."
msgstr ""
#: df_trees\doc.lua:58
msgid ""
"Cyan Spindlestems are a sign of both copper and iron deposits nearby. Their "
"glowing symbiotes can be extracted as a long-lived light source."
msgstr ""
#: df_trees\doc.lua:60
msgid ""
"The cap of a Spindlestem, glowing a brilliant yellow due to symbiotic "
"microorganisms."
msgstr ""
#: df_trees\doc.lua:61
msgid ""
"Golden Spindlestems are a sign of rare and magical mineral deposits nearby. "
"Their glowing symbiotes can be extracted as a strong and long-lived light "
"source."
msgstr ""
#: df_trees\doc.lua:64
msgid "Living extract from the cap of a red Spindlestem."
msgstr ""
#: df_trees\doc.lua:66
msgid "Living extract from the cap of a green Spindlestem."
msgstr ""
#: df_trees\doc.lua:68
msgid "Living extract from the cap of a cyan Spindlestem."
msgstr ""
#: df_trees\doc.lua:70
msgid "Living extract from the cap of a yellow Spindlestem."
msgstr ""
#: df_trees\fungiwood.lua:13
msgid "Fungiwood Stem"
msgstr ""
@ -264,6 +354,42 @@ msgstr ""
msgid "Nether Cap Spawn"
msgstr ""
#: df_trees\spindlestem.lua:64
msgid "Spindlestem"
msgstr ""
#: df_trees\spindlestem.lua:97
msgid "@1 Spindlestem Cap"
msgstr ""
#: df_trees\spindlestem.lua:186
msgid "@1 Spindlestem Extract"
msgstr ""
#: df_trees\spindlestem.lua:234
msgid "Spindlestem Spawn"
msgstr ""
#: df_trees\spindlestem.lua:273
msgid "White"
msgstr ""
#: df_trees\spindlestem.lua:274
msgid "Red"
msgstr ""
#: df_trees\spindlestem.lua:275
msgid "Green"
msgstr ""
#: df_trees\spindlestem.lua:276
msgid "Cyan"
msgstr ""
#: df_trees\spindlestem.lua:277
msgid "Golden"
msgstr ""
#: df_trees\spore_tree.lua:14
msgid "Spore Tree Stem"
msgstr ""
@ -284,7 +410,7 @@ msgstr ""
msgid "Spore Tree Spawn"
msgstr ""
#: df_trees\spore_tree.lua:303
#: df_trees\spore_tree.lua:306
msgid "Spore Tree Ladder"
msgstr ""
@ -323,23 +449,23 @@ msgstr ""
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
#: df_trees\tunnel_tube.lua:14
#: df_trees\tunnel_tube.lua:37
#: df_trees\tunnel_tube.lua:67
#: df_trees\tunnel_tube.lua:96
msgid "Tunnel Tube"
msgstr ""
#: df_trees\tunnel_tube.lua:135
#: df_trees\tunnel_tube.lua:133
msgid "Tunnel Tube Plies"
msgstr ""
#: df_trees\tunnel_tube.lua:172
#: df_trees\tunnel_tube.lua:228
#: df_trees\tunnel_tube.lua:248
#: df_trees\tunnel_tube.lua:170
#: df_trees\tunnel_tube.lua:226
#: df_trees\tunnel_tube.lua:246
msgid "Tunnel Tube Fruiting Body"
msgstr ""
#: df_trees\tunnel_tube.lua:279
#: df_trees\tunnel_tube.lua:277
msgid "Tunnel Tube Spawn"
msgstr ""

View File

@ -1 +1,4 @@
name = df_trees
name = df_trees
description = Adds various types of underground fungal "trees". Light kills their saplings, they only grow in the dark.
depends = default
optional_depends = intllib, doc, moreblocks, stairs, vessels, basic_materials

View File

@ -21,7 +21,9 @@ minetest.register_node("df_trees:nether_cap", {
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(),
sounds = default.node_sound_wood_defaults({
footstep = {name = "default_snow_footstep", gain = 0.2},
}),
})
--gills

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
dfcaverns_fungus_footstep are from https://freesound.org/people/jakeh111/sounds/60853/ under CC-BY-SA 3.0 in 2008 by jakeh111

340
df_trees/spindlestem.lua Normal file
View File

@ -0,0 +1,340 @@
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local vessels = minetest.get_modpath("vessels")
-- pre-declare
local get_spindlestem_cap_type
-- Copied from subterrane's features.lua
-- Figured that was nicer than adding a dependency for just this little bit
local stem_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 spindlestem
if minetest.get_item_group(under.name, "spindlestem") > 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 growth_delay = function()
return 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
local disp = 0.0625 -- adjusting position a bit
minetest.register_node("df_trees:spindlestem_stem", {
description = S("Spindlestem"),
_doc_items_longdesc = df_trees.doc.spindlestem_desc,
_doc_items_usagehelp = df_trees.doc.spindlestem_usage,
is_ground_content = true,
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, spindlestem = 1},
sounds = default.node_sound_wood_defaults(),
tiles = {
"dfcaverns_tower_cap.png",
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
node_box = {
type = "fixed",
fixed = {
{-0.0625+disp, -0.5, -0.125+disp, 0.1875+disp, 0.5, 0.25+disp},
{-0.125+disp, -0.5, -0.0625+disp, 0.25+disp, 0.5, 0.1875+disp},
}
},
on_place = stem_on_place,
})
minetest.register_craft({
type = "fuel",
recipe = "df_trees:spindlestem_stem",
burntime = 5,
})
local register_spindlestem_type = function(item_suffix, colour_name, colour_code, light_level)
local cap_item = "df_trees:spindlestem_cap_"..item_suffix
minetest.register_node(cap_item, {
description = S("@1 Spindlestem Cap", colour_name),
is_ground_content = true,
_doc_items_longdesc = df_trees.doc["spindlestem_cap_"..item_suffix.."_desc"],
_doc_items_usagehelp = df_trees.doc["spindlestem_cap_"..item_suffix.."_usage"],
groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, spindlestem = 1},
sounds = default.node_sound_wood_defaults(),
tiles = {
"dfcaverns_tower_cap.png^[multiply:#"..colour_code,
"dfcaverns_spindlestem_cap.png^[multiply:#"..colour_code,
"dfcaverns_tower_cap.png^[multiply:#"..colour_code,
"dfcaverns_tower_cap.png^[multiply:#"..colour_code,
"dfcaverns_tower_cap.png^[multiply:#"..colour_code,
"dfcaverns_tower_cap.png^[multiply:#"..colour_code,
},
light_source = light_level,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
node_box = {
type = "fixed",
fixed = {
{-0.1875+disp, -0.5, -0.3125+disp, 0.3125+disp, -0.3125, 0.4375+disp},
{-0.3125+disp, -0.5, -0.1875+disp, 0.4375+disp, -0.3125, 0.3125+disp},
{-0.0625+disp, -0.1875, -0.0625+disp, 0.1875+disp, -0.125, 0.1875+disp},
{-0.1875+disp, -0.3125, -0.1875+disp, 0.3125+disp, -0.1875, 0.3125+disp},
}
},
drop = {
-- Maximum number of items to drop
max_items = 1,
-- Choose max_items randomly from this list
items = {
{
items = {cap_item, "df_trees:spindlestem_seedling"}, -- Items to drop
rarity = 2, -- Probability of dropping is 1 / rarity
},
{
items = {cap_item, "df_trees:spindlestem_seedling", "df_trees:spindlestem_seedling"}, -- Items to drop
rarity = 2, -- Probability of dropping is 1 / rarity
},
{
items = {cap_item, "df_trees:spindlestem_seedling", "df_trees:spindlestem_seedling", "df_trees:spindlestem_seedling"}, -- Items to drop
rarity = 2, -- Probability of dropping is 1 / rarity
},
{
items = {cap_item}, -- Items to drop
rarity = 1, -- Probability of dropping is 1 / rarity
},
},
},
on_place = stem_on_place,
on_timer = function(pos, elapsed)
local above = vector.add(pos, {x=0,y=1,z=0})
local node_above = minetest.get_node(above)
local above_def = minetest.registered_nodes[node_above.name]
if not above_def or not above_def.buildable_to then
-- can't grow any more, exit
return
end
local meta = minetest.get_meta(pos)
local height = meta:get_int("spindlestem_to_grow")
local node = minetest.get_node(pos)
minetest.set_node(pos, {name="df_trees:spindlestem_stem", param2 = node.param2})
minetest.set_node(above, {name=cap_item, param2 = node.param2})
height = height - 1
if height > 0 then
meta = minetest.get_meta(above)
meta:set_int("spindlestem_to_grow", height)
minetest.get_node_timer(above):start(growth_delay())
end
end,
})
minetest.register_craft({
type = "fuel",
recipe = cap_item,
burntime = 10,
})
local c_stem = minetest.get_content_id("df_trees:spindlestem_stem")
local c_cap = minetest.get_content_id(cap_item)
if vessels and light_level > 0 then
local tex = "dfcaverns_vessels_glowing_liquid.png^[multiply:#"..colour_code.."^vessels_glass_bottle.png"
local new_light = light_level + math.floor((minetest.LIGHT_MAX-light_level)/2)
minetest.register_node("df_trees:glowing_bottle_"..item_suffix, {
description = S("@1 Spindlestem Extract", colour_name),
drawtype = "plantlike",
_doc_items_longdesc = df_trees.doc["spindlestem_extract_"..item_suffix.."_desc"],
_doc_items_usagehelp = df_trees.doc["spindlestem_extract_"..item_suffix.."_usage"],
tiles = {tex},
inventory_image = tex,
wield_image = tex,
paramtype = "light",
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
},
groups = {vessel = 1, dig_immediate = 3, attached_node = 1},
sounds = default.node_sound_glass_defaults(),
light_source = new_light,
})
minetest.register_craft( {
output = "df_trees:glowing_bottle_"..item_suffix.." 3",
type = "shapeless",
recipe = {
"vessels:glass_bottle",
"vessels:glass_bottle",
"vessels:glass_bottle",
cap_item,
}
})
minetest.register_craft( {
output = "vessels:glass_bottle",
type = "shapeless",
recipe = {
"df_trees:glowing_bottle_"..item_suffix,
}
})
end
end
local seedling_construct = function(pos)
local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0}))
if minetest.get_item_group(below_node.name, "soil") > 0 then
minetest.get_node_timer(pos):start(growth_delay())
end
end
minetest.register_node("df_trees:spindlestem_seedling", {
description = S("Spindlestem Spawn"),
_doc_items_longdesc = df_trees.doc.spindlestem_desc,
_doc_items_usagehelp = df_trees.doc.spindlestem_usage,
tiles = {
"dfcaverns_tower_cap.png",
},
groups = {snappy = 3, flammable = 2, plant = 1, attached_node = 1, light_sensitive_fungus = 11, digtron_on_place=1},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
floodable = true,
node_box = {
type = "fixed",
fixed = {
{-0.0625 + 0.125, -0.5, -0.125 + 0.125, 0.125 + 0.125, -0.375, 0.0625 + 0.125},
}
},
on_place = stem_on_place,
on_construct = seedling_construct,
on_timer = function(pos, elapsed)
local cap_item = minetest.get_name_from_content_id(get_spindlestem_cap_type(pos))
local node = minetest.get_node(pos)
minetest.set_node(pos, {name=cap_item, param2 = node.param2})
local meta = minetest.get_meta(pos)
local disp = {x=3, y=3, z=3}
local nearby = minetest.find_nodes_in_area(vector.add(pos, disp), vector.subtract(pos, disp), {"group:spindlestem"})
local count = #nearby
local height = math.random(1,3)
if count > 10 then height = height + 2 end -- if there are a lot of nearby spindlestems, grow taller
if height > 0 then
meta:set_int("spindlestem_to_grow", height)
minetest.get_node_timer(pos):start(growth_delay())
end
end,
})
register_spindlestem_type("white", S("White"), "FFFFFF", 0)
register_spindlestem_type("red", S("Red"), "FFC3C3", 3)
register_spindlestem_type("green", S("Green"), "C3FFC3", 4)
register_spindlestem_type("cyan", S("Cyan"), "C3FFFF", 6)
register_spindlestem_type("golden", S("Golden"), "FFFFC3", 12)
local c_air = minetest.get_content_id("air")
local c_stem = minetest.get_content_id("df_trees:spindlestem_stem")
df_trees.spawn_spindlestem_vm = function(vi, area, data, data_param2, c_cap)
if data[vi] ~= c_air then return end
if c_cap == nil then
-- note: this won't account for rock removed by subterrane, so may not be entirely accurate. Good enough!
c_cap = get_spindlestem_cap_type(area:position(vi))
end
local stem_height = math.random(1,3)
local param2 = math.random(1,4)-1
local i = 0
local top = 0
local index
while i <= stem_height do
index = vi + i * area.ystride
if data[index] == c_air then
data[index] = c_stem
data_param2[index] = param2
top = i
else
i = 100
end
i = i + 1
end
index = vi + top * area.ystride
data[index] = c_cap
end
local c_white = minetest.get_content_id("df_trees:spindlestem_cap_white")
local c_red = minetest.get_content_id("df_trees:spindlestem_cap_red")
local c_green = minetest.get_content_id("df_trees:spindlestem_cap_green")
local c_cyan = minetest.get_content_id("df_trees:spindlestem_cap_cyan")
local c_golden = minetest.get_content_id("df_trees:spindlestem_cap_golden")
get_spindlestem_cap_type = function(pos)
if pos.y > -100 or minetest.find_node_near(pos, 15, "group:tower_cap") then
return c_white
end
if minetest.find_node_near(pos, 15, "group:goblin_cap") then
return c_red
end
local iron = minetest.find_node_near(pos, 5, {"default:stone_with_iron", "default:steelblock"})
local copper = minetest.find_node_near(pos, 5, {"default:stone_with_copper", "default:copperblock"})
local mese = minetest.find_node_near(pos, 5, {"default:stone_with_mese", "default:mese"})
local possibilities = {}
if mese then table.insert(possibilities, c_golden) end
if copper then table.insert(possibilities, c_green) end
if iron then table.insert(possibilities, c_red) end
if iron and copper then table.insert(possibilities, c_cyan) end
if #possibilities == 0 then
return c_white
else
local pick = math.random(1, #possibilities)
return possibilities[pick]
end
end

View File

@ -167,9 +167,12 @@ minetest.register_node("df_trees:spore_tree_sapling", {
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))
local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0}))
if minetest.get_item_group(below_node.name, "soil") > 0 then
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
end,
on_timer = function(pos)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 774 B

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 B

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 354 B

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

View File

@ -9,8 +9,8 @@ minetest.register_node("df_trees:tower_cap_stem", {
_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(),
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, tower_cap = 1},
sounds = df_trees.node_sound_tree_soft_fungus_defaults(),
})
--cap
@ -20,8 +20,8 @@ minetest.register_node("df_trees:tower_cap", {
_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(),
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, tower_cap = 1},
sounds = df_trees.node_sound_tree_soft_fungus_defaults(),
})
--gills
@ -31,7 +31,7 @@ minetest.register_node("df_trees:tower_cap_gills", {
_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},
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, tower_cap = 1},
sounds = default.node_sound_leaves_defaults(),
drawtype = "plantlike",
paramtype = "light",
@ -50,7 +50,7 @@ minetest.register_node("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
if default.register_leafdecay then -- default.register_leafdecay is 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"},
@ -136,9 +136,12 @@ minetest.register_node("df_trees:tower_cap_sapling", {
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))
local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0}))
if minetest.get_item_group(below_node.name, "soil") > 0 then
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
end,
on_timer = function(pos)

View File

@ -295,9 +295,12 @@ minetest.register_node("df_trees:tunnel_tube_sapling", {
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))
local below_node = minetest.get_node(vector.add(pos, {x=0,y=-1,z=0}))
if minetest.get_item_group(below_node.name, "soil") > 0 then
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
end,
on_timer = function(pos)