mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-06-28 06:30:34 +02:00
rough out the jungle biome
This commit is contained in:
@ -2,13 +2,6 @@ if not df_caverns.config.enable_primordial or not minetest.get_modpath("df_primo
|
||||
return
|
||||
end
|
||||
|
||||
local c_orb = minetest.get_content_id("df_primordial_items:glow_orb_hanging")
|
||||
local c_mycelial_dirt = minetest.get_content_id("df_primordial_items:dirt_with_mycelium")
|
||||
local c_dirt = minetest.get_content_id("default:dirt")
|
||||
local c_giant_mycelium = minetest.get_content_id("df_primordial_items:giant_hypha_apical_mapgen")
|
||||
|
||||
-----------------------------------------------------------------------------------------
|
||||
|
||||
local perlin_cave_primordial = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
@ -27,8 +20,15 @@ local perlin_wave_primordial = {
|
||||
persist = 0.63
|
||||
}
|
||||
|
||||
-----------------------------------------------------------------------------------------
|
||||
-- Fungal biome
|
||||
|
||||
local plants = {
|
||||
local c_orb = minetest.get_content_id("df_primordial_items:glow_orb_hanging")
|
||||
local c_mycelial_dirt = minetest.get_content_id("df_primordial_items:dirt_with_mycelium")
|
||||
local c_dirt = minetest.get_content_id("default:dirt")
|
||||
local c_giant_mycelium = minetest.get_content_id("df_primordial_items:giant_hypha_apical_mapgen")
|
||||
|
||||
local fungal_plants = {
|
||||
minetest.get_content_id("df_primordial_items:fungal_grass_1"),
|
||||
minetest.get_content_id("df_primordial_items:fungal_grass_2"),
|
||||
minetest.get_content_id("df_primordial_items:glow_orb"),
|
||||
@ -55,7 +55,7 @@ local mushroom_cavern_floor = function(abs_cracks, humidity, vi, area, data, dat
|
||||
local rotation = (math.random(1,4)-1)*90
|
||||
mapgen_helper.place_schematic_on_data_if_it_fits(data, data_param2, area, area:position(vi+ystride), schematic, rotation)
|
||||
elseif rand < 0.05 then
|
||||
data[vi+ystride] = plants[math.random(1,5)]
|
||||
data[vi+ystride] = fungal_plants[math.random(1,5)]
|
||||
end
|
||||
end
|
||||
|
||||
@ -108,19 +108,63 @@ local mushroom_warren_floor = function(abs_cracks, vi, area, data, data_param2)
|
||||
if rand < 0.001 then
|
||||
data[vi+ystride] = c_giant_mycelium
|
||||
elseif rand < 0.03 then
|
||||
data[vi+ystride] = plants[math.random(1,5)]
|
||||
data[vi+ystride] = fungal_plants[math.random(1,5)]
|
||||
end
|
||||
end
|
||||
|
||||
local jungle_cavern_floor = function(abs_cracks, vi, area, data, data_param2)
|
||||
--------------------------------------------------------------------------------------------------
|
||||
-- Jungle biome
|
||||
|
||||
|
||||
local jungle_plants = {
|
||||
minetest.get_content_id("df_primordial_items:fern_1"),
|
||||
minetest.get_content_id("df_primordial_items:fern_2"),
|
||||
minetest.get_content_id("df_primordial_items:glow_plant_1"),
|
||||
minetest.get_content_id("df_primordial_items:glow_plant_2"),
|
||||
minetest.get_content_id("df_primordial_items:glow_plant_3"),
|
||||
minetest.get_content_id("df_primordial_items:jungle_grass_1"),
|
||||
minetest.get_content_id("df_primordial_items:jungle_grass_2"),
|
||||
minetest.get_content_id("df_primordial_items:jungle_grass_3"),
|
||||
minetest.get_content_id("df_primordial_items:jungle_mushroom_1"),
|
||||
minetest.get_content_id("df_primordial_items:jungle_mushroom_2"),
|
||||
}
|
||||
|
||||
local c_jungle_dirt = minetest.get_content_id("df_primordial_items:dirt_with_jungle_grass")
|
||||
local c_plant_matter = minetest.get_content_id("df_primordial_items:plant_matter")
|
||||
local c_packed_roots = minetest.get_content_id("df_primordial_items:packed_roots")
|
||||
local c_glowstone = minetest.get_content_id("df_underworld_items:glowstone")
|
||||
|
||||
local jungle_cavern_floor = function(abs_cracks, humidity, vi, area, data, data_param2)
|
||||
local ystride = area.ystride
|
||||
local humidityfactor = humidity/100
|
||||
|
||||
data[vi] = c_jungle_dirt
|
||||
|
||||
local rand = math.random()
|
||||
if rand < 0.05 then
|
||||
local fern_schematic = df_primordial_items.get_fern_schematic()
|
||||
local rotation = (math.random(1,4)-1)*90
|
||||
mapgen_helper.place_schematic_on_data_if_it_fits(data, data_param2, area, area:position(vi+ystride), fern_schematic, rotation)
|
||||
elseif rand < 0.075 then
|
||||
df_primordial_items.spawn_jungle_mushroom_vm(vi+ystride, area, data)
|
||||
elseif rand < 0.125 then
|
||||
df_primordial_items.spawn_jungle_tree_vm(math.random(8,14), vi+ystride, area, data)
|
||||
elseif rand < 0.3 then
|
||||
data[vi+ystride] = jungle_plants[math.random(1,#jungle_plants)]
|
||||
end
|
||||
end
|
||||
|
||||
local jungle_cavern_ceiling = function(abs_cracks, vi, area, data, data_param2)
|
||||
if abs_cracks < 0.25 then
|
||||
data[vi] = c_glowstone
|
||||
end
|
||||
end
|
||||
|
||||
local jungle_warren_ceiling = function(abs_cracks, vi, area, data, data_param2)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
local decorate_primordial = function(minp, maxp, seed, vm, node_arrays, area, data)
|
||||
math.randomseed(minp.x + minp.y*2^8 + minp.z*2^16 + seed) -- make decorations consistent between runs
|
||||
|
||||
@ -143,11 +187,11 @@ local decorate_primordial = function(minp, maxp, seed, vm, node_arrays, area, da
|
||||
local humidity = humiditymap[index2d]
|
||||
local jungle = nvals_cave[cave_area:transform(area, vi)] < 0
|
||||
|
||||
-- if jungle then
|
||||
-- jungle_cavern_floor(abs_cracks, vi, area, data, data_param2)
|
||||
-- else
|
||||
if jungle then
|
||||
jungle_cavern_floor(abs_cracks, humidity, vi, area, data, data_param2)
|
||||
else
|
||||
mushroom_cavern_floor(abs_cracks, humidity, vi, area, data, data_param2)
|
||||
-- end
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------
|
||||
@ -159,11 +203,11 @@ local decorate_primordial = function(minp, maxp, seed, vm, node_arrays, area, da
|
||||
local abs_cracks = math.abs(cracks)
|
||||
local jungle = nvals_cave[cave_area:transform(area, vi)] < 0
|
||||
local humidity = humiditymap[index2d]
|
||||
-- if jungle then
|
||||
-- jungle_cavern_ceiling(abs_cracks, vi, area, data, data_param2)
|
||||
-- else
|
||||
if jungle then
|
||||
jungle_cavern_ceiling(abs_cracks, vi, area, data, data_param2)
|
||||
else
|
||||
mushroom_cavern_ceiling(abs_cracks, humidity, vi, area, data, data_param2)
|
||||
-- end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user