* As an additional cost to cast discard X cards abilities - fixed wrong text (Firestorm, etc);

This commit is contained in:
Oleg Agafonov 2020-04-19 21:18:57 +04:00
parent 037d9894dd
commit 39894c6394
7 changed files with 17 additions and 17 deletions

View file

@ -25,7 +25,7 @@ public final class ChanneledForce extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}{R}");
// As an additional cost to cast this spell, discard X cards.
this.getSpellAbility().addCost(new DiscardXTargetCost(StaticFilters.FILTER_CARD_CARDS, true));
this.getSpellAbility().addCost(new DiscardXTargetCost(StaticFilters.FILTER_CARD_CARDS, false));
// Target player draws X cards. Channeled Force deals X damage to up to one target creature or planeswalker.
this.getSpellAbility().addEffect(new ChanneledForceEffect());

View file

@ -27,7 +27,8 @@ public final class Firestorm extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}");
// As an additional cost to cast Firestorm, discard X cards.
this.getSpellAbility().addCost(new DiscardXTargetCost(new FilterCard("cards"), true));
this.getSpellAbility().addCost(new DiscardXTargetCost(new FilterCard("cards"), false));
// Firestorm deals X damage to each of X target creatures and/or players.
this.getSpellAbility().addEffect(new FirestormEffect());
this.getSpellAbility().setTargetAdjuster(FirestormAdjuster.instance);

View file

@ -1,4 +1,3 @@
package mage.cards.n;
import mage.abilities.Ability;
@ -27,7 +26,8 @@ public final class NostalgicDreams extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}{G}");
// As an additional cost to cast Nostalgic Dreams, discard X cards.
this.getSpellAbility().addCost(new DiscardXTargetCost(new FilterCard("cards"), true));
this.getSpellAbility().addCost(new DiscardXTargetCost(new FilterCard("cards"), false));
// Return X target cards from your graveyard to your hand.
Effect effect = new ReturnFromGraveyardToHandTargetEffect();
effect.setText("Return X target cards from your graveyard to your hand");

View file

@ -1,6 +1,7 @@
package mage.cards.r;
import mage.abilities.Ability;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.DiscardXTargetCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
@ -8,14 +9,13 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.target.Target;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetadjustment.TargetAdjuster;
import java.util.UUID;
import mage.abilities.costs.Cost;
import mage.filter.common.FilterCreatureCard;
import mage.target.Target;
/**
* @author fireshoes
@ -26,7 +26,8 @@ public final class RestlessDreams extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}");
// As an additional cost to cast Restless Dreams, discard X cards.
this.getSpellAbility().addCost(new DiscardXTargetCost(StaticFilters.FILTER_CARD_CARDS, true));
this.getSpellAbility().addCost(new DiscardXTargetCost(StaticFilters.FILTER_CARD_CARDS, false));
// Return X target creature cards from your graveyard to your hand.
Effect effect = new ReturnFromGraveyardToHandTargetEffect();
effect.setText("Return X target creature cards from your graveyard to your hand");
@ -57,8 +58,8 @@ enum RestlessDreamsAdjuster implements TargetAdjuster {
xValue = ((DiscardXTargetCost) cost).getAmount();
}
}
Target target = new TargetCardInYourGraveyard(xValue,
new FilterCreatureCard(new StringBuilder(xValue).append(xValue != 1 ?
Target target = new TargetCardInYourGraveyard(xValue,
new FilterCreatureCard(new StringBuilder(xValue).append(xValue != 1 ?
" creature cards" : "creature card").append(" from your graveyard").toString()));
ability.addTarget(target);
}

View file

@ -1,4 +1,3 @@
package mage.cards.t;
import mage.abilities.Ability;
@ -27,7 +26,7 @@ public final class TurbulentDreams extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}{U}");
// As an additional cost to cast Turbulent Dreams, discard X cards.
this.getSpellAbility().addCost(new DiscardXTargetCost(StaticFilters.FILTER_CARD_CARDS, true));
this.getSpellAbility().addCost(new DiscardXTargetCost(StaticFilters.FILTER_CARD_CARDS, false));
// Return X target nonland permanents to their owners' hands.
Effect effect = new ReturnToHandTargetEffect();

View file

@ -1,6 +1,5 @@
package mage.cards.v;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.costs.common.DiscardXTargetCost;
import mage.abilities.effects.Effect;
@ -15,6 +14,8 @@ import mage.target.Target;
import mage.target.TargetPermanent;
import mage.target.targetadjustment.TargetAdjuster;
import java.util.UUID;
/**
* @author fireshoes
*/
@ -24,7 +25,7 @@ public final class VengefulDreams extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}{W}");
// As an additional cost to cast Vengeful Dreams, discard X cards.
this.getSpellAbility().addCost(new DiscardXTargetCost(new FilterCard("cards"), true));
this.getSpellAbility().addCost(new DiscardXTargetCost(new FilterCard("cards"), false));
// Exile X target attacking creatures.
Effect effect = new ExileTargetEffect();

View file

@ -1,4 +1,3 @@
package mage.abilities.costs.common;
import mage.abilities.Ability;
@ -10,7 +9,6 @@ import mage.players.Player;
import mage.target.common.TargetCardInHand;
/**
*
* @author LevelX2
*/
public class DiscardXTargetCost extends VariableCostImpl {
@ -23,7 +21,7 @@ public class DiscardXTargetCost extends VariableCostImpl {
public DiscardXTargetCost(FilterCard filter, boolean additionalCostText) {
super(filter.getMessage() + " to discard");
this.text = (additionalCostText ? "as an additional cost to cast this spell, discard " : "Discard ") + xText + ' ' + filter.getMessage();
this.text = (additionalCostText ? "as an additional cost to cast this spell, discard " : "discard ") + xText + ' ' + filter.getMessage();
this.filter = filter;
}