@Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { Player controller = game.getPlayer(controllerId); return controller != null && (controller.getLife() < 1 || controller.canPayLifeCost()); }
@Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { Player controller = game.getPlayer(controllerId); return controller != null && (controller.getLife() < 1 || controller.canPayLifeCost()); }
@Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { Player controller = game.getPlayer(controllerId); return controller != null && (controller.getLife() < 1 || controller.canPayLifeCost()); }
@Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { Player player = game.getPlayer(controllerId); if (player != null && player.canPayLifeCost() && player.getLife() >= 1) { return true; } return false; }
@Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { //118.4. If a cost or effect allows a player to pay an amount of life greater than 0, //the player may do so only if their life total is greater than or equal to the //amount of the payment. If a player pays life, the payment is subtracted from his or //her life total; in other words, the player loses that much life. (Players can always pay 0 life.) int lifeToPayAmount = amount.calculate(game, ability, null); // Paying 0 life is not considered paying any life. if (lifeToPayAmount > 0 && !game.getPlayer(controllerId).canPayLifeCost()) { return false; } return game.getPlayer(controllerId).getLife() >= lifeToPayAmount || lifeToPayAmount == 0; }
@Override public int getMaxValue(Ability source, Game game) { int maxValue = 0; Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { // Paying 0 life is not considered paying any life, so paying 0 is still allowed if (game.getPlayer(source.getControllerId()).canPayLifeCost()) { maxValue = controller.getLife(); } } return maxValue; }
@Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { Player player = game.getPlayer(controllerId); if (player == null) { return false; } paid = false; manaCost.clearPaid(); if (manaCost.pay(ability, game, player.getId(), player.getId(), false) && player.canPayLifeCost() && player.getLife() >= 1 && lifeCost.pay(ability, game, player.getId(), player.getId(), false)) { paid = true; } return paid; }
this.canPayLifeCost = player.canPayLifeCost(); this.sacrificeCostFilter = player.getSacrificeCostFilter() != null ? player.getSacrificeCostFilter().copy() : null; this.loseByZeroOrLessLife = player.canLoseByZeroOrLessLife();
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(source.getFirstTarget()); if (controller != null && targetPlayer != null) { Card card = targetPlayer.getLibrary().getFromTop(game); if (card != null) { MageObject sourceObject = game.getObject(source.getSourceId()); controller.lookAtCards(sourceObject != null ? sourceObject.getName() : "", new CardsImpl(card), game); if (!card.isLand() && controller.canPayLifeCost() && controller.getLife() >= 2 && controller.chooseUse(Outcome.Neutral, "Pay 2 life to put " + card.getLogName() + " into graveyard?", source, game)) { controller.loseLife(2, game, false); controller.moveCards(card, Zone.GRAVEYARD, source, game); } return true; } } return false; }
Card card = cards.get(cardId, game); if (card != null) { if (controller.canPayLifeCost() && controller.getLife() >= 4 && controller.chooseUse(outcome, "Pay 4 life for " + card.getLogName() + "? (Otherwise it's put on top of your library)", source, game)) {
if (otherPlayer.canPayLifeCost() && otherPlayer.getLife() >= 2) { PayLifeCost lifeCost = new PayLifeCost(2);