Fixed hints on ward

This commit is contained in:
Alex Vasile 2022-02-06 16:24:57 -05:00
parent 149c799926
commit 24ff47c803
16 changed files with 48 additions and 26 deletions

View file

@ -43,7 +43,9 @@ public final class ChapelShieldgeist extends CardImpl {
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect( this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(
new WardAbility(new GenericManaCost(1)), Duration.WhileOnBattlefield, new WardAbility(new GenericManaCost(1)), Duration.WhileOnBattlefield,
StaticFilters.FILTER_PERMANENT_CREATURE StaticFilters.FILTER_PERMANENT_CREATURE
).setText("each creature you control has ward {1}"))); ).setText("each creature you control has ward {1}. " +
"<i>(Whenever it becomes the target of a spell or ability an opponent controls, " +
"counter it unless that player pays 1.)</i>")));
// If Chapel Shieldgeist would be put into a graveyard from anywhere, exile it instead. // If Chapel Shieldgeist would be put into a graveyard from anywhere, exile it instead.
this.addAbility(new PutIntoGraveFromAnywhereSourceAbility(new ExileSourceEffect().setText("exile it instead"))); this.addAbility(new PutIntoGraveFromAnywhereSourceAbility(new ExileSourceEffect().setText("exile it instead")));

View file

@ -44,7 +44,9 @@ public final class DragonsDisciple extends CardImpl {
// Dragons you control have ward {1}. // Dragons you control have ward {1}.
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect( this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(
new WardAbility(new GenericManaCost(1)), Duration.WhileOnBattlefield, filter new WardAbility(new GenericManaCost(1)), Duration.WhileOnBattlefield, filter
))); ).setText("Dragons you control have ward {1}. " +
"<i>(Whenever a Dragon you control becomes the target of a spell or ability an opponent controls, " +
"counter it unless that player pays 1.)</i>")));
} }
private DragonsDisciple(final DragonsDisciple card) { private DragonsDisciple(final DragonsDisciple card) {

View file

@ -39,7 +39,7 @@ public final class GavonyDawnguard extends CardImpl {
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Ward {1} // Ward {1}
this.addAbility(new WardAbility(new ManaCostsImpl<>("{1}"))); this.addAbility(new WardAbility(new ManaCostsImpl<>("{1}"), false));
// If it's neither day nor night, it becomes day as Gavony Dawnguard enters the battlefield. // If it's neither day nor night, it becomes day as Gavony Dawnguard enters the battlefield.
this.addAbility(new BecomeDayAsEntersAbility()); this.addAbility(new BecomeDayAsEntersAbility());

View file

@ -37,7 +37,7 @@ public final class GraveyardGlutton extends CardImpl {
this.nightCard = true; this.nightCard = true;
// WardDiscard a card. // WardDiscard a card.
this.addAbility(new WardAbility(new DiscardCardCost())); this.addAbility(new WardAbility(new DiscardCardCost(), false));
// Whenever Graveyard Glutton enters the battlefield or attacks, exile up to two target cards from graveyards. For each creature card exiled this way, each opponent loses 1 life and you gain 1 life. // Whenever Graveyard Glutton enters the battlefield or attacks, exile up to two target cards from graveyards. For each creature card exiled this way, each opponent loses 1 life and you gain 1 life.
Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new GraveyardGluttonEffect()); Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new GraveyardGluttonEffect());

View file

@ -37,7 +37,7 @@ public final class GraveyardTrespasser extends CardImpl {
this.secondSideCardClazz = mage.cards.g.GraveyardGlutton.class; this.secondSideCardClazz = mage.cards.g.GraveyardGlutton.class;
// WardDiscard a card. // WardDiscard a card.
this.addAbility(new WardAbility(new DiscardCardCost())); this.addAbility(new WardAbility(new DiscardCardCost(), false));
// Whenever Graveyard Trespasser enters the battlefield or attacks, exile up to one target card from a graveyard. If a creature card was exiled this way, each opponent loses 1 life and you gain 1 life. // Whenever Graveyard Trespasser enters the battlefield or attacks, exile up to one target card from a graveyard. If a creature card was exiled this way, each opponent loses 1 life and you gain 1 life.
Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new GraveyardTrespasserEffect()); Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new GraveyardTrespasserEffect());

View file

@ -50,7 +50,12 @@ public final class HallOfStormGiants extends CardImpl {
.withColor("U") .withColor("U")
.withSubType(SubType.GIANT) .withSubType(SubType.GIANT)
.withAbility(new WardAbility(new GenericManaCost(3))), .withAbility(new WardAbility(new GenericManaCost(3))),
"land", Duration.EndOfTurn), new ManaCostsImpl("{5}{U}"))); "land", Duration.EndOfTurn).setText(
"Until end of turn, Hall of Storm Giants becomes a 7/7 blue Giant creature with ward {3}. " +
"It's still a land. " +
"<i>(Whenever it becomes the target of a spell or ability an opponent controls, " +
"counter it unless that player pays {3}.)</i>"),
new ManaCostsImpl("{5}{U}")));
} }
private HallOfStormGiants(final HallOfStormGiants card) { private HallOfStormGiants(final HallOfStormGiants card) {

View file

@ -33,7 +33,8 @@ public final class LeatherArmor extends CardImpl {
new WardAbility(new GenericManaCost(1)), new WardAbility(new GenericManaCost(1)),
AttachmentType.EQUIPMENT, AttachmentType.EQUIPMENT,
Duration.WhileOnBattlefield, Duration.WhileOnBattlefield,
"and has ward {1}" "and has ward {1}. <i>(Whenever equipped creature becomes the target of a spell or ability an opponent controls, " +
"counter it unless that player pays {1}.)</i>"
)); ));
this.addAbility(ability); this.addAbility(ability);

