forked from External/mage
small complexity rewrite
This commit is contained in:
parent
d9ace1b66f
commit
b704618f32
2 changed files with 8 additions and 15 deletions
|
|
@ -35,14 +35,10 @@ public enum GetKickerXValue implements DynamicValue {
|
|||
|
||||
// search that kicker used X value
|
||||
KickerAbility kickerAbility = (KickerAbility) ability;
|
||||
boolean haveVarCost = false;
|
||||
for (OptionalAdditionalCost cost : kickerAbility.getKickerCosts()) {
|
||||
List<VariableCost> varCosts = ((OptionalAdditionalCostImpl) cost).getVariableCosts();
|
||||
if (!varCosts.isEmpty()) {
|
||||
haveVarCost = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
boolean haveVarCost = kickerAbility.getKickerCosts()
|
||||
.stream()
|
||||
.anyMatch(varCost -> !((OptionalAdditionalCostImpl) varCost).getVariableCosts().isEmpty());
|
||||
|
||||
|
||||
if (haveVarCost) {
|
||||
int kickedCount = ((KickerAbility) ability).getKickedCounter(game, source);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue