New conf.json setting "powerPlayerStarting" (default 0.0) for the power level which new players will now start at; previously new players would start with max power, now it's configurable

This commit is contained in:
Brettflan 2011-12-18 07:26:10 -06:00
parent fc5d45d8c4
commit e32660c188
2 changed files with 6 additions and 2 deletions

View File

@ -23,6 +23,7 @@ public class Conf
// Power // Power
public static double powerPlayerMax = 10.0; public static double powerPlayerMax = 10.0;
public static double powerPlayerMin = -10.0; public static double powerPlayerMin = -10.0;
public static double powerPlayerStarting = 0.0;
public static double powerPerMinute = 0.2; // Default health rate... it takes 5 min to heal one power public static double powerPerMinute = 0.2; // Default health rate... it takes 5 min to heal one power
public static double powerPerDeath = 4.0; // A death makes you lose 4 power public static double powerPerDeath = 4.0; // A death makes you lose 4 power
public static boolean powerRegenOffline = false; // does player power regenerate even while they're offline? public static boolean powerRegenOffline = false; // does player power regenerate even while they're offline?

View File

@ -149,7 +149,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
public FPlayer() public FPlayer()
{ {
this.resetFactionData(false); this.resetFactionData(false);
this.power = this.getPowerMax(); this.power = Conf.powerPlayerStarting;
this.lastPowerUpdateTime = System.currentTimeMillis(); this.lastPowerUpdateTime = System.currentTimeMillis();
this.lastLoginTime = System.currentTimeMillis(); this.lastLoginTime = System.currentTimeMillis();
this.mapAutoUpdating = false; this.mapAutoUpdating = false;
@ -809,7 +809,10 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
@Override @Override
public boolean shouldBeSaved() public boolean shouldBeSaved()
{ {
if (this.getPowerRounded() == this.getPowerMaxRounded() && !this.hasFaction()) return false; if (!this.hasFaction() &&
(this.getPowerRounded() == this.getPowerMaxRounded() || this.getPowerRounded() == (int) Math.round(Conf.powerPlayerStarting))
)
return false;
return ! this.deleteMe; return ! this.deleteMe;
} }