@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { int xValue = sourceAbility.getManaCostsToPay().getX(); for (Cost cost : sourceAbility.getCosts()) { if (cost instanceof DiscardXTargetCost) { xValue = ((DiscardXTargetCost) cost).getAmount(); } } return xValue; }
@Override public void adjustTargets(Ability ability, Game game) { Target target = new TargetPermanent(0, ability.getManaCostsToPay().getX(), filter, false); ability.addTarget(target); } }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { MageObject mageObject = game.getLastKnownInformation(sourceAbility.getSourceId(), Zone.STACK); if (mageObject != null && mageObject instanceof StackObject) { return ((StackObject) mageObject).getStackAbility().getManaCostsToPay().getX(); } return 0; }
@Override public void adjustTargets(Ability ability, Game game) { ability.getTargets().clear(); ability.addTarget(new TargetCardInYourGraveyard( ability.getManaCostsToPay().getX(), StaticFilters.FILTER_CARD_FROM_YOUR_GRAVEYARD )); } }
@Override public void adjustTargets(Ability ability, Game game) { ability.getTargets().clear(); ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter)); } }
@Override public void adjustTargets(Ability ability, Game game) { ability.getTargets().clear(); int xValue = ability.getManaCostsToPay().getX(); ability.addTarget(new TargetLandPermanent(xValue, xValue, filter, false)); } }
@Override public void adjustTargets(Ability ability, Game game) { ability.getTargets().clear(); int xValue = ability.getManaCostsToPay().getX(); ability.addTarget(new TargetArtifactPermanent(xValue, xValue)); } }
@Override public void adjustTargets(Ability ability, Game game) { ability.getTargets().clear(); int xValue = ability.getManaCostsToPay().getX(); ability.addTarget(new TargetPermanent(xValue, xValue, filter, false)); } }
@Override public boolean apply(Game game, Ability source) { int howMany = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES, source.getFirstTarget(), game).size(); int amount = source.getManaCostsToPay().getX()/howMany; DamageAllControlledTargetEffect dmgEffect = new DamageAllControlledTargetEffect(amount, new FilterCreaturePermanent()); return dmgEffect.apply(game, source); }
@Override public void adjustTargets(Ability ability, Game game) { ability.getTargets().clear(); int xValue = ability.getManaCostsToPay().getX(); Target target = new TargetCardInYourGraveyard(xValue, new FilterCreatureCard((xValue != 1 ? " creature cards" : "creature card") + " from your graveyard")); ability.addTarget(target); } }
@Override public boolean apply(Game game, Ability source) { for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { if (!permanent.isLand() && permanent.getConvertedManaCost() <= source.getManaCostsToPay().getX()) { permanent.destroy(source.getSourceId(), game, false); } } return true; }
@Override public boolean apply(Game game, Ability source) { for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { if (permanent != null && permanent.isArtifact() && permanent.getConvertedManaCost() <= source.getManaCostsToPay().getX()) { permanent.destroy(source.getSourceId(), game, false); } } return true; } }
@Override public void adjustTargets(Ability ability, Game game) { int xValue = ability.getManaCostsToPay().getX(); ability.getTargets().clear(); FilterSpell filter = new FilterSpell("spell with converted mana cost " + xValue); filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue)); ability.addTarget(new TargetSpell(filter)); } }
@Override public void adjustTargets(Ability ability, Game game) { ability.getTargets().clear(); int xValue = ability.getManaCostsToPay().getX(); FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost X"); filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue)); ability.addTarget(new TargetCreaturePermanent(filter)); } }
@Override public void adjustTargets(Ability ability, Game game) { int xValue = ability.getManaCostsToPay().getX(); ability.getTargets().clear(); FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power " + xValue + " or less"); filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1)); ability.addTarget(new TargetCreaturePermanent(filter)); } }
@Override public boolean apply(Game game, Ability source) { for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { if (!permanent.isLand() && permanent.getConvertedManaCost() <= source.getManaCostsToPay().getX()) { permanent.moveToZone(Zone.HAND, source.getSourceId(), game, true); } } return true; } }
@Override public boolean apply(Game game, Ability source) { int count = source.getManaCostsToPay().getX(); OozeToken oozeToken = new OozeToken(); oozeToken.getPower().modifyBaseValue(count); oozeToken.getToughness().modifyBaseValue(count); oozeToken.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); return true; }
@Override public void adjustTargets(Ability ability, Game game) { int xValue = ability.getManaCostsToPay().getX(); FilterPermanent permanentFilter = new FilterCreaturePermanent("creature with power " + xValue + " or less"); permanentFilter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1)); ability.getTargets().clear(); ability.getTargets().add(new TargetPermanent(permanentFilter)); } }
@Override public void adjustTargets(Ability ability, Game game) { ability.getTargets().clear(); int xValue = ability.getManaCostsToPay().getX(); FilterCard filter = new FilterCreatureCard("creature card with converted mana cost " + xValue + " or less from your graveyard"); filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xValue + 1)); ability.getTargets().add(new TargetCardInYourGraveyard(filter)); } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { permanent.addCounters(CounterType.P1P1.createInstance(source.getManaCostsToPay().getX()), source, game); } return true; } return false; }