Package mage.players

Examples of mage.players.Player.drawCards()


    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
        if (player != null && permanent != null
                && (permanent.getColor().isBlack() || permanent.getColor().isBlue())) {
            player.drawCards(1, game);
            return true;
        }
        return false;
    }
}
View Full Code Here


    public boolean apply(Game game, Ability source) {
        Permanent p = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
        Player player = game.getPlayer(source.getControllerId());
        if (p != null && player != null) {
            int count = p.getCounters().getCount(CounterType.CHARGE);
            player.drawCards(count, game);
            return true;
        }
        return false;
    }
View Full Code Here

                }
                if (flipsWon > 1) {
                    new DamagePlayersEffect(6, TargetController.OPPONENT).apply(game, source);
                }
                if (flipsWon > 2) {
                    controller.drawCards(9, game);
                    new UntapAllLandsControllerEffect().apply(game, source);
                }
            } else {
                game.informPlayers("Fiery Gambit had no effect");
            }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            Card card = controller.getLibrary().getFromTop(game);
            controller.drawCards(1, game);
            controller.revealCards("Fa'adiyah Seer", new CardsImpl(card), game);
            if (!filter.match(card, game)) {
                controller.discard(card, source, game);
            }
            return true;
View Full Code Here

            Set<Card> cardsInHand = player.getHand().getCards(game);
            int amount = cardsInHand.size();
            for (Card card : cardsInHand) {
                player.discard(card, source, game);
            }
            player.drawCards(amount, game);
            return true;
        }
        return false;
    }
}
View Full Code Here

        if (permanent != null) {
            if (permanent.sacrifice(source.getSourceId(), game)) {
                for (UUID uuid : game.getOpponents(this.getTargetPointer().getFirst(game, source))) {
                    Player player = game.getPlayer(uuid);
                    if (player != null) {
                        player.drawCards(3, game);
                    }
                }
                return true;
            }
        }
View Full Code Here

            }
            if (xSum > 0) {
                for(UUID playerId : controller.getInRange()) {
                    Player player = game.getPlayer(playerId);
                    if (player != null) {
                        player.drawCards(xSum, game);
                    }
                }
               
            }
            // prevent undo
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
      Player player = game.getPlayer(source.getControllerId());
      if (player != null) {
          player.drawCards(1, game);
          Target target = new TargetCardInHand(new FilterCard("card to exile"));
          if (player.chooseTarget(outcome, target, source, game)) {
              Card card = game.getCard(target.getFirstTarget());
              MageObject sourceObject = game.getObject(source.getSourceId());             
              if (card != null && sourceObject != null) {
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            do {
                controller.loseLife(2, game);
                controller.drawCards(2, game);
            } while (controller.isInGame() && ClashEffect.getInstance().apply(game, source));
            return true;
        }
        return false;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player you = game.getPlayer(source.getControllerId());
        you.discardToMax(game);
        you.drawCards(7, game);
        Cards hand = you.getHand();
        for (int i = 0; i < 3; i++) {
            Card card = hand.getRandom(game);
            if (card != null) {
                you.discard(card, source, game);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.