mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-07-02 00:10:21 +02:00
add option to spin mob when playing death animation
This commit is contained in:
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 speed = self.animation.die_speed or 15
|
||||
local length = max((frames / speed), 0)
|
||||
local rot = self.animation.die_rotate and 5
|
||||
|
||||
self.attack = nil
|
||||
self.v_start = false
|
||||
@ -912,7 +913,8 @@ function mob_class:check_for_death(cmi_cause)
|
||||
self.passive = true
|
||||
self.state = "die"
|
||||
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_animation("die")
|
||||
|
Reference in New Issue
Block a user