@Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { Player controller = game.getPlayer(controllerId); if (controller != null) { return !controller.getHand().isEmpty(); } return false; }
@Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { Player controller = game.getPlayer(controllerId); return (controller != null && !controller.getHand().isEmpty()); }
@Override public Card discardOne(boolean random, Ability source, Game game) { Cards cards = discard(1, random, source, game); if (cards.isEmpty()) { return null; } return cards.getRandom(game); }
@Override public boolean apply(Game game, Ability source) { return game.getPlayer(source.getControllerId()).getHand().isEmpty(); }
@Override public boolean apply(Game game, Ability source) { return game.getPlayer(game.getActivePlayerId()).getHand().isEmpty(); }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getPlayerId().equals(source.getControllerId())) { Player player = game.getPlayer(event.getPlayerId()); if(player != null) { if (player.getHand().isEmpty()) { return true; } } } return false; } }
@Override public boolean applies(Permanent permanent, Ability source, Game game) { if (permanent.getId().equals(source.getSourceId())) { for (Player player : game.getPlayers().values()) { if (player != null && player.getHand().isEmpty()) { return false; } } return true; } // don't apply for all other creatures! return false; }
@Override public boolean chooseTarget(Outcome outcome, Cards cards, TargetCard target, Ability source, Game game) { if (cards.isEmpty()) { return !target.isRequired(source); } Card card = cards.getRandom(game); if (card != null) { target.addTarget(card.getId(), source, game); return true; } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { for (UUID playerId : game.getState().getPlayersInRange(controllerId, game)) { Player player = game.getPlayer(playerId); if (player != null && player.getHand().isEmpty()) { return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { boolean result = false; Set<UUID> opponents = game.getOpponents(source.getControllerId()); for (UUID opponentId : opponents) { result |= game.getPlayer(opponentId).getHand().isEmpty(); } return result; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Cards cards = controller.discard(1, false, source, game); if (!cards.isEmpty()) { controller.drawCards(1, game); } return true; } return false; } }
@Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify.getSourceId().equals(source.getSourceId())) { for (UUID playerId : game.getOpponents(source.getControllerId())) { Player opponent = game.getPlayer(playerId); if (opponent != null && opponent.getHand().isEmpty()) { return true; } } } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (game.getOpponents(controllerId).contains(event.getPlayerId())) { Player opponent = game.getPlayer(event.getPlayerId()); if (opponent != null && opponent.getHand().isEmpty()) { opponent.loseLife(2, game, false); return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { Player attacker = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (attacker != null) { if (!attacker.getHand().isEmpty() && attacker.chooseUse(outcome, "Discard a card and draw a card?", source, game)){ attacker.discard(1, false, source, game); attacker.drawCards(1, game); } return true; } return false; } }
@Override public ManaCosts getManaCostToPay(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && !controller.getHand().isEmpty()) { ManaCosts manaCosts = new ManaCostsImpl(); manaCosts.add(new GenericManaCost(controller.getHand().size())); return manaCosts; } return null; }
@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 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) { Player player = game.getPlayer(source.getControllerId()); Permanent thoughtGorger = game.getPermanent(source.getSourceId()); if (player != null && !player.getHand().isEmpty() && thoughtGorger != null ) { int cardsInHand = player.getHand().size(); thoughtGorger.addCounters(CounterType.P1P1.createInstance(cardsInHand), source, game); player.discard(cardsInHand, false, 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); } } } } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Cards cardsToExile = new CardsImpl(getTargetPointer().getTargets(game, source)); controller.moveCards(cardsToExile, Zone.EXILED, source, game); if (!cardsToExile.isEmpty()) { new ZombieToken().putOntoBattlefield(cardsToExile.size(), game, source.getSourceId(), controller.getId()); } return true; } return false; } }