diff --git a/config.lua b/config.lua index b444f0e..b06daba 100644 --- a/config.lua +++ b/config.lua @@ -78,3 +78,11 @@ setting("int", "lava_sea_min", -2700, "Lower limit of the lava sea") setting("float", "lava_sea_threshold", 0.2, "Cavern threshold for magma sea (higher number means sparser magma)") setting("bool", "bottom_sea_contains_lava", true, "Lower sea contains lava") + +if minetest.get_modpath("tnt") then + dfcaverns.config.enable_tnt = minetest.settings:get_bool("enable_tnt") + if dfcaverns.config.enable_tnt == nil then + -- Default to enabled when in singleplayer + dfcaverns.config.enable_tnt = minetest.is_singleplayer() + end +end diff --git a/doc.lua b/doc.lua index bf55756..03ebe3f 100644 --- a/doc.lua +++ b/doc.lua @@ -93,4 +93,8 @@ dfcaverns.doc.tower_cap_desc = S("The king of the fungi, tower cap mushrooms gro dfcaverns.doc.tower_cap_usage = S("Tower caps are an excellent source of wood.") dfcaverns.doc.tunnel_tube_desc = S("Tunnel tubes are hollow, curved fungal growths that support a fruiting body.") -dfcaverns.doc.tunnel_tube_usage = S("The trunk of a tunnel tube can be cut and processed to produce plywood-like material.") +if dfcaverns.config.enable_tnt then + dfcaverns.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 + dfcaverns.doc.tunnel_tube_usage = S("The trunk of a tunnel tube can be cut and processed to produce plywood-like material.") +end diff --git a/locale/it.po b/locale/it.po index 43b933a..a10dcb2 100644 --- a/locale/it.po +++ b/locale/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: dfcaverns module's Italian locale\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-09-10 12:21-0600\n" +"POT-Creation-Date: 2018-04-19 19:58-0600\n" "PO-Revision-Date: 2017-08-17 23:01+0100\n" "Last-Translator: H4mlet \n" "Language-Team: ITALIANO\n" @@ -352,7 +352,15 @@ msgid "" "Tunnel tubes are hollow, curved fungal growths that support a fruiting body." msgstr "" -#: doc.lua:96 +#: doc.lua:97 +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 "" + +#: doc.lua:99 msgid "" "The trunk of a tunnel tube can be cut and processed to produce plywood-like " "material." @@ -384,12 +392,12 @@ msgid "Cave Wheat" msgstr "Grano di caverna" #: plants\cave_wheat.lua:61 -#: plants\cooking.lua:49 +#: plants\cooking.lua:85 msgid "Cave Wheat Seed" msgstr "Seme di grano di caverna" #: plants\cave_wheat.lua:82 -#: plants\cooking.lua:48 +#: plants\cooking.lua:84 msgid "Cave Wheat Flour" msgstr "Farina di grano di caverna" @@ -401,24 +409,24 @@ msgstr "Pane nanico" msgid "@1 Biscuit" msgstr "Biscotto di @1" -#: plants\cooking.lua:14 +#: plants\cooking.lua:15 msgid "@1 Stew" msgstr "Stufato di @1" -#: plants\cooking.lua:21 +#: plants\cooking.lua:23 msgid "@1 Roast" msgstr "Arrosto di @1" -#: plants\cooking.lua:50 +#: plants\cooking.lua:86 msgid "Sweet Pod Spore" msgstr "Spora di baccello dolce" -#: plants\cooking.lua:51 +#: plants\cooking.lua:87 #: plants\sweet_pod.lua:83 msgid "Sweet Pod Sugar" msgstr "Zucchero di baccello dolce" -#: plants\cooking.lua:52 +#: plants\cooking.lua:88 #: plants\plump_helmet.lua:91 #: plants\plump_helmet.lua:127 #: plants\plump_helmet.lua:161 @@ -427,29 +435,29 @@ msgstr "Zucchero di baccello dolce" msgid "Plump Helmet" msgstr "Elmo rotondo" -#: plants\cooking.lua:53 +#: plants\cooking.lua:89 #: plants\plump_helmet.lua:61 msgid "Plump Helmet Spawn" msgstr "Prole di elmo rotondo" -#: plants\cooking.lua:54 +#: plants\cooking.lua:90 msgid "Quarry Bush Leaf" msgstr "Foglia di cespuglio di cava" -#: plants\cooking.lua:55 +#: plants\cooking.lua:91 msgid "Rock Nut" msgstr "Noce di roccia" -#: plants\cooking.lua:56 +#: plants\cooking.lua:92 msgid "Dimple Cup Spore" msgstr "Spora di coppa increspata" -#: plants\cooking.lua:57 +#: plants\cooking.lua:93 #: plants\pig_tail.lua:61 msgid "Pig Tail Spore" msgstr "Spora di coda di maiale" -#: plants\cooking.lua:58 +#: plants\cooking.lua:94 msgid "Dwarven Syrup" msgstr "Sciroppo nanico" @@ -597,11 +605,11 @@ msgstr "Cappello del Nether" msgid "Nether Cap Gills" msgstr "Lamelle di cappello del Nether" -#: trees\nether_cap.lua:77 +#: trees\nether_cap.lua:78 msgid "Nether Cap Planks" msgstr "Assi di cappello del Nether" -#: trees\nether_cap.lua:91 +#: trees\nether_cap.lua:92 msgid "Nether Cap Spawn" msgstr "Prole di cappello del Nether" @@ -645,18 +653,20 @@ msgstr "Assi di cappello a torre" msgid "Tower Cap Spawn" msgstr "Prole di cappello a torre" -#: trees\tunnel_tube.lua:14 +#: trees\tunnel_tube.lua:16 msgid "Tunnel Tube" msgstr "Tubo di galleria" -#: trees\tunnel_tube.lua:45 +#: trees\tunnel_tube.lua:47 msgid "Tunnel Tube Plies" msgstr "Strati di tubo di galleria" -#: trees\tunnel_tube.lua:74 +#: trees\tunnel_tube.lua:79 +#: trees\tunnel_tube.lua:135 +#: trees\tunnel_tube.lua:157 msgid "Tunnel Tube Fruiting Body" msgstr "Corpo fruttifero del tubo di galleria" -#: trees\tunnel_tube.lua:103 +#: trees\tunnel_tube.lua:187 msgid "Tunnel Tube Spawn" msgstr "Prole di tubo di galleria" diff --git a/locale/template.pot b/locale/template.pot index 580a16d..a85a65d 100644 --- a/locale/template.pot +++ b/locale/template.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-09-10 12:21-0600\n" +"POT-Creation-Date: 2018-04-19 19:58-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -351,7 +351,15 @@ msgid "" "Tunnel tubes are hollow, curved fungal growths that support a fruiting body." msgstr "" -#: doc.lua:96 +#: doc.lua:97 +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 "" + +#: doc.lua:99 msgid "" "The trunk of a tunnel tube can be cut and processed to produce plywood-like " "material." @@ -383,12 +391,12 @@ msgid "Cave Wheat" msgstr "" #: plants\cave_wheat.lua:61 -#: plants\cooking.lua:49 +#: plants\cooking.lua:85 msgid "Cave Wheat Seed" msgstr "" #: plants\cave_wheat.lua:82 -#: plants\cooking.lua:48 +#: plants\cooking.lua:84 msgid "Cave Wheat Flour" msgstr "" @@ -400,24 +408,24 @@ msgstr "" msgid "@1 Biscuit" msgstr "" -#: plants\cooking.lua:14 +#: plants\cooking.lua:15 msgid "@1 Stew" msgstr "" -#: plants\cooking.lua:21 +#: plants\cooking.lua:23 msgid "@1 Roast" msgstr "" -#: plants\cooking.lua:50 +#: plants\cooking.lua:86 msgid "Sweet Pod Spore" msgstr "" -#: plants\cooking.lua:51 +#: plants\cooking.lua:87 #: plants\sweet_pod.lua:83 msgid "Sweet Pod Sugar" msgstr "" -#: plants\cooking.lua:52 +#: plants\cooking.lua:88 #: plants\plump_helmet.lua:91 #: plants\plump_helmet.lua:127 #: plants\plump_helmet.lua:161 @@ -426,29 +434,29 @@ msgstr "" msgid "Plump Helmet" msgstr "" -#: plants\cooking.lua:53 +#: plants\cooking.lua:89 #: plants\plump_helmet.lua:61 msgid "Plump Helmet Spawn" msgstr "" -#: plants\cooking.lua:54 +#: plants\cooking.lua:90 msgid "Quarry Bush Leaf" msgstr "" -#: plants\cooking.lua:55 +#: plants\cooking.lua:91 msgid "Rock Nut" msgstr "" -#: plants\cooking.lua:56 +#: plants\cooking.lua:92 msgid "Dimple Cup Spore" msgstr "" -#: plants\cooking.lua:57 +#: plants\cooking.lua:93 #: plants\pig_tail.lua:61 msgid "Pig Tail Spore" msgstr "" -#: plants\cooking.lua:58 +#: plants\cooking.lua:94 msgid "Dwarven Syrup" msgstr "" @@ -596,11 +604,11 @@ msgstr "" msgid "Nether Cap Gills" msgstr "" -#: trees\nether_cap.lua:77 +#: trees\nether_cap.lua:78 msgid "Nether Cap Planks" msgstr "" -#: trees\nether_cap.lua:91 +#: trees\nether_cap.lua:92 msgid "Nether Cap Spawn" msgstr "" @@ -644,18 +652,20 @@ msgstr "" msgid "Tower Cap Spawn" msgstr "" -#: trees\tunnel_tube.lua:14 +#: trees\tunnel_tube.lua:16 msgid "Tunnel Tube" msgstr "" -#: trees\tunnel_tube.lua:45 +#: trees\tunnel_tube.lua:47 msgid "Tunnel Tube Plies" msgstr "" -#: trees\tunnel_tube.lua:74 +#: trees\tunnel_tube.lua:79 +#: trees\tunnel_tube.lua:135 +#: trees\tunnel_tube.lua:157 msgid "Tunnel Tube Fruiting Body" msgstr "" -#: trees\tunnel_tube.lua:103 +#: trees\tunnel_tube.lua:187 msgid "Tunnel Tube Spawn" msgstr "" diff --git a/trees/tunnel_tube.lua b/trees/tunnel_tube.lua index 64c32ec..4df96f0 100644 --- a/trees/tunnel_tube.lua +++ b/trees/tunnel_tube.lua @@ -10,6 +10,8 @@ local MP = minetest.get_modpath(minetest.get_current_modname()) local S, NS = dofile(MP.."/intllib.lua") +local tunnel_tube_drop = nil + minetest.register_node("dfcaverns:tunnel_tube", { description = S("Tunnel Tube"), _doc_items_longdesc = dfcaverns.doc.tunnel_tube_desc, @@ -69,35 +71,119 @@ minetest.register_craft({ burntime = 3, }) +-- TNT +----------------------------------------------------------------------------------------------------------- +if dfcaverns.config.enable_tnt then -minetest.register_node("dfcaverns:tunnel_tube_fruiting_body", { - description = S("Tunnel Tube Fruiting Body"), - _doc_items_longdesc = dfcaverns.doc.tunnel_tube_desc, - _doc_items_usagehelp = dfcaverns.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, + local tnt_radius = tonumber(minetest.settings:get("tnt_radius") or 3) * 2/3 + local tnt_def = {radius = tnt_radius, damage_radius = tnt_radius * 2} - drop = { - max_items = 3, - items = { - { - items = {'dfcaverns:tunnel_tube_sapling'}, - rarity = 2, + minetest.register_node("dfcaverns:tunnel_tube_fruiting_body", { + description = S("Tunnel Tube Fruiting Body"), + _doc_items_longdesc = dfcaverns.doc.tunnel_tube_desc, + _doc_items_usagehelp = dfcaverns.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 = {'dfcaverns:tunnel_tube_sapling'}, + rarity = 2, + }, + { + items = {'dfcaverns:tunnel_tube_sapling', 'tnt:gunpowder'}, + rarity = 2, + }, + { + items = {'dfcaverns:tunnel_tube_sapling', 'tnt:gunpowder 2'}, + rarity = 2, + }, }, - { - items = {'dfcaverns:tunnel_tube_sapling'}, - rarity = 2, + }, + + on_punch = function(pos, node, puncher) + if puncher:get_wielded_item():get_name() == "default:torch" then + minetest.swap_node(pos, {name = "dfcaverns:tunnel_tube_fruiting_body_burning"}) + minetest.registered_nodes["dfcaverns: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 = "dfcaverns:tunnel_tube_fruiting_body_burning"}) + minetest.registered_nodes["dfcaverns:tunnel_tube_fruiting_body_burning"].on_construct(pos) + end, + on_ignite = function(pos, igniter) + minetest.swap_node(pos, {name = "dfcaverns:tunnel_tube_fruiting_body_burning"}) + minetest.registered_nodes["dfcaverns:tunnel_tube_fruiting_body_burning"].on_construct(pos) + end, + }) + + minetest.register_node("dfcaverns:tunnel_tube_fruiting_body_burning", { + description = S("Tunnel Tube Fruiting Body"), + _doc_items_longdesc = dfcaverns.doc.tunnel_tube_desc, + _doc_items_usagehelp = dfcaverns.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("dfcaverns:tunnel_tube_fruiting_body", { + description = S("Tunnel Tube Fruiting Body"), + _doc_items_longdesc = dfcaverns.doc.tunnel_tube_desc, + _doc_items_usagehelp = dfcaverns.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 = {'dfcaverns:tunnel_tube_sapling'}, + rarity = 2, + }, + { + items = {'dfcaverns:tunnel_tube_sapling'}, + rarity = 2, + }, + { + items = {'dfcaverns:tunnel_tube_sapling'}, + rarity = 2, + }, }, - { - items = {'dfcaverns:tunnel_tube_sapling'}, - rarity = 2, - }, - } - }, -}) + }, + }) +end +----------------------------------------------------------------------------------------------------------- minetest.register_node("dfcaverns:tunnel_tube_sapling", { description = S("Tunnel Tube Spawn"),