* Kopala, Warden of Waves - Fixed that the cost modification did not work correctly for multi modal spells.
@@ -30,6 +30,7 @@ package mage.cards.k;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
+import mage.abilities.Mode;
import mage.abilities.SpellAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
@@ -111,7 +112,9 @@ class KopalaWardenOfWavesCostReductionEffect extends CostModificationEffectImpl
public boolean applies(Ability abilityToModify, Ability source, Game game) {
if (abilityToModify.getAbilityType() == AbilityType.SPELL) {
if (game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId())) {
- for (Target target : abilityToModify.getTargets()) {
+ for (UUID modeId : abilityToModify.getModes().getSelectedModes()) {
+ Mode mode = abilityToModify.getModes().get(modeId);
+ for (Target target : mode.getTargets()) {
for (UUID targetUUID : target.getTargets()) {
Permanent creature = game.getPermanent(targetUUID);
if (creature != null
@@ -123,6 +126,7 @@ class KopalaWardenOfWavesCostReductionEffect extends CostModificationEffectImpl
}
}
}
+ }
return false;
}
