@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { CardUtil.reduceCost(abilityToModify, new DomainValue().calculate(game, source, this)); return true; }
@Override public void init(Ability source, Game game) { super.init(source, game); amountToPrevent = new DomainValue().calculate(game, source, this); }
@Override public boolean apply(Game game, Ability source, Ability abilityToModify) { CardUtil.reduceCost(abilityToModify, new DomainValue(2).calculate(game, source, this)); return true; }
@Override protected int getInputValue(Game game, Ability source) { return new DomainValue(1, game.getActivePlayerId()).calculate(game, source, null); } }
@Override public ManaCosts getManaCostToPay(GameEvent event, Ability source, Game game) { int domainValue = new DomainValue().calculate(game, source, this); if (domainValue > 0) { return new ManaCostsImpl<>("{" + domainValue + '}'); } return null; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (player != null && permanent != null) { // The cost is reduced by {2} for each basic land type. int domainValueReduction = new DomainValue(2).calculate(game, source, this); int count = MAX_DOMAIN_VALUE - domainValueReduction; if (player.chooseUse(Outcome.Benefit, "Pay {" + count + "}? Or " + permanent.getName() + " will be sacrificed.", source, game)) { GenericManaCost cost = new GenericManaCost(count); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { return true; } } permanent.sacrifice(source.getSourceId(), game); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller == null) { return false; } Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, (new DomainValue()).calculate(game, source, this))); controller.lookAtCards(source, null, cards, game); if (!cards.isEmpty()) { if (cards.size() == 1) { controller.moveCards(cards, Zone.HAND, source, game); } else { TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand")); if (controller.choose(Outcome.DrawCard, cards, target, game)) { Card card = cards.get(target.getFirstTarget(), game); if (card != null) { cards.remove(card); controller.moveCards(card, Zone.HAND, source, game); } } controller.putCardsOnBottomOfLibrary(cards, game, source, true); } } return true; } }