mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Fix owner of token to be its initial controller.
This commit is contained in:
@@ -80,6 +80,17 @@ public class CopyPermanentEffect extends SpellAbilityEffect {
|
|||||||
final int numCopies = sa.hasParam("NumCopies") ? AbilityUtils.calculateAmount(hostCard,
|
final int numCopies = sa.hasParam("NumCopies") ? AbilityUtils.calculateAmount(hostCard,
|
||||||
sa.getParam("NumCopies"), sa) : 1;
|
sa.getParam("NumCopies"), sa) : 1;
|
||||||
|
|
||||||
|
Player controller = null;
|
||||||
|
if (sa.hasParam("Controller")) {
|
||||||
|
final FCollectionView<Player> defined = AbilityUtils.getDefinedPlayers(hostCard, sa.getParam("Controller"), sa);
|
||||||
|
if (!defined.isEmpty()) {
|
||||||
|
controller = defined.getFirst();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (controller == null) {
|
||||||
|
controller = sa.getActivatingPlayer();
|
||||||
|
}
|
||||||
|
|
||||||
List<Card> tgtCards = getTargetCards(sa);
|
List<Card> tgtCards = getTargetCards(sa);
|
||||||
final TargetRestrictions tgt = sa.getTargetRestrictions();
|
final TargetRestrictions tgt = sa.getTargetRestrictions();
|
||||||
|
|
||||||
@@ -128,22 +139,10 @@ public class CopyPermanentEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
tgtCards.clear();
|
tgtCards.clear();
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
tgtCards.add(Card.fromPaperCard(cards.get(0), sa.getActivatingPlayer()));
|
tgtCards.add(Card.fromPaperCard(cards.get(0), controller));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Player controller = null;
|
|
||||||
if (sa.hasParam("Controller")) {
|
|
||||||
FCollectionView<Player> defined = AbilityUtils.getDefinedPlayers(hostCard, sa.getParam("Controller"), sa);
|
|
||||||
if (!defined.isEmpty()) {
|
|
||||||
controller = defined.getFirst();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (controller == null) {
|
|
||||||
controller = sa.getActivatingPlayer();
|
|
||||||
}
|
|
||||||
|
|
||||||
hostCard.clearClones();
|
hostCard.clearClones();
|
||||||
|
|
||||||
for (final Card c : tgtCards) {
|
for (final Card c : tgtCards) {
|
||||||
|
|||||||
Reference in New Issue
Block a user