Guest User

Untitled

a guest
May 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. public void drawHPOrb() {
  2. int health;
  3. String cHP = ""+currentStats[3]+"";
  4. cHP = cHP.replaceAll("%", "");
  5. int currentHP = Integer.parseInt(cHP);
  6. String mHP = ""+maxStats[3]+"";
  7. mHP = mHP.replaceAll("%", "");
  8. int maxHP2 = Integer.parseInt(mHP);
  9. health = (int) (((double) currentHP / (double) maxHP2) * 100D);
  10. emptyOrb.drawSprite(170, 13);
  11. if (health <= 100 && health >= 75) {
  12. smallText.method382(65280, 213, cHP, 39, true);
  13. } else if (health <= 74 && health >= 50) {
  14. smallText.method382(0xffff00, 213, cHP, 39, true);
  15. } else if (health <= 49 && health >= 25) {
  16. smallText.method382(0xfca607, 213, cHP, 39, true);
  17. } else if (health <= 24 && health >= 0) {
  18. smallText.method382(0xf50d0d, 213, cHP, 39, true);
  19. }
  20. hitPointsFill.drawSprite(173, 16);
  21. double percent = (health / 100D);
  22. fillHP = 27 * percent;
  23. int depleteFill = 27 - (int) fillHP;
  24. deplete.myHeight = depleteFill;
  25. deplete.height = depleteFill;
  26. deplete.drawSprite(173, 16);
  27. hitPointsIcon.drawSprite(179, 24);
  28. }
Add Comment
Please, Sign In to add comment