Fix particle spawners, adjust a few mobs spawning
This commit is contained in:
parent
260b3ca374
commit
ae135bc10a
@ -74,9 +74,18 @@ MAGICMISSLE_ENTITY.on_step = function(self, dtime)
|
||||
})
|
||||
]]
|
||||
local rnd = math.random(0,1)*-1
|
||||
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 rnd2 = math.random(1,2)
|
||||
|
||||
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
|
||||
minetest.sound_play("magic_magicmissle_hit",{object=self.object})
|
||||
@ -86,22 +95,23 @@ MAGICMISSLE_ENTITY.on_step = function(self, dtime)
|
||||
end
|
||||
|
||||
function hitparticles(pos)
|
||||
minetest.add_particlespawner(
|
||||
45, --amount
|
||||
0.75, --time
|
||||
{x=pos.x-0.3, y=pos.y+0.3, z=pos.z-0.3}, --minpos
|
||||
{x=pos.x+0.3, y=pos.y+0.5, z=pos.z+0.3}, --maxpos
|
||||
{x=0, y=-2, z=0}, --minvel
|
||||
{x=2, y=2, z=2}, --maxvel
|
||||
{x=-4,y=-4,z=-4}, --minacc
|
||||
{x=4,y=-4,z=4}, --maxacc
|
||||
0.1, --minexptime
|
||||
1, --maxexptime
|
||||
1, --minsize
|
||||
3, --maxsize
|
||||
false, --collisiondetection
|
||||
"magic_magicmissle_particle1.png" --texture
|
||||
)
|
||||
local ps_def = {
|
||||
amount = 45,
|
||||
time = 0.75,
|
||||
minpos = {x=pos.x-0.3, y=pos.y+0.3, z=pos.z-0.3},
|
||||
maxpos = {x=pos.x+0.3, y=pos.y+0.5, z=pos.z+0.3},
|
||||
minvel = {x=0, y=-2, z=0},
|
||||
maxvel = {x=2, y=2, z=2},
|
||||
minacc = {x=-4,y=-4,z=-4},
|
||||
maxacc = {x=4,y=-4,z=4},
|
||||
minexptime = 0.1,
|
||||
maxexptime = 1,
|
||||
minsize = 1,
|
||||
maxsize = 3,
|
||||
collisiondetection = false,
|
||||
texture = "magic_magicmissle_particle1.png",
|
||||
}
|
||||
minetest.add_particlespawner(ps_def)
|
||||
end
|
||||
|
||||
minetest.register_entity("magic:magicmissle", MAGICMISSLE_ENTITY)
|
||||
|
@ -27,7 +27,7 @@ mobs:register_mob("mobs:rat", {
|
||||
blood_amount = 5,
|
||||
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", {
|
||||
description = "Rat",
|
||||
|
@ -1001,26 +1001,28 @@ function get_distance(pos1,pos2)
|
||||
end
|
||||
end
|
||||
|
||||
blood_particles = function(pos,offset,amount,texture)
|
||||
if amount > 0 and pos ~= nil then
|
||||
blood_particles = function(pos,offset,amt,tex)
|
||||
if amt > 0 and pos ~= nil then
|
||||
local p = pos
|
||||
p.y = p.y + offset
|
||||
minetest.add_particlespawner(
|
||||
amount, --amount
|
||||
0.25, --time
|
||||
{x=p.x-0.2, y=p.y-0.2, z=p.z-0.2}, --minpos
|
||||
{x=p.x+0.2, y=p.y+0.2, z=p.z+0.2}, --maxpos
|
||||
{x=0, y=-2, z=0}, --minvel
|
||||
{x=2, y=2, z=2}, --maxvel
|
||||
{x=-4,y=-4,z=-4}, --minacc
|
||||
{x=4,y=-4,z=4}, --maxacc
|
||||
0.1, --minexptime
|
||||
1, --maxexptime
|
||||
0.5, --minsize
|
||||
1, --maxsize
|
||||
false, --collisiondetection
|
||||
texture --texture
|
||||
)
|
||||
|
||||
local ps_def = {
|
||||
amount = amt,
|
||||
time = 0.25,
|
||||
minpos = {x=p.x-0.2, y=p.y-0.2, z=p.z-0.2},
|
||||
maxpos = {x=p.x+0.2, y=p.y+0.2, z=p.z+0.2},
|
||||
minvel = {x=0, y=-2, z=0},
|
||||
maxvel = {x=2, y=2, z=2},
|
||||
minacc = {x=-4,y=-4,z=-4},
|
||||
maxacc = {x=4,y=-4,z=4},
|
||||
minexptime = 0.1,
|
||||
maxexptime = 1,
|
||||
minsize = 0.5,
|
||||
maxsize = 1,
|
||||
collisiondetection = false,
|
||||
texture = tex
|
||||
}
|
||||
minetest.add_particlespawner(ps_def)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -43,5 +43,5 @@ mobs:register_mob("mobs:oerkki", {
|
||||
blood_amount = 0,
|
||||
|
||||
})
|
||||
mobs:register_spawn("mobs:oerkki", {"default:stone"}, 3, -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, 7000, 3, -10)
|
||||
mobs:register_spawn("mobs:oerkki", {"default:stone"}, 7, -1, 2000, 3, -100)
|
||||
|
@ -54,4 +54,4 @@ mobs:register_mob("mobs:stone_monster", {
|
||||
},
|
||||
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)
|
Loading…
x
Reference in New Issue
Block a user