+local minetest = minetest
--class
mobs = {}
local mob_register = {}
+register_mob_spawner(def.mobname,def.textures,def.mesh)
+
------------------------------------------------
mob_register.initial_properties = {
physical = def.physical,
automatic_face_movement_dir = def.automatic_face_movement_dir,
automatic_face_movement_max_rotation_per_sec = def.automatic_face_movement_max_rotation_per_sec,
makes_footstep_sound = def.makes_footstep_sound,
+ static_save = false,
}
mob_register.attack_type = def.attack_type
if def.attack_type == "explode" then
mob_register.tnt_tick_timer = 0
+ mob_register.explosion_type = def.explosion_type
end
mob_register.explosion_radius = def.explosion_radius
mob_register.explosion_power = def.explosion_power
mob_register.projectile_timer_cooldown = def.projectile_timer_cooldown
mob_register.attacked_hostile = def.attacked_hostile
+if not def.hostile and not def.attacked_hostile then
+ mob_register.scared = false
+ mob_register.scared_timer = 0
+end
mob_register.attack_damage = def.attack_damage
mob_register.projectile_timer = 0
mob_register.custom_on_activate = def.custom_on_activate
+mob_register.custom_on_punch = def.custom_on_punch
+
+mob_register.c_mob_data = def.c_mob_data
+
+mob_register.deactivating = false
+
+mob_register.on_fire = false
+
+mob_register.fire_table = def.fire_table
+
if def.pathfinds then
--mob_register.path = {}
mob_register.pathfinding_timer = 0
self.custom_function_begin(self,dtime)
end
+ flow(self)
self.collision_detection(self)
if self.fall_damage then
self.fall_damage(self)
self.manage_hurt_color_timer(self,dtime)
+ if self.manage_scared_timer then
+ self.manage_scared_timer(self,dtime)
+ end
+
if self.set_animation then
self.set_animation(self)
end