battleaxe.lua 644 B

1234567891011121314151617181920212223242526
  1. local BattleAxe = extend(app.logic.spell)
  2. BattleAxe.code = 'battleaxe'
  3. BattleAxe.duration = .5
  4. BattleAxe.radius = 45
  5. BattleAxe.distance = 85
  6. function BattleAxe:activate(visions)
  7. self.timer = BattleAxe.duration
  8. self:mirrorOwner()
  9. self:move(self.distance)
  10. self:damageInRadius(data.weapon.battleaxe.damage)
  11. self:playSound('dash')
  12. end
  13. function BattleAxe:update()
  14. self:rot()
  15. end
  16. function BattleAxe:draw()
  17. love.graphics.setColor(255, 255, 255, 50 * (self.timer / BattleAxe.duration))
  18. self:drawCircle('fill')
  19. love.graphics.setColor(255, 255, 255, 255 * (self.timer / BattleAxe.duration))
  20. self:drawCircle('line')
  21. end
  22. return BattleAxe