spjspj - Fix copy's owner for Mirrorwing Dragon (EMN)

This commit is contained in:
spjspj 2016-07-16 03:11:06 +10:00
parent e5117a967d
commit 09cc97dd85
2 changed files with 16 additions and 0 deletions

View file

@ -172,6 +172,17 @@ class MirrorwingDragonCopySpellEffect extends CopySpellForEachItCouldTargetEffec
@Override @Override
protected void modifyCopy(Spell copy, Game game, Ability source) { protected void modifyCopy(Spell copy, Game game, Ability source) {
Spell spell = getSpell(game, source);
copy.setControllerId(spell.getControllerId());
}
@Override
protected boolean okUUIDToCopyFor(UUID potentialTarget, Game game, Ability source, Spell spell) {
Permanent permanent = game.getPermanent(potentialTarget);
if (permanent == null || !permanent.getControllerId().equals(spell.getControllerId())) {
return false;
}
return true;
} }
@Override @Override

View file

@ -82,6 +82,10 @@ public abstract class CopySpellForEachItCouldTargetEffect<T extends MageItem> ex
modifyCopy(copy, game, source); modifyCopy(copy, game, source);
} }
protected boolean okUUIDToCopyFor(UUID potentialTarget, Game game, Ability source, Spell spell) {
return true;
}
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player actingPlayer = getPlayer(game, source); Player actingPlayer = getPlayer(game, source);
@ -146,6 +150,7 @@ public abstract class CopySpellForEachItCouldTargetEffect<T extends MageItem> ex
} }
} }
legal &= okUUIDToCopyFor(objId, game, source, spell);
if (legal) { if (legal) {
for (TargetAddress addr : targetsToBeChanged) { for (TargetAddress addr : targetsToBeChanged) {
Target targetInstance = addr.getTarget(copy); Target targetInstance = addr.getTarget(copy);