From 5c703563c3fc45d404d4427d8b9930778797e262 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Thu, 8 Aug 2019 19:01:19 -0600 Subject: [PATCH] in anticipation of eventually adding stuff below the Slade, making glowing pit erosion self-limiting. --- df_caverns/underworld.lua | 4 +--- df_underworld_items/glowing_pit_plasma.lua | 13 +++++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/df_caverns/underworld.lua b/df_caverns/underworld.lua index e24d3f9..4c970b8 100644 --- a/df_caverns/underworld.lua +++ b/df_caverns/underworld.lua @@ -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 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 diff --git a/df_underworld_items/glowing_pit_plasma.lua b/df_underworld_items/glowing_pit_plasma.lua index 3fff9cf..3fe263c 100644 --- a/df_underworld_items/glowing_pit_plasma.lua +++ b/df_underworld_items/glowing_pit_plasma.lua @@ -138,9 +138,18 @@ if df_underworld_items.config.destructive_pit_plasma then for y = pos.y-1, pos.y+1 do for z = pos.z-1, pos.z+1 do 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 - 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