command.lua 513 B

12345678910111213141516171819202122232425
  1. local command = lib.object.create():include(lib.ability)
  2. function command:getColor()
  3. local entity = lib.target.objectAtPosition(app.context.view:worldPoint(love.mouse.getPosition()))
  4. if entity then
  5. if entity.isEnemy then
  6. return { 255, 140, 140 }
  7. elseif entity.isShruju then
  8. return { 220, 220, 140 }
  9. else
  10. return { 140, 255, 140 }
  11. end
  12. else
  13. return { 140, 255, 140 }
  14. end
  15. end
  16. function command:canCast()
  17. return true
  18. end
  19. function command:cast(x, y)
  20. end
  21. return command