Power regeneration rate increase as power decreases

This commit is contained in:
sp1ky
2011-11-28 23:07:29 +00:00
parent 3d929138a5
commit 486fce400f
2 changed files with 10 additions and 2 deletions

View File

@@ -377,9 +377,15 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
long now = System.currentTimeMillis();
long millisPassed = now - this.lastPowerUpdateTime;
this.lastPowerUpdateTime = now;
int millisPerMinute = 60*1000;
double powerPerMinute = Conf.powerPerMinute;
if(Conf.scaleNegativePower && this.power < 0)
{
powerPerMinute += (Math.sqrt(Math.abs(this.power)) * Math.abs(this.power)) / Conf.scaleNegativeDivisor;
}
this.alterPower(millisPassed * powerPerMinute / millisPerMinute);
int millisPerMinute = 60*1000;
this.alterPower(millisPassed * Conf.powerPerMinute / millisPerMinute);
}
protected void losePowerFromBeingOffline()