forked from VoxeLibre/VoxeLibre
Update api_hook for mcl_mobs definition
This commit is contained in:
parent
796c45d4b3
commit
3bbe7a6826
|
@ -1,5 +1,5 @@
|
||||||
local minetest = minetest
|
local minetest = minetest
|
||||||
--class
|
--class
|
||||||
mobs = {}
|
mobs = {}
|
||||||
|
|
||||||
local path = minetest.get_modpath(minetest.get_current_modname()).."/api/"
|
local path = minetest.get_modpath(minetest.get_current_modname()).."/api/"
|
||||||
|
@ -10,7 +10,7 @@ dofile(path.."head_code.lua")
|
||||||
dofile(path.."animation.lua")
|
dofile(path.."animation.lua")
|
||||||
dofile(path.."timers.lua")
|
dofile(path.."timers.lua")
|
||||||
|
|
||||||
mobs.register_mob = function(def)
|
mcl_mobs.register_mob = function(def)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ mob_register.jump_timer = 0
|
||||||
|
|
||||||
if def.head_bone then
|
if def.head_bone then
|
||||||
mob_register.head_bone = def.head_bone
|
mob_register.head_bone = def.head_bone
|
||||||
mobs.create_head_functions(def,mob_register)
|
mcl_mobs.create_head_functions(def,mob_register)
|
||||||
mob_register.debug_head_pos = def.debug_head_pos
|
mob_register.debug_head_pos = def.debug_head_pos
|
||||||
mob_register.head_directional_offset = def.head_directional_offset
|
mob_register.head_directional_offset = def.head_directional_offset
|
||||||
mob_register.head_height_offset = def.head_height_offset
|
mob_register.head_height_offset = def.head_height_offset
|
||||||
|
@ -165,23 +165,23 @@ if def.custom_timer then
|
||||||
mob_register.custom_timer_function = def.custom_timer_function
|
mob_register.custom_timer_function = def.custom_timer_function
|
||||||
end
|
end
|
||||||
|
|
||||||
mobs.create_movement_functions(def,mob_register)
|
mcl_mobs.create_movement_functions(def,mob_register)
|
||||||
mobs.create_interaction_functions(def,mob_register)
|
mcl_mobs.create_interaction_functions(def,mob_register)
|
||||||
mobs.create_data_handling_functions(def,mob_register)
|
mcl_mobs.create_data_handling_functions(def,mob_register)
|
||||||
mobs.create_animation_functions(def,mob_register)
|
mcl_mobs.create_animation_functions(def,mob_register)
|
||||||
mobs.create_timer_functions(def,mob_register)
|
mcl_mobs.create_timer_functions(def,mob_register)
|
||||||
|
|
||||||
|
|
||||||
mob_register.on_step = function(self, dtime,moveresult)
|
mob_register.on_step = function(self, dtime,moveresult)
|
||||||
if self.custom_function_begin then
|
if self.custom_function_begin then
|
||||||
self.custom_function_begin(self,dtime)
|
self.custom_function_begin(self,dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.collision_detection(self)
|
self.collision_detection(self)
|
||||||
if self.fall_damage then
|
if self.fall_damage then
|
||||||
self.fall_damage(self)
|
self.fall_damage(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.dead == false and self.death_animation_timer == 0 then
|
if self.dead == false and self.death_animation_timer == 0 then
|
||||||
if self.do_custom_timer then
|
if self.do_custom_timer then
|
||||||
self.do_custom_timer(self,dtime)
|
self.do_custom_timer(self,dtime)
|
||||||
|
@ -192,7 +192,7 @@ mob_register.on_step = function(self, dtime,moveresult)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.move(self,dtime,moveresult)
|
self.move(self,dtime,moveresult)
|
||||||
|
|
||||||
self.flow(self)
|
self.flow(self)
|
||||||
--self.debug_nametag(self,dtime)
|
--self.debug_nametag(self,dtime)
|
||||||
|
|
||||||
|
@ -205,11 +205,11 @@ mob_register.on_step = function(self, dtime,moveresult)
|
||||||
if self.set_animation then
|
if self.set_animation then
|
||||||
self.set_animation(self)
|
self.set_animation(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.look_around then
|
if self.look_around then
|
||||||
self.look_around(self,dtime)
|
self.look_around(self,dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.pathfinding then
|
if self.pathfinding then
|
||||||
self.pathfinding(self,dtime)
|
self.pathfinding(self,dtime)
|
||||||
end
|
end
|
||||||
|
@ -230,15 +230,15 @@ mob_register.on_step = function(self, dtime,moveresult)
|
||||||
if self.dead == true and self.death_animation_timer <= 0 then
|
if self.dead == true and self.death_animation_timer <= 0 then
|
||||||
self.on_death(self)
|
self.on_death(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.tnt_timer then
|
if self.tnt_timer then
|
||||||
self.manage_explode_timer(self,dtime)
|
self.manage_explode_timer(self,dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.projectile_timer then
|
if self.projectile_timer then
|
||||||
self.manage_projectile_timer(self,dtime)
|
self.manage_projectile_timer(self,dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.custom_function_end then
|
if self.custom_function_end then
|
||||||
self.custom_function_end(self,dtime)
|
self.custom_function_end(self,dtime)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue