puppetize.lua 527 B

1234567891011121314151617181920212223242526
  1. local Puppetize = extend(Ability)
  2. ----------------
  3. -- Data
  4. ----------------
  5. Puppetize.cooldown = 30
  6. ----------------
  7. -- Behavior
  8. ----------------
  9. function Puppetize:activate()
  10. self.timer = love.math.random() * self.cooldown
  11. end
  12. function Puppetize:use()
  13. if self.unit.target and isa(self.unit.target, Unit) then
  14. self.unit.target.buffs:add('puppetize', {timer = 3, owner = self.unit})
  15. self.unit.animation:set('puppetize')
  16. self.unit.channeling = true
  17. self.timer = self.cooldown
  18. end
  19. end
  20. return Puppetize