mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-06-28 06:30:34 +02:00
Merge branch 'master' into primordial
This commit is contained in:
@ -6,4 +6,5 @@ df_mapitems
|
||||
ice_sprites?
|
||||
oil?
|
||||
df_underworld_items?
|
||||
magma_conduits?
|
||||
magma_conduits?
|
||||
bones_loot?
|
111
df_caverns/dungeon_loot.lua
Normal file
111
df_caverns/dungeon_loot.lua
Normal file
@ -0,0 +1,111 @@
|
||||
if minetest.get_modpath("dungeon_loot") then
|
||||
|
||||
if df_caverns.config.enable_underworld then
|
||||
dungeon_loot.register({
|
||||
{name = "df_underworld_items:glow_amethyst", chance = 0.3, count = {1, 12}, y = {-32768, df_caverns.config.lava_sea_level}},
|
||||
})
|
||||
end
|
||||
|
||||
if df_caverns.config.enable_oil_sea and minetest.get_modpath("bucket") then
|
||||
dungeon_loot.register({
|
||||
{name = "oil:oil_bucket", chance = 0.5, count = {1, 3}, y = {-32768, df_caverns.config.ymax}},
|
||||
})
|
||||
end
|
||||
|
||||
if df_caverns.config.enable_lava_sea then
|
||||
dungeon_loot.register({
|
||||
{name = "df_mapitems:mese_crystal", chance = 0.25, count = {1, 5}, y = {-32768, df_caverns.config.sunless_sea_min}},
|
||||
{name = "df_mapitems:glow_mese", chance = 0.1, count = {1, 3}, y = {-32768, df_caverns.config.sunless_sea_min}},
|
||||
})
|
||||
end
|
||||
|
||||
dungeon_loot.register({
|
||||
{name = "df_farming:cave_wheat_seed", chance = 0.5, count = {1, 10}, y = {-32768, df_caverns.config.ymax}},
|
||||
{name = "df_farming:cave_bread", chance = 0.8, count = {1, 10}, y = {-32768, df_caverns.config.ymax}},
|
||||
{name = "df_farming:pig_tail_thread", chance = 0.7, count = {1, 10}, y = {-32768, df_caverns.config.ymax}},
|
||||
{name = "df_farming:plump_helmet_spawn", chance = 0.4, count = {1, 8}, y = {-32768, df_caverns.config.ymax}},
|
||||
{name = "df_farming:plump_helmet_4_picked", chance = 0.8, count = {1, 15}, y = {-32768, df_caverns.config.ymax}},
|
||||
{name = "df_trees:glowing_bottle_red", chance = 0.6, count = {1, 20}, y = {-32768, df_caverns.config.ymax}},
|
||||
{name = "df_trees:glowing_bottle_green", chance = 0.5, count = {1, 20}, y = {-32768, df_caverns.config.ymax}},
|
||||
{name = "df_trees:glowing_bottle_cyan", chance = 0.4, count = {1, 15}, y = {-32768, df_caverns.config.ymax}},
|
||||
{name = "df_trees:glowing_bottle_golden", chance = 0.3, count = {1, 5}, y = {-32768, df_caverns.config.ymax}},
|
||||
|
||||
{name = "df_farming:pig_tail_seed", chance = 0.5, count = {1, 10}, y = {-32768, df_caverns.config.level1_min}},
|
||||
{name = "df_mapitems:med_crystal", chance = 0.2, count = {1, 2}, y = {-32768, df_caverns.config.level1_min}},
|
||||
|
||||
{name = "df_farming:dimple_cup_seed", chance = 0.3, count = {1, 10}, y = {-32768, df_caverns.config.level2_min}},
|
||||
{name = "df_farming:quarry_bush_seed", chance = 0.3, count = {1, 5}, y = {-32768, df_caverns.config.level2_min}},
|
||||
{name = "df_farming:sweet_pod_seed", chance = 0.3, count = {1, 5}, y = {-32768, df_caverns.config.level2_min}},
|
||||
{name = "df_mapitems:big_crystal", chance = 0.1, count = {1, 1}, y = {-32768, df_caverns.config.level2_min}},
|
||||
{name = "df_trees:torchspine_ember", chance = 0.3, count = {1, 3}, y = {-32768, df_caverns.config.level2_min}},
|
||||
{name = "ice_sprites:ice_sprite_bottle", chance = 0.1, count = {1, 1}, y = {-32768, df_caverns.config.level2_min}},
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
if minetest.get_modpath("bones_loot") and df_caverns.config.enable_underworld then
|
||||
|
||||
bones_loot.register_loot({
|
||||
{name = "binoculars:binoculars", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "boats:boat", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "bucket:bucket_empty", chance = 0.3, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "fire:flint_and_steel", chance = 0.3, count = {1,2}, types = {"underworld_warrior"}},
|
||||
{name = "flowers:tulip_black", chance = 0.01, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "map:mapping_kit", chance = 0.1, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "screwdriver:screwdriver", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}},
|
||||
-- don't give the player tnt:tnt, they can craft that from this if tnt is enabled for them
|
||||
{name = "tnt:gunpowder", chance = 0.4, count = {1,10}, types = {"underworld_warrior"}},
|
||||
{name = "tnt:tnt_stick", chance = 0.3, count = {1,6}, types = {"underworld_warrior"}},
|
||||
|
||||
{name = "vessels:steel_bottle", chance = 0.4, count = {1,3}, types = {"underworld_warrior"}},
|
||||
{name = "vessels:glass_bottle", chance = 0.2, count = {1,2}, types = {"underworld_warrior"}},
|
||||
{name = "vessels:glass_fragments", chance = 0.1, count = {1,4}, types = {"underworld_warrior"}},
|
||||
|
||||
{name = "default:book", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:paper", chance = 0.1, count = {1,6}, types = {"underworld_warrior"}},
|
||||
{name = "default:skeleton_key", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:torch", chance = 0.75, count = {1,10}, types = {"underworld_warrior"}},
|
||||
|
||||
{name = "default:pick_bronze", chance = 0.15, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:pick_steel", chance = 0.1, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:pick_mese", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:pick_diamond", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:shovel_bronze", chance = 0.15, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:shovel_steel", chance = 0.1, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:shovel_mese", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:shovel_diamond", chance = 0.05, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:axe_bronze", chance = 0.3, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:axe_steel", chance = 0.5, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:axe_mese", chance = 0.15, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:axe_diamond", chance = 0.15, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:sword_bronze", chance = 0.5, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:sword_steel", chance = 0.75, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:sword_mese", chance = 0.35, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:sword_diamond", chance = 0.35, count = {1,1}, types = {"underworld_warrior"}},
|
||||
|
||||
{name = "default:coal_lump", chance = 0.5, count = {1,5}, types = {"underworld_warrior"}},
|
||||
{name = "default:mese_crystal", chance = 0.1, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:diamond", chance = 0.1, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:steel_ingot", chance = 0.2, count = {1,3}, types = {"underworld_warrior"}},
|
||||
{name = "default:copper_ingot", chance = 0.1, count = {1,2}, types = {"underworld_warrior"}},
|
||||
{name = "default:bronze_ingot", chance = 0.2, count = {1,5}, types = {"underworld_warrior"}},
|
||||
{name = "default:gold_ingot", chance = 0.3, count = {1,3}, types = {"underworld_warrior"}},
|
||||
{name = "default:mese_crystal_fragment", chance = 0.4, count = {1,5}, types = {"underworld_warrior"}},
|
||||
{name = "default:obsidian_shard", chance = 0.4, count = {1,3}, types = {"underworld_warrior"}},
|
||||
{name = "default:flint", chance = 0.3, count = {1,1}, types = {"underworld_warrior"}},
|
||||
{name = "default:sign_wall_wood", chance = 0.1, count = {1,4}, types = {"underworld_warrior"}},
|
||||
{name = "default:sign_wall_steel", chance = 0.1, count = {1,2}, types = {"underworld_warrior"}},
|
||||
{name = "default:ladder_wood", chance = 0.5, count = {1,10}, types = {"underworld_warrior"}},
|
||||
{name = "default:ladder_steel", chance = 0.2, count = {1,5}, types = {"underworld_warrior"}},
|
||||
{name = "default:meselamp", chance = 0.1, count = {1,2}, types = {"underworld_warrior"}},
|
||||
{name = "default:mese_post_light", chance = 0.25, count = {1,5}, types = {"underworld_warrior"}},
|
||||
|
||||
{name = "ice_sprites:ice_sprite_bottle", chance = 0.025, count = {1, 1}, types = {"underworld_warrior"}},
|
||||
{name = "df_underworld_items:glow_amethyst", chance = 0.25, count = {1, 2}, types = {"underworld_warrior"}},
|
||||
})
|
||||
|
||||
if df_caverns.config.enable_lava_sea then
|
||||
bones_loot.register_loot({name = "df_mapitems:mese_crystal", chance = 0.25, count = {1, 2}, types = {"underworld_warrior"}})
|
||||
end
|
||||
|
||||
end
|
@ -15,4 +15,5 @@ dofile(modpath.."/sunless_sea.lua")
|
||||
dofile(modpath.."/oil_sea.lua")
|
||||
dofile(modpath.."/lava_sea.lua")
|
||||
dofile(modpath.."/underworld.lua")
|
||||
dofile(modpath.."/primordial.lua")
|
||||
dofile(modpath.."/primordial.lua")
|
||||
dofile(modpath.."/dungeon_loot.lua")
|
||||
|
@ -6,6 +6,8 @@ local c_dirt_moss = minetest.get_content_id("df_mapitems:dirt_with_cave_moss")
|
||||
local c_wet_flowstone = minetest.get_content_id("df_mapitems:wet_flowstone")
|
||||
local c_dry_flowstone = minetest.get_content_id("df_mapitems:dry_flowstone")
|
||||
|
||||
local c_spindlestem_white = minetest.get_content_id("df_trees:spindlestem_cap_white")
|
||||
|
||||
local tower_cap_shrublist
|
||||
local fungiwood_shrublist
|
||||
|
||||
@ -51,8 +53,12 @@ local tower_cap_cavern_floor = function(abs_cracks, vert_rand, vi, area, data, d
|
||||
|
||||
if math.random() < 0.1 then
|
||||
df_caverns.place_shrub(vi+ystride, area, data, data_param2, tower_cap_shrublist)
|
||||
elseif math.random() < 0.01 and abs_cracks > 0.25 then
|
||||
df_trees.spawn_tower_cap_vm(vi+ystride, area, data)
|
||||
elseif abs_cracks > 0.25 then
|
||||
if math.random() < 0.01 then
|
||||
df_trees.spawn_tower_cap_vm(vi+ystride, area, data)
|
||||
elseif math.random() < 0.04 then
|
||||
df_trees.spawn_spindlestem_vm(vi+ystride, area, data, data_param2, c_spindlestem_white)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -71,6 +77,8 @@ local fungiwood_cavern_floor = function(abs_cracks, vert_rand, vi, area, data, d
|
||||
df_caverns.place_shrub(vi+ystride, area, data, data_param2, fungiwood_shrublist)
|
||||
elseif math.random() < 0.03 and abs_cracks > 0.35 then
|
||||
df_trees.spawn_fungiwood_vm(vi+ystride, area, data)
|
||||
elseif math.random() < 0.04 then
|
||||
df_trees.spawn_spindlestem_vm(vi+ystride, area, data, data_param2)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -203,6 +211,7 @@ local decorate_level_1 = function(minp, maxp, seed, vm, node_arrays, area, data)
|
||||
local index2d = mapgen_helper.index2di(minp, maxp, area, vi)
|
||||
local biome_name = get_biome(heatmap[index2d], humiditymap[index2d])
|
||||
local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not.
|
||||
local ystride = area.ystride
|
||||
|
||||
if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then
|
||||
if flooded_caverns or biome_name ~= "barren" then
|
||||
@ -211,6 +220,26 @@ local decorate_level_1 = function(minp, maxp, seed, vm, node_arrays, area, data)
|
||||
else
|
||||
df_caverns.tunnel_floor(minp, maxp, area, vi, nvals_cracks, data, data_param2, false)
|
||||
end
|
||||
|
||||
if biome_name ~= "barren" then
|
||||
local cracks = nvals_cracks[index2d]
|
||||
if cracks > 0.25 then
|
||||
local rand = math.random()
|
||||
if rand > cracks then
|
||||
if math.random() < 0.25 then
|
||||
data[vi] = c_dirt_moss
|
||||
else
|
||||
data[vi] = c_dirt
|
||||
end
|
||||
if data[vi+ystride] == c_air and math.random() < 0.25 then
|
||||
df_caverns.place_shrub(vi+ystride, area, data, data_param2, tower_cap_shrublist)
|
||||
end
|
||||
end
|
||||
if rand > cracks*2 then
|
||||
df_trees.spawn_spindlestem_vm(vi+ystride, area, data, data_param2)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -18,6 +18,8 @@ local wall_vein_perlin_params = {
|
||||
flags = "eased",
|
||||
}
|
||||
|
||||
local c_pearls = minetest.get_content_id("df_mapitems:cave_pearls")
|
||||
|
||||
local subsea_level = df_caverns.config.level2_min - (df_caverns.config.level2_min - df_caverns.config.level1_min) * 0.33 -- "sea level" for the flooded caverns.
|
||||
local flooding_threshold = math.min(df_caverns.config.tunnel_flooding_threshold, df_caverns.config.cavern_threshold) -- cavern value out to which we're flooding tunnels and warrens
|
||||
|
||||
@ -60,6 +62,8 @@ if minetest.get_modpath("df_farming") then
|
||||
}
|
||||
end
|
||||
|
||||
local c_red = minetest.get_content_id("df_trees:spindlestem_cap_red")
|
||||
|
||||
local goblin_cap_cavern_floor = function(abs_cracks, vert_rand, vi, area, data, data_param2)
|
||||
local ystride = area.ystride
|
||||
if abs_cracks < 0.1 then
|
||||
@ -72,6 +76,8 @@ local goblin_cap_cavern_floor = function(abs_cracks, vert_rand, vi, area, data,
|
||||
end
|
||||
if math.random() < 0.1 then
|
||||
df_caverns.place_shrub(vi+ystride, area, data, data_param2, goblin_cap_shrublist)
|
||||
elseif math.random() < 0.02 then
|
||||
df_trees.spawn_spindlestem_vm(vi+ystride, area, data, data_param2, c_red)
|
||||
elseif math.random() < 0.015 then
|
||||
df_trees.spawn_goblin_cap_vm(vi+ystride, area, data)
|
||||
end
|
||||
@ -243,21 +249,32 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data)
|
||||
local index2d = mapgen_helper.index2di(minp, maxp, area, vi)
|
||||
local biome_name = get_biome(heatmap[index2d], humiditymap[index2d])
|
||||
local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not.
|
||||
local ystride = area.ystride
|
||||
|
||||
if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then
|
||||
if flooded_caverns or biome_name ~= "barren" then
|
||||
if flooded_caverns or biome_name ~= "barren" then
|
||||
-- we're in flooded areas or are not barren
|
||||
df_caverns.tunnel_ceiling(minp, maxp, area, vi, nvals_cracks, data, data_param2, true)
|
||||
else
|
||||
df_caverns.tunnel_ceiling(minp, maxp, area, vi, nvals_cracks, data, data_param2, false)
|
||||
end
|
||||
if not flooded_caverns and (biome_name == "barren" or biome_name == "sporetree") and nvals_cracks[index2d] > 0.5 then
|
||||
for i= 1, 4 do
|
||||
if math.random() > 0.5 then
|
||||
local index = vi-i*ystride
|
||||
if data[index] == c_air then
|
||||
df_mapitems.place_against_surface_vm(c_pearls, index, area, data, data_param2)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
-- air pockets
|
||||
local ystride = area.ystride
|
||||
local cracks = nvals_cracks[index2d]
|
||||
if cracks > 0.5 and data[vi-ystride] == c_water then
|
||||
if cracks > 0.4 and data[vi-ystride] == c_water then
|
||||
data[vi-ystride] = c_air
|
||||
if cracks > 0.7 and data[vi-ystride*2] == c_water then
|
||||
if cracks > 0.6 and data[vi-ystride*2] == c_water then
|
||||
data[vi-ystride*2] = c_air
|
||||
end
|
||||
end
|
||||
@ -289,6 +306,7 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data)
|
||||
local index2d = mapgen_helper.index2di(minp, maxp, area, vi)
|
||||
local biome_name = get_biome(heatmap[index2d], humiditymap[index2d])
|
||||
local flooded_caverns = nvals_cave[cave_area:transform(area, vi)] < 0 -- this indicates if we're in the "flooded" set of caves or not.
|
||||
local ystride = area.ystride
|
||||
|
||||
if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then
|
||||
if flooded_caverns or biome_name ~= "barren" then
|
||||
@ -297,8 +315,28 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data)
|
||||
else
|
||||
df_caverns.tunnel_ceiling(minp, maxp, area, vi, nvals_cracks, data, data_param2, false)
|
||||
end
|
||||
|
||||
if not flooded_caverns and (biome_name == "barren" or biome_name == "sporetree") and nvals_cracks[index2d] > 0.5 then
|
||||
for i= 1, 4 do
|
||||
if math.random() > 0.5 then
|
||||
local index = vi-i*ystride
|
||||
if data[index] == c_air then
|
||||
df_mapitems.place_against_surface_vm(c_pearls, index, area, data, data_param2)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
-- air pockets
|
||||
local cracks = nvals_cracks[index2d]
|
||||
if cracks > 0.4 and data[vi-ystride] == c_water then
|
||||
data[vi-ystride] = c_air
|
||||
if cracks > 0.6 and data[vi-ystride*2] == c_water then
|
||||
data[vi-ystride*2] = c_air
|
||||
end
|
||||
end
|
||||
end
|
||||
-- else air pockets?
|
||||
|
||||
end
|
||||
|
||||
----------------------------------------------
|
||||
|
@ -20,6 +20,9 @@ local c_dry_flowstone = minetest.get_content_id("df_mapitems:dry_flowstone")
|
||||
|
||||
local c_glow_ore = minetest.get_content_id("df_mapitems:glow_ruby_ore")
|
||||
|
||||
local c_salty_cobble = minetest.get_content_id("df_mapitems:salty_cobble")
|
||||
local c_salt_crystal = minetest.get_content_id("df_mapitems:salt_crystal")
|
||||
|
||||
local c_sprite
|
||||
if minetest.get_modpath("ice_sprites") then
|
||||
c_sprite = minetest.get_content_id("ice_sprites:ice_sprite")
|
||||
@ -157,20 +160,28 @@ local nether_cap_cavern_ceiling = function(abs_cracks, vert_rand, vi, area, data
|
||||
end
|
||||
|
||||
local blood_thorn_cavern_floor = function(abs_cracks, vert_rand, vi, area, data, data_param2)
|
||||
local ai = vi+area.ystride
|
||||
|
||||
if abs_cracks < 0.075 then
|
||||
if vert_rand < 0.004 then
|
||||
subterrane.big_stalagmite(vi+area.ystride, area, data, 6, 15, c_dry_flowstone, c_dry_flowstone, c_dry_flowstone)
|
||||
subterrane.big_stalagmite(ai, area, data, 6, 15, c_dry_flowstone, c_dry_flowstone, c_dry_flowstone)
|
||||
elseif data[vi] ~= air and math.random() < 0.5 then
|
||||
data[vi] = c_salty_cobble
|
||||
if data[ai] == c_air and math.random() < 0.25 then
|
||||
data[ai] = c_salt_crystal
|
||||
data_param2[ai] = math.random(1,4)-1
|
||||
end
|
||||
else
|
||||
local param2 = abs_cracks*1000000 - math.floor(abs_cracks*1000000/4)*4
|
||||
local height = math.floor(abs_cracks * 66)
|
||||
subterrane.stalagmite(vi+area.ystride, area, data, data_param2, param2, height, df_mapitems.dry_stalagmite_ids)
|
||||
subterrane.stalagmite(ai, area, data, data_param2, param2, height, df_mapitems.dry_stalagmite_ids)
|
||||
end
|
||||
elseif math.random() > abs_cracks + 0.66 then
|
||||
df_trees.spawn_blood_thorn_vm(vi+area.ystride, area, data, data_param2)
|
||||
df_trees.spawn_blood_thorn_vm(ai, area, data, data_param2)
|
||||
data[vi] = c_desert_sand
|
||||
else
|
||||
if math.random() < 0.1 then
|
||||
df_caverns.place_shrub(vi+area.ystride, area, data, data_param2, blood_thorn_shrublist)
|
||||
df_caverns.place_shrub(ai, area, data, data_param2, blood_thorn_shrublist)
|
||||
data[vi] = c_desert_sand
|
||||
elseif math.random() > 0.25 then
|
||||
data[vi] = c_desert_sand
|
||||
@ -310,7 +321,16 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data)
|
||||
else
|
||||
-- bloodthorn ceiling
|
||||
if abs_cracks < 0.075 then
|
||||
df_caverns.stalactites(abs_cracks, vert_rand, vi, area, data, data_param2, false)
|
||||
if data[vi] ~= air and math.random() < 0.5 then
|
||||
data[vi] = c_salty_cobble
|
||||
local bi = vi - area.ystride
|
||||
if data[bi] == c_air and math.random() < 0.25 then
|
||||
data[bi] = c_salt_crystal
|
||||
data_param2[bi] = 19 + math.random(1,4)
|
||||
end
|
||||
else
|
||||
df_caverns.stalactites(abs_cracks, vert_rand, vi, area, data, data_param2, false)
|
||||
end
|
||||
elseif abs_cracks > 0.75 and math.random() < 0.05 then
|
||||
data[vi] = c_glow_ore
|
||||
df_mapitems.place_big_crystal(data, data_param2, vi-area.ystride, true)
|
||||
|
@ -1 +1,4 @@
|
||||
name = df_caverns
|
||||
name = df_caverns
|
||||
description = Adds vast underground caverns in the style of Dwarf Fortress, complete with underground flora in diverse biomes. Also adds stalactite/stalagmite decorations in the smaller tunnels.
|
||||
depends = default, subterrane, df_trees, df_mapitems
|
||||
optional_depends = df_farming, ice_sprites, oil, df_underworld_items, magma_conduits, bones_loot
|
@ -4,6 +4,7 @@ end
|
||||
|
||||
local c_oil = minetest.get_content_id("oil:oil_source")
|
||||
local c_gas = minetest.get_content_id("mine_gas:gas")
|
||||
local c_gas_wisp = minetest.get_content_id("mine_gas:gas_wisp")
|
||||
local c_lava = minetest.get_content_id("default:lava_source")
|
||||
local c_obsidian = minetest.get_content_id("default:obsidian")
|
||||
|
||||
@ -78,7 +79,11 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||
end
|
||||
if y > floor_height and y < ceiling_height then
|
||||
if y > median then
|
||||
data[vi] = c_gas
|
||||
if math.random() < 0.00025 and ((y < median + 3) or (y > ceiling_height - 3)) then
|
||||
data[vi] = c_gas_wisp
|
||||
else
|
||||
data[vi] = c_gas
|
||||
end
|
||||
else
|
||||
data[vi] = c_oil
|
||||
end
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 20 KiB |
BIN
df_caverns/screenshots/cave_pearls.jpg
Normal file
BIN
df_caverns/screenshots/cave_pearls.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
BIN
df_caverns/screenshots/spindlestems.jpg
Normal file
BIN
df_caverns/screenshots/spindlestems.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
@ -108,6 +108,8 @@ local mushroom_cavern_floor = function(abs_cracks, vert_rand, vi, area, data, da
|
||||
df_trees.spawn_tower_cap_vm(vi+ystride, area, data)
|
||||
elseif math.random() < 0.01 then
|
||||
df_trees.spawn_goblin_cap_vm(vi+ystride, area, data)
|
||||
elseif math.random() < 0.02 then
|
||||
df_trees.spawn_spindlestem_vm(vi+ystride, area, data, data_param2)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -274,7 +276,7 @@ local decorate_sunless_sea = function(minp, maxp, seed, vm, node_arrays, area, d
|
||||
if math.random() < 0.001 then
|
||||
local iterations = math.random(1, 6)
|
||||
df_mapitems.spawn_coral_pile(area, data, vi, iterations)
|
||||
df_mapitems.spawn_cave_coral(area, data, vi+area.ystride, iterations)
|
||||
df_mapitems.spawn_castle_coral(area, data, vi+area.ystride, iterations)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -372,6 +374,7 @@ local decorate_sunless_sea = function(minp, maxp, seed, vm, node_arrays, area, d
|
||||
end
|
||||
else
|
||||
data[vi] = c_coral_table[math.random(1,3)]
|
||||
data_param2[vi] = math.random(1,4)-1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,7 +1,9 @@
|
||||
if not df_caverns.config.enable_underworld then
|
||||
if not df_caverns.config.enable_underworld or not minetest.get_modpath("df_underworld_items") then
|
||||
return
|
||||
end
|
||||
|
||||
local bones_loot_path = minetest.get_modpath("bones_loot")
|
||||
|
||||
local c_slade = minetest.get_content_id("df_underworld_items:slade")
|
||||
local c_air = minetest.get_content_id("air")
|
||||
local c_water = minetest.get_content_id("default:water_source")
|
||||
@ -56,6 +58,8 @@ local wave_mult = 50
|
||||
local y_max = median + 2*wave_mult + ceiling_displace + -2*ceiling_mult
|
||||
local y_min = median - 2*wave_mult + floor_displace - 2*floor_mult
|
||||
|
||||
--df_caverns.config.underworld_min = y_min
|
||||
|
||||
---------------------------------------------------------
|
||||
-- Buildings
|
||||
|
||||
@ -231,6 +235,17 @@ local perlin_pit = {
|
||||
|
||||
-------------------------------------
|
||||
|
||||
minetest.register_chatcommand("find_pit", {
|
||||
params = "",
|
||||
privs = {server=true},
|
||||
decription = "find a nearby glowing pit",
|
||||
func = function(name, param)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
local pit = get_pit(player:get_pos())
|
||||
minetest.chat_send_player(name, "Pit location: x=" .. math.floor(pit.location.x) .. " z=" .. math.floor(pit.location.z))
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, seed)
|
||||
|
||||
@ -265,7 +280,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||
|
||||
local floor_height = math.floor(abs_cave * floor_mult + median + floor_displace + wave)
|
||||
local ceiling_height = math.floor(abs_cave * ceiling_mult + median + ceiling_displace + wave)
|
||||
if y <= floor_height then
|
||||
if y < floor_height and y > y_min + math.abs(wave) / 5 then -- divide wave by five to smooth out the underside of the slade, we only want the interface to ripple a little down here
|
||||
data[vi] = c_slade
|
||||
if pit and
|
||||
pit.location.x - radius_pit_max - radius_pit_variance < maxp.x and
|
||||
@ -281,9 +296,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||
local pit_value = nvals_pit[area_pit:index(x,y,z)] * pit.variance
|
||||
local distance = vector.distance({x=x, y=y, z=z}, {x=pit.location.x, y=y, z=pit.location.z}) + pit_value
|
||||
if distance < pit.radius -3 then
|
||||
if y < y_min + 4 then -- make a layer of amethyst at the bottom of the pit to keep the plasma from digging infinitely downward.
|
||||
data[vi] = c_amethyst
|
||||
elseif y < median + floor_displace + wave - pit.depth then
|
||||
if y < median + floor_displace + wave - pit.depth then
|
||||
data[vi] = c_pit_plasma
|
||||
else
|
||||
data[vi] = c_air
|
||||
@ -386,6 +399,40 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||
--write it to world
|
||||
vm:write_to_map()
|
||||
|
||||
if bones_loot_path then
|
||||
for i = 1, 30 do
|
||||
local x = math.random(minp.x, maxp.x)
|
||||
local z = math.random(minp.z, maxp.z)
|
||||
local index2d = mapgen_helper.index2d(emin, emax, x, z)
|
||||
local abs_cave = math.abs(nvals_cave[index2d]) -- range is from 0 to approximately 2, with 0 being connected and 2s being islands
|
||||
local wave = nvals_wave[index2d] * wave_mult
|
||||
local floor_height = math.floor(abs_cave * floor_mult + median + floor_displace + wave)
|
||||
local ceiling_height = math.floor(abs_cave * ceiling_mult + median + ceiling_displace + wave)
|
||||
if floor_height < ceiling_height then
|
||||
local zone = math.abs(nvals_zone[index2d])
|
||||
if math.random() < zone then -- bones are more common in the built-up areas
|
||||
local floor_node = minetest.get_node({x=x, y=floor_height, z=z})
|
||||
local floor_node_def = minetest.registered_nodes[floor_node.name]
|
||||
if floor_node_def and not floor_node_def.buildable_to then
|
||||
local y = floor_height + 1
|
||||
while y < ceiling_height do
|
||||
local target_pos = {x=x, y=y, z=z}
|
||||
local target_node = minetest.get_node(target_pos)
|
||||
if target_node.name == "air" then
|
||||
bones_loot.place_bones(target_pos, "underworld_warrior", math.random(3, 10), nil, true)
|
||||
break
|
||||
elseif target_node.name == "bones:bones" then
|
||||
-- don't stack bones on bones, it looks silly
|
||||
break
|
||||
end
|
||||
y = y + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local chunk_generation_time = math.ceil((os.clock() - t_start) * 1000) --grab how long it took
|
||||
if chunk_generation_time < 1000 then
|
||||
minetest.log("info", "[df_caverns] underworld mapblock generation took "..chunk_generation_time.." ms") --tell people how long
|
||||
|
Reference in New Issue
Block a user