diff --git a/Mage.Sets/src/mage/sets/innistrad/CacklingCounterpart.java b/Mage.Sets/src/mage/sets/innistrad/CacklingCounterpart.java index 391c2dd5bd..f6c0e7328a 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CacklingCounterpart.java +++ b/Mage.Sets/src/mage/sets/innistrad/CacklingCounterpart.java @@ -32,13 +32,14 @@ import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.Constants.TimingRule; +import mage.Constants.Zone; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlashbackAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.sets.tokens.EmptyToken; import mage.target.common.TargetControlledCreaturePermanent; import mage.util.CardUtil; @@ -85,10 +86,13 @@ class CacklingCounterpartEffect extends OneShotEffect @Override public boolean apply(Game game, Ability source) { - Card card = game.getCard(this.targetPointer.getFirst(game, source)); - if (card != null) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent == null) { + permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); + } + if (permanent != null) { EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(card); + CardUtil.copyTo(token).from(permanent); token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); return true; } diff --git a/Mage.Sets/src/mage/sets/returntoravnica/PackRat.java b/Mage.Sets/src/mage/sets/returntoravnica/PackRat.java index 6c0136d4e8..43bb600be7 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/PackRat.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/PackRat.java @@ -31,6 +31,7 @@ import java.util.UUID; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -119,10 +120,13 @@ class PackRatEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent packRat = game.getPermanent(source.getSourceId()); - if (packRat != null) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent == null) { + permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); + } + if (permanent != null) { EmptyToken newToken = new EmptyToken(); - CardUtil.copyTo(newToken).from(packRat); + CardUtil.copyTo(newToken).from(permanent); return newToken.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); } return false; diff --git a/Mage.Sets/src/mage/sets/zendikar/RiteOfReplication.java b/Mage.Sets/src/mage/sets/zendikar/RiteOfReplication.java index e60989e190..7a83ba9ff3 100644 --- a/Mage.Sets/src/mage/sets/zendikar/RiteOfReplication.java +++ b/Mage.Sets/src/mage/sets/zendikar/RiteOfReplication.java @@ -31,14 +31,15 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.abilities.Ability; import mage.abilities.condition.common.KickedCondition; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.KickerAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.sets.tokens.EmptyToken; import mage.target.common.TargetCreaturePermanent; import mage.util.CardUtil; @@ -96,10 +97,13 @@ class RiteOfReplicationEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Card card = game.getCard(source.getFirstTarget()); - if (card != null) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent == null) { + permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); + } + if (permanent != null) { EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(card); + CardUtil.copyTo(token).from(permanent); token.putOntoBattlefield(amount, game, source.getSourceId(), source.getControllerId()); return true; }