fixed Dack Fayden emblem not using all targets from modal spells
@@ -31,6 +31,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
+import mage.abilities.Mode;
import mage.abilities.SpellAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.ContinuousEffectImpl;
@@ -92,7 +93,8 @@ class DackFaydenEmblemTriggeredAbility extends TriggeredAbilityImpl {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null) {
SpellAbility spellAbility = spell.getSpellAbility();
- for (Target target : spellAbility.getTargets()) {
+ for (Mode mode : spellAbility.getModes().values()) {
+ for (Target target : mode.getTargets()) {
if (!target.isNotTarget()) {
for (UUID targetId : target.getTargets()) {
if (game.getBattlefield().containsPermanent(targetId)) {
@@ -102,6 +104,7 @@ class DackFaydenEmblemTriggeredAbility extends TriggeredAbilityImpl {
}
}
}
+ }
for (Effect effect : spellAbility.getEffects()) {
for (UUID targetId : effect.getTargetPointer().getTargets(game, spellAbility)) {
if (game.getBattlefield().containsPermanent(targetId)) {
