public MeldCard(final MeldCard card) { super(card); this.topHalfCard = card.topHalfCard; this.bottomHalfCard = card.bottomHalfCard; this.topLastZoneChangeCounter = card.topLastZoneChangeCounter; this.bottomLastZoneChangeCounter = card.bottomLastZoneChangeCounter; this.halves = new CardsImpl(card.halves); this.isMelded = card.isMelded; }
public PlayerImpl(String name, RangeOfInfluence range) { this(UUID.randomUUID()); this.name = name; this.range = range; hand = new CardsImpl(); graveyard = new Graveyard(); abilities = new AbilitiesImpl<>(); counters = new Counters(); manaPool = new ManaPool(playerId); library = new Library(playerId); sideboard = new CardsImpl(); }
@Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { Player player = game.getPlayer(controllerId); Permanent sourcePermanent = game.getPermanent(sourceId); if (player != null && sourcePermanent != null) { paid = true; player.putCardsOnBottomOfLibrary(new CardsImpl(sourcePermanent), game, ability, false); } return paid; }
private void chooseAndSearchLibrary(List<Player> usingPlayers, Player player, Ability source, Game game) { if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for up to two basic land cards and put them onto the battlefield?", source, game)) { usingPlayers.add(player); TargetCardInLibrary target = new TargetCardInLibrary(0, 2, StaticFilters.FILTER_CARD_BASIC_LAND); if (player.searchLibrary(target, game)) { if (!target.getTargets().isEmpty()) { player.moveCards(new CardsImpl(target.getTargets()), Zone.BATTLEFIELD, source, game); } } } }
@Override public void doOpeningHandAction(Card card, Player player, Game game) { Cards cards = new CardsImpl(); cards.add(card); player.revealCards(card.getName(), cards, game); this.resolve(game); } }
@Override public boolean lookAtFaceDownCard(Card card, Game game ) { if (null != game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.LOOK_AT_FACE_DOWN, card.getSpellAbility(), this.getId(), game)) { if (chooseUse(Outcome.Benefit, "Look at that card?", null, game)) { Cards cards = new CardsImpl(card); this.lookAtCards(getName() + " - " + sdf.format(System.currentTimeMillis()), cards, game); return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.putCardsOnBottomOfLibrary(new CardsImpl(card), game, source, true); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { return controller.moveCards(new CardsImpl(getTargetPointer().getTargets(game, source)), Zone.HAND, source, game); } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { controller.moveCards(new CardsImpl(this.getTargetPointer().getTargets(game, source)), Zone.LIBRARY, source, game); controller.shuffleLibrary(source, game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { if (controller.searchLibrary(target, game)) { controller.moveCards(new CardsImpl(target.getTargets()), Zone.GRAVEYARD, source, game); } controller.shuffleLibrary(source, game); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Cards cards = new CardsImpl(source.getTargets().get(1).getTargets()); controller.putCardsOnTopOfLibrary(cards, game, source, true); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { controller.moveCards(new CardsImpl(this.getTargetPointer().getTargets(game, source)), Zone.LIBRARY, source, game); controller.shuffleLibrary(source, game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(source.getFirstTarget()); if (targetPlayer != null) { Cards cards = new CardsImpl(source.getTargets().get(1).getTargets()); targetPlayer.moveCards(cards, Zone.LIBRARY, source, game); targetPlayer.shuffleLibrary(source, game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); if (targetPlayer != null) { Cards cards = new CardsImpl(); cards.addAll(targetPlayer.getLibrary().getTopCards(game, amount)); return targetPlayer.moveCards(cards, Zone.EXILED, source, game); } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Cards cards = new CardsImpl(source.getTargets().get(0).getTargets()); game.getState().setValue(CardUtil.getCardZoneString("ParadoxicalOutcomeEffect", source.getSourceId(), game), cards.size()); controller.moveCards(new CardsImpl(source.getTargets().get(0).getTargets()), Zone.HAND, source, game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(game, source)); if (player != null && !player.getHand().isEmpty()) { Cards revealed = new CardsImpl(); revealed.add(player.getHand().getRandom(game)); player.revealCards("Hired Torturer", revealed, game); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { CardsImpl libraryCards = new CardsImpl(); libraryCards.addAll(player.getLibrary().getCards(game)); player.moveCards(libraryCards, Zone.HAND, source, game); } } return true; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(game, source)); if (player != null && !player.getHand().isEmpty()) { Cards revealed = new CardsImpl(); revealed.add(player.getHand().getRandom(game)); player.revealCards("Merfolk Spy", revealed, game); return true; } return false; }
@Override public void lookAtAllLibraries(Ability source, Game game) { for (UUID playerId : game.getState().getPlayersInRange(this.getId(), game)) { Player player = game.getPlayer(playerId); String playerName = this.getName().equals(player.getName()) ? "Your " : player.getName() + "'s "; playerName += "library"; Cards cardsInLibrary = new CardsImpl(player.getLibrary().getTopCards(game, player.getLibrary().size())); lookAtCards(playerName, cardsInLibrary, game); } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { TargetCard target = new TargetCardInHand(0, 2, new FilterLandCard("up to two land cards to put onto the battlefield tapped")); controller.chooseTarget(outcome, controller.getHand(), target, source, game); return controller.moveCards(new CardsImpl(target.getTargets()).getCards(game), Zone.BATTLEFIELD, source, game, true, false, false, null); } return false; }