mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-24 01:30:22 +01:00
add "hover" animation
This commit is contained in:
parent
7b429df9e9
commit
7bb5e2b382
12
api.lua
12
api.lua
@ -28,7 +28,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20220421",
|
version = "20220430",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -2393,7 +2393,17 @@ function mob_class:do_states(dtime)
|
|||||||
and self.animation
|
and self.animation
|
||||||
and self.animation.fly_start
|
and self.animation.fly_start
|
||||||
and self.animation.fly_end then
|
and self.animation.fly_end then
|
||||||
|
|
||||||
|
local def = minetest.registered_nodes[self.standing_on] or {}
|
||||||
|
|
||||||
|
if def.walkable
|
||||||
|
and self.animation
|
||||||
|
and self.animation.hover_start
|
||||||
|
and self.animation.hover_end then
|
||||||
|
self:set_animation("hover")
|
||||||
|
else
|
||||||
self:set_animation("fly")
|
self:set_animation("fly")
|
||||||
|
end
|
||||||
else
|
else
|
||||||
self:set_animation("walk")
|
self:set_animation("walk")
|
||||||
end
|
end
|
||||||
|
2
api.txt
2
api.txt
@ -237,6 +237,8 @@ functions needed for the mob to work properly which contains the following:
|
|||||||
'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.
|
'die_rotate' if true mob spins during death animation.
|
||||||
|
'hover_start" hover animation when flying/swimming and solid node below
|
||||||
|
'hover_end"
|
||||||
|
|
||||||
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