balance: make decomposition more expensive.

decomposing leaves are now less likely to turn into dirt.
This commit is contained in:
trans_soup 2023-10-19 16:00:43 +02:00
parent 737afdfcc9
commit 292358a3db

View file

@ -36,6 +36,7 @@ local decompose_scores = {
} }
local decompose_cost = 30000 local decompose_cost = 30000
local average_leaves_per_dirt = 4
blockgame.register_increasing_abm({ blockgame.register_increasing_abm({
id = modname .. ":decompose", id = modname .. ":decompose",
@ -82,7 +83,7 @@ blockgame.register_increasing_abm({
local def = minetest.registered_nodes[node.name] local def = minetest.registered_nodes[node.name]
local dirt_chance = def.level_max - def.level + 1 local dirt_chance = def.level_max - def.level + 1
if blockgame.chance(dirt_chance) then if blockgame.chance(dirt_chance * average_leaves_per_dirt) then
minetest.set_node(pos, {name = "bg_terrain:dirt"}) minetest.set_node(pos, {name = "bg_terrain:dirt"})
else else
minetest.remove_node(pos) minetest.remove_node(pos)