Use particlespawners instead of single particles

This commit is contained in:
NO11 2021-10-25 17:08:38 +00:00
parent dafe860e56
commit 7489010152

View file

@ -34,20 +34,29 @@ mcl_damage.register_modifier(function(obj, damage, reason)
-- Effects -- Effects
minetest.sound_play({name = "mcl_totems_totem", gain = 1}, {pos=ppos, max_hear_distance = 16}, true) minetest.sound_play({name = "mcl_totems_totem", gain = 1}, {pos=ppos, max_hear_distance = 16}, true)
for i = 1, 100 do for i = 1, 4 do
minetest.add_particle({ for c = 1, #particle_colors do
pos = vector.offset(ppos, 0, math.random(-10, 10) / 10, 0), minetest.add_particlespawner({
velocity = vector.new(math.random(-15, 15) / 10, math.random(0, 15) / 10, math.random(-15, 15) / 10), amount = math.round(100/(4 * #particle_colors)),
acceleration = vector.new(0, -math.random(1, 10) / 10, 0), time = 1,
expirationtime = math.random(1, 3), minpos = vector.offset(ppos, 0, -1, 0),
size = math.random(1, 2), maxpos = vector.offset(ppos, 0, 1, 0),
collisiondetection = true, minvel = vector.new(-1.5, 0, -1.5),
collision_removal = true, maxvel = vector.new(1.5, 1.5, 1.5),
object_collision = false, minacc = vector.new(0, -0.1, 0),
texture = "mcl_particles_totem" .. math.random(1, 4) .. ".png^[colorize:#" .. particle_colors[math.random(#particle_colors)], maxacc = vector.new(0, -1, 0),
glow = 10, minexptime = 1,
}) maxexptime = 3,
minsize = 1,
maxsize = 2,
collisiondetection = true,
collision_removal = true,
object_collision = false,
vertical = false,
texture = "mcl_particles_totem" .. i .. ".png^[colorize:#" .. particle_colors[c],
glow = 10,
})
end
end end
-- Big totem overlay -- Big totem overlay