mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Use mage.util.SpellTargetAddress in Ink-Treader Nephilim.
This commit is contained in:
parent
d341e39e05
commit
018a2a163e
1 changed files with 11 additions and 19 deletions
|
@ -60,7 +60,7 @@ import mage.abilities.Modes;
|
|||
import mage.filter.predicate.ObjectPlayer;
|
||||
import mage.filter.predicate.ObjectPlayerPredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import mage.util.SpellTargetAddress;
|
||||
|
||||
/**
|
||||
* @author duncancmt
|
||||
|
@ -190,26 +190,18 @@ class InkTreaderNephilimEffect extends OneShotEffect {
|
|||
continue; // copy only for other creatures
|
||||
}
|
||||
boolean legal = true;
|
||||
for (SpellAbility sa : copy.getSpellAbilities()) {
|
||||
Modes modes = sa.getModes();
|
||||
for (UUID mode : modes.getSelectedModes()) {
|
||||
for (Target targetInstance : modes.get(mode).getTargets()) {
|
||||
legal &= targetInstance.canTarget(permanent.getId(), sa, game);
|
||||
}
|
||||
}
|
||||
for (SpellTargetAddress addr : SpellTargetAddress.walk(copy)) {
|
||||
Target targetInstance = addr.getTarget(copy);
|
||||
legal &= targetInstance.canTarget(permanent.getId(), addr.getSpellAbility(copy), game);
|
||||
}
|
||||
if (legal) {
|
||||
for (SpellAbility sa : copy.getSpellAbilities()) {
|
||||
Modes modes = sa.getModes();
|
||||
for (UUID mode : modes.getSelectedModes()) {
|
||||
for (Target targetInstance : modes.get(mode).getTargets()) {
|
||||
int numTargets = targetInstance.getNumberOfTargets();
|
||||
targetInstance.clearChosen();
|
||||
while (numTargets > 0) {
|
||||
targetInstance.add(permanent.getId(), game);
|
||||
numTargets--;
|
||||
}
|
||||
}
|
||||
for (SpellTargetAddress addr : SpellTargetAddress.walk(copy)) {
|
||||
Target targetInstance = addr.getTarget(copy);
|
||||
int numTargets = targetInstance.getNumberOfTargets();
|
||||
targetInstance.clearChosen();
|
||||
while (numTargets > 0) {
|
||||
targetInstance.add(permanent.getId(), game);
|
||||
numTargets--;
|
||||
}
|
||||
}
|
||||
targetable.put(permanent.getId(), copy);
|
||||
|
|
Loading…
Reference in a new issue