diff --git a/config.lua b/config.lua index 00c7651..1d1ca63 100644 --- a/config.lua +++ b/config.lua @@ -33,6 +33,15 @@ local trees = { {name="tower_cap", min_depth=-100, max_depth=-31000, delay_multiplier = 1}, } +local plants = { + {name="cave_wheat", delay_multiplier=1}, + {name="dimple_cup", delay_multiplier=3}, + {name="pig_tail", delay_multiplier=1}, + {name="plump_helmet", delay_multiplier=3}, + {name="quarry_bush", delay_multiplier=2}, + {name="sweet_pod", delay_multiplier=2}, +} + setting("int", "tree_min_growth_delay", 2400, "Minimum sapling growth delay") setting("int", "tree_max_growth_delay", 4800, "Maximum sapling growth delay") @@ -47,4 +56,11 @@ 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("int", "plant_growth_timer", 100, "Base plant growth timer interval") +setting("int", "plant_growth_chance", 4, "Base plant growth chance") + +for _, plant in pairs(plants) do + setting("float", plant.name.."_timer_multiplier", plant.delay_multiplier, plant.name.." growth delay multiplier") +end + setting("bool", "light_kills_fungus", true, "Light kills fungus") \ No newline at end of file diff --git a/plants/cave_wheat.lua b/plants/cave_wheat.lua index 7625556..027f294 100644 --- a/plants/cave_wheat.lua +++ b/plants/cave_wheat.lua @@ -51,7 +51,7 @@ end dfcaverns.register_seed("cave_wheat_seed", S("Cave Wheat Seed"), "dfcaverns_cave_wheat_seed.png", "dfcaverns:cave_wheat_1") table.insert(wheat_names, "dfcaverns:cave_wheat_seed") -dfcaverns.register_grow_abm(wheat_names, 10, 1) +dfcaverns.register_grow_abm(wheat_names, dfcaverns.config.plant_growth_timer * dfcaverns.config.cave_wheat_timer_multiplier, dfcaverns.config.plant_growth_chance) minetest.register_craftitem("dfcaverns:cave_wheat", { description = S("Cave Wheat"), diff --git a/plants/dimple_cup.lua b/plants/dimple_cup.lua index 5590891..00448a6 100644 --- a/plants/dimple_cup.lua +++ b/plants/dimple_cup.lua @@ -45,4 +45,4 @@ end dfcaverns.register_seed("dimple_cup_seed", S("Dimple Cup Spores"), "dfcaverns_dimple_cup_seed.png", "dfcaverns:dimple_cup_1") table.insert(dimple_names, "dfcaverns:dimple_cup_seed") -dfcaverns.register_grow_abm(dimple_names, 10, 1) +dfcaverns.register_grow_abm(dimple_names, dfcaverns.config.plant_growth_timer * dfcaverns.config.dimple_cup_timer_multiplier, dfcaverns.config.plant_growth_chance) diff --git a/plants/pig_tail.lua b/plants/pig_tail.lua index e00098a..127ca8d 100644 --- a/plants/pig_tail.lua +++ b/plants/pig_tail.lua @@ -51,7 +51,7 @@ end dfcaverns.register_seed("pig_tail_seed", S("Pig Tail Spore"), "dfcaverns_pig_tail_seed.png", "dfcaverns:pig_tail_1") table.insert(pig_tail_names, "dfcaverns:pig_tail_seed") -dfcaverns.register_grow_abm(pig_tail_names, 10, 1) +dfcaverns.register_grow_abm(pig_tail_names, dfcaverns.config.plant_growth_timer * dfcaverns.config.pig_tail_timer_multiplier, dfcaverns.config.plant_growth_chance) minetest.register_craftitem("dfcaverns:pig_tail_thread", { description = S("Pig tail thread"), diff --git a/plants/plump_helmet.lua b/plants/plump_helmet.lua index ec5b1d5..43d0c9f 100644 --- a/plants/plump_helmet.lua +++ b/plants/plump_helmet.lua @@ -226,7 +226,8 @@ minetest.register_node("dfcaverns:plump_helmet_4", { }) local plump_names = {"dfcaverns:plump_helmet_spawn", "dfcaverns:plump_helmet_1", "dfcaverns:plump_helmet_2", "dfcaverns:plump_helmet_3"} -dfcaverns.register_grow_abm(plump_names, 10, 1) + +dfcaverns.register_grow_abm(plump_names, dfcaverns.config.plant_growth_timer * dfcaverns.config.plump_helmet_timer_multiplier, dfcaverns.config.plant_growth_chance) minetest.register_craft({ type = "fuel", diff --git a/plants/quarry_bush.lua b/plants/quarry_bush.lua index 5b72b64..54667ae 100644 --- a/plants/quarry_bush.lua +++ b/plants/quarry_bush.lua @@ -52,7 +52,7 @@ end dfcaverns.register_seed("quarry_bush_seed", S("Rock Nuts"), "dfcaverns_rock_nuts.png", "dfcaverns:quarry_bush_1") table.insert(quarry_names, "dfcaverns:quarry_bush_seed") -dfcaverns.register_grow_abm(quarry_names, 10, 1) +dfcaverns.register_grow_abm(quarry_names, dfcaverns.config.plant_growth_timer * dfcaverns.config.quarry_bush_timer_multiplier, dfcaverns.config.plant_growth_chance) minetest.register_craftitem("dfcaverns:quarry_bush_leaves", { description = S("Quarry Bush Leaves"), diff --git a/plants/sweet_pod.lua b/plants/sweet_pod.lua index 1fe4f47..165da72 100644 --- a/plants/sweet_pod.lua +++ b/plants/sweet_pod.lua @@ -50,7 +50,7 @@ end dfcaverns.register_seed("sweet_pod_seed", S("Sweet Pod Spores"), "dfcaverns_sweet_pod_seed.png", "dfcaverns:sweet_pod_1") table.insert(sweet_names, "dfcaverns:sweet_pod_seed") -dfcaverns.register_grow_abm(sweet_names, 10, 1) +dfcaverns.register_grow_abm(sweet_names, dfcaverns.config.plant_growth_timer * dfcaverns.config.sweet_pod_timer_multiplier, dfcaverns.config.plant_growth_chance) minetest.register_craftitem("dfcaverns:sweet_pods", { description = S("Sweet Pods"), diff --git a/settingtypes.txt b/settingtypes.txt index da6b20e..2f0a88b 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -25,4 +25,12 @@ 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 +dfcaverns_plant_growth_timer (Base plant growth timer interval) int 100 +dfcaverns_plant_growth_chance (Base plant growth chance) int 4 +dfcaverns_cave_wheat_timer_multiplier (cave_wheat growth delay multiplier) float 1 +dfcaverns_dimple_cup_timer_multiplier (dimple_cup growth delay multiplier) float 3 +dfcaverns_pig_tail_timer_multiplier (pig_tail growth delay multiplier) float 1 +dfcaverns_plump_helmet_timer_multiplier (plump_helmet growth delay multiplier) float 3 +dfcaverns_quarry_bush_timer_multiplier (quarry_bush growth delay multiplier) float 2 +dfcaverns_sweet_pod_timer_multiplier (sweet_pod growth delay multiplier) float 2 dfcaverns_light_kills_fungus (Light kills fungus) bool true \ No newline at end of file