fixed various instances of mana costs which don't include braces

This commit is contained in:
Evan Kranzler 2022-03-21 19:10:38 -04:00
parent d0b90379f6
commit 0f1375ca60
34 changed files with 38 additions and 38 deletions

View file

@ -22,7 +22,7 @@ public final class AncestralVision extends CardImpl {
this.color.setBlue(true);
// Suspend 4-{U}
this.addAbility(new SuspendAbility(4, new ManaCostsImpl("U"), this));
this.addAbility(new SuspendAbility(4, new ManaCostsImpl<>("{U}"), this));
// Target player draws three cards.
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new DrawCardTargetEffect(3));

View file

@ -28,7 +28,7 @@ import java.util.UUID;
public class BlessedDefiance extends CardImpl {
public BlessedDefiance(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "W");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}");
// Target creature you control gets +2/+0 and gains lifelink until end of turn. When that creature dies this turn, create a 1/1 white Spirit creature token with flying.
this.getSpellAbility().addEffect(new BoostTargetEffect(2, 0)

View file

@ -30,7 +30,7 @@ public final class CircleOfProtectionArtifacts extends CardImpl {
// {2}: The next time an artifact source of your choice would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("2")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{2}")));
}
private CircleOfProtectionArtifacts(final CircleOfProtectionArtifacts card) {

View file

@ -33,7 +33,7 @@ public final class CircleOfProtectionBlack extends CardImpl {
// {1}: The next time a black source of your choice would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("1")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{1}")));
}
private CircleOfProtectionBlack(final CircleOfProtectionBlack card) {

View file

@ -33,7 +33,7 @@ public final class CircleOfProtectionBlue extends CardImpl {
// {1}: The next time a blue source of your choice would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("1")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{1}")));
}
private CircleOfProtectionBlue(final CircleOfProtectionBlue card) {

View file

@ -33,7 +33,7 @@ public final class CircleOfProtectionGreen extends CardImpl {
// {1}: The next time a green source of your choice would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("1")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{1}")));
}
private CircleOfProtectionGreen(final CircleOfProtectionGreen card) {

View file

@ -33,7 +33,7 @@ public final class CircleOfProtectionRed extends CardImpl {
// {1}: The next time a red source of your choice would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("1")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{1}")));
}
private CircleOfProtectionRed(final CircleOfProtectionRed card) {

View file

@ -33,7 +33,7 @@ public final class CircleOfProtectionShadow extends CardImpl {
// {1}: The next time a creature of your choice with shadow would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
effect.setText("The next time a creature of your choice with shadow would deal damage to you this turn, prevent that damage");
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("1")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{1}")));
}
private CircleOfProtectionShadow(final CircleOfProtectionShadow card) {

View file

@ -33,7 +33,7 @@ public final class CircleOfProtectionWhite extends CardImpl {
// {1}: The next time a white source of your choice would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("1")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{1}")));
}
private CircleOfProtectionWhite(final CircleOfProtectionWhite card) {

View file

@ -41,7 +41,7 @@ public final class Conviction extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 3, Duration.WhileOnBattlefield)));
// {W}: Return Conviction to its owner's hand.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("W")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl<>("{W}")));
}
private Conviction(final Conviction card) {

View file

@ -31,7 +31,7 @@ public final class DungeonShade extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// {B}: Dungeon Shade gets +1/+1 until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("B")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl<>("{B}")));
}
private DungeonShade(final DungeonShade card) {

View file

@ -24,7 +24,7 @@ public final class ElementalAugury extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}{B}{R}");
// {3}: Look at the top three cards of target player's library, then put them back in any order.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ElementalAuguryEffect(), new ManaCostsImpl("3"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ElementalAuguryEffect(), new ManaCostsImpl<>("{3}"));
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}

View file

@ -36,7 +36,7 @@ public final class FlowstoneBlade extends CardImpl {
this.addAbility(ability);
// {R}: Enchanted creature gets +1/-1 until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl("R")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl<>("{R}")));
}
private FlowstoneBlade(final FlowstoneBlade card) {

View file

@ -30,7 +30,7 @@ public final class GaeasWill extends CardImpl {
this.color.setGreen(true);
// Suspend 4{G}
this.addAbility(new SuspendAbility(4, new ManaCostsImpl<>("G"), this));
this.addAbility(new SuspendAbility(4, new ManaCostsImpl<>("{G}"), this));
// Until end of turn, you may play land cards and cast spells from your graveyard.
this.getSpellAbility().addEffect(new GaeasWillGraveyardEffect());

View file

@ -25,7 +25,7 @@ public final class GnarledEffigy extends CardImpl {
// {4}, {tap}: Put a -1/-1 counter on target creature.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new AddCountersTargetEffect(CounterType.M1M1.createInstance()),
new ManaCostsImpl("4"));
new ManaCostsImpl<>("{4}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);

View file

@ -50,7 +50,7 @@ public final class Imprison extends CardImpl {
this.addAbility(new ImprisonTriggeredAbility());
// Whenever enchanted creature attacks or blocks, you may pay {1}. If you do, tap the creature, remove it from combat, and creatures it was blocking that had become blocked by only that creature this combat become unblocked. If you don't, destroy Imprison.
this.addAbility(new AttacksOrBlocksAttachedTriggeredAbility(new DoIfCostPaid(new ImprisonUnblockEffect(), new DestroySourceEffect(), new ManaCostsImpl("1")), AttachmentType.AURA));
this.addAbility(new AttacksOrBlocksAttachedTriggeredAbility(new DoIfCostPaid(new ImprisonUnblockEffect(), new DestroySourceEffect(), new ManaCostsImpl<>("{1}")), AttachmentType.AURA));
}
private Imprison(final Imprison card) {
@ -66,7 +66,7 @@ public final class Imprison extends CardImpl {
class ImprisonTriggeredAbility extends TriggeredAbilityImpl {
ImprisonTriggeredAbility() {
super(Zone.BATTLEFIELD, new DoIfCostPaid(new CounterTargetEffect().setText("counter that ability"), new DestroySourceEffect(), new ManaCostsImpl("1")));
super(Zone.BATTLEFIELD, new DoIfCostPaid(new CounterTargetEffect().setText("counter that ability"), new DestroySourceEffect(), new ManaCostsImpl<>("{1}")));
}
ImprisonTriggeredAbility(final ImprisonTriggeredAbility ability) {

View file

@ -58,7 +58,7 @@ public final class JabbaTheHutt extends CardImpl {
this.addAbility(ability);
// {R},{T}: Create a tapped 4/4 red Hunter creature token. It fights another target creature an opponent control with a bounty counter on it. Activate this ability only any time you could cast a sorcery.
ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new JabbaTheHuttEffect(), new ManaCostsImpl("R"));
ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new JabbaTheHuttEffect(), new ManaCostsImpl<>("{R}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetOpponentsCreaturePermanent(filter));
this.addAbility(ability);

View file

@ -30,7 +30,7 @@ public final class KillerWhale extends CardImpl {
this.addAbility(new SimpleActivatedAbility(
Zone.BATTLEFIELD,
new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn),
new ManaCostsImpl("U")));
new ManaCostsImpl<>("{U}")));
}
private KillerWhale(final KillerWhale card) {

View file

@ -17,7 +17,7 @@ import mage.constants.TargetController;
public final class RuinCrab extends CardImpl {
public RuinCrab(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "U");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}");
this.subtype.add(SubType.CRAB);
this.power = new MageInt(0);

View file

@ -31,7 +31,7 @@ public final class RuneOfProtectionArtifacts extends CardImpl {
// {W}: The next time an artifact source of your choice would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("W")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{W}")));
// Cycling {2} ({2}, Discard this card: Draw a card.)
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
}

View file

@ -31,7 +31,7 @@ public final class RuneOfProtectionBlack extends CardImpl {
// {W}: The next time a black source of your choice would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("W")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{W}")));
// Cycling {2} ({2}, Discard this card: Draw a card.)
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
}

View file

@ -31,7 +31,7 @@ public final class RuneOfProtectionBlue extends CardImpl {
// {W}: The next time a blue source of your choice would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("W")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{W}")));
// Cycling {2} ({2}, Discard this card: Draw a card.)
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
}

View file

@ -31,7 +31,7 @@ public final class RuneOfProtectionGreen extends CardImpl {
// {W}: The next time a green source of your choice would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("W")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{W}")));
// Cycling {2} ({2}, Discard this card: Draw a card.)
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
}

View file

@ -31,7 +31,7 @@ public final class RuneOfProtectionLands extends CardImpl {
// {W}: The next time a land source of your choice would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("W")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{W}")));
// Cycling {2} ({2}, Discard this card: Draw a card.)
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
}

View file

@ -31,7 +31,7 @@ public final class RuneOfProtectionRed extends CardImpl {
// {W}: The next time a red source of your choice would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("W")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{W}")));
// Cycling {2} ({2}, Discard this card: Draw a card.)
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
}

View file

@ -31,7 +31,7 @@ public final class RuneOfProtectionWhite extends CardImpl {
// {W}: The next time a white source of your choice would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("W")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{W}")));
// Cycling {2} ({2}, Discard this card: Draw a card.)
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
}

View file

@ -29,7 +29,7 @@ public final class Soothsaying extends CardImpl {
// {X}: Look at the top X cards of your library, then put them back in any order.
Effect effect = new LookLibraryControllerEffect(ManacostVariableValue.REGULAR);
effect.setText("Look at the top X cards of your library, then put them back in any order");
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("X")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{X}")));
}
private Soothsaying(final Soothsaying card) {

View file

@ -92,7 +92,7 @@ class ThelonsCurseEffect extends OneShotEffect {
while (player.canRespond() && countBattlefield > 0 && player.chooseUse(Outcome.AIDontUseIt, "Pay {U} and untap a tapped blue creature under your control?", source, game)) {
Target tappedCreatureTarget = new TargetControlledCreaturePermanent(1, 1, filter, true);
if (player.choose(Outcome.Detriment, tappedCreatureTarget, source.getSourceId(), game)) {
Cost cost = new ManaCostsImpl("U");
Cost cost = new ManaCostsImpl<>("{U}");
Permanent tappedCreature = game.getPermanent(tappedCreatureTarget.getFirstTarget());
if (cost.pay(source, game, source, player.getId(), false)) {

View file

@ -40,7 +40,7 @@ public final class Torture extends CardImpl {
this.addAbility(ability);
// {1}{B}: Put a -1/-1 counter on enchanted creature.
//this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersAttachedEffect(CounterType.M1M1.createInstance(), rule), new ManaCostsImpl("[1}{B}")));
//this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersAttachedEffect(CounterType.M1M1.createInstance(), rule), new ManaCostsImpl<>("{[1}{B}}")));
this.addAbility(new SimpleActivatedAbility(
Zone.BATTLEFIELD,
new AddCountersAttachedEffect(CounterType.M1M1.createInstance(),"enchanted creature"),

View file

@ -23,7 +23,7 @@ public final class TripNoose extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
// {2}, {tap}: Tap target creature.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("2"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl<>("{2}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);

View file

@ -41,7 +41,7 @@ public final class WallOfMulch extends CardImpl {
// Defender
this.addAbility(DefenderAbility.getInstance());
// {G}, Sacrifice a Wall: Draw a card.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("G"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl<>("{G}"));
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
this.addAbility(ability);

View file

@ -231,7 +231,7 @@ public class TargetPriorityTest extends CardTestPlayerBaseAI {
@Test
public void test_targetAmount_NormalCase() {
Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageMultiEffect(3), new ManaCostsImpl("R"));
Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageMultiEffect(3), new ManaCostsImpl<>("{R}"));
ability.addTarget(new TargetCreaturePermanentAmount(3));
addCustomCardWithAbility("damage 3", playerA, ability);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
@ -258,7 +258,7 @@ public class TargetPriorityTest extends CardTestPlayerBaseAI {
@Test
public void test_targetAmount_BadCase() {
// choose targets as enters battlefield (e.g. can't be canceled)
SpellAbility spell = new SpellAbility(new ManaCostsImpl("R"), "damage 3", Zone.HAND);
SpellAbility spell = new SpellAbility(new ManaCostsImpl<>("{R}"), "damage 3", Zone.HAND);
Ability ability = new EntersBattlefieldTriggeredAbility(new DamageMultiEffect(3));
ability.addTarget(new TargetCreaturePermanentAmount(3));
addCustomCardWithSpell(playerA, spell, ability, CardType.ENCHANTMENT);
@ -293,7 +293,7 @@ public class TargetPriorityTest extends CardTestPlayerBaseAI {
public void test_targetAmount_Performance() {
int cardsMultiplier = 3;
Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageMultiEffect(3), new ManaCostsImpl("R"));
Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageMultiEffect(3), new ManaCostsImpl<>("{R}"));
ability.addTarget(new TargetCreaturePermanentAmount(3));
addCustomCardWithAbility("damage 3", playerA, ability);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);

View file

@ -91,7 +91,7 @@ public class CommanderAffinityTest extends CardTestCommanderDuelBase {
public void test_Gained_Affinity() {
// bug: Mycosynth Golem did not allow my commander, Karn, Silver Golem, to cost 0 even though I had 7+ artifacts on the board.
Ability ability = new SimpleActivatedAbility(Zone.ALL, new CreateTokenEffect(new ArtifactWallToken(), 7), new ManaCostsImpl("R"));
Ability ability = new SimpleActivatedAbility(Zone.ALL, new CreateTokenEffect(new ArtifactWallToken(), 7), new ManaCostsImpl<>("{R}"));
addCustomCardWithAbility("generate tokens", playerA, ability);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
//

View file

@ -439,8 +439,8 @@ public class ManaCostsImpl<T extends ManaCost> extends ArrayList<T> implements M
if (mana == null || mana.isEmpty()) {
return;
}
if (mana.startsWith("{") != mana.endsWith("}")) {
throw new IllegalArgumentException("mana costs should be surrounded by braces on both sides or not at all");
if (!mana.startsWith("{") || !mana.endsWith("}")) {
throw new IllegalArgumentException("mana costs should start and end with braces");
}
if (!extractMonoHybridGenericValue && costsCache.containsKey(mana)) {