muju.lua 891 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. local muju = {}
  2. function muju:tint(r, g, b)
  3. for _, slot in pairs({'robebottom', 'torso', 'front_upper_arm', 'rear_upper_arm', 'front_bracer', 'rear_bracer'}) do
  4. local slot = self.animation.skeleton:findSlot(slot)
  5. slot.r, slot.g, slot.b = r, g, b
  6. end
  7. end
  8. function muju:hurt(amount)
  9. return
  10. end
  11. function muju:addJuju(amount)
  12. self.juju = self.juju + amount
  13. self.totalJuju = self.totalJuju + amount
  14. end
  15. function muju:spendJuju(amount)
  16. self.juju = self.juju - amount
  17. end
  18. function muju:draw()
  19. local image = app.environment.art.stump
  20. local scale = 60 / image:getWidth()
  21. self:drawRing(180, 40, 255)
  22. g.white()
  23. g.draw(image, self.position.x, self.position.y - 10, 0, scale, scale, image:getWidth() / 2, image:getHeight() / 2)
  24. self.animation:tick(lib.tick.delta)
  25. self.animation:draw(self.position.x, self.position.y)
  26. return -self.position.y
  27. end
  28. return muju