From 9212bd7ddc4f316b61fec7ee16102ecff965276e Mon Sep 17 00:00:00 2001 From: Juraj Vajda Date: Wed, 12 Dec 2018 19:36:14 -0500 Subject: [PATCH] new death particles --- api.lua | 32 ++++++++++++++++++++-- textures/mobs_death_particle_animated.png | Bin 0 -> 174 bytes 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 textures/mobs_death_particle_animated.png 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 0000000000000000000000000000000000000000..dcc32a99115f308e5868bbca17e1ab43821cee3c GIT binary patch literal 174 zcmeAS@N?(olHy`uVBq!ia0vp^0zllr$P6ScqN@{u6kC8#h^u>n&;S4b=TBMW3>0B3 z3GxeOaCmkj4af=eba4!kxIFjNM&1Sk9@m5E(Gyp{IiMk_y7-TvL}Q?l6sw5H0+*QD z4-cAeooIe>MOOX^+oQ=Ey&@M^9%4V%61zXJrCYOEgmK#+XBLGyOZmUYr`!MAE&Mx# W=UniFe=R^87(8A5T-G@yGywoXDn2~` literal 0 HcmV?d00001