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 == false 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
27 mob_register.manage_explode_timer = function(self,dtime)
28 self.tnt_timer = self.tnt_timer - dtime
29 if self.tnt_timer <= 0 and not self.dead then
31 self.object:set_texture_mod("^[colorize:red:130")
33 self.child:set_texture_mod("^[colorize:red:130")
36 local pos = self.object:get_pos()
37 --direction.y = direction.y + 1
40 self.death_animation_timer = 1
46 mob_register.manage_projectile_timer = function(self,dtime)
47 self.projectile_timer = self.projectile_timer - dtime
50 --this stops the pig from flying into the air
51 mob_register.manage_jump_timer = function(self,dtime)
52 if self.jump_timer > 0 then
53 self.jump_timer = self.jump_timer - dtime