rl-api, rl-client: rename getHealth to getHealthScale

This commit is contained in:
Max Weber
2020-04-28 23:14:09 -06:00
parent 06d8a217c8
commit d6bb219c79
4 changed files with 13 additions and 12 deletions

View File

@@ -69,21 +69,22 @@ public interface Actor extends Renderable
Actor getInteracting();
/**
* Gets the health ratio of the actor.
* <p>
* The ratio is the number of green bars in the overhead
* HP display.
* Gets the health of the actor in {@link #getHealthScale()} units.
*
* @return the health ratio
* The server does not transmit actors' real health, only this value
* between zero and {@link #getHealthScale()}. Some actors may be
* missing this info, in which case -1 is returned.
*/
int getHealthRatio();
/**
* Gets the health of the actor.
* Gets the maximum value {@link #getHealthRatio()} can return
*
* @return the health
* For actors with the default size health bar this is 30, but
* for bosses with a larger health bar this can be a larger number.
* Some actors may be missing this info, in which case -1 is returned.
*/
int getHealth();
int getHealthScale();
/**
* Gets the server-side location of the actor.

View File

@@ -100,10 +100,10 @@ class OpponentInfoOverlay extends OverlayPanel
return null;
}
if (opponent.getName() != null && opponent.getHealth() > 0)
if (opponent.getName() != null && opponent.getHealthScale() > 0)
{
lastRatio = opponent.getHealthRatio();
lastHealthScale = opponent.getHealth();
lastHealthScale = opponent.getHealthScale();
opponentName = Text.removeTags(opponent.getName());
lastMaxHealth = null;

View File

@@ -165,7 +165,7 @@ class PrayerBarOverlay extends Overlay
return;
}
if (config.hideIfOutOfCombat() && localPlayer.getHealth() == -1)
if (config.hideIfOutOfCombat() && localPlayer.getHealthScale() == -1)
{
showingPrayerBar = false;
}

View File

@@ -106,7 +106,7 @@ class TargetWeaknessOverlay extends Overlay
return -1;
}
final int healthScale = target.getHealth();
final int healthScale = target.getHealthScale();
final int healthRatio = target.getHealthRatio();
final Integer maxHealth = npcManager.getHealth(target.getId());