mirror of
https://codeberg.org/tenplus1/mobs_monster.git
synced 2024-12-23 09:20:26 +01:00
sand monsters kinda dissolve when killed
This commit is contained in:
parent
20fba93293
commit
55b2e8d429
@ -2,6 +2,34 @@
|
|||||||
local S = mobs.intllib
|
local S = mobs.intllib
|
||||||
|
|
||||||
|
|
||||||
|
-- custom particle effects
|
||||||
|
local effect = function(pos, amount, texture, min_size, max_size, radius, gravity, glow)
|
||||||
|
|
||||||
|
radius = radius or 2
|
||||||
|
min_size = min_size or 0.5
|
||||||
|
max_size = max_size or 1
|
||||||
|
gravity = gravity or -10
|
||||||
|
glow = glow or 0
|
||||||
|
|
||||||
|
minetest.add_particlespawner({
|
||||||
|
amount = amount,
|
||||||
|
time = 0.25,
|
||||||
|
minpos = pos,
|
||||||
|
maxpos = pos,
|
||||||
|
minvel = {x = -radius, y = -radius, z = -radius},
|
||||||
|
maxvel = {x = radius, y = radius, z = radius},
|
||||||
|
minacc = {x = 0, y = gravity, z = 0},
|
||||||
|
maxacc = {x = 0, y = gravity, z = 0},
|
||||||
|
minexptime = 0.1,
|
||||||
|
maxexptime = 1,
|
||||||
|
minsize = min_size,
|
||||||
|
maxsize = max_size,
|
||||||
|
texture = texture,
|
||||||
|
glow = glow,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Sand Monster by PilzAdam
|
-- Sand Monster by PilzAdam
|
||||||
|
|
||||||
mobs:register_mob("mobs_monster:sand_monster", {
|
mobs:register_mob("mobs_monster:sand_monster", {
|
||||||
@ -21,6 +49,7 @@ mobs:register_mob("mobs_monster:sand_monster", {
|
|||||||
textures = {
|
textures = {
|
||||||
{"mobs_sand_monster.png"},
|
{"mobs_sand_monster.png"},
|
||||||
},
|
},
|
||||||
|
blood_texture = "default_sand.png",
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
sounds = {
|
sounds = {
|
||||||
random = "mobs_sandmonster",
|
random = "mobs_sandmonster",
|
||||||
@ -55,6 +84,13 @@ mobs:register_mob("mobs_monster:sand_monster", {
|
|||||||
minetest.add_item(pos, "default:sand")
|
minetest.add_item(pos, "default:sand")
|
||||||
end,
|
end,
|
||||||
]]
|
]]
|
||||||
|
on_die = function(self, pos)
|
||||||
|
pos.y = pos.y + 0.5
|
||||||
|
effect(pos, 20, "default_sand.png", nil, nil, 0.5, nil)
|
||||||
|
pos.y = pos.y + 0.25
|
||||||
|
effect(pos, 20, "default_sand.png", nil, nil, 1, nil)
|
||||||
|
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user