New command /f powerboost <p|f|player|faction> <name> <#>, which will apply a permanent power bonus/penalty to a specified player or faction. When applied to a player, it will affect their max power and min power. When applied to a faction, it will be applied to current and max power levels. Whether it is a bonus or a penalty depends on whether the number you specify is positive or negative.

New permission factions.powerboost which is required to use the above command. This permission is added to the factions.kit.mod permission kit.

example usage:
/f powerboost p Player1 1.5  (give player "Player1" a bonus of 1.5 power)
/f powerboost faction SomeFaction -6  (give faction "SomeFaction" a penalty of -6 power)
This commit is contained in:
Brettflan
2012-01-28 11:56:51 -06:00
parent 30b3facc19
commit 9a6c15edd1
9 changed files with 106 additions and 13 deletions

View File

@@ -66,7 +66,13 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
// FIELD: power
private double power;
// FIELD: powerBoost
// special increase/decrease to min and max power for this player
private double powerBoost;
public double getPowerBoost() { return this.powerBoost; }
public void setPowerBoost(double powerBoost) { this.powerBoost = powerBoost; }
// FIELD: lastPowerUpdateTime
private long lastPowerUpdateTime;
@@ -124,6 +130,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
this.mapAutoUpdating = false;
this.autoClaimFor = null;
this.loginPvpDisabled = (Conf.noPVPDamageToOthersForXSecondsAfterLogin > 0) ? true : false;
this.powerBoost = 0.0;
if ( ! Conf.newPlayerStartingFactionID.equals("0") && Factions.i.exists(Conf.newPlayerStartingFactionID))
{
@@ -337,23 +344,19 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
{
this.power += delta;
if (this.power > this.getPowerMax())
{
this.power = this.getPowerMax();
} else if (this.power < this.getPowerMin())
{
else if (this.power < this.getPowerMin())
this.power = this.getPowerMin();
}
//Log.debug("Power of "+this.getName()+" is now: "+this.power);
}
public double getPowerMax()
{
return Conf.powerPlayerMax;
return Conf.powerPlayerMax + this.powerBoost;
}
public double getPowerMin()
{
return Conf.powerPlayerMin;
return Conf.powerPlayerMin + this.powerBoost;
}
public int getPowerRounded()