1 mobs.create_timer_functions = function(def,mob_register)
2 --this controls how fast the mob punches
3 mob_register.manage_punch_timer = function(self,dtime)
4 if self.punch_timer > 0 then
5 self.punch_timer = self.punch_timer - dtime
7 --this controls how fast you can punch the mob (punched timer reset)
8 if self.punched_timer > 0 then
9 --print(self.punched_timer)
10 self.punched_timer = self.punched_timer - dtime
14 --this controls the hostile state
15 if def.hostile == true or def.attacked_hostile == true then
16 mob_register.manage_hostile_timer = function(self,dtime)
17 if self.hostile_timer > 0 then
18 self.hostile_timer = self.hostile_timer - dtime
20 if self.hostile_timer <= 0 then
26 mob_register.manage_hurt_color_timer = function(self,dtime)
27 if self.hurt_color_timer > 0 then
28 self.hurt_color_timer = self.hurt_color_timer - dtime
29 if self.hurt_color_timer <= 0 then
30 self.hurt_color_timer = 0
31 self.object:set_texture_mod("")
36 mob_register.manage_explode_timer = function(self,dtime)
37 self.tnt_timer = self.tnt_timer - dtime
38 if self.tnt_timer <= 0 and not self.dead then
40 self.object:set_texture_mod("^[colorize:red:130")
42 local pos = self.object:get_pos()
43 --direction.y = direction.y + 1
46 self.death_animation_timer = 1
52 mob_register.manage_projectile_timer = function(self,dtime)
53 self.projectile_timer = self.projectile_timer - dtime
56 --this stops the pig from flying into the air
57 mob_register.manage_jump_timer = function(self,dtime)
58 if self.jump_timer > 0 then
59 self.jump_timer = self.jump_timer - dtime