Package mage.players

Examples of mage.players.Player.gainLife()


        }
        if (creature != null) {
            int amount = creature.getToughness().getValue();
            Player player = game.getPlayer(source.getControllerId());
            if (player != null) {
        player.gainLife(amount, game);
            }
            return true;
        }
        return false;
    }
View Full Code Here


            if (permanent.destroy(source.getSourceId(), game, false)) {
                enchantmentsDestoyed++;
            }
        }
    if(enchantmentsDestoyed > 0) {
      controller.gainLife(enchantmentsDestoyed * 2, game);
    }
        return false;
    }
}
View Full Code Here

                }
                player.revealCards("cards", cards, game);
                for (Card card : cards.getCards(game)) {
                    chroma += card.getManaCost().getMana().getGreen();
                }
                player.gainLife(chroma * 2, game);
            }
        }
        return true;
    }
}
View Full Code Here

            target.setNotTarget(true);
            if (you.choose(Outcome.Sacrifice, target, source.getSourceId(), game)) {
                Permanent creature = game.getPermanent(target.getFirstTarget());
                if (creature != null) {
                    if (creature.sacrifice(source.getSourceId(), game)) {
                        you.gainLife(creature.getToughness().getValue(), game);
                        return true;
                    }
                }
            }
        }
View Full Code Here

                        numSacrificed++;
                    }
                }
            }
            if (numSacrificed > 0) {
                player.gainLife(3 * numSacrificed, game);
            }
            return true;
        }
        return false;
    }
View Full Code Here

            // add live now
            if (prevented > 0) {
                Player controller = game.getPlayer(source.getControllerId());
                if (controller != null) {
                    controller.gainLife(prevented, game);
                    game.informPlayers(new StringBuilder("Candles' Glow: Prevented ").append(prevented).append(" damage ").toString());
                    game.informPlayers(new StringBuilder("Candles' Glow: ").append(controller.getName()).append(" gained ").append(prevented).append("life").toString());
                }
            }
        }
View Full Code Here

        Cost cost = new GenericManaCost(1);
        cost.clearPaid();
        if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
            Player player = game.getPlayer(source.getControllerId());
            if (player != null) {
                player.gainLife(3, game);
                return true;
            }
        }
        return false;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent creature = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
        if (player != null && creature != null && creature.hasSubtype("Human")) {
            player.gainLife(creature.getToughness().getValue(), game);
            return true;
        }
        return false;
    }
}
View Full Code Here

        if (you != null && you.getLibrary().size() > 0) {
            Card card = you.getLibrary().removeFromTop(game);
            cards.add(card);
            you.revealCards("Sapling of Colfenor", cards, game);
            if (card.getCardType().contains(CardType.CREATURE)) {
                you.gainLife(card.getToughness().getValue(), game);
                you.loseLife(card.getPower().getValue(), game);
                return card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
            }
        }
        return false;
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            if (controller.flipCoin(game)) {
                game.informPlayers(controller.getName() + " got " + controller.gainLife(6, game)+ " live");
            }
        }
        return false;
    }
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.