From 19f518b21eae0d2721037219098d14837a9d5a37 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Fri, 27 Dec 2019 22:45:09 -0700 Subject: [PATCH] boost default plant growth delay, add growing selection boxes --- df_caverns/level3.lua | 4 ++-- df_farming/cave_wheat.lua | 8 +++++++- df_farming/config.lua | 2 +- df_farming/dimple_cup.lua | 6 ++++++ df_farming/pig_tail.lua | 6 ++++++ df_farming/quarry_bush.lua | 6 ++++++ df_farming/settingtypes.txt | 2 +- df_farming/sweet_pod.lua | 6 ++++++ 8 files changed, 35 insertions(+), 5 deletions(-) diff --git a/df_caverns/level3.lua b/df_caverns/level3.lua index 22fcabe..6b9986e 100644 --- a/df_caverns/level3.lua +++ b/df_caverns/level3.lua @@ -165,7 +165,7 @@ local blood_thorn_cavern_floor = function(abs_cracks, vert_rand, vi, area, data, if abs_cracks < 0.075 then if vert_rand < 0.004 then subterrane.big_stalagmite(ai, area, data, 6, 15, c_dry_flowstone, c_dry_flowstone, c_dry_flowstone) - elseif data[vi] ~= air and math.random() < 0.5 then + elseif data[vi] ~= c_air and math.random() < 0.5 then data[vi] = c_salty_cobble if data[ai] == c_air and math.random() < 0.25 then data[ai] = c_salt_crystal @@ -321,7 +321,7 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) else -- bloodthorn ceiling if abs_cracks < 0.075 then - if data[vi] ~= air and math.random() < 0.5 then + if data[vi] ~= c_air and math.random() < 0.5 then data[vi] = c_salty_cobble local bi = vi - area.ystride if data[bi] == c_air and math.random() < 0.25 then diff --git a/df_farming/cave_wheat.lua b/df_farming/cave_wheat.lua index 7605dce..3285826 100644 --- a/df_farming/cave_wheat.lua +++ b/df_farming/cave_wheat.lua @@ -22,7 +22,13 @@ local register_cave_wheat = function(number) floodable = true, groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11}, sounds = default.node_sound_leaves_defaults(), - + selection_box = { + type = "fixed", + fixed = { + {-8/16, -8/16, -8/16, 8/16, -8/16 + 2*number/16, 8/16}, + }, + }, + on_timer = function(pos, elapsed) df_farming.grow_underground_plant(pos, name, elapsed) end, diff --git a/df_farming/config.lua b/df_farming/config.lua index f5711ab..afdcb49 100644 --- a/df_farming/config.lua +++ b/df_farming/config.lua @@ -34,7 +34,7 @@ local plants = { --Plants -setting("int", "plant_growth_time", 500, "Base plant growth time") +setting("int", "plant_growth_time", 3600, "Base plant growth time") -- 60 minutes for _, plant in pairs(plants) do setting("float", plant.name.."_delay_multiplier", plant.delay_multiplier, plant.name.." growth delay multiplier") diff --git a/df_farming/dimple_cup.lua b/df_farming/dimple_cup.lua index c25025c..303e7d6 100644 --- a/df_farming/dimple_cup.lua +++ b/df_farming/dimple_cup.lua @@ -20,6 +20,12 @@ local register_dimple_cup = function(number) buildable_to = true, groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, color_blue = 1, light_sensitive_fungus = 11, flower = 1}, sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { + {-8/16, -8/16, -8/16, 8/16, -8/16 + 4*number/16, 8/16}, + }, + }, on_timer = function(pos, elapsed) df_farming.grow_underground_plant(pos, name, elapsed) diff --git a/df_farming/pig_tail.lua b/df_farming/pig_tail.lua index efc25ff..7ab1ca6 100644 --- a/df_farming/pig_tail.lua +++ b/df_farming/pig_tail.lua @@ -22,6 +22,12 @@ local register_pig_tail = function(number) buildable_to = true, groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11}, sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { + {-8/16, -8/16, -8/16, 8/16, -8/16 + 2*number/16, 8/16}, + }, + }, on_timer = function(pos, elapsed) df_farming.grow_underground_plant(pos, name, elapsed) diff --git a/df_farming/quarry_bush.lua b/df_farming/quarry_bush.lua index 8eb6168..b5db3e2 100644 --- a/df_farming/quarry_bush.lua +++ b/df_farming/quarry_bush.lua @@ -22,6 +22,12 @@ local register_quarry_bush = function(number) floodable = true, groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11}, sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { + {-8/16, -8/16, -8/16, 8/16, -8/16 + (16/5)*number/16, 8/16}, + }, + }, on_timer = function(pos, elapsed) df_farming.grow_underground_plant(pos, name, elapsed) diff --git a/df_farming/settingtypes.txt b/df_farming/settingtypes.txt index 73e63de..213c576 100644 --- a/df_farming/settingtypes.txt +++ b/df_farming/settingtypes.txt @@ -1,4 +1,4 @@ -dfcaverns_plant_growth_time (Base plant growth timer interval) int 100 +dfcaverns_plant_growth_time (Base plant growth timer interval) int 3600 dfcaverns_cave_wheat_delay_multiplier (cave_wheat growth delay multiplier) float 1 dfcaverns_dimple_cup_delay_multiplier (dimple_cup growth delay multiplier) float 3 dfcaverns_pig_tail_delay_multiplier (pig_tail growth delay multiplier) float 1 diff --git a/df_farming/sweet_pod.lua b/df_farming/sweet_pod.lua index 28903fa..a1c2818 100644 --- a/df_farming/sweet_pod.lua +++ b/df_farming/sweet_pod.lua @@ -20,6 +20,12 @@ local register_sweet_pod = function(number) floodable = true, groups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, light_sensitive_fungus = 11}, sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { + {-8/16, -8/16, -8/16, 8/16, -8/16 + (16/6)*number/16, 8/16}, + }, + }, on_timer = function(pos, elapsed) df_farming.grow_underground_plant(pos, name, elapsed)