forked from External/mage
rewrote enum comparisons, iterator to removeIf, added some stream and filters
This commit is contained in:
parent
05e5ca3c78
commit
3a152ab3d6
41 changed files with 178 additions and 239 deletions
|
|
@ -166,12 +166,7 @@ public class AlternativeCostSourceAbility extends StaticAbility implements Alter
|
|||
if (alternativeCostsToCheck.canPay(ability, ability.getSourceId(), ability.getControllerId(), game)
|
||||
&& player.chooseUse(Outcome.Benefit, costChoiceText, this, game)) {
|
||||
if (ability instanceof SpellAbility) {
|
||||
for (Iterator<ManaCost> iterator = ability.getManaCostsToPay().iterator(); iterator.hasNext();) {
|
||||
ManaCost manaCost = iterator.next();
|
||||
if (manaCost instanceof VariableCost) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
ability.getManaCostsToPay().removeIf(manaCost -> manaCost instanceof VariableCost);
|
||||
CardUtil.reduceCost((SpellAbility) ability, ability.getManaCosts());
|
||||
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue