Lightning now creates fire

This commit is contained in:
IamPyu 2024-12-16 15:13:17 -06:00
parent 6252c5fa99
commit 6f7a75ab23

View File

@ -28,7 +28,27 @@ PyuTest.lightning_strike = function(pos, radius, size)
pos = pos
})
for o in core.objects_inside_radius(pos, radius or 3) do
PyuTest.deal_damage(o, 9, PyuTest.DAMAGE_TYPES.lightning())
local r = radius or 3
for o in core.objects_inside_radius(pos, r) do
PyuTest.deal_damage(o, 12, PyuTest.DAMAGE_TYPES.lightning())
end
for x = -r, r do
for z = -r, r do
local y_pos
if core.get_node(pos).name ~= "air" then
y_pos = pos.y + 1
elseif core.get_node(pos - vector.new(0, 1, 0)).name ~= "air" then
y_pos = pos.y
end
if y_pos then
local npos = vector.new(pos.x + x, y_pos, pos.z +z)
if math.random(1, 6) == 1 then
core.set_node(npos, {name = "pyutest_blocks:fire"})
end
end
end
end
end