Move bubble particle spawner to playerplus

This commit is contained in:
Wuzzy 2017-05-22 22:43:25 +02:00
parent c4094e17ea
commit 75cfe51b54
4 changed files with 22 additions and 28 deletions

View File

@ -1 +0,0 @@
mcl_particles

View File

@ -202,33 +202,6 @@ minetest.register_globalstep(function(dtime)
player_set_animation(player, "stand", animation_speed_mod)
end
-- Spawn bubble particles when underwater
local pos = player:getpos()
local head_pos = {
x = math.floor(pos.x+0.5),
y = math.ceil(pos.y+1.0),
z = math.floor(pos.z+0.5)
}
if minetest.get_item_group(minetest.get_node(head_pos).name, "water") ~= 0 then
minetest.add_particlespawner({
amount = 2,
time = 0.15,
minpos = { x = -0.25, y = 0.3, z = -0.25 },
maxpos = { x = 0.25, y = 0.7, z = 0.75 },
attached = player,
minvel = {x = -0.2, y = 0, z = -0.2},
maxvel = {x = 0.5, y = 0, z = 0.5},
minacc = {x = -0.4, y = 4, z = -0.4},
maxacc = {x = 0.5, y = 1, z = 0.5},
minexptime = 0.3,
maxexptime = 0.8,
minsize = 0.7,
maxsize = 2.4,
texture = "mcl_particles_bubble.png"
})
end
end
end
end)

View File

@ -1,5 +1,6 @@
mcl_init
mcl_util
mcl_core
mcl_particles
mcl_hunger
3d_armor?

View File

@ -139,6 +139,27 @@ minetest.register_globalstep(function(dtime)
end
end
-- Spawn bubble particles when underwater
if minetest.get_item_group(playerplus[name].nod_head, "water") ~= 0 then
minetest.add_particlespawner({
amount = 10,
time = 0.15,
minpos = { x = -0.25, y = 0.3, z = -0.25 },
maxpos = { x = 0.25, y = 0.7, z = 0.75 },
attached = player,
minvel = {x = -0.2, y = 0, z = -0.2},
maxvel = {x = 0.5, y = 0, z = 0.5},
minacc = {x = -0.4, y = 4, z = -0.4},
maxacc = {x = 0.5, y = 1, z = 0.5},
minexptime = 0.3,
maxexptime = 0.8,
minsize = 0.7,
maxsize = 2.4,
texture = "mcl_particles_bubble.png"
})
end
-- Show positions of barriers when player is wielding a barrier
if player:get_wielded_item():get_name() == "mcl_core:barrier" then
local pos = vector.round(player:getpos())