Merge pull request 'Improve crying obsidian visuals once more' (#2454) from crying_obby_particles_2 into master

Reviewed-on: MineClone2/MineClone2#2454
Reviewed-by: MysticTempest <mystictempest@noreply.git.minetest.land>
This commit is contained in:
cora 2022-07-18 20:24:26 +00:00
commit d45fc46d0e
1 changed files with 18 additions and 49 deletions

View File

@ -1702,41 +1702,14 @@ end
-- Obsidian crying -- Obsidian crying
local crobby_psdef = { local crobby_particle = {
amount = 1, velocity = vector.new(0,0,0),
time = 0.9, --everything longer than 1 is a coord exploit size = math.random(1.3,2.5),
minvel = vector.new(0,-2,0), texture = "mcl_core_crying_obsidian_tear.png",
maxvel = vector.new(0,-0.5,0), collision_removal = false,
minacc = vector.new(0,-10,0),
maxacc = vector.new(0,-8,0),
minexptime = 1,
maxexptime = 6,
minsize = 1.5,
maxsize = 2,
collisiondetection = true,
collision_removal = true,
object_collision = true,
vertical = true,
texture = "mcl_core_crying_obsidian_tear.png",
}
local crobby_psdef2 = {
amount = 1,
time = 0.9, --everything longer than 1 is a coord exploit
minvel = vector.new(0,-0.01,0),
maxvel = vector.new(0,-0.005,0),
minacc = vector.new(0,-0.1,0),
maxacc = vector.new(0,-0.01,0),
minexptime = 2,
maxexptime = 3,
minsize = 0.3,
maxsize = 0.6,
collisiondetection = true,
collision_removal = true,
object_collision = true,
vertical = true,
texture = "mcl_core_crying_obsidian_tear.png",
} }
minetest.register_abm({ minetest.register_abm({
label = "Obsidian cries", label = "Obsidian cries",
nodenames = {"mcl_core:crying_obsidian"}, nodenames = {"mcl_core:crying_obsidian"},
@ -1744,22 +1717,18 @@ minetest.register_abm({
chance = 10, chance = 10,
action = function(pos, node) action = function(pos, node)
minetest.after(math.random(0.1,1.5),function() minetest.after(math.random(0.1,1.5),function()
crobby_psdef.minpos = vector.offset(pos,-0.6,-0.51,-0.6) local pt = table.copy(crobby_particle)
crobby_psdef.maxpos = vector.offset(pos,0.6,0.51,0.6) pt.acceleration = vector.new(0,0,0)
minetest.add_particlespawner(crobby_psdef) pt.collisiondetection = false
crobby_psdef2.minpos = vector.offset(pos,-0.51,-0.51,-0.51) pt.expirationtime = math.random(0.5,1.5)
crobby_psdef2.maxpos = vector.offset(pos,-0.5,0.51,-0.5) pt.pos = vector.offset(pos,math.random(-0.5,0.5),-0.51,math.random(-0.5,0.5))
minetest.add_particlespawner(crobby_psdef2) minetest.add_particle(pt)
crobby_psdef2.minpos = vector.offset(pos,0.51,-0.51,-0.51) minetest.after(pt.expirationtime,function()
crobby_psdef2.maxpos = vector.offset(pos,0.5,0.51,-0.5) pt.acceleration = vector.new(0,-9,0)
minetest.add_particlespawner(crobby_psdef2) pt.collisiondetection = true
crobby_psdef2.minpos = vector.offset(pos,0.51,-0.51,0.51) pt.expirationtime = math.random(1.2,4.5)
crobby_psdef2.maxpos = vector.offset(pos,0.5,0.51,0.5) minetest.add_particle(pt)
minetest.add_particlespawner(crobby_psdef2) end)
crobby_psdef2.minpos = vector.offset(pos,-0.51,-0.51,0.51)
crobby_psdef2.maxpos = vector.offset(pos,-0.5,0.51,0.5)
minetest.add_particlespawner(crobby_psdef2)
end) end)
end end
}) })