public void clear() { getTargets().clearChosen(); this.manaCosts.clearPaid(); this.costs.clearPaid(); }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + '?', source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)){ return true; } } player.lost(game); return true; } return false; }
private boolean handleManaCosts(ManaCosts attackBlockManaTax, GameEvent event, Ability source, Game game) { Player player = game.getPlayer(event.getPlayerId()); if (player != null) { String chooseText; if (event.getType() == EventType.DECLARE_ATTACKER) { chooseText = "Pay " + attackBlockManaTax.getText() + " to attack?"; } else { chooseText = "Pay " + attackBlockManaTax.getText() + " to block?"; } attackBlockManaTax.clearPaid(); if (attackBlockManaTax.canPay(source, source.getSourceId(), player.getId(), game) && player.chooseUse(Outcome.Neutral, chooseText, source, game)) { if (attackBlockManaTax instanceof ManaCostsImpl) { if (attackBlockManaTax.payOrRollback(source, game, source.getSourceId(), event.getPlayerId())) { return false; } } } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller == null || !controller.chooseUse(Outcome.PutCreatureInPlay, choiceText, source, game)) { return false; } TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard()); if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); ManaCosts<ManaCost> reducedCost = ManaCosts.removeVariableManaCost(CardUtil.reduceCost(card.getManaCost(), 2)); if (controller.chooseUse(Outcome.Benefit, String.valueOf("Pay " + reducedCost.getText()) + Character.toString('?'), source, game)) { reducedCost.clearPaid(); if (reducedCost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { return true; } } Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { permanent.sacrifice(source.getSourceId(), game); } return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { ManaCosts cost = new ManaCostsImpl("{5}{R}{R}"); if (player.chooseUse(Outcome.Damage, "Pay " + cost.getText() + '?', source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { new UntapAllControllerEffect(new FilterAttackingCreature(),"").apply(game, source); game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); return true; } } } return false; }