From a1be5250b80f1dd7b0b3b9c59611cdb0c0bf57a7 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Wed, 6 May 2015 23:59:25 -0700 Subject: Unify the difficulty settings into init.lua All the scaling factors are now either in the plant table or the crops.settings table. This makes end-user tuning a bit harder, but switching easier and configuring easier as well. --- corn.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'corn.lua') diff --git a/corn.lua b/corn.lua index 3d561cd..8dd04ac 100644 --- a/corn.lua +++ b/corn.lua @@ -84,8 +84,8 @@ minetest.register_node("crops:corn_base_seed", { minetest.register_abm({ nodenames = { "crops:corn_base_seed" }, neighbors = { "group:soil" }, - interval = crops.interval, - chance = crops.chance, + interval = crops.settings.interval, + chance = crops.settings.chance, action = function(pos, node, active_object_count, active_object_count_wider) if not crops.can_grow(pos) then return @@ -112,8 +112,8 @@ minetest.register_node("crops:corn_base_1", { minetest.register_abm({ nodenames = { "crops:corn_base_1" }, neighbors = { "group:soil" }, - interval = crops.interval, - chance = crops.chance, + interval = crops.settings.interval, + chance = crops.settings.chance, action = function(pos, node, active_object_count, active_object_count_wider) if not crops.can_grow(pos) then return @@ -218,10 +218,10 @@ minetest.register_node("crops:corn_top_1", { minetest.register_abm({ nodenames = { "crops:corn_top_1" }, neighbors = { "crops:corn_base_2" }, - interval = crops.interval, - chance = crops.chance, + interval = crops.settings.interval, + chance = crops.settings.chance, action = function(pos, node, active_object_count, active_object_count_wider) - if minetest.get_node_light(pos, nil) < crops.light then + if minetest.get_node_light(pos, nil) < crops.settings.light then return end minetest.swap_node(pos, { name = "crops:corn_top_2" }) @@ -254,12 +254,12 @@ minetest.register_node("crops:corn_top_2", { minetest.register_abm({ nodenames = { "crops:corn_top_2" }, neighbors = { "crops:corn_base_2" }, - interval = crops.interval, - chance = crops.chance, + interval = crops.settings.interval, + chance = crops.settings.chance, action = function(pos, node, active_object_count, active_object_count_wider) -- we don't call crops.grow here otherwise there would be 2 abm's hitting -- this stack, and dmg needs to be applied to the bottom part - if minetest.get_node_light(pos, nil) < crops.light then + if minetest.get_node_light(pos, nil) < crops.settings.light then return end minetest.swap_node(pos, { name = "crops:corn_top_3" }) -- cgit v1.2.3