mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Use mage.util.SpellTargetAddress everywhere we iterate over Targets in Ink-Treader Nephilim.
Also removed unused imports.
This commit is contained in:
parent
542997be8f
commit
f7a7b69be3
1 changed files with 5 additions and 11 deletions
|
@ -36,7 +36,6 @@ import mage.constants.Rarity;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
@ -53,7 +52,6 @@ import mage.game.stack.Spell;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.abilities.Modes;
|
|
||||||
import mage.filter.predicate.mageobject.FromSetPredicate;
|
import mage.filter.predicate.mageobject.FromSetPredicate;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
@ -130,15 +128,11 @@ class InkTreaderNephilimTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
if (spell != null) {
|
if (spell != null) {
|
||||||
boolean allTargetsInkTreaderNephilim = true;
|
boolean allTargetsInkTreaderNephilim = true;
|
||||||
boolean atLeastOneTargetsInkTreaderNephilim = false;
|
boolean atLeastOneTargetsInkTreaderNephilim = false;
|
||||||
for (SpellAbility spellAbility: spell.getSpellAbilities()){
|
for (SpellTargetAddress addr : SpellTargetAddress.walk(spell)) {
|
||||||
Modes modesSpell = spellAbility.getModes();
|
Target targetInstance = addr.getTarget(spell);
|
||||||
for (UUID mode : modesSpell.getSelectedModes()) {
|
for (UUID target : targetInstance.getTargets()) {
|
||||||
for (Target targetInstance : modesSpell.get(mode).getTargets()) {
|
allTargetsInkTreaderNephilim &= target.equals(sourceId);
|
||||||
for (UUID target : targetInstance.getTargets()) {
|
atLeastOneTargetsInkTreaderNephilim |= target.equals(sourceId);
|
||||||
allTargetsInkTreaderNephilim &= target.equals(sourceId);
|
|
||||||
atLeastOneTargetsInkTreaderNephilim |= target.equals(sourceId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (allTargetsInkTreaderNephilim && atLeastOneTargetsInkTreaderNephilim) {
|
if (allTargetsInkTreaderNephilim && atLeastOneTargetsInkTreaderNephilim) {
|
||||||
|
|
Loading…
Reference in a new issue