lazor.lua 581 B

12345678910111213141516171819202122232425262728293031323334353637
  1. local Lazor = {}
  2. Lazor.name = 'LAZOR'
  3. Lazor.code = 'lazor'
  4. Lazor.text = 'Ima firin\' Malaysia!'
  5. Lazor.type = 'skill'
  6. Lazor.cooldown = 10
  7. function Lazor:activate()
  8. self.timer = 0
  9. end
  10. function Lazor:update(owner)
  11. self.timer = timer.rot(self.timer)
  12. end
  13. function Lazor:canFire()
  14. return self.timer == 0
  15. end
  16. function Lazor:fire(owner)
  17. ctx.spells:activate(owner.id, data.spell.lazor)
  18. self.timer = self.cooldown
  19. end
  20. function Lazor:draw(owner)
  21. if owner.id == ctx.id then
  22. --
  23. end
  24. end
  25. function Lazor:value(owner)
  26. return self.timer / self.cooldown
  27. end
  28. return Lazor