]> git.lizzy.rs Git - Crafter.git/blob - mods/mob/exploder/timers.lua
Add in exploder prototype 2
[Crafter.git] / mods / mob / exploder / timers.lua
1 --this is where all the pig's timers are!
2
3 --this controls how fast the mob punches
4 exploder.manage_punch_timer = function(self,dtime)
5         if self.punch_timer > 0 then
6                 self.punch_timer = self.punch_timer - dtime
7         end
8         --this controls how fast you can punch the mob (punched timer reset)
9         if self.punched_timer > 0 then
10                 --print(self.punched_timer)
11                 self.punched_timer = self.punched_timer - dtime
12         end
13 end
14
15 --this controls the hostile state
16 exploder.manage_hostile_timer = function(self,dtime)
17         if self.hostile_timer > 0 then
18                 self.hostile_timer = self.hostile_timer - dtime
19         end
20         if self.hostile_timer <= 0 then
21                 self.hostile = false
22         end
23 end
24
25 --this stops the pig from flying into the air
26 exploder.manage_jump_timer = function(self,dtime)
27         if self.jump_timer > 0 then
28                 self.jump_timer = self.jump_timer - dtime
29         end
30 end