mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-01-11 10:20:21 +01:00
add option to spin mob when playing death animation
This commit is contained in:
parent
1dfd7e1af1
commit
9489ff6965
4
api.lua
4
api.lua
@ -904,6 +904,7 @@ function mob_class:check_for_death(cmi_cause)
|
|||||||
local frames = self.animation.die_end - self.animation.die_start
|
local frames = self.animation.die_end - self.animation.die_start
|
||||||
local speed = self.animation.die_speed or 15
|
local speed = self.animation.die_speed or 15
|
||||||
local length = max((frames / speed), 0)
|
local length = max((frames / speed), 0)
|
||||||
|
local rot = self.animation.die_rotate and 5
|
||||||
|
|
||||||
self.attack = nil
|
self.attack = nil
|
||||||
self.v_start = false
|
self.v_start = false
|
||||||
@ -912,7 +913,8 @@ function mob_class:check_for_death(cmi_cause)
|
|||||||
self.passive = true
|
self.passive = true
|
||||||
self.state = "die"
|
self.state = "die"
|
||||||
self.object:set_properties({
|
self.object:set_properties({
|
||||||
pointable = false, collide_with_objects = false
|
pointable = false, collide_with_objects = false,
|
||||||
|
automatic_rotate = rot,
|
||||||
})
|
})
|
||||||
self:set_velocity(0)
|
self:set_velocity(0)
|
||||||
self:set_animation("die")
|
self:set_animation("die")
|
||||||
|
1
api.txt
1
api.txt
@ -226,6 +226,7 @@ functions needed for the mob to work properly which contains the following:
|
|||||||
'die_end'
|
'die_end'
|
||||||
'die_speed'
|
'die_speed'
|
||||||
'die_loop' when set to false stops the animation looping.
|
'die_loop' when set to false stops the animation looping.
|
||||||
|
'die_rotate' if true mob spins during death animation.
|
||||||
|
|
||||||
Using '_loop = false' setting will stop any of the above animations from
|
Using '_loop = false' setting will stop any of the above animations from
|
||||||
looping.
|
looping.
|
||||||
|
Loading…
Reference in New Issue
Block a user