@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); Player controller = game.getPlayer(source.getControllerId()); if (permanent != null && controller != null) { controller.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, false, true); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card card = game.getPermanent(source.getSourceId()); if (card != null) { controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.STACK, toTop, true); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getFirstTarget()); if (player != null) { for (Card card: player.getGraveyard().getCards(game)) { player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true); } player.shuffleLibrary(source, game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { for (Card card : controller.getGraveyard().getCards(game)) { controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true); } controller.shuffleLibrary(source, game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getFirstTarget()); if (player != null) { for (Card card: player.getGraveyard().getCards(game)) { player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true); } player.shuffleLibrary(source, game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { for (Card card: controller.getGraveyard().getCards(game)) { controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true); } controller.shuffleLibrary(source, game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (permanent != null) { Player owner = game.getPlayer(permanent.getOwnerId()); if (owner != null) { owner.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, true, true); owner.shuffleLibrary(source, game); return true; } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), source.getSourceId(), game)) { controller.moveCardToLibraryWithInfo(creature, source.getSourceId(), game, Zone.BATTLEFIELD, false, true); } return true; } return false; } }
@Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { Player controller = game.getPlayer(controllerId); TargetCardInHand targetCardInHand = new TargetCardInHand(); targetCardInHand.setRequired(false); Card card; if (targetCardInHand.canChoose(controllerId, game) && controller.choose(Outcome.PreventDamage, targetCardInHand, sourceId, game)) { card = game.getCard(targetCardInHand.getFirstTarget()); paid = card != null && controller.moveCardToLibraryWithInfo(card, sourceId, game, Zone.HAND, true, true); } return paid; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (player != null) { for (Card card: player.getGraveyard().getCards(game)) { player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true); } player.shuffleLibrary(source, game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (player != null) { for (Card card: player.getGraveyard().getCards(game)) { player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true); } player.shuffleLibrary(source, game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Card sourceCard = game.getCard(source.getSourceId()); if (controller != null && sourceCard != null) { if (game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) { controller.moveCardToLibraryWithInfo(sourceCard, source.getSourceId(), game, Zone.GRAVEYARD, true, true); } return true; } return false; } }
private boolean putOnLibrary(Player player, Ability source, Game game) { TargetCardInHand target = new TargetCardInHand(); if (target.canChoose(source.getSourceId(), player.getId(), game)) { player.chooseTarget(Outcome.ReturnToHand, target, source, game); Card card = player.getHand().get(target.getFirstTarget(), game); if (card != null) { return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false); } } return false; } }
private boolean putOnLibrary(Player player, Ability source, Game game) { TargetCardInHand target = new TargetCardInHand(); if (target.canChoose(source.getSourceId(), player.getId(), game)) { player.chooseTarget(Outcome.ReturnToHand, target, source, game); Card card = player.getHand().get(target.getFirstTarget(), game); if (card != null) { return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false); } } return false; } }
private boolean putOnLibrary(Player player, Ability source, Game game) { TargetCardInHand target = new TargetCardInHand(); if (target.canChoose(source.getSourceId(), player.getId(), game)) { player.chooseTarget(Outcome.ReturnToHand, target, source, game); Card card = player.getHand().get(target.getFirstTarget(), game); if (card != null) { return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false); } } return false; } }
private boolean putOnLibrary(Player player, Ability source, Game game) { TargetCardInHand target = new TargetCardInHand(); if (target.canChoose(source.getSourceId(), player.getId(), game)) { player.chooseTarget(Outcome.ReturnToHand, target, source, game); Card card = player.getHand().get(target.getFirstTarget(), game); if (card != null) { return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false); } } return false; } }
private boolean putOnLibrary(Player player, Ability source, Game game) { TargetCardInHand target = new TargetCardInHand(); if (target.canChoose(source.getSourceId(), player.getId(), game)) { player.chooseTarget(Outcome.ReturnToHand, target, source, game); Card card = player.getHand().get(target.getFirstTarget(), game); if (card != null) { return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false); } } return false; } }
private boolean putOnLibrary(Player player, Ability source, Game game) { TargetCardInHand target = new TargetCardInHand(); if (target.canChoose(source.getSourceId(), player.getId(), game)) { player.chooseTarget(Outcome.ReturnToHand, target, source, game); Card card = player.getHand().get(target.getFirstTarget(), game); if (card != null) { return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false); } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); DynamicValue value = new CardsInControllerGraveyardCount(); if (controller != null) { controller.gainLife(value.calculate(game, source, this) * 2, game, source); for (Card card: controller.getGraveyard().getCards(game)) { controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true); } controller.shuffleLibrary(source, game); return true; } return false; }
private void chooseCardInHandAndPutOnTopOfLibrary(Game game, Ability source, Player you, Player targetPlayer) { if (!targetPlayer.getHand().isEmpty()) { TargetCard target = new TargetCard(Zone.HAND, new FilterCard("card to put on the top of library (last chosen will be on top)")); if (you.choose(Outcome.Benefit, targetPlayer.getHand(), target, game)) { Card card = targetPlayer.getHand().get(target.getFirstTarget(), game); if (card != null) { targetPlayer.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false); } } } } }