Spawn particles for receiver overload

This commit is contained in:
Wuzzy 2024-09-08 17:13:23 +02:00
parent 6a850c5d4a
commit 4e26c00de8
3 changed files with 16 additions and 2 deletions

View File

@ -34,6 +34,7 @@ All levels by Wuzzy.
- Thatch by Mossmanikin and Neuromancer (CC BY-SA 4.0)
- Coconut and coconut tree by Neuromancer (CC BY-SA 4.0)
- Crosshair, wieldhand, `smoke_puff.png`: trivial textures by Wuzzy (CC0)
- `lzr_laser_overload_smoke.png`: by Wuzzy (CC0)
- Emitter, detector, dark locked chest textures: Derivate works of xdecor textures by jp (CC0)
- Mirror textures: by Wuzzy (CC0)
- Screwdriver texture: by 12Me21 (CC0)

View File

@ -1078,9 +1078,22 @@ local function laser_update(pos1, pos2, force_update, clear_first, max_iteration
if check_receiver_overload(receiver_id) then
-- If the receiver is overloaded in this, we prevent triggering it on again,
-- but we allow to shut down one last time.
if receiver_active then
if not receiver_active then
minetest.log("action", "[lzr_laser] Receiver '"..receiver_id.."' shuts down due to recursive re-activation")
else
-- Add fancy smoke particles at the node that just shut down
minetest.add_particlespawner({
amount = 8,
time = 0.1,
minpos = vector.add(rpos, vector.new(-0.4, 0.1, -0.4)),
maxpos = vector.add(rpos, vector.new(0.4, 0.45, 0.4)),
minvel = vector.new(-0.1, 0.4, -0.1),
maxvel = vector.new(0.1, 0.5, 0.1),
minsize = 4,
maxsize = 5,
minexptime = 2,
maxexptime = 2.85,
texture = "lzr_laser_overload_smoke.png",
})
return
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B