View file

@ -30,7 +30,7 @@ public final class MoonrageBrute extends CardImpl {
this.addAbility(FirstStrikeAbility.getInstance()); this.addAbility(FirstStrikeAbility.getInstance());
// WardPay 3 life. // WardPay 3 life.
this.addAbility(new WardAbility(new PayLifeCost(3))); this.addAbility(new WardAbility(new PayLifeCost(3), false));
// Nightbound // Nightbound
this.addAbility(new NightboundAbility()); this.addAbility(new NightboundAbility());

View file

@ -48,7 +48,7 @@ public final class OctaviaLivingThesis extends CardImpl {
).setRuleAtTheTop(true).addHint(hint)); ).setRuleAtTheTop(true).addHint(hint));
// Ward {8} // Ward {8}
this.addAbility(new WardAbility(new ManaCostsImpl<>("{8}"))); this.addAbility(new WardAbility(new ManaCostsImpl<>("{8}"), false));
// Magecraft Whenever you cast an instant or sorcery spell, target creature has base power and toughness 8/8 until end of turn. // Magecraft Whenever you cast an instant or sorcery spell, target creature has base power and toughness 8/8 until end of turn.
Ability ability = new MagecraftAbility( Ability ability = new MagecraftAbility(

View file

@ -40,7 +40,8 @@ public final class PlateArmor extends CardImpl {
new WardAbility(new GenericManaCost(1)), new WardAbility(new GenericManaCost(1)),
AttachmentType.EQUIPMENT, AttachmentType.EQUIPMENT,
Duration.WhileOnBattlefield, Duration.WhileOnBattlefield,
"and has ward {1}" "and has ward {1}. <i>(Whenever equipped creature becomes the target of a spell or ability an opponent controls, " +
"counter it unless that player pays {1}.)</i>"
)); ));
this.addAbility(ability); this.addAbility(ability);

View file

@ -35,11 +35,11 @@ public final class StorvaldFrostGiantJarl extends CardImpl {
this.toughness = new MageInt(7); this.toughness = new MageInt(7);
// Ward {3} // Ward {3}
this.addAbility(new WardAbility(new ManaCostsImpl<>("{3}"))); this.addAbility(new WardAbility(new ManaCostsImpl<>("{3}"), false));
// Other creatures you control have ward {3}. // Other creatures you control have ward {3}.
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect( this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(
new WardAbility(new GenericManaCost(3)), Duration.WhileOnBattlefield, new WardAbility(new GenericManaCost(3), false), Duration.WhileOnBattlefield,
StaticFilters.FILTER_PERMANENT_CREATURES, true StaticFilters.FILTER_PERMANENT_CREATURES, true
))); )));

View file

@ -58,7 +58,7 @@ public class TimotharBaronOfBats extends CardImpl {
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
// WardDiscard a card. // WardDiscard a card.
this.addAbility(new WardAbility(new DiscardCardCost())); this.addAbility(new WardAbility(new DiscardCardCost(), false));
// Whenever another nontoken Vampire you control dies, you may pay {1} and exile it. // Whenever another nontoken Vampire you control dies, you may pay {1} and exile it.
// If you do, create a 1/1 black Bat creature token with flying. // If you do, create a 1/1 black Bat creature token with flying.

View file

@ -47,7 +47,7 @@ public final class VarisSilverymoonRanger extends CardImpl {
this.addAbility(ReachAbility.getInstance()); this.addAbility(ReachAbility.getInstance());
// Ward {1} // Ward {1}
this.addAbility(new WardAbility(new ManaCostsImpl<>("{1}"))); this.addAbility(new WardAbility(new ManaCostsImpl<>("{1}"), false));
// Whenever you cast a creature or planeswalker spell, venture into the dungeon. This ability triggers only once each turn. // Whenever you cast a creature or planeswalker spell, venture into the dungeon. This ability triggers only once each turn.
this.addAbility(new SpellCastControllerTriggeredAbility( this.addAbility(new SpellCastControllerTriggeredAbility(

View file

@ -31,7 +31,9 @@ public final class WingedBoots extends CardImpl {
)); ));
ability.addEffect(new GainAbilityAttachedEffect( ability.addEffect(new GainAbilityAttachedEffect(
new WardAbility(new GenericManaCost(4)), AttachmentType.EQUIPMENT new WardAbility(new GenericManaCost(4)), AttachmentType.EQUIPMENT
).setText("and ward {4}")); ).setText("and ward {4}. " +
"<i>(Whenever equipped creature becomes the target of a spell or ability an opponent controls, " +
"counter it unless that player pays {4}.)</i>"));
this.addAbility(ability); this.addAbility(ability);
// Equip {1} // Equip {1}

View file

@ -7,10 +7,7 @@ import mage.abilities.common.WerewolfBackTriggeredAbility;
import mage.abilities.common.WerewolfFrontTriggeredAbility; import mage.abilities.common.WerewolfFrontTriggeredAbility;
import mage.abilities.effects.common.FightTargetsEffect; import mage.abilities.effects.common.FightTargetsEffect;
import mage.abilities.effects.keyword.ScryEffect; import mage.abilities.effects.keyword.ScryEffect;
import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.*;
import mage.abilities.keyword.MenaceAbility;
import mage.abilities.keyword.MultikickerAbility;
import mage.abilities.keyword.TransformAbility;
import mage.cards.*; import mage.cards.*;
import mage.cards.decks.DeckCardLists; import mage.cards.decks.DeckCardLists;
import mage.cards.decks.importer.DeckImporter; import mage.cards.decks.importer.DeckImporter;
@ -1420,6 +1417,7 @@ public class VerifyCardDataTest {
hints.put(FightTargetsEffect.class, "Each deals damage equal to its power to the other"); hints.put(FightTargetsEffect.class, "Each deals damage equal to its power to the other");
hints.put(MenaceAbility.class, "can't be blocked except by two or more"); hints.put(MenaceAbility.class, "can't be blocked except by two or more");
hints.put(ScryEffect.class, "Look at the top card of your library. You may put that card on the bottom of your library"); hints.put(ScryEffect.class, "Look at the top card of your library. You may put that card on the bottom of your library");
hints.put(WardAbility.class, "becomes the target of a spell or ability an opponent controls");
for (Class objectClass : hints.keySet()) { for (Class objectClass : hints.keySet()) {
String objectHint = hints.get(objectClass); String objectHint = hints.get(objectClass);

View file

@ -18,15 +18,22 @@ import mage.util.CardUtil;
public class WardAbility extends TriggeredAbilityImpl { public class WardAbility extends TriggeredAbilityImpl {
private final Cost cost; private final Cost cost;
private final boolean showAbilityHint;
public WardAbility(Cost cost) { public WardAbility(Cost cost) {
this(cost, true);
}
public WardAbility(Cost cost, boolean showAbilityHint) {
super(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(cost), false); super(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(cost), false);
this.cost = cost; this.cost = cost;
this.showAbilityHint = showAbilityHint;
} }
private WardAbility(final WardAbility ability) { private WardAbility(final WardAbility ability) {
super(ability); super(ability);
this.cost = ability.cost.copy(); this.cost = ability.cost.copy();
this.showAbilityHint = ability.showAbilityHint;
} }
@Override @Override
@ -73,14 +80,18 @@ public class WardAbility extends TriggeredAbilityImpl {
} else { } else {
sb.append("&mdash;").append(CardUtil.getTextWithFirstCharUpperCase(cost.getText())).append('.'); sb.append("&mdash;").append(CardUtil.getTextWithFirstCharUpperCase(cost.getText())).append('.');
} }
sb.append(" <i>(Whenever {this} becomes the target of a spell or ability an opponent controls, " +
"counter that spell or ability unless that player "); if (showAbilityHint) {
if (cost instanceof ManaCost) { sb.append(" <i>(Whenever this creature becomes the target of a spell or ability an opponent controls, " +
sb.append("pays ").append(cost.getText()); "counter it unless that player ");
} else { if (cost instanceof ManaCost) {
sb.append(cost.getText().replace("pay ", "pays ")); sb.append("pays ").append(cost.getText());
} else {
sb.append(cost.getText().replace("pay ", "pays "));
}
sb.append(".)</i>");
} }
sb.append(".)</i>");
return sb.toString(); return sb.toString();
} }
} }