Fix particle spawners, adjust a few mobs spawning

This commit is contained in:
Brandon 2015-08-21 16:53:16 -05:00
parent 260b3ca374
commit ae135bc10a
5 changed files with 53 additions and 41 deletions

View File

@ -74,9 +74,18 @@ MAGICMISSLE_ENTITY.on_step = function(self, dtime)
}) })
]] ]]
local rnd = math.random(0,1)*-1 local rnd = math.random(0,1)*-1
local rnd2 = math.random(1,2) local rnd2 = math.random(1,2)
minetest.add_particle(pos, {x=0.1*rnd, y=0, z=-0.1*rnd}, {x=0, y=-12, z=0}, 4,
1.2, true, "magic_magicmissle_particle1.png") local ps_def = {
pos = pos,
velocity = {x=0.1*rnd, y=0, z=-0.1*rnd},
acceleration = {x=0, y=-12, z=0},
expirationtime = 4,
size = 1.2,
collisiondetection = true,
texture = "magic_magicmissle_particle1.png",
}
minetest.add_particle(ps_def)
if self.timer > 1.5 then if self.timer > 1.5 then
minetest.sound_play("magic_magicmissle_hit",{object=self.object}) minetest.sound_play("magic_magicmissle_hit",{object=self.object})
@ -86,22 +95,23 @@ MAGICMISSLE_ENTITY.on_step = function(self, dtime)
end end
function hitparticles(pos) function hitparticles(pos)
minetest.add_particlespawner( local ps_def = {
45, --amount amount = 45,
0.75, --time time = 0.75,
{x=pos.x-0.3, y=pos.y+0.3, z=pos.z-0.3}, --minpos minpos = {x=pos.x-0.3, y=pos.y+0.3, z=pos.z-0.3},
{x=pos.x+0.3, y=pos.y+0.5, z=pos.z+0.3}, --maxpos maxpos = {x=pos.x+0.3, y=pos.y+0.5, z=pos.z+0.3},
{x=0, y=-2, z=0}, --minvel minvel = {x=0, y=-2, z=0},
{x=2, y=2, z=2}, --maxvel maxvel = {x=2, y=2, z=2},
{x=-4,y=-4,z=-4}, --minacc minacc = {x=-4,y=-4,z=-4},
{x=4,y=-4,z=4}, --maxacc maxacc = {x=4,y=-4,z=4},
0.1, --minexptime minexptime = 0.1,
1, --maxexptime maxexptime = 1,
1, --minsize minsize = 1,
3, --maxsize maxsize = 3,
false, --collisiondetection collisiondetection = false,
"magic_magicmissle_particle1.png" --texture texture = "magic_magicmissle_particle1.png",
) }
minetest.add_particlespawner(ps_def)
end end
minetest.register_entity("magic:magicmissle", MAGICMISSLE_ENTITY) minetest.register_entity("magic:magicmissle", MAGICMISSLE_ENTITY)

View File

@ -27,7 +27,7 @@ mobs:register_mob("mobs:rat", {
blood_amount = 5, blood_amount = 5,
blood_offset = 0, blood_offset = 0,
}) })
mobs:register_spawn("mobs:rat", {"default:dirt_with_grass", "default:stone"}, 20, -1, 7000, 1, 31000) mobs:register_spawn("mobs:rat", {"default:dirt_with_grass", "default:stone"}, 20, -1, 10000, 1, 31000)
minetest.register_craftitem("mobs:rat", { minetest.register_craftitem("mobs:rat", {
description = "Rat", description = "Rat",

View File

@ -1001,26 +1001,28 @@ function get_distance(pos1,pos2)
end end
end end
blood_particles = function(pos,offset,amount,texture) blood_particles = function(pos,offset,amt,tex)
if amount > 0 and pos ~= nil then if amt > 0 and pos ~= nil then
local p = pos local p = pos
p.y = p.y + offset p.y = p.y + offset
minetest.add_particlespawner(
amount, --amount local ps_def = {
0.25, --time amount = amt,
{x=p.x-0.2, y=p.y-0.2, z=p.z-0.2}, --minpos time = 0.25,
{x=p.x+0.2, y=p.y+0.2, z=p.z+0.2}, --maxpos minpos = {x=p.x-0.2, y=p.y-0.2, z=p.z-0.2},
{x=0, y=-2, z=0}, --minvel maxpos = {x=p.x+0.2, y=p.y+0.2, z=p.z+0.2},
{x=2, y=2, z=2}, --maxvel minvel = {x=0, y=-2, z=0},
{x=-4,y=-4,z=-4}, --minacc maxvel = {x=2, y=2, z=2},
{x=4,y=-4,z=4}, --maxacc minacc = {x=-4,y=-4,z=-4},
0.1, --minexptime maxacc = {x=4,y=-4,z=4},
1, --maxexptime minexptime = 0.1,
0.5, --minsize maxexptime = 1,
1, --maxsize minsize = 0.5,
false, --collisiondetection maxsize = 1,
texture --texture collisiondetection = false,
) texture = tex
}
minetest.add_particlespawner(ps_def)
end end
end end

View File

@ -43,5 +43,5 @@ mobs:register_mob("mobs:oerkki", {
blood_amount = 0, blood_amount = 0,
}) })
mobs:register_spawn("mobs:oerkki", {"default:stone"}, 3, -1, 7000, 3, -10) mobs:register_spawn("mobs:oerkki", {"default:stone"}, 7, -1, 7000, 3, -10)
mobs:register_spawn("mobs:oerkki", {"default:stone"}, 3, -1, 2000, 3, -100) mobs:register_spawn("mobs:oerkki", {"default:stone"}, 7, -1, 2000, 3, -100)

View File

@ -54,4 +54,4 @@ mobs:register_mob("mobs:stone_monster", {
}, },
step = 0.5, step = 0.5,
}) })
mobs:register_spawn("mobs:stone_monster", {"default:stone"}, 3, -1, 3000, 3, 0) mobs:register_spawn("mobs:stone_monster", {"default:stone"}, 7, -1, 8000, 3, 0)