mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
spjspj - Fix copy's owner for Mirrorwing Dragon (EMN)
This commit is contained in:
parent
e5117a967d
commit
09cc97dd85
2 changed files with 16 additions and 0 deletions
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue