@Override public boolean apply(Game game, Ability source) { for (UUID targetPlayerId : targetPointer.getTargets(game, source)) { Player player = game.getPlayer(targetPlayerId); if (player != null) { player.discard(amount.calculate(game, source, this), randomDiscard, source, game); } } return true; }
@Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { Player player = game.getPlayer(controllerId); if (player != null) { for (Card card : player.getHand().getCards(game)) { player.discard(card, ability, game); } paid = true; } return paid; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { controller.drawCards(2, game); controller.discard(1, false, source, game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); if (targetPlayer != null) { targetPlayer.drawCards(1, game); targetPlayer.discard(1, false, source, game); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { int amount = player.getHand().getCards(game).size(); player.discard(amount, false, source, game); player.drawCards(amount, game); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null && player.chooseUse(Outcome.DrawCard, "Do you wish to draw a card? If you do, discard a card.", source, game)) { if (player.drawCards(1, game) > 0) { player.discard(1, source, game); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { for (Card card : player.getHand().getCards(game)) { player.discard(card, source, game); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null && player.chooseUse(Outcome.DrawCard, "Do you wish to draw a card? If you do, discard a card.", source, game)) { if (player.drawCards(1, game) > 0) { player.discard(1, source, game); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { for (Card card : player.getHand().getCards(game)) { player.discard(card, 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) { int value = player.getCounters().getCount(CounterType.POISON); if (value > 0) { player.discard(value, source, game); return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); if (player != null) { player.drawCards(cardsToDraw, game); player.discard(cardsToDiscard, source, game); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { if (!optional || player.chooseUse(outcome, "Use draw, then discard effect?", source, game)) { player.drawCards(cardsToDraw, game); player.discard(cardsToDiscard, false, source, game); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getFirstTarget()); if (player != null) { Set<Card> cards = player.getHand().getCards(game); for (Card card : cards) { player.discard(card, source, game); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); if (permanent != null) { Player player = game.getPlayer(permanent.getControllerId()); if (player != null) { player.discard(1, false, source, game); return true; } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { for (Card card : player.getHand().getCards(game)) { player.discard(card, source, game); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); if (targetPlayer != null) { int damage = (Integer)getValue("damage"); targetPlayer.discard(damage, false, source, game); game.informPlayers(targetPlayer.getLogName() + "discards " + damage + " card(s)"); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player you = game.getPlayer(source.getControllerId()); Player damagedPlayer = game.getPlayer(targetPointer.getFirst(game, source)); if (damagedPlayer != null) { damagedPlayer.discard(1, source, game); } if (you != null) { you.drawCards(1, game); } return true; }
@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null) { Player you = game.getPlayer(source.getControllerId()); if (you != null) { you.discard(permanent.getToughness().getValue(), false, source, game); } } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int cardsInHand = controller.getHand().size(); controller.discard(cardsInHand, false, source, game); controller.drawCards(cardsInHand, game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getFirstTarget()); if(player != null) { int handCount = player.getHand().count(new FilterCard(), game); player.drawCards(handCount, game); player.discard(handCount, false, source, game); } return false; } }