@Override public CopyEffect copy() { return new CopyEffect(this); }
@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { game.addEffect(new CopyEffect(Duration.Custom, new AngelVigilanceToken(), event.getTargetId()), source); return false; }
@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (sourceObject != null) { Permanent permanentReset = sourceObject.copy(); permanentReset.getCounters(game).clear(); permanentReset.getPower().resetToBaseValue(); permanentReset.getToughness().resetToBaseValue(); game.addEffect(new CopyEffect(Duration.Custom, permanentReset, event.getTargetId()), source); } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (player != null && sourcePermanent != null) { if (player.searchLibrary(target, game)) { for (UUID cardId : target.getTargets()) { Card card = player.getLibrary().getCard(cardId, game); if (card != null) { player.moveCards(card, Zone.GRAVEYARD, source, game); CopyEffect copyEffect = new CopyEffect(Duration.EndOfTurn, card, source.getSourceId()); game.addEffect(copyEffect, source); } } } player.shuffleLibrary(source, game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { Target target = new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard")); target.setNotTarget(true); if (target.canChoose(source.getControllerId(), game)) { player.choose(outcome, target, source.getSourceId(), game); Card copyFromCard = game.getCard(target.getFirstTarget()); if (copyFromCard != null) { CopyEffect copyEffect = new CopyEffect(Duration.Custom, copyFromCard, source.getSourceId()); game.addEffect(copyEffect, source); } } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player activePlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source)); MageObject sourceObject = game.getObject(source.getSourceId()); if (activePlayer != null && sourceObject != null) { Card card = activePlayer.getLibrary().getFromTop(game); if (card != null) { activePlayer.revealCards(sourceObject.getIdName(), new CardsImpl(card), game); if (card.isCreature()) { activePlayer.moveCards(activePlayer.getLibrary().getTopCards(game, 1), Zone.GRAVEYARD, source, game); CopyEffect copyEffect = new CopyEffect(Duration.Custom, card, source.getSourceId()); game.addEffect(copyEffect, source); } } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); if (targetPlayer != null) { TargetCard targetCard = new TargetCard(0, 1, Zone.HAND, new FilterCreatureCard()); controller.choose(outcome, targetPlayer.getHand(), targetCard, game); Card copyFromCard = game.getCard(targetCard.getFirstTarget()); if (copyFromCard != null) { game.informPlayers(controller.getLogName() + " chooses to copy " + copyFromCard.getName()); CopyEffect copyEffect = new CopyEffect(Duration.Custom, copyFromCard, source.getSourceId()); game.addEffect(copyEffect, source); } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent lazavTheMultifarious = game.getPermanent(source.getSourceId()); Permanent newBluePrint = null; if (controller != null && lazavTheMultifarious != null) { Card copyFromCard = game.getCard(source.getFirstTarget()); if (copyFromCard != null) { newBluePrint = new PermanentCard(copyFromCard, source.getControllerId(), game); newBluePrint.assignNewId(); ApplyToPermanent applier = new LazavTheMultifariousApplier(); applier.apply(game, newBluePrint, source, lazavTheMultifarious.getId()); CopyEffect copyEffect = new CopyEffect(Duration.Custom, newBluePrint, lazavTheMultifarious.getId()); copyEffect.newId(); copyEffect.setApplier(applier); Ability newAbility = source.copy(); copyEffect.init(newAbility, game); game.addEffect(copyEffect, newAbility); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent lazavDimirMastermind = game.getPermanent(source.getSourceId()); Permanent newBluePrint = null; if (controller != null && lazavDimirMastermind != null) { Card copyFromCard = game.getCard(((FixedTarget) getTargetPointer()).getTarget()); if (copyFromCard != null) { newBluePrint = new PermanentCard(copyFromCard, source.getControllerId(), game); newBluePrint.assignNewId(); ApplyToPermanent applier = new LazavDimirMastermindApplier(); applier.apply(game, newBluePrint, source, lazavDimirMastermind.getId()); CopyEffect copyEffect = new CopyEffect(Duration.Custom, newBluePrint, lazavDimirMastermind.getId()); copyEffect.newId(); copyEffect.setApplier(applier); Ability newAbility = source.copy(); copyEffect.init(newAbility, game); game.addEffect(copyEffect, newAbility); } return true; } return false; } }
CopyEffect newEffect = new CopyEffect(duration, newBluePrint, copyToPermanentId); newEffect.newId(); newEffect.setApplier(applier);
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent dimirDoppelganger = game.getPermanent(source.getSourceId()); Permanent newBluePrint = null; if (controller != null && dimirDoppelganger != null) { Card copyFromCard = game.getCard(source.getFirstTarget()); if (copyFromCard != null) { Cards cardsToExile = new CardsImpl(); cardsToExile.add(copyFromCard); controller.moveCards(cardsToExile, Zone.EXILED, source, game); newBluePrint = new PermanentCard(copyFromCard, source.getControllerId(), game); newBluePrint.assignNewId(); ApplyToPermanent applier = new DimirDoppelgangerApplier(); applier.apply(game, newBluePrint, source, dimirDoppelganger.getId()); CopyEffect copyEffect = new CopyEffect(Duration.Custom, newBluePrint, dimirDoppelganger.getId()); copyEffect.newId(); copyEffect.setApplier(applier); Ability newAbility = source.copy(); copyEffect.init(newAbility, game); game.addEffect(copyEffect, newAbility); } return true; } return false; } }
newBluePrint = new PermanentCard(copyFromCard, source.getControllerId(), game); newBluePrint.assignNewId(); CopyEffect copyEffect = new CopyEffect(Duration.EndOfTurn, newBluePrint, permanent.getId()); copyEffect.newId(); Ability newAbility = source.copy();
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getFirstTarget()); Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (controller != null && permanent != null && sourcePermanent != null) { Permanent permanentReset = permanent.copy(); permanentReset.getCounters(game).clear(); permanentReset.getPower().resetToBaseValue(); permanentReset.getToughness().resetToBaseValue(); CopyEffect copyEffect = new CopyEffect(Duration.EndOfTurn, permanentReset, source.getSourceId()); if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) { // Copy exiled permanent game.addEffect(copyEffect, source); // Create delayed triggered ability 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.setTargetPointer(new FixedTarget(source.getFirstTarget(), game)); game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect), source); return true; } } return false; }
cardsToExile.add(cardForCounters); controller.moveCards(cardsToExile, Zone.EXILED, source, game); CopyEffect copyEffect = new CopyEffect(Duration.Custom, cardToCopy, source.getSourceId()); game.addEffect(copyEffect, source); permanent.addCounters(CounterType.P1P1.createInstance(cardForCounters.getPower().getValue()), source, game);