mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
* Kopala, Warden of Waves - Fixed that the cost modification did not work correctly for multi modal spells.
This commit is contained in:
parent
9a28f8d678
commit
874de47b28
1 changed files with 11 additions and 7 deletions
|
@ -30,6 +30,7 @@ package mage.cards.k;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.Mode;
|
||||||
import mage.abilities.SpellAbility;
|
import mage.abilities.SpellAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||||
|
@ -111,13 +112,16 @@ class KopalaWardenOfWavesCostReductionEffect extends CostModificationEffectImpl
|
||||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||||
if (abilityToModify.getAbilityType() == AbilityType.SPELL) {
|
if (abilityToModify.getAbilityType() == AbilityType.SPELL) {
|
||||||
if (game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId())) {
|
if (game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId())) {
|
||||||
for (Target target : abilityToModify.getTargets()) {
|
for (UUID modeId : abilityToModify.getModes().getSelectedModes()) {
|
||||||
for (UUID targetUUID : target.getTargets()) {
|
Mode mode = abilityToModify.getModes().get(modeId);
|
||||||
Permanent creature = game.getPermanent(targetUUID);
|
for (Target target : mode.getTargets()) {
|
||||||
if (creature != null
|
for (UUID targetUUID : target.getTargets()) {
|
||||||
&& filter.match(creature, game)
|
Permanent creature = game.getPermanent(targetUUID);
|
||||||
&& creature.getControllerId().equals(source.getControllerId())) {
|
if (creature != null
|
||||||
return true;
|
&& filter.match(creature, game)
|
||||||
|
&& creature.getControllerId().equals(source.getControllerId())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue