Booby trap redstone nodes in ruined portal (20%)

This commit is contained in:
Nils Dagsson Moskopp 2021-12-08 13:10:02 +01:00
parent 8fa8a6fe37
commit bdde99f147
No known key found for this signature in database
GPG key ID: A3BC671C35191080

View file

@ -413,7 +413,10 @@ local function ruined_portal_callback(p1, p2, size, rotation, pr)
local biome_is_cold = (biome_data.heat < 15) or false
local biome_name = minetest.get_biome_name(biome_data.biome)
local biome_is_ocean = string.find(biome_name, "ocean") and true or false
local r_boobytrapped = pr:next(1, 100)
local nodes = minetest.find_nodes_in_area(p1, p2, {
"mesecons_pistons:piston_normal_off",
"mesecons_pistons:piston_sticky_off",
"mcl_core:goldblock",
"mcl_stairs:slab_goldblock",
"mcl_stairs:slab_goldblock_double",
@ -546,8 +549,14 @@ local function ruined_portal_callback(p1, p2, size, rotation, pr)
end
end
end
-- Booby trap all redstone mechanisms (20%)
if r_boobytrapped <= 20 and (
"mesecons_pistons:piston_normal_off" == node.name or
"mesecons_pistons:piston_sticky_off" == node.name
) then
node.name = "mcl_tnt:tnt"
-- Replace gold with air (30%)
if (
elseif (
"mcl_core:goldblock" == node.name or
"mcl_stairs:slab_goldblock" == node.name or
"mcl_stairs:slab_goldblock_double" == node.name or