Use particlespawners instead of single particles
This commit is contained in:
parent
dafe860e56
commit
7489010152
|
@ -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),
|
||||||
|
minvel = vector.new(-1.5, 0, -1.5),
|
||||||
|
maxvel = vector.new(1.5, 1.5, 1.5),
|
||||||
|
minacc = vector.new(0, -0.1, 0),
|
||||||
|
maxacc = vector.new(0, -1, 0),
|
||||||
|
minexptime = 1,
|
||||||
|
maxexptime = 3,
|
||||||
|
minsize = 1,
|
||||||
|
maxsize = 2,
|
||||||
collisiondetection = true,
|
collisiondetection = true,
|
||||||
collision_removal = true,
|
collision_removal = true,
|
||||||
object_collision = false,
|
object_collision = false,
|
||||||
texture = "mcl_particles_totem" .. math.random(1, 4) .. ".png^[colorize:#" .. particle_colors[math.random(#particle_colors)],
|
vertical = false,
|
||||||
|
texture = "mcl_particles_totem" .. i .. ".png^[colorize:#" .. particle_colors[c],
|
||||||
glow = 10,
|
glow = 10,
|
||||||
})
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Big totem overlay
|
-- Big totem overlay
|
||||||
|
|
Loading…
Reference in New Issue