in anticipation of eventually adding stuff below the Slade, making glowing pit erosion self-limiting.

This commit is contained in:
FaceDeer 2019-08-08 19:01:19 -06:00
parent a1eb415587
commit 5c703563c3
2 changed files with 12 additions and 5 deletions

View File

@ -283,9 +283,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
local pit_value = nvals_pit[area_pit:index(x,y,z)] * pit.variance 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 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 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. if y < median + floor_displace + wave - pit.depth then
data[vi] = c_amethyst
elseif y < median + floor_displace + wave - pit.depth then
data[vi] = c_pit_plasma data[vi] = c_pit_plasma
else else
data[vi] = c_air data[vi] = c_air

View File

@ -138,9 +138,18 @@ if df_underworld_items.config.destructive_pit_plasma then
for y = pos.y-1, pos.y+1 do for y = pos.y-1, pos.y+1 do
for z = pos.z-1, pos.z+1 do for z = pos.z-1, pos.z+1 do
local test_pos = {x=x, y=y, z=z} local test_pos = {x=x, y=y, z=z}
if minetest.get_item_group(minetest.get_node(test_pos).name, "pit_plasma_resistant") == 0 then local node_name = minetest.get_node(test_pos).name
if minetest.get_item_group(node_name, "pit_plasma_resistant") == 0 then
sparkle_pos = test_pos sparkle_pos = test_pos
minetest.set_node(test_pos, {name="air"}) if minetest.get_item_group(node_name, "stone") > 0 then
if math.random() < 0.66 then
minetest.set_node(test_pos, {name="df_underworld_items:glow_amethyst"})
else
minetest.set_node(test_pos, {name="default:lava_source"})
end
else
minetest.set_node(test_pos, {name="air"})
end
end end
end end
end end