@Override public ExileTargetCost copy() { return new ExileTargetCost(this); }
public FoodChain(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); // Exile a creature you control: Add X mana of any one color, where X is the exiled creature's converted mana cost plus one. Spend this mana only to cast creature spells. Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new FoodChainManaEffect(), new ExileTargetCost(new TargetControlledCreaturePermanent(1, 1, StaticFilters.FILTER_CONTROLLED_A_CREATURE, true))); this.addAbility(ability); }
public SoulExchange(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}{B}"); // As an additional cost to cast Soul Exchange, exile a creature you control. Cost cost = new ExileTargetCost(new TargetControlledCreaturePermanent()); this.getSpellAbility().addCost(cost); // Return target creature card from your graveyard to the battlefield. Put a +2/+2 counter on that creature if the exiled creature was a Thrull. this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); this.getSpellAbility().addEffect(new SoulExchangeEffect()); }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Permanent permanent = source.getSourcePermanentIfItStillExists(game); if (player == null || permanent == null) { return false; } FilterControlledPermanent filter = new FilterControlledPermanent("tokens created with " + permanent.getName()); filter.add(new TetravusPredicate(new MageObjectReference(permanent, game))); filter.add(TokenPredicate.instance); ExileTargetCost cost = new ExileTargetCost(new TargetControlledPermanent(0, Integer.MAX_VALUE, filter, true)); if (cost.pay(source, game, source.getSourceId(), player.getId(), true)) { return new AddCountersSourceEffect(CounterType.P1P1.createInstance(cost.getPermanents().size())).apply(game, source); } return false; } }
public CityOfShadows(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.LAND},""); // {T}, Exile a creature you control: Put a storage counter on City of Shadows. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance()), new TapSourceCost()); ability.addCost(new ExileTargetCost(new TargetControlledCreaturePermanent())); this.addAbility(ability); // {T}: Add X mana of {C}, where X is the number of storage counters on City of Shadows. ability = new DynamicManaAbility(Mana.ColorlessMana(1), new CountersSourceCount(CounterType.STORAGE), "Add X mana of {C}, where X is the number of storage counters on {this}"); this.addAbility(ability); }