/**
* Drains the player's run energy.
*/
public void drainRunEnergy() {
double drainRate = 0.7D;
double weightFactor = (weight > 1.371D ? (int) weight * 0.00729166D : 0.0D);
// Truncated the weight factor to the nearest hundredth
weightFactor = Math.round(weightFactor * 100.0D) / 100.0D;
setRunEnergy(runEnergy - (drainRate + weightFactor));
}
/**
* Restores the player's run energy.
*/
public void restoreRunEnergy() {
double restoreRate = 0.45D;
double agilityFactor = (skills.getLevel(Skills.AGILITY) > 1 ? 0.001 * skills.getLevel(Skills.AGILITY) : 0.00D);
setRunEnergy(runEnergy + (recoverRate + agilityFactor));
}
Copyright © 2026, NextGenUpdate.
All Rights Reserved.