Extracted code into method.
This commit is contained in:
@ -50,16 +50,20 @@ public abstract class TotemItem extends Item {
|
||||
return totemData.getCharge() >= getMaxCharge();
|
||||
}
|
||||
|
||||
private boolean isChargeCostDynamic() {
|
||||
return getConfig().getChargeCost() == -1;
|
||||
}
|
||||
|
||||
private int getMaxCharge() {
|
||||
return getConfig().getChargeCost() == -1
|
||||
return isChargeCostDynamic()
|
||||
? getConfig().getChargeCostLimit()
|
||||
: getConfig().getChargeCost();
|
||||
}
|
||||
|
||||
private int getTargetCost(TotemData totemData) {
|
||||
return getConfig().getChargeCost() != -1
|
||||
? getConfig().getChargeCost()
|
||||
: (int)(totemData.getTargetDeaths() * getConfig().getChargeCostMultiplier());
|
||||
return isChargeCostDynamic()
|
||||
? (int)(totemData.getTargetDeaths() * getConfig().getChargeCostMultiplier())
|
||||
: getConfig().getChargeCost();
|
||||
}
|
||||
|
||||
private boolean canAffordTarget(TotemData totemData) {
|
||||
|
||||
Reference in New Issue
Block a user