1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-13 01:01:11 -09:00
This commit is contained in:
jeffwadsworth 2019-11-25 09:56:52 -06:00
parent 4468a1abc6
commit 6fd98b4fd4

View file

@ -6,7 +6,6 @@ import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CopyEffect;
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect; import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -105,21 +104,21 @@ class IdentityThiefEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget()); Permanent permanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (controller != null && permanent != null && sourcePermanent != null) { if (controller != null
CopyEffect copyEffect = new CopyEffect(Duration.EndOfTurn, permanent, source.getSourceId()); && permanent != null
if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) { && sourcePermanent != null) {
// Copy exiled permanent game.copyPermanent(permanent, sourcePermanent.getId(), source, null);
game.addEffect(copyEffect, source); if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), sourcePermanent.getIdName(),
// Create delayed triggered ability source.getSourceId(), game, Zone.BATTLEFIELD, true)) {
Effect effect = new ReturnToBattlefieldUnderOwnerControlTargetEffect(); Effect effect = new ReturnToBattlefieldUnderOwnerControlTargetEffect();
effect.setText("Return the exiled card to the battlefield under its owner's control at the beginning of the next end step"); effect.setText("Return the exiled card to the battlefield under its owner's control at the beginning of the next end step");
effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game)); effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect), source); game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect), source);
return true;
} }
return true;
} }
return false; return false;
} }