fixed some cards with malformed mana strings

This commit is contained in:
Evan Kranzler 2022-03-21 18:07:50 -04:00
parent b61125c0f3
commit a5afba5d5a
14 changed files with 17 additions and 14 deletions

View file

@ -31,7 +31,7 @@ public final class Damn extends CardImpl {
this.addAbility(new OverloadAbility(
this,
new DestroyAllEffect(FILTER_PERMANENT_CREATURES, true),
new ManaCostsImpl<>("{2}{W}{W")
new ManaCostsImpl<>("{2}{W}{W}")
));
}

View file

@ -24,7 +24,7 @@ public final class DurkwoodBaloth extends CardImpl {
this.toughness = new MageInt(5);
// Suspend 5-{G}
this.addAbility(new SuspendAbility(5, new ManaCostsImpl("{G"), this));
this.addAbility(new SuspendAbility(5, new ManaCostsImpl("{G}"), this));
}
private DurkwoodBaloth(final DurkwoodBaloth card) {

View file

@ -41,7 +41,7 @@ public final class ElephantGrass extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackYouAllEffect(Duration.WhileOnBattlefield, filterBlack)));
// Nonblack creatures can't attack you unless their controller pays {2} for each creature they control that's attacking you.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackYouUnlessPayManaAllEffect(new ManaCostsImpl<>("{2"), false, filter)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackYouUnlessPayManaAllEffect(new ManaCostsImpl<>("{2}"), false, filter)));
}
private ElephantGrass(final ElephantGrass card) {

View file

@ -29,7 +29,7 @@ public final class FlowstoneSalamander extends CardImpl {
this.toughness = new MageInt(4);
// {R}: Flowstone Salamander deals 1 damage to target creature blocking it.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{R"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{R}"));
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature blocking it");
filter.add(new BlockingAttackerIdPredicate(this.getId()));
ability.addTarget(new TargetCreaturePermanent(filter));

View file

@ -37,7 +37,7 @@ public final class GatewayShade extends CardImpl {
this.toughness = new MageInt(1);
// {B}: Gateway 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}")));
// Tap an untapped Gate you control: Gateway Shade gets +2/+2 until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2,2, Duration.EndOfTurn),new TapTargetCost(new TargetControlledPermanent(1,1,filter, true))));

View file

@ -31,7 +31,7 @@ public final class GodosIrregulars extends CardImpl {
this.toughness = new MageInt(1);
// {R}: Godo's Irregulars deals 1 damage to target creature blocking it.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{R"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{R}"));
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature blocking it");
filter.add(new BlockingAttackerIdPredicate(this.getId()));
ability.addTarget(new TargetCreaturePermanent(filter));

View file

@ -37,7 +37,7 @@ public final class IvoryGiant extends CardImpl {
// When Ivory Giant enters the battlefield, tap all nonwhite creatures.
this.addAbility(new EntersBattlefieldTriggeredAbility(new TapAllEffect(filter)));
// Suspend 5-{W}
this.addAbility(new SuspendAbility(5, new ManaCostsImpl("{W"), this));
this.addAbility(new SuspendAbility(5, new ManaCostsImpl("{W}"), this));
}
private IvoryGiant(final IvoryGiant card) {

View file

@ -41,7 +41,7 @@ public final class KarnSilverGolem extends CardImpl {
this.addAbility(new BlocksOrBecomesBlockedSourceTriggeredAbility(new BoostSourceEffect(-4, +4, Duration.EndOfTurn), false));
// {1}: Target noncreature artifact becomes an artifact creature with power and toughness each equal to its converted mana cost until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new KarnSilverGolemEffect(), new ManaCostsImpl("{1"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new KarnSilverGolemEffect(), new ManaCostsImpl("{1}"));
ability.addTarget(new TargetPermanent(filterNonCreature));
this.addAbility(ability);
}

View file

@ -35,7 +35,7 @@ public final class KessigWolfrider extends CardImpl {
// {2}{R}, {T}, Exile three cards from your graveyard: Create a 3/2 red Wolf creature token.
Ability ability = new SimpleActivatedAbility(
new CreateTokenEffect(new RedWolfToken()), new ManaCostsImpl<>("2}{R}")
new CreateTokenEffect(new RedWolfToken()), new ManaCostsImpl<>("{2}{R}")
);
ability.addCost(new TapSourceCost());
ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(3, 3)));

View file

@ -42,7 +42,7 @@ public final class RenownedWeaponsmith extends CardImpl {
this.addAbility(new ConditionalColorlessManaAbility(new TapSourceCost(), 2, new RenownedWeaponsmithManaBuilder()));
// {U}, {T}: Search your library for a card named Heart-Piercer Bow or Vial of Dragonfire, reveal it, put it into your hand, then shuffle your library.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RenownedWeaponsmithEffect(), new ManaCostsImpl("{U"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RenownedWeaponsmithEffect(), new ManaCostsImpl("{U}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);

View file

@ -30,7 +30,7 @@ public final class RuinGhost extends CardImpl {
this.toughness = new MageInt(1);
// {W}, {T}: Exile target land you control, then return it to the battlefield under your control.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect(), new ManaCostsImpl("{W"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect(), new ManaCostsImpl("{W}"));
ability.addCost(new TapSourceCost());
ability.addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect(false).concatBy(", then"));
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND));

View file

@ -20,7 +20,7 @@ import mage.target.common.TargetControlledCreaturePermanent;
* @author LevelX2
*/
public final class SwirlingSpriggan extends CardImpl {
public SwirlingSpriggan(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}");
this.subtype.add(SubType.GOBLIN);
@ -30,7 +30,7 @@ public final class SwirlingSpriggan extends CardImpl {
this.toughness = new MageInt(3);
// {GU}{GU}: Target creature you control becomes the color or colors of your choice until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorOrColorsTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("G/U}{G/U}"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorOrColorsTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{G/U}{G/U}"));
ability.addTarget(new TargetControlledCreaturePermanent());
this.addAbility(ability);
}

View file

@ -46,7 +46,7 @@ public final class SydriGalvanicGenius extends CardImpl {
this.toughness = new MageInt(2);
// {U}: Target noncreature artifact becomes an artifact creature with power and toughness each equal to its converted mana cost until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SydriGalvanicGeniusEffect(), new ManaCostsImpl("{U"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SydriGalvanicGeniusEffect(), new ManaCostsImpl("{U}"));
ability.addTarget(new TargetPermanent(filterNonCreature));
this.addAbility(ability);

View file

@ -439,6 +439,9 @@ 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 (!extractMonoHybridGenericValue && costsCache.containsKey(mana)) {
ManaCosts<ManaCost> savedCosts = costsCache.get(mana);