mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2024-12-25 02:10:37 +01:00
begin setting up real biomes
This commit is contained in:
parent
1068672909
commit
7d99acad03
136
biomes.lua
136
biomes.lua
@ -1,9 +1,10 @@
|
||||
local c_water = minetest.get_content_id("default:water_source")
|
||||
local c_air = minetest.get_content_id("air")
|
||||
local c_stone = minetest.get_content_id("default:stone")
|
||||
local c_dirt = minetest.get_content_id("default:dirt")
|
||||
local c_sand = minetest.get_content_id("default:sand")
|
||||
|
||||
local c_dirt = minetest.get_content_id("default:dirt")
|
||||
local c_coal_ore = minetest.get_content_id("default:stone_with_coal")
|
||||
local c_gravel = minetest.get_content_id("default:gravel")
|
||||
|
||||
local c_sweet_pod = minetest.get_content_id("dfcaverns:sweet_pod_6") -- param2 = 0
|
||||
local c_quarry_bush = minetest.get_content_id("dfcaverns:quarry_bush_5") -- param2 = 4
|
||||
@ -14,113 +15,36 @@ local c_cave_wheat = minetest.get_content_id("dfcaverns:cave_wheat_8") -- param2
|
||||
local c_dead_fungus = minetest.get_content_id("dfcaverns:dead_fungus") -- param2 = 0
|
||||
local c_cavern_fungi = minetest.get_content_id("dfcaverns:cavern_fungi") -- param2 = 0
|
||||
|
||||
|
||||
local c_dirt_moss = minetest.get_content_id("dfcaverns:dirt_with_cave_moss")
|
||||
local c_dirt = minetest.get_content_id("default:dirt")
|
||||
local c_cobble = minetest.get_content_id("default:cobble")
|
||||
local c_cobble_fungus = minetest.get_content_id("dfcaverns:cobble_with_floor_fungus")
|
||||
|
||||
--dfcaverns.spawn_tunnel_tube_vm(vi, area, data, param2_data)
|
||||
--dfcaverns.spawn_tower_cap_vm(vi, area, data)
|
||||
--dfcaverns.spawn_spore_tree_vm(vi, data, area)
|
||||
--dfcaverns.spawn_nether_cap_vm(vi, area, data)
|
||||
--dfcaverns.spawn_goblin_cap_vm(vi, area, data)
|
||||
--dfcaverns.spawn_fungiwood_vm(vi, area, data)
|
||||
--dfcaverns.spawn_blood_thorn_vm(vi, area, data, data_param2)
|
||||
dfcaverns.can_support_vegetation = {[c_sand] = true, [c_dirt] = true, [c_coal_ore] = true, [c_gravel] = true}
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------
|
||||
-- Coal Dust
|
||||
|
||||
local test_biome_floor = function(area, data, ai, vi, bi, param2_data)
|
||||
if data[bi] ~= c_stone then
|
||||
return
|
||||
end
|
||||
|
||||
if math.random() < 0.25 then
|
||||
data[bi] = c_dirt
|
||||
else
|
||||
data[bi] = c_dirt_moss
|
||||
end
|
||||
|
||||
local drip_rand = subterrane:vertically_consistent_random(vi, area)
|
||||
|
||||
if math.random() < 0.1 then
|
||||
--data[vi] = c_plump_helmet
|
||||
--param2_data[vi] = math.random(0,3)
|
||||
dfcaverns.place_shrub = function(data, vi, param2_data)
|
||||
local shrub = math.random(1,8)
|
||||
if shrub == 1 then
|
||||
data[vi] = c_sweet_pod
|
||||
param2_data[vi] = 0
|
||||
elseif shrub == 2 then
|
||||
data[vi] = c_quarry_bush
|
||||
param2_data[vi] = 4
|
||||
elseif shrub == 3 then
|
||||
data[vi] = c_plump_helmet
|
||||
param2_data[vi] = math.random(0,3)
|
||||
elseif shrub == 4 then
|
||||
data[vi] = c_pig_tail
|
||||
param2_data[vi] = 3
|
||||
elseif shrub == 5 then
|
||||
data[vi] = c_dimple_cup
|
||||
param2_data[vi] = 0
|
||||
elseif shrub == 6 then
|
||||
data[vi] = c_cave_wheat
|
||||
param2_data[vi] = 3
|
||||
elseif shrub == 7 then
|
||||
data[vi] = c_dead_fungus
|
||||
param2_data[vi] = 0
|
||||
elseif shrub == 8 then
|
||||
data[vi] = c_cavern_fungi
|
||||
elseif drip_rand < 0.1 then
|
||||
--subterrane:stalagmite(bi, area, data, 6, 15, c_stone, c_stone, c_stone)
|
||||
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
|
||||
local height = math.floor(drip_rand/0.1 * 5)
|
||||
subterrane:small_stalagmite(vi, area, data, param2_data, param2, height)
|
||||
elseif math.random() < 0.002 then
|
||||
dfcaverns.spawn_tower_cap_vm(bi, area, data)
|
||||
end
|
||||
end
|
||||
|
||||
local test_biome_cave_floor = function(area, data, ai, vi, bi, param2_data)
|
||||
if data[bi] == c_dirt or data[bi] == c_sand then
|
||||
data[bi] = c_dirt_moss
|
||||
if math.random() < 0.5 then
|
||||
if data[vi] == c_air then
|
||||
data[vi] = c_cavern_fungi
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
if data[bi] ~= c_stone then
|
||||
return
|
||||
end
|
||||
|
||||
local drip_rand = subterrane:vertically_consistent_random(vi, area)
|
||||
if drip_rand < 0.075 then
|
||||
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
|
||||
local height = math.floor(drip_rand/0.075 * 4)
|
||||
subterrane:small_stalagmite(vi, area, data, param2_data, param2, height)
|
||||
param2_data[vi] = 0
|
||||
end
|
||||
end
|
||||
|
||||
local test_biome_cave_ceiling = function(area, data, ai, vi, bi, param2_data)
|
||||
if data[ai] ~= c_stone then
|
||||
return
|
||||
end
|
||||
|
||||
local drip_rand = subterrane:vertically_consistent_random(vi, area)
|
||||
|
||||
if drip_rand < 0.1 then
|
||||
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
|
||||
local height = math.floor(drip_rand/0.1 * 5)
|
||||
subterrane:small_stalagmite(vi, area, data, param2_data, param2, -height)
|
||||
end
|
||||
end
|
||||
|
||||
local test_biome_ceiling = function(area, data, ai, vi, bi, param2_data)
|
||||
if data[ai] ~= c_stone then
|
||||
return
|
||||
end
|
||||
|
||||
local drip_rand = subterrane:vertically_consistent_random(vi, area)
|
||||
if drip_rand < 0.075 then
|
||||
--subterrane:stalactite(ai, area, data, 6, 20, c_stone, c_stone, c_stone)
|
||||
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
|
||||
local height = math.floor(drip_rand/0.075 * 5)
|
||||
subterrane:small_stalagmite(vi, area, data, param2_data, param2, -height)
|
||||
elseif math.random() < 0.03 then
|
||||
dfcaverns.glow_worm_ceiling(area, data, ai, vi, bi)
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------
|
||||
|
||||
minetest.register_biome({
|
||||
name = "dfcaverns_test_biome",
|
||||
y_min = -2000,
|
||||
y_max = -300,
|
||||
heat_point = 50,
|
||||
humidity_point = 50,
|
||||
_subterrane_ceiling_decor = test_biome_ceiling,
|
||||
_subterrane_floor_decor = test_biome_floor,
|
||||
_subterrane_fill_node = c_air,
|
||||
_subterrane_cave_floor_decor = test_biome_cave_floor,
|
||||
_subterrane_cave_ceiling_decor = test_biome_cave_ceiling,
|
||||
})
|
||||
end
|
0
biomes/lava_sea.lua
Normal file
0
biomes/lava_sea.lua
Normal file
202
biomes/level1.lua
Normal file
202
biomes/level1.lua
Normal file
@ -0,0 +1,202 @@
|
||||
local c_water = minetest.get_content_id("default:water_source")
|
||||
local c_air = minetest.get_content_id("air")
|
||||
local c_stone = minetest.get_content_id("default:stone")
|
||||
local c_cobble = minetest.get_content_id("default:cobble")
|
||||
local c_dirt = minetest.get_content_id("default:dirt")
|
||||
|
||||
local c_dirt_moss = minetest.get_content_id("dfcaverns:dirt_with_cave_moss")
|
||||
local c_cobble_fungus = minetest.get_content_id("dfcaverns:cobble_with_floor_fungus")
|
||||
local c_dead_fungus = minetest.get_content_id("dfcaverns:dead_fungus") -- param2 = 0
|
||||
|
||||
--dfcaverns.spawn_fungiwood_vm(vi, area, data)
|
||||
|
||||
local level_1_tower_cap_floor = function(area, data, ai, vi, bi, param2_data)
|
||||
subterrane:obsidian_floor_dam(area, data, ai, vi, bi)
|
||||
if data[bi] ~= c_stone then
|
||||
return
|
||||
end
|
||||
|
||||
if math.random() < 0.25 then
|
||||
data[bi] = c_dirt
|
||||
else
|
||||
data[bi] = c_dirt_moss
|
||||
end
|
||||
|
||||
local drip_rand = subterrane:vertically_consistent_random(vi, area)
|
||||
if math.random() < 0.1 then
|
||||
dfcaverns.place_shrub(data, vi, param2_data)
|
||||
elseif drip_rand < 0.1 then
|
||||
--subterrane:stalagmite(bi, area, data, 6, 15, c_stone, c_stone, c_stone)
|
||||
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
|
||||
local height = math.floor(drip_rand/0.1 * 5)
|
||||
subterrane:small_stalagmite(vi, area, data, param2_data, param2, height, true)
|
||||
elseif math.random() < 0.005 then
|
||||
dfcaverns.spawn_tower_cap_vm(bi, area, data)
|
||||
end
|
||||
end
|
||||
|
||||
local level_1_moist_ceiling = function(area, data, ai, vi, bi, param2_data)
|
||||
subterrane:obsidian_ceiling_plug(area, data, ai, vi, bi)
|
||||
if data[ai] ~= c_stone then
|
||||
return
|
||||
end
|
||||
local drip_rand = subterrane:vertically_consistent_random(vi, area)
|
||||
if drip_rand < 0.075 then
|
||||
--subterrane:stalactite(ai, area, data, 6, 20, c_stone, c_stone, c_stone)
|
||||
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
|
||||
local height = math.floor(drip_rand/0.075 * 5)
|
||||
subterrane:small_stalagmite(vi, area, data, param2_data, param2, -height, true)
|
||||
elseif math.random() < 0.03 then
|
||||
dfcaverns.glow_worm_ceiling(area, data, ai, vi, bi)
|
||||
end
|
||||
end
|
||||
|
||||
local level_1_dry_floor = function(area, data, ai, vi, bi, param2_data)
|
||||
if data[bi] ~= c_stone then
|
||||
return
|
||||
end
|
||||
|
||||
if math.random() < 0.25 then
|
||||
data[bi] = c_cobble_fungus
|
||||
if math.random() < 0.1 then
|
||||
data[vi] = c_dead_fungus
|
||||
end
|
||||
elseif math.random() < 0.5 then
|
||||
data[bi] = c_cobble
|
||||
end
|
||||
local drip_rand = subterrane:vertically_consistent_random(vi, area)
|
||||
|
||||
if drip_rand < 0.05 then
|
||||
--subterrane:stalagmite(bi, area, data, 6, 15, c_stone, c_stone, c_stone)
|
||||
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
|
||||
local height = math.floor(drip_rand/0.025 * 5)
|
||||
subterrane:small_stalagmite(vi, area, data, param2_data, param2, height, false)
|
||||
end
|
||||
end
|
||||
|
||||
local level_1_dry_ceiling = function(area, data, ai, vi, bi, param2_data)
|
||||
if data[ai] ~= c_stone then
|
||||
return
|
||||
end
|
||||
local drip_rand = subterrane:vertically_consistent_random(vi, area)
|
||||
if drip_rand < 0.075 then
|
||||
--subterrane:stalactite(ai, area, data, 6, 20, c_stone, c_stone, c_stone)
|
||||
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
|
||||
local height = math.floor(drip_rand/0.05 * 5)
|
||||
subterrane:small_stalagmite(vi, area, data, param2_data, param2, -height, false)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local level_1_fungiwood_floor = function(area, data, ai, vi, bi, param2_data)
|
||||
subterrane:obsidian_floor_dam(area, data, ai, vi, bi)
|
||||
if data[bi] ~= c_stone then
|
||||
return
|
||||
end
|
||||
|
||||
if math.random() < 0.25 then
|
||||
data[bi] = c_dirt
|
||||
else
|
||||
data[bi] = c_dirt_moss
|
||||
end
|
||||
|
||||
local drip_rand = subterrane:vertically_consistent_random(vi, area)
|
||||
|
||||
if math.random() < 0.1 then
|
||||
dfcaverns.place_shrub(data, vi, param2_data)
|
||||
elseif drip_rand < 0.1 then
|
||||
--subterrane:stalagmite(bi, area, data, 6, 15, c_stone, c_stone, c_stone)
|
||||
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
|
||||
local height = math.floor(drip_rand/0.1 * 5)
|
||||
subterrane:small_stalagmite(vi, area, data, param2_data, param2, height, true)
|
||||
elseif math.random() < 0.005 then
|
||||
dfcaverns.spawn_fungiwood_vm(bi, area, data)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local level_1_cave_floor = function(area, data, ai, vi, bi, param2_data)
|
||||
if dfcaverns.can_support_vegetation[data[bi]] then
|
||||
data[bi] = c_dirt_moss
|
||||
if math.random() < 0.25 then
|
||||
if data[vi] == c_air then
|
||||
dfcaverns.place_shrub(data, vi, param2_data)
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
if data[bi] ~= c_stone then
|
||||
return
|
||||
end
|
||||
|
||||
local drip_rand = subterrane:vertically_consistent_random(vi, area)
|
||||
if drip_rand < 0.075 then
|
||||
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
|
||||
local height = math.floor(drip_rand/0.075 * 4)
|
||||
subterrane:small_stalagmite(vi, area, data, param2_data, param2, height, true)
|
||||
end
|
||||
end
|
||||
|
||||
local level_1_cave_ceiling = function(area, data, ai, vi, bi, param2_data)
|
||||
if data[ai] ~= c_stone then
|
||||
return
|
||||
end
|
||||
|
||||
local drip_rand = subterrane:vertically_consistent_random(vi, area)
|
||||
|
||||
if drip_rand < 0.1 then
|
||||
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
|
||||
local height = math.floor(drip_rand/0.1 * 5)
|
||||
subterrane:small_stalagmite(vi, area, data, param2_data, param2, -height, true)
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------
|
||||
|
||||
minetest.register_biome({
|
||||
name = "dfcaverns_level1_flooded_biome",
|
||||
y_min = -2000,
|
||||
y_max = -300,
|
||||
heat_point = -20,
|
||||
humidity_point = 0,
|
||||
_subterrane_fill_node = c_water,
|
||||
_subterrane_cave_fill_node = c_water,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_biome({
|
||||
name = "dfcaverns_level1_tower_cap_biome",
|
||||
y_min = -2000,
|
||||
y_max = -300,
|
||||
heat_point = 80,
|
||||
humidity_point = 20,
|
||||
_subterrane_ceiling_decor = level_1_moist_ceiling,
|
||||
_subterrane_floor_decor = level_1_tower_cap_floor,
|
||||
_subterrane_fill_node = c_air,
|
||||
_subterrane_cave_floor_decor = level_1_cave_floor,
|
||||
_subterrane_cave_ceiling_decor = level_1_cave_ceiling,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "dfcaverns_level1_fungiwood_biome",
|
||||
y_min = -2000,
|
||||
y_max = -300,
|
||||
heat_point = 60,
|
||||
humidity_point = 100,
|
||||
_subterrane_ceiling_decor = level_1_moist_ceiling,
|
||||
_subterrane_floor_decor = level_1_fungiwood_floor,
|
||||
_subterrane_fill_node = c_air,
|
||||
_subterrane_cave_floor_decor = level_1_cave_floor,
|
||||
_subterrane_cave_ceiling_decor = level_1_cave_ceiling,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "dfcaverns_level1_dry_biome",
|
||||
y_min = -2000,
|
||||
y_max = -300,
|
||||
heat_point = 20,
|
||||
humidity_point = 140,
|
||||
_subterrane_ceiling_decor = level_1_dry_ceiling,
|
||||
_subterrane_floor_decor = level_1_dry_floor,
|
||||
_subterrane_fill_node = c_air,
|
||||
})
|
5
biomes/level2.lua
Normal file
5
biomes/level2.lua
Normal file
@ -0,0 +1,5 @@
|
||||
--dfcaverns.spawn_tower_cap_vm(vi, area, data)
|
||||
--dfcaverns.spawn_fungiwood_vm(vi, area, data)
|
||||
--dfcaverns.spawn_tunnel_tube_vm(vi, area, data, param2_data)
|
||||
--dfcaverns.spawn_spore_tree_vm(vi, data, area)
|
||||
--dfcaverns.spawn_goblin_cap_vm(vi, area, data)
|
5
biomes/level3.lua
Normal file
5
biomes/level3.lua
Normal file
@ -0,0 +1,5 @@
|
||||
--dfcaverns.spawn_tunnel_tube_vm(vi, area, data, param2_data)
|
||||
--dfcaverns.spawn_spore_tree_vm(vi, data, area)
|
||||
--dfcaverns.spawn_nether_cap_vm(vi, area, data)
|
||||
--dfcaverns.spawn_goblin_cap_vm(vi, area, data)
|
||||
--dfcaverns.spawn_blood_thorn_vm(vi, area, data, data_param2)
|
0
biomes/underworld.lua
Normal file
0
biomes/underworld.lua
Normal file
@ -35,7 +35,7 @@ minetest.register_abm{
|
||||
catch_up = true,
|
||||
action = function(pos)
|
||||
local above_def = minetest.registered_nodes[minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name]
|
||||
if above_def.buildable_to == true or above_def.walkable == false then
|
||||
if above_def and (above_def.buildable_to == true or above_def.walkable == false) then
|
||||
minetest.swap_node(pos, {name="dfcaverns:dirt_with_cave_moss"})
|
||||
end
|
||||
end,
|
||||
|
6
init.lua
6
init.lua
@ -32,7 +32,13 @@ dofile(modpath.."/trees/nether_cap.lua")
|
||||
dofile(modpath.."/trees/goblin_cap.lua")
|
||||
dofile(modpath.."/trees/tower_cap.lua")
|
||||
|
||||
-- Biomes
|
||||
dofile(modpath.."/biomes.lua")
|
||||
dofile(modpath.."/biomes/level1.lua")
|
||||
dofile(modpath.."/biomes/level2.lua")
|
||||
dofile(modpath.."/biomes/level3.lua")
|
||||
dofile(modpath.."/biomes/lava_sea.lua")
|
||||
dofile(modpath.."/biomes/underworld.lua")
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "vein",
|
||||
|
Loading…
Reference in New Issue
Block a user