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:
@@ -94,6 +94,12 @@ public class Faction extends Entity implements EconomyParticipator
|
||||
return aid;
|
||||
}
|
||||
|
||||
// FIELD: powerBoost
|
||||
// special increase/decrease to default and max power for this faction
|
||||
private double powerBoost;
|
||||
public double getPowerBoost() { return this.powerBoost; }
|
||||
public void setPowerBoost(double powerBoost) { this.powerBoost = powerBoost; }
|
||||
|
||||
// FIELDS: Flag management
|
||||
// TODO: This will save... defaults if they where changed to...
|
||||
private Map<FFlag, Boolean> flagOverrides; // Contains the modifications to the default values
|
||||
@@ -168,6 +174,7 @@ public class Faction extends Entity implements EconomyParticipator
|
||||
this.tag = "???";
|
||||
this.description = "Default faction description :(";
|
||||
this.money = 0.0;
|
||||
this.powerBoost = 0.0;
|
||||
this.flagOverrides = new LinkedHashMap<FFlag, Boolean>();
|
||||
this.permOverrides = new LinkedHashMap<FPerm, Set<Rel>>();
|
||||
}
|
||||
@@ -280,7 +287,7 @@ public class Faction extends Entity implements EconomyParticipator
|
||||
{
|
||||
ret = Conf.powerFactionMax;
|
||||
}
|
||||
return ret;
|
||||
return ret + this.powerBoost;
|
||||
}
|
||||
|
||||
public double getPowerMax()
|
||||
@@ -299,7 +306,7 @@ public class Faction extends Entity implements EconomyParticipator
|
||||
{
|
||||
ret = Conf.powerFactionMax;
|
||||
}
|
||||
return ret;
|
||||
return ret + this.powerBoost;
|
||||
}
|
||||
|
||||
public int getPowerRounded()
|
||||
|
||||
Reference in New Issue
Block a user