mirror of
https://github.com/correl/mage.git
synced 2025-04-13 01:01:11 -09:00
Fixed #6028
This commit is contained in:
parent
4468a1abc6
commit
6fd98b4fd4
1 changed files with 8 additions and 9 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue