@Override public ExileFromGraveCost copy() { return new ExileFromGraveCost(this); }
public ExileFromGraveCost(final ExileFromGraveCost cost) { super(cost); this.exiledCards.addAll(cost.getExiledCards()); }
public ExileFromGraveCost(TargetCardInYourGraveyard target, String text) { target.setNotTarget(true); this.addTarget(target); this.text = text; }
@Override public void adjustTargets(Ability ability, Game game) { int xValue = ability.getManaCostsToPay().getX(); for (Cost cost : ability.getCosts()) { if (!(cost instanceof ExileFromGraveCost)) { continue; } ExileFromGraveCost exileCost = (ExileFromGraveCost) cost; for (Target target : exileCost.getTargets()) { if (target instanceof TargetCardInYourGraveyard) { target.setMaxNumberOfTargets(xValue); target.setMinNumberOfTargets(xValue); } } } } }
@Override public Cost getFixedCostsFromAnnouncedValue(int xValue) { TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(xValue, filter); return new ExileFromGraveCost(target); } }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { for (Cost cost : sourceAbility.getCosts()) { if (cost.isPaid() && cost instanceof ExileFromGraveCost) { int xValue = 0; for (Card card : ((ExileFromGraveCost) cost).getExiledCards()) { xValue += card.getConvertedManaCost(); } return xValue; } } return 0; }
public ExileFromGraveCost(TargetCardInASingleGraveyard target) { target.setNotTarget(true); this.addTarget(target); this.text = "Exile " + target.getTargetName(); }
public RottingGiant(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); this.subtype.add(SubType.ZOMBIE); this.subtype.add(SubType.GIANT); this.power = new MageInt(3); this.toughness = new MageInt(3); // Whenever Rotting Giant attacks or blocks, sacrifice it unless you exile a card from your graveyard. TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(); this.addAbility(new AttacksOrBlocksTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ExileFromGraveCost(target)), false)); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int amount = 0; for (Cost cost : source.getCosts()) { if (cost instanceof ExileFromGraveCost) { amount = ((ExileFromGraveCost) cost).getExiledCards().size() * 2; new CreateTokenEffect(new CorpseweftZombieToken(amount, amount), 1, true, false).apply(game, source); } } if (amount > 0) { } } return false; } }
public ExileFromGraveCost(TargetCardInYourGraveyard target) { target.setNotTarget(true); this.addTarget(target); if (target.getMaxNumberOfTargets() > 1) { this.text = "Exile " + (target.getNumberOfTargets() == 1 && target.getMaxNumberOfTargets() == Integer.MAX_VALUE ? "one or more" : ((target.getNumberOfTargets() < target.getMaxNumberOfTargets() ? "up to " : "")) + CardUtil.numberToText(target.getMaxNumberOfTargets())) + ' ' + target.getTargetName(); } else { this.text = "Exile " + target.getTargetName(); } if (!this.text.endsWith(" from your graveyard")) { this.text = this.text + " from your graveyard"; } }
public IchoridTriggerdAbility(FilterCard filter){ super(Zone.GRAVEYARD, new DoIfCostPaid(new ReturnSourceFromGraveyardToBattlefieldEffect(), new ExileFromGraveCost( new TargetCardInYourGraveyard(1, 1, filter, true) ) ), TargetController.YOU, false); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); if (targetCreature != null) { int amount = 0; for (Cost cost : source.getCosts()) { if (cost instanceof ExileFromGraveCost) { amount = ((ExileFromGraveCost) cost).getExiledCards().size(); ContinuousEffect effect = new BoostTargetEffect(-amount, -amount, Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(source.getTargets().getFirstTarget())); game.addEffect(effect, source); } } } } return false; } }
public ForgottenHarvest(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); // At the beginning of your upkeep, you may exile a land card from your graveyard. If you do, put a +1/+1 counter on target creature. Ability ability = new BeginningOfUpkeepTriggeredAbility( new DoIfCostPaid( new AddCountersTargetEffect(CounterType.P1P1.createInstance()), new ExileFromGraveCost(new TargetCardInYourGraveyard(new FilterLandCard("land card from your graveyard"))) ), TargetController.YOU, false ); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { ExileFromGraveCost exileFromGraveCost = (ExileFromGraveCost) source.getCosts().get(0); List<Card> exiledCards = exileFromGraveCost.getExiledCards(); if (!exiledCards.isEmpty()) { Cards toDelve = new CardsImpl(); for (Card card : exiledCards) { toDelve.add(card); } ManaPool manaPool = controller.getManaPool(); manaPool.addMana(new Mana(0, 0, 0, 0, 0, 0, 0, toDelve.size()), game, source); manaPool.unlockManaType(ManaType.COLORLESS); String keyString = CardUtil.getCardZoneString("delvedCards", source.getSourceId(), game); @SuppressWarnings("unchecked") Cards delvedCards = (Cards) game.getState().getValue(keyString); if (delvedCards == null) { game.getState().setValue(keyString, toDelve); } else { delvedCards.addAll(toDelve); } } return true; } return false; } }
public FlamesOfRemembrance(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{R}"); // At the beggining of your upkeep, you may exile a card from your graveyard. If you do, put a lore counter on Flames of Remembrance. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DoIfCostPaid(new AddCountersSourceEffect(CounterType.LORE.createInstance()), new ExileFromGraveCost(new TargetCardInYourGraveyard()), null, true), TargetController.YOU, false)); // Sacrifice Flames of Remembrance: Exile top X cards of your library, where X is the number of lore counters on Flames of Remembrance. Until end of turn you play cards exile this way. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new FlamesOfRemembranceExileEffect(new CountersSourceCount(CounterType.LORE)), new SacrificeSourceCost())); }
xValue = ((ExileFromGraveCost) cost).getExiledCards().size();
public WoodwraithStrangler(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{G}"); this.subtype.add(SubType.PLANT); this.subtype.add(SubType.ZOMBIE); this.power = new MageInt(2); this.toughness = new MageInt(2); // Exile a creature card from your graveyard: Regenerate Woodwraith Strangler. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ExileFromGraveCost(new TargetCardInYourGraveyard(new FilterCreatureCard("a creature card from your graveyard"))))); }
@Override public void adjustCosts(Ability ability, Game game) { int xValue = ability.getManaCostsToPay().getX(); if (xValue > 0) { ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(xValue, xValue, new FilterCard("cards from your graveyard")))); } }
public MakeshiftMauler(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.subtype.add(SubType.ZOMBIE); this.subtype.add(SubType.HORROR); this.power = new MageInt(4); this.toughness = new MageInt(5); // As an additional cost to cast Makeshift Mauler, exile a creature card from your graveyard. this.getSpellAbility().addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD))); }
public TreacherousVampire(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}"); this.subtype.add(SubType.VAMPIRE); this.power = new MageInt(4); this.toughness = new MageInt(4); // Flying this.addAbility(FlyingAbility.getInstance()); // Whenever Treacherous Vampire attacks or blocks, sacrifice it unless you exile a card from your graveyard. this.addAbility(new AttacksOrBlocksTriggeredAbility( new DoUnlessControllerPaysEffect( new SacrificeSourceEffect(), new ExileFromGraveCost(new ExileFromGraveCost(new TargetCardInYourGraveyard())) ), false )); // Threshold - As long as seven or more cards are in your graveyard, Treacherous Vampire gets +2/+2 and has "When Treacherous Vampire dies, you lose 6 life." Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), "As long as seven or more cards are in your graveyard, {this} gets +2/+2")); Effect effect = new ConditionalContinuousEffect( new GainAbilitySourceEffect(new DiesTriggeredAbility(new LoseLifeSourceControllerEffect(6))), new CardsInControllerGraveCondition(7), "and has \"When {this} dies, you lose 6 life.\"" ); ability.addEffect(effect); ability.setAbilityWord(AbilityWord.THRESHOLD); this.addAbility(ability); }