make mapgen mycelium timer delay configurable

This commit is contained in:
FaceDeer 2020-02-09 17:15:41 -07:00
parent bf507c3177
commit d9b3903e66
2 changed files with 15 additions and 6 deletions

View File

@ -22,6 +22,8 @@ local perlin_wave_primordial = {
local c_air = minetest.get_content_id("air")
local giant_mycelium_timer_spread = tonumber(minetest.settings:get("dcaverns_giant_mycelium_timer_spread")) or 10
-----------------------------------------------------------------------------------------
-- Fungal biome
@ -62,7 +64,7 @@ local mushroom_cavern_floor = function(abs_cracks, humidity, vi, area, data, dat
if rand < 0.0005 then
local mycelium_index = vi+ystride
data[mycelium_index] = c_giant_mycelium
minetest.get_node_timer(area:position(mycelium_index)):start(math.random(1,10))
minetest.get_node_timer(area:position(mycelium_index)):start(math.random(1,giant_mycelium_timer_spread))
elseif rand < 0.003 then
local schematic = df_primordial_items.get_primordial_mushroom()
local rotation = (math.random(1,4)-1)*90
@ -84,7 +86,7 @@ local mushroom_cavern_ceiling = function(abs_cracks, humidity, vi, area, data, d
if rand < 0.002 then
local mycelium_index = vi-ystride
data[mycelium_index] = c_giant_mycelium
minetest.get_node_timer(area:position(mycelium_index)):start(math.random(1,10))
minetest.get_node_timer(area:position(mycelium_index)):start(math.random(1,giant_mycelium_timer_spread))
elseif rand < 0.03 then
df_primordial_items.spawn_ceiling_spire_vm(vi, area, data)
elseif rand < 0.2 then
@ -105,7 +107,7 @@ local mushroom_warren_ceiling = function(abs_cracks, vi, area, data, data_param2
if rand < 0.002 then
local mycelium_index = vi-ystride
data[mycelium_index] = c_giant_mycelium
minetest.get_node_timer(area:position(mycelium_index)):start(math.random(1,10))
minetest.get_node_timer(area:position(mycelium_index)):start(math.random(1,giant_mycelium_timer_spread))
elseif rand < 0.2 then
data[vi-ystride] = c_orb
data_param2[vi-ystride] = math.random(0,179)
@ -125,7 +127,7 @@ local mushroom_warren_floor = function(abs_cracks, vi, area, data, data_param2)
if rand < 0.001 then
local mycelium_index = vi+ystride
data[mycelium_index] = c_giant_mycelium
minetest.get_node_timer(area:position(mycelium_index)):start(math.random(1,10))
minetest.get_node_timer(area:position(mycelium_index)):start(math.random(1,giant_mycelium_timer_spread))
elseif rand < 0.03 then
data[vi+ystride] = fungal_plants[math.random(1,5)]
end
@ -356,7 +358,7 @@ local decorate_primordial = function(minp, maxp, seed, vm, node_arrays, area, da
local rand_vi = vi + random_dir[math.random(1,4)]
if data[rand_vi] == c_air then
data[rand_vi] = c_giant_mycelium
minetest.get_node_timer(area:position(rand_vi)):start(math.random(1,10))
minetest.get_node_timer(area:position(rand_vi)):start(math.random(1,giant_mycelium_timer_spread))
end
end
end

View File

@ -63,4 +63,11 @@ dfcaverns_ruin_visibility_range (Ruin visibility range) int 250
[Primordial]
dfcaverns_enable_primordial (Generate primordial caverns) bool true
dfcaverns_primordial_max (Upper limit of primordial caverns) int -3393
dfcaverns_primordial_min (Lower limit of primordial caverns) int -4032
dfcaverns_primordial_min (Lower limit of primordial caverns) int -4032
# This setting is pretty technical, it spreads out the
# construction of giant mycelium networks on mapgen
# over this many seconds. If you're experiencing lag spikes
# during mapgen of Primordial cavern layer mushroom caverns
# then increasing this number may help.
dcaverns_giant_mycelium_timer_spread (Giant Mycelium mapgen timer spread) int 10