infusion.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. local Infusion = extend(Ability)
  2. ----------------
  3. -- Meta
  4. ----------------
  5. Infusion.name = 'Infusion'
  6. Infusion.description = 'Huju plants itself in the ground like a boss, channeling for $duration second$s. During this time, nearby allies are healed for a total of %maxHealthHeal of their maximum health. This ability costs %currentHealthCost of Huju\'s current health to use.'
  7. ----------------
  8. -- Data
  9. ----------------
  10. Infusion.cooldown = 8
  11. Infusion.range = 150
  12. Infusion.duration = 5
  13. Infusion.currentHealthCost = .2
  14. Infusion.maxHealthHeal = .3
  15. ----------------
  16. -- Behavior
  17. ----------------
  18. function Infusion:activate()
  19. self.channelTimer = 0
  20. end
  21. function Infusion:update()
  22. self.channelTimer = timer.rot(self.channelTimer, function()
  23. self.unit.channeling = false
  24. end)
  25. end
  26. function Infusion:use()
  27. self.unit:hurt(self.unit.health * self.currentHealthCost, self.unit)
  28. self.unit.channeling = true
  29. self.channelTimer = self.duration
  30. self:createSpell()
  31. end
  32. ----------------
  33. -- Upgrades
  34. ----------------
  35. local Distortion = {}
  36. Distortion.code = 'distortion'
  37. Distortion.name = 'Distortion'
  38. Distortion.description = 'Infusion creates some void zone thing that hastes allies in the area by %haste and slows enemies in the area by %slow.'
  39. Distortion.slow = .5
  40. Distortion.haste = .5
  41. local Resilience = {}
  42. Resilience.code = 'resilience'
  43. Resilience.name = 'Resilience'
  44. Resilience.description = 'Any allies under the effect of infusion become immune to crowd control effects.'
  45. Infusion.upgrades = {Distortion, Resilience}
  46. return Infusion