diff --git a/api.lua b/api.lua index ec605dc..f780a04 100644 --- a/api.lua +++ b/api.lua @@ -420,6 +420,34 @@ local flight_check = function(self, pos_w) return false end +local function mobs_death_cloud(pos) + pos.y = pos.y + 0.5 + + minetest.add_particlespawner({ + amount = 3, + time = 0.5, + minpos = { x = pos.x-1, y = pos.y, z = pos.z-1 }, + maxpos = { x = pos.x+1, y = pos.y, z = pos.z+1 }, + minvel = { x = -0.5, y = 1, z = -0.5 }, + maxvel = { x = 0.5, y = 2, z = 0.5 }, + minacc = vector.new({ x = -0.5, y = 1, z = -0.5 }), + maxacc = vector.new({ x = 0.5, y = 4, z = 0.5 }), + minexptime = 0.5, + maxexptime = 1, + minsize = 16, + maxsize = 24, + texture = "mobs_death_particle_animated.png", + animation = { + type = "vertical_frames", + -- Width of a frame in pixels + aspect_w = 16, + -- Height of a frame in pixels + aspect_h = 16, + -- Full loop length + length = 1, + }, + }) +end -- custom particle effects local effect = function(pos, amount, texture, min_size, max_size, radius, gravity, glow) @@ -493,8 +521,6 @@ local item_drop = function(self) local death_by_player = self.cause_of_death and self.cause_of_death.puncher and self.cause_of_death.puncher:is_player() or nil - print("cause_of_death", dump(cause_of_death)) - local obj, item, num local pos = self.object:get_pos() @@ -639,7 +665,7 @@ local check_for_death = function(self, cmi_cause) self.object:remove() end - effect(pos, 20, "tnt_smoke.png") + mobs_death_cloud(pos) return true end diff --git a/textures/mobs_death_particle_animated.png b/textures/mobs_death_particle_animated.png new file mode 100644 index 0000000..dcc32a9 Binary files /dev/null and b/textures/mobs_death_particle_animated.png differ