public DeadIronSledge(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}"); this.subtype.add(SubType.EQUIPMENT); // Whenever equipped creature blocks or becomes blocked by a creature, destroy both creatures. this.addAbility(new DeadIronSledgeTriggeredAbility()); // Equip {2} this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); }
public int reduceCost(int genericManaToReduce) { int amountToReduce = genericManaToReduce; boolean foundCostToReduce = false; if (buybackCost != null) { for (Object cost : ((Costs) buybackCost)) { if (cost instanceof ManaCostsImpl) { for (Object c : (ManaCostsImpl) cost) { if (c instanceof GenericManaCost) { int newCostCMC = ((GenericManaCost) c).convertedManaCost() - amountToReduceBy - genericManaToReduce; foundCostToReduce = true; if (newCostCMC > 0) { amountToReduceBy += genericManaToReduce; } else { amountToReduce = ((GenericManaCost) c).convertedManaCost() - amountToReduceBy; amountToReduceBy = ((GenericManaCost) c).convertedManaCost(); } } } } } } if (foundCostToReduce) { return amountToReduce; } return 0; }
@Override public void assignPayment(Game game, Ability ability, ManaPool pool, Cost costsToPay) { this.assignGeneric(ability, game, pool, mana, costsToPay); }
@Override public GenericManaCost getUnpaid() { GenericManaCost unpaid = new GenericManaCost(mana - this.payment.count()); if (sourceFilter != null) { unpaid.setSourceFilter(sourceFilter); } return unpaid; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Spell targetSpell = game.getStack().getSpell(source.getFirstTarget()); if (targetSpell != null) { Player controllerOfTargetedSpell = game.getPlayer(targetSpell.getControllerId()); if (controller != null && controllerOfTargetedSpell != null) { int numToDiscard = controller.getAmount(0, controller.getHand().size(), "How many cards do you want to discard?", game); Cards discardedCards = controller.discard(numToDiscard, false, source, game); int actualNumberDiscarded = discardedCards.size(); GenericManaCost cost = new GenericManaCost(actualNumberDiscarded * 3); if (controllerOfTargetedSpell.chooseUse(Outcome.AIDontUseIt, "Do you want to pay " + cost.convertedManaCost() + " to prevent " + targetSpell.getName() + " from gettting countered?", source, game) && cost.pay(source, game, source.getSourceId(), controllerOfTargetedSpell.getId(), false)) { return true; } else { targetSpell.counter(source.getSourceId(), game); return true; } } } return false; } }
int amount = source.getManaCostsToPay().getX(); if (amount > 0) { GenericManaCost cost = new GenericManaCost(amount); String sb = String.valueOf("Pay " + cost.getText()) + Character.toString('?'); if (player.chooseUse(Outcome.Benefit, sb, source, game)) { if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) { game.informPlayers(sourceObject.getName() + ": additional cost was paid"); return true;
@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; if (player.getHand().count(filter, game) > 0 && player.chooseUse(Outcome.Benefit, "Reveal a Merfolk card? Otherwise pay {3}.", ability, game)) { TargetCardInHand target = new TargetCardInHand(filter); if (player.choose(Outcome.Benefit, target, sourceId, game)) { Card card = player.getHand().get(target.getFirstTarget(), game); if (card != null) { paid = true; player.revealCards("Revealed card", new CardsImpl(card), game); } } } else { mana.clearPaid(); if (mana.pay(ability, game, player.getId(), player.getId(), false)) { paid = true; } } return paid; }
@Override public boolean isPaid() { if (paid) { return true; } return this.isColorlessPaid(mana); }
@Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { Player player = game.getPlayer(controllerId); if (player != null && player.getHand().count(filter, game) > 0) { return true; } if (mana.canPay(ability, sourceId, controllerId, game)) { return true; } return false; }
public ManaTithe(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}"); // Counter target spell unless its controller pays {1}. this.getSpellAbility().addTarget(new TargetSpell()); this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(1))); }
public UnknownShores(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.LAND},""); // {T}: Add {C}. this.addAbility(new ColorlessManaAbility()); // {1}, {T}: Add one mana of any color. Ability ability = new AnyColorManaAbility(new GenericManaCost(1)); ability.addCost(new TapSourceCost()); this.addAbility(ability); }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player == null) { return false; } return new SacrificeSourceUnlessPaysEffect( new GenericManaCost(player.getHand().size()) ).apply(game, source); } }
public CandlesOfLeng(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); // {4}, {tap}: Reveal the top card of your library. If it has the same name as a card in your graveyard, put it into your graveyard. Otherwise, draw a card. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CandlesOfLengEffect(), new GenericManaCost(4)); ability.addCost(new TapSourceCost()); this.addAbility(ability); }
public JayemdaeTome(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new GenericManaCost(4)); ability.addCost(new TapSourceCost()); this.addAbility(ability); }
public Convolute(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}"); // Counter target spell unless its controller pays {4}. this.getSpellAbility().addTarget(new TargetSpell()); this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(4))); }
public TransguildPromenade(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); // Transguild Promenade enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); // When Transguild Promenade enters the battlefield, sacrifice it unless you pay {1}. this.addAbility(new EntersBattlefieldTriggeredAbility( new SacrificeSourceUnlessPaysEffect(new GenericManaCost(1)).setText("sacrifice it unless you pay {1}") )); // {T}: Add one mana of any color. this.addAbility(new AnyColorManaAbility()); }
public BoneFlute(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); // {2}, {tap}: All creatures get -1/-0 until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -0, Duration.EndOfTurn), new GenericManaCost(2)); ability.addCost(new TapSourceCost()); this.addAbility(ability); }
public GolgariSignet (UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 1, 0, 0, 1, 0, 0, 0), new GenericManaCost(1)); ability.addCost(new TapSourceCost()); this.addAbility(ability); }
@Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { Player controller = game.getPlayer(controllerId); if (controller == null) { return false; } int convertedCost = amount.calculate(game, ability, null); Cost cost = new GenericManaCost(convertedCost); return cost.canPay(ability, sourceId, controllerId, game); }
public SelesnyaSignet (UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 1, 0, 1, 0, 0, 0, 0), new GenericManaCost(1)); ability.addCost(new TapSourceCost()); this.addAbility(ability); }