add webs to level 3 tunnels, fix sunless sea chasms

This commit is contained in:
FaceDeer 2021-03-27 18:33:13 -06:00
parent 293f0c5092
commit 0c5d49ffd5
7 changed files with 37 additions and 5 deletions

View File

@ -132,6 +132,8 @@ minetest.register_node("big_webs:webbing", {
drawtype = "nodebox",
node_box = get_node_box(0.0625),
collision_box = get_node_box(0.0625),
inventory_image = "big_webs_item.png",
wield_image = "big_webs_item.png",
paramtype = "light",
is_ground_content = false,
climbable = true,
@ -183,6 +185,8 @@ minetest.register_node("big_webs:web_egg", {
drawtype = "nodebox",
node_box = get_node_box(0.0625),
collision_box = get_node_box(0.0625),
inventory_image = "big_webs_item.png",
wield_image = "big_webs_item.png",
paramtype = "light",
is_ground_content = false,
climbable = true,

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

View File

@ -79,8 +79,8 @@ local calculate_web_array = function(minp, maxp)
local seed = math.random()*10000000
math.randomseed(minp.y + z_displace*minp.z) -- use consistent seeds across the x axis
local webs = {}
for count = 1, math.random(10,30) do
local width = math.random(5, 20)
for count = 1, math.random(5,20) do
local width = math.random(5, 25)
local direction_vertical = math.random() > 0.5
local web_y = math.random(minp.y+8, maxp.y-8)
local web_z = math.random(minp.z+8, maxp.z-8)

View File

@ -17,6 +17,7 @@ local c_glow_ore = df_caverns.node_id.glow_ore
local c_salty_cobble = df_caverns.node_id.salty_cobble
local c_salt_crystal = df_caverns.node_id.salt_crystal
local c_sprite = df_caverns.node_id.sprite
local c_webs_egg = df_caverns.node_id.big_webs_egg
local chasms_path = minetest.get_modpath("chasms")
@ -365,6 +366,18 @@ local decorate_level_3 = 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 c_webs_egg and not flooded_caverns and biome_name == "barren" and nvals_cracks[index2d] > 0.5 then
if math.random() < 0.05 then
local index = vi-ystride
if data[index] == c_air then
data[index] = c_webs_egg
minetest.get_node_timer(area:position(index)):start(1)
--minetest.debug("webs generated at " .. minetest.pos_to_string(area:position(index)))
end
end
end
else
-- air pockets
local ystride = area.ystride

View File

@ -18,6 +18,8 @@ local c_spongestone = df_caverns.node_id.spongestone
local c_rock_rot = df_caverns.node_id.rock_rot
local c_water = df_caverns.node_id.water
local c_wet_flowstone = df_caverns.node_id.wet_flowstone
local c_webs = df_caverns.node_id.big_webs
local c_webs_egg = df_caverns.node_id.big_webs_egg
df_caverns.data_param2 = {}
@ -30,8 +32,8 @@ for _, content_id in pairs(df_mapitems.dry_stalagmite_ids) do
dont_build_speleothems_on[content_id] = true
end
if minetest.get_modpath("big_webs") then
dont_build_speleothems_on[df_caverns.node_id.big_webs] = true
dont_build_speleothems_on[df_caverns.node_id.big_webs_egg] = true
dont_build_speleothems_on[c_webs] = true
dont_build_speleothems_on[c_webs_egg] = true
end
--------------------------------------------------

View File

@ -9,6 +9,8 @@ local c_dry_flowstone = df_caverns.node_id.dry_flowstone
local c_lava = df_caverns.node_id.lava
local c_obsidian = df_caverns.node_id.obsidian
local chasms_path = minetest.get_modpath("chasms")
local c_coral_table = {}
for node_name, node_def in pairs(minetest.registered_nodes) do
if minetest.get_item_group(node_name, "dfcaverns_cave_coral") > 0 then
@ -383,6 +385,17 @@ local decorate_sunless_sea = function(minp, maxp, seed, vm, node_arrays, area, d
data_param2[vi] = math.random(1,4)-1
minetest.get_node_timer(area:position(vi)):start(math.random(10, 60))
end
if chasms_path then
local pos = area:position(vi)
if chasms.is_in_chasm(pos) then
if pos.y <= sea_level then
data[vi] = c_water
else
data[vi] = c_air
end
end
end
end
end

@ -1 +1 @@
Subproject commit 6439ca59bfe8e3e4c5ed0826f41d2c49b862fb75
Subproject commit 6cc2fe8faea4026101dc9f462a7594edfc26ca7f