1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2024-12-25 02:00:21 +01:00

add check for 'injured' animation

This commit is contained in:
tenplus1 2023-03-13 11:52:59 +00:00
parent 0c2ddab172
commit 7e585b0bdc
2 changed files with 5 additions and 2 deletions

View File

@ -3036,8 +3036,8 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir, damage)
-- turn mob on knockback and play run/walk animation -- turn mob on knockback and play run/walk animation
self:set_yaw((random(0, 360) - 180) / 180 * pi, 12) self:set_yaw((random(0, 360) - 180) / 180 * pi, 12)
if self.animation and self.animation.run_end then if self.animation and self.animation.injured_end and damage >= 1 then
self:set_animation("run") self:set_animation("injured")
else else
self:set_animation("walk") self:set_animation("walk")
end end

View File

@ -249,6 +249,9 @@ functions needed for the mob to work properly which contains the following:
'shoot_start' shooting animation. 'shoot_start' shooting animation.
'shoot_end' 'shoot_end'
'shoot_speed' 'shoot_speed'
'injured_start' when hit or damaged > 1 hp (if not set then 'walk' is used)
'injured_end'
'injured_speed'
'die_start' death animation 'die_start' death animation
'die_end' 'die_end'
'die_speed' 'die_speed'