예제 #1
0
 @Override
 public boolean apply(Game game, Ability source) {
   Player player = game.getPlayer(source.getControllerId());
   if (player != null) {
     TargetDiscard target = new TargetDiscard(player.getId());
     player.choose(Outcome.Discard, target, source.getSourceId(), game);
     Card card = player.getHand().get(target.getFirstTarget(), game);
     if (card != null) {
       player.discard(card, source, game);
       source.getEffects().get(1).setValue("discardedCard", card);
       game.getState().setValue(source.getSourceId().toString(), card);
       return true;
     }
   }
   return false;
 }
예제 #2
0
 @Override
 public boolean apply(Game game, Ability source) {
   Player player = game.getPlayer(source.getControllerId());
   if (player != null) {
     player.drawCards(1, game);
     TargetDiscard target = new TargetDiscard(player.getId());
     player.choose(Outcome.Discard, target, source.getSourceId(), game);
     Card card = player.getHand().get(target.getFirstTarget(), game);
     if (card != null) {
       player.discard(card, source, game);
       if (card.getCardType().contains(CardType.CREATURE)) {
         Permanent permanent = game.getPermanent(source.getSourceId());
         if (permanent != null) {
           permanent.untap(game);
           permanent.transform(game);
         }
       }
       return true;
     }
     return false;
   }
   return false;
 }