mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-25 10:10:21 +01:00
update death animation timers
This commit is contained in:
parent
8ad63d35d0
commit
276c2fc0ce
10
api.lua
10
api.lua
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
-- Mobs Api (26th July 2017)
|
-- Mobs Api (30th July 2017)
|
||||||
|
|
||||||
mobs = {}
|
mobs = {}
|
||||||
mobs.mod = "redo"
|
mobs.mod = "redo"
|
||||||
mobs.version = "20170726"
|
mobs.version = "20170730"
|
||||||
|
|
||||||
|
|
||||||
-- Intllib
|
-- Intllib
|
||||||
@ -439,6 +439,10 @@ local check_for_death = function(self, cause, cmi_cause)
|
|||||||
and self.animation.die_start
|
and self.animation.die_start
|
||||||
and self.animation.die_end then
|
and self.animation.die_end then
|
||||||
|
|
||||||
|
local frames = self.animation.die_end - self.animation.die_start
|
||||||
|
local speed = self.animation.die_speed or 15
|
||||||
|
local length = max(frames / speed, 0)
|
||||||
|
|
||||||
self.attack = nil
|
self.attack = nil
|
||||||
self.v_start = false
|
self.v_start = false
|
||||||
self.timer = 0
|
self.timer = 0
|
||||||
@ -448,7 +452,7 @@ local check_for_death = function(self, cause, cmi_cause)
|
|||||||
set_velocity(self, 0)
|
set_velocity(self, 0)
|
||||||
set_animation(self, "die")
|
set_animation(self, "die")
|
||||||
|
|
||||||
minetest.after(2, function(self)
|
minetest.after(length, function(self)
|
||||||
|
|
||||||
if use_cmi then
|
if use_cmi then
|
||||||
cmi.notify_die(self.object, cmi_cause)
|
cmi.notify_die(self.object, cmi_cause)
|
||||||
|
Loading…
Reference in New Issue
Block a user