From 08d85dd65521c02191c2f2535718b024283512b2 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Thu, 16 Mar 2017 02:17:55 -0600 Subject: [PATCH] rearranging and renaming --- config.lua | 4 +- init.lua | 48 +++++++++--------- settingtypes.txt | 3 +- ..._cups_1.png => dfcaverns_dimple_cup_1.png} | Bin ..._cups_2.png => dfcaverns_dimple_cup_2.png} | Bin ..._cups_3.png => dfcaverns_dimple_cup_3.png} | Bin ..._cups_4.png => dfcaverns_dimple_cup_4.png} | Bin ...seed.png => dfcaverns_dimple_cup_seed.png} | Bin ...igtails_1.png => dfcaverns_pig_tail_1.png} | Bin ...igtails_2.png => dfcaverns_pig_tail_2.png} | Bin ...igtails_3.png => dfcaverns_pig_tail_3.png} | Bin ...igtails_4.png => dfcaverns_pig_tail_4.png} | Bin ...igtails_5.png => dfcaverns_pig_tail_5.png} | Bin ...igtails_6.png => dfcaverns_pig_tail_6.png} | Bin ...igtails_7.png => dfcaverns_pig_tail_7.png} | Bin ...igtails_8.png => dfcaverns_pig_tail_8.png} | Bin ...l_seed.png => dfcaverns_pig_tail_seed.png} | Bin ...read.png => dfcaverns_pig_tail_thread.png} | Bin ...t_pods_1.png => dfcaverns_sweet_pod_1.png} | Bin ...t_pods_2.png => dfcaverns_sweet_pod_2.png} | Bin ...t_pods_3.png => dfcaverns_sweet_pod_3.png} | Bin ...t_pods_4.png => dfcaverns_sweet_pod_4.png} | Bin ...t_pods_5.png => dfcaverns_sweet_pod_5.png} | Bin ...t_pods_6.png => dfcaverns_sweet_pod_6.png} | Bin black_cap.lua => trees/black_cap.lua | 0 blood_thorn.lua => trees/blood_thorn.lua | 0 fungiwood.lua => trees/fungiwood.lua | 0 goblin_cap.lua => trees/goblin_cap.lua | 0 nether_cap.lua => trees/nether_cap.lua | 0 spore_tree.lua => trees/spore_tree.lua | 2 +- tower_cap.lua => trees/tower_cap.lua | 0 tunnel_tube.lua => trees/tunnel_tube.lua | 18 ++----- 32 files changed, 35 insertions(+), 40 deletions(-) rename textures/{dfcaverns_dimple_cups_1.png => dfcaverns_dimple_cup_1.png} (100%) rename textures/{dfcaverns_dimple_cups_2.png => dfcaverns_dimple_cup_2.png} (100%) rename textures/{dfcaverns_dimple_cups_3.png => dfcaverns_dimple_cup_3.png} (100%) rename textures/{dfcaverns_dimple_cups_4.png => dfcaverns_dimple_cup_4.png} (100%) rename textures/{dfcaverns_dimple_cups_seed.png => dfcaverns_dimple_cup_seed.png} (100%) rename textures/{dfcaverns_pigtails_1.png => dfcaverns_pig_tail_1.png} (100%) rename textures/{dfcaverns_pigtails_2.png => dfcaverns_pig_tail_2.png} (100%) rename textures/{dfcaverns_pigtails_3.png => dfcaverns_pig_tail_3.png} (100%) rename textures/{dfcaverns_pigtails_4.png => dfcaverns_pig_tail_4.png} (100%) rename textures/{dfcaverns_pigtails_5.png => dfcaverns_pig_tail_5.png} (100%) rename textures/{dfcaverns_pigtails_6.png => dfcaverns_pig_tail_6.png} (100%) rename textures/{dfcaverns_pigtails_7.png => dfcaverns_pig_tail_7.png} (100%) rename textures/{dfcaverns_pigtails_8.png => dfcaverns_pig_tail_8.png} (100%) rename textures/{dfcaverns_pigtail_seed.png => dfcaverns_pig_tail_seed.png} (100%) rename textures/{dfcaverns_pigtail_thread.png => dfcaverns_pig_tail_thread.png} (100%) rename textures/{dfcaverns_sweet_pods_1.png => dfcaverns_sweet_pod_1.png} (100%) rename textures/{dfcaverns_sweet_pods_2.png => dfcaverns_sweet_pod_2.png} (100%) rename textures/{dfcaverns_sweet_pods_3.png => dfcaverns_sweet_pod_3.png} (100%) rename textures/{dfcaverns_sweet_pods_4.png => dfcaverns_sweet_pod_4.png} (100%) rename textures/{dfcaverns_sweet_pods_5.png => dfcaverns_sweet_pod_5.png} (100%) rename textures/{dfcaverns_sweet_pods_6.png => dfcaverns_sweet_pod_6.png} (100%) rename black_cap.lua => trees/black_cap.lua (100%) rename blood_thorn.lua => trees/blood_thorn.lua (100%) rename fungiwood.lua => trees/fungiwood.lua (100%) rename goblin_cap.lua => trees/goblin_cap.lua (100%) rename nether_cap.lua => trees/nether_cap.lua (100%) rename spore_tree.lua => trees/spore_tree.lua (98%) rename tower_cap.lua => trees/tower_cap.lua (100%) rename tunnel_tube.lua => trees/tunnel_tube.lua (93%) diff --git a/config.lua b/config.lua index 4f860ff..278ea8b 100644 --- a/config.lua +++ b/config.lua @@ -2,7 +2,7 @@ local CONFIG_FILE_PREFIX = "dfcaverns_" dfcaverns.config = {} -local print_settingtypes = false +local print_settingtypes = true local function setting(stype, name, default, description) local value @@ -44,3 +44,5 @@ setting("int", "blood_thorn_growth_interval", 12, "blood_thorn growth ABM interv setting("int", "blood_thorn_growth_chance", 83, "blood_thorn growth ABM chance") setting("int", "blood_thorn_min_depth", -100, "blood_thorn minimum sapling growth depth") setting("int", "blood_thorn_max_depth", -31000, "blood_thorn maximum sapling growth depth") + +setting("bool", "light_kills_fungus", true, "Light kills fungus") \ No newline at end of file diff --git a/init.lua b/init.lua index ebd7fd7..8c2fe9c 100644 --- a/init.lua +++ b/init.lua @@ -14,31 +14,33 @@ dofile(modpath.."/ground_cover.lua") dofile(modpath.."/plants.lua") -- Trees -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.."/trees/blood_thorn.lua") +dofile(modpath.."/trees/fungiwood.lua") +dofile(modpath.."/trees/tunnel_tube.lua") +dofile(modpath.."/trees/spore_tree.lua") +dofile(modpath.."/trees/black_cap.lua") +dofile(modpath.."/trees/nether_cap.lua") +dofile(modpath.."/trees/goblin_cap.lua") +dofile(modpath.."/trees/tower_cap.lua") - -minetest.register_abm({ - label = "dfcaverns:kill_light_sensitive_fungus", - nodenames = {"group:light_sensitive_fungus"}, - catch_up = true, - interval = 30, - chance = 5, - action = function(pos, node) - local node_def = minetest.registered_nodes[node.name] - local dead_node = node_def._dfcaverns_dead_node or "dfcaverns:dead_fungus" - -- 11 is the value adjacent to a torch - if minetest.get_node_light(pos) > node_def.groups.light_sensitive_fungus then - minetest.set_node(pos, {name=dead_node, param2 = node.param2}) +if dfcaverns.config.light_kills_fungus then + minetest.register_abm({ + label = "dfcaverns:kill_light_sensitive_fungus", + nodenames = {"group:light_sensitive_fungus"}, + catch_up = true, + interval = 30, + chance = 5, + action = function(pos, node) + local node_def = minetest.registered_nodes[node.name] + local dead_node = node_def._dfcaverns_dead_node or "dfcaverns:dead_fungus" + -- 11 is the value adjacent to a torch + local light_level = minetest.get_node_light(pos) + if light_level and light_level > node_def.groups.light_sensitive_fungus then + minetest.set_node(pos, {name=dead_node, param2 = node.param2}) + end end - end -}) + }) +end minetest.register_ore({ ore_type = "vein", diff --git a/settingtypes.txt b/settingtypes.txt index 2fd1255..66973e6 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -29,4 +29,5 @@ dfcaverns_tower_cap_max_depth (tower_cap maximum sapling growth depth) int -3100 dfcaverns_blood_thorn_growth_interval (blood_thorn growth ABM interval) int 12 dfcaverns_blood_thorn_growth_chance (blood_thorn growth ABM chance) int 83 dfcaverns_blood_thorn_min_depth (blood_thorn minimum sapling growth depth) int -100 -dfcaverns_blood_thorn_max_depth (blood_thorn maximum sapling growth depth) int -31000 \ No newline at end of file +dfcaverns_blood_thorn_max_depth (blood_thorn maximum sapling growth depth) int -31000 +dfcaverns_light_kills_fungus (Light kills fungus) bool true \ No newline at end of file diff --git a/textures/dfcaverns_dimple_cups_1.png b/textures/dfcaverns_dimple_cup_1.png similarity index 100% rename from textures/dfcaverns_dimple_cups_1.png rename to textures/dfcaverns_dimple_cup_1.png diff --git a/textures/dfcaverns_dimple_cups_2.png b/textures/dfcaverns_dimple_cup_2.png similarity index 100% rename from textures/dfcaverns_dimple_cups_2.png rename to textures/dfcaverns_dimple_cup_2.png diff --git a/textures/dfcaverns_dimple_cups_3.png b/textures/dfcaverns_dimple_cup_3.png similarity index 100% rename from textures/dfcaverns_dimple_cups_3.png rename to textures/dfcaverns_dimple_cup_3.png diff --git a/textures/dfcaverns_dimple_cups_4.png b/textures/dfcaverns_dimple_cup_4.png similarity index 100% rename from textures/dfcaverns_dimple_cups_4.png rename to textures/dfcaverns_dimple_cup_4.png diff --git a/textures/dfcaverns_dimple_cups_seed.png b/textures/dfcaverns_dimple_cup_seed.png similarity index 100% rename from textures/dfcaverns_dimple_cups_seed.png rename to textures/dfcaverns_dimple_cup_seed.png diff --git a/textures/dfcaverns_pigtails_1.png b/textures/dfcaverns_pig_tail_1.png similarity index 100% rename from textures/dfcaverns_pigtails_1.png rename to textures/dfcaverns_pig_tail_1.png diff --git a/textures/dfcaverns_pigtails_2.png b/textures/dfcaverns_pig_tail_2.png similarity index 100% rename from textures/dfcaverns_pigtails_2.png rename to textures/dfcaverns_pig_tail_2.png diff --git a/textures/dfcaverns_pigtails_3.png b/textures/dfcaverns_pig_tail_3.png similarity index 100% rename from textures/dfcaverns_pigtails_3.png rename to textures/dfcaverns_pig_tail_3.png diff --git a/textures/dfcaverns_pigtails_4.png b/textures/dfcaverns_pig_tail_4.png similarity index 100% rename from textures/dfcaverns_pigtails_4.png rename to textures/dfcaverns_pig_tail_4.png diff --git a/textures/dfcaverns_pigtails_5.png b/textures/dfcaverns_pig_tail_5.png similarity index 100% rename from textures/dfcaverns_pigtails_5.png rename to textures/dfcaverns_pig_tail_5.png diff --git a/textures/dfcaverns_pigtails_6.png b/textures/dfcaverns_pig_tail_6.png similarity index 100% rename from textures/dfcaverns_pigtails_6.png rename to textures/dfcaverns_pig_tail_6.png diff --git a/textures/dfcaverns_pigtails_7.png b/textures/dfcaverns_pig_tail_7.png similarity index 100% rename from textures/dfcaverns_pigtails_7.png rename to textures/dfcaverns_pig_tail_7.png diff --git a/textures/dfcaverns_pigtails_8.png b/textures/dfcaverns_pig_tail_8.png similarity index 100% rename from textures/dfcaverns_pigtails_8.png rename to textures/dfcaverns_pig_tail_8.png diff --git a/textures/dfcaverns_pigtail_seed.png b/textures/dfcaverns_pig_tail_seed.png similarity index 100% rename from textures/dfcaverns_pigtail_seed.png rename to textures/dfcaverns_pig_tail_seed.png diff --git a/textures/dfcaverns_pigtail_thread.png b/textures/dfcaverns_pig_tail_thread.png similarity index 100% rename from textures/dfcaverns_pigtail_thread.png rename to textures/dfcaverns_pig_tail_thread.png diff --git a/textures/dfcaverns_sweet_pods_1.png b/textures/dfcaverns_sweet_pod_1.png similarity index 100% rename from textures/dfcaverns_sweet_pods_1.png rename to textures/dfcaverns_sweet_pod_1.png diff --git a/textures/dfcaverns_sweet_pods_2.png b/textures/dfcaverns_sweet_pod_2.png similarity index 100% rename from textures/dfcaverns_sweet_pods_2.png rename to textures/dfcaverns_sweet_pod_2.png diff --git a/textures/dfcaverns_sweet_pods_3.png b/textures/dfcaverns_sweet_pod_3.png similarity index 100% rename from textures/dfcaverns_sweet_pods_3.png rename to textures/dfcaverns_sweet_pod_3.png diff --git a/textures/dfcaverns_sweet_pods_4.png b/textures/dfcaverns_sweet_pod_4.png similarity index 100% rename from textures/dfcaverns_sweet_pods_4.png rename to textures/dfcaverns_sweet_pod_4.png diff --git a/textures/dfcaverns_sweet_pods_5.png b/textures/dfcaverns_sweet_pod_5.png similarity index 100% rename from textures/dfcaverns_sweet_pods_5.png rename to textures/dfcaverns_sweet_pod_5.png diff --git a/textures/dfcaverns_sweet_pods_6.png b/textures/dfcaverns_sweet_pod_6.png similarity index 100% rename from textures/dfcaverns_sweet_pods_6.png rename to textures/dfcaverns_sweet_pod_6.png diff --git a/black_cap.lua b/trees/black_cap.lua similarity index 100% rename from black_cap.lua rename to trees/black_cap.lua diff --git a/blood_thorn.lua b/trees/blood_thorn.lua similarity index 100% rename from blood_thorn.lua rename to trees/blood_thorn.lua diff --git a/fungiwood.lua b/trees/fungiwood.lua similarity index 100% rename from fungiwood.lua rename to trees/fungiwood.lua diff --git a/goblin_cap.lua b/trees/goblin_cap.lua similarity index 100% rename from goblin_cap.lua rename to trees/goblin_cap.lua diff --git a/nether_cap.lua b/trees/nether_cap.lua similarity index 100% rename from nether_cap.lua rename to trees/nether_cap.lua diff --git a/spore_tree.lua b/trees/spore_tree.lua similarity index 98% rename from spore_tree.lua rename to trees/spore_tree.lua index 1678302..32745de 100644 --- a/spore_tree.lua +++ b/trees/spore_tree.lua @@ -109,7 +109,7 @@ minetest.register_node("dfcaverns:spore_tree_sapling", { sounds = default.node_sound_leaves_defaults(), on_construct = function(pos) - minetest.get_node_timer(pos):start(math.random(dfcaverns.config.spore_tree_min_growth_delay,dfcaverns.config.spore_tree_max_growth_delay)) + minetest.get_node_timer(pos):start(math.random(dfcaverns.config.spore_tree_min_growth_delay, dfcaverns.config.spore_tree_max_growth_delay)) end, on_timer = function(pos) diff --git a/tower_cap.lua b/trees/tower_cap.lua similarity index 100% rename from tower_cap.lua rename to trees/tower_cap.lua diff --git a/tunnel_tube.lua b/trees/tunnel_tube.lua similarity index 93% rename from tunnel_tube.lua rename to trees/tunnel_tube.lua index a374a34..61e0567 100644 --- a/tunnel_tube.lua +++ b/trees/tunnel_tube.lua @@ -58,20 +58,6 @@ minetest.register_node("dfcaverns:tunnel_tube_fruiting_body", { }, }) ---dfcaverns.tunnel_tube_def = { --- axiom="FFcccccc&FFFFFdddR", --- rules_c="/", --- rules_d="F", --- trunk="dfcaverns:tunnel_tube", --- angle=20, --- iterations=2, --- random_level=0, --- trunk_type="single", --- thin_branches=true, --- fruit="dfcaverns:tunnel_tube_fruiting_body", --- fruit_chance=0 ---} - minetest.register_node("dfcaverns:tunnel_tube_sapling", { description = S("Tunnel Tube Spawn"), drawtype = "plantlike", @@ -105,6 +91,10 @@ local tunnel_tube_directions = { {x=-1,y=0,z=0}, {x=0,y=0,z=1}, {x=0,y=0,z=-1}, +-- {x=1,y=0,z=1}, -- diagonals work, but they don't look as nice as orthogonals +-- {x=-1,y=0,z=1}, +-- {x=1,y=0,z=-1}, +-- {x=-1,y=0,z=-1}, } local tunnel_tube_curvature = {0,0,0,0,1,1,1,2,2,3,4}