[WOE][WOC] Fixed card texts, fixed Free the Fae (#11098)

* fix name compare when both full and small name are used
* fix Free the Fae, it is mandatory
This commit is contained in:
Susucre 2023-09-02 13:40:40 +02:00 committed by GitHub
parent 24315460fe
commit 344ff81a37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 38 additions and 24 deletions

View file

@ -44,7 +44,7 @@ public final class EidolonOfCountlessBattles extends CardImpl {
// Eidolon of Countless Battles and enchanted creature get +1/+1 for each creature you control and +1/+1 for each Aura you control. // Eidolon of Countless Battles and enchanted creature get +1/+1 for each creature you control and +1/+1 for each Aura you control.
PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(filter, 1); PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(filter, 1);
Effect effect = new BoostSourceEffect(amount, amount, Duration.WhileOnBattlefield); Effect effect = new BoostSourceEffect(amount, amount, Duration.WhileOnBattlefield);
effect.setText("{this} and enchanted creature get +1/+1 for each creature you control"); effect.setText("{this} and enchanted creature each get +1/+1 for each creature you control");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
effect = new BoostEnchantedEffect(amount, amount, Duration.WhileOnBattlefield); effect = new BoostEnchantedEffect(amount, amount, Duration.WhileOnBattlefield);
effect.setText("and +1/+1 for each Aura you control"); effect.setText("and +1/+1 for each Aura you control");

View file

@ -40,7 +40,7 @@ public final class EllivereOfTheWildCourt extends CardImpl {
// Whenever Ellivere of the Wild Court enters the battlefield or attacks, create a Virtuous Role token attached to another target creature you control. // Whenever Ellivere of the Wild Court enters the battlefield or attacks, create a Virtuous Role token attached to another target creature you control.
Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new CreateRoleAttachedTargetEffect(RoleType.VIRTUOUS)); Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new CreateRoleAttachedTargetEffect(RoleType.VIRTUOUS));
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE)); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_ANOTHER_TARGET_CREATURE_YOU_CONTROL));
this.addAbility(ability); this.addAbility(ability);
// Whenever an enchanted creature you control deals combat damage to a player, draw a card. // Whenever an enchanted creature you control deals combat damage to a player, draw a card.

View file

@ -46,7 +46,10 @@ public final class GiantInheritance extends CardImpl {
this.addAbility(ability); this.addAbility(ability);
// When Giant Inheritance is put into a graveyard from the battlefield, return it to its owner's hand. // When Giant Inheritance is put into a graveyard from the battlefield, return it to its owner's hand.
this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new ReturnToHandSourceEffect())); this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(
new ReturnToHandSourceEffect()
.setText("return it to its owner's hand")
));
} }
private GiantInheritance(final GiantInheritance card) { private GiantInheritance(final GiantInheritance card) {

View file

@ -63,8 +63,9 @@ public final class KorvoldGleefulGlutton extends CardImpl {
// Whenever Korvold deals combat damage to a player, put X +1/+1 counters on Korvold and draw X cards, where X is the number of permanent types among cards in your graveyard. // Whenever Korvold deals combat damage to a player, put X +1/+1 counters on Korvold and draw X cards, where X is the number of permanent types among cards in your graveyard.
Ability combatDamageAbility = new DealsCombatDamageToAPlayerTriggeredAbility( Ability combatDamageAbility = new DealsCombatDamageToAPlayerTriggeredAbility(
new AddCountersSourceEffect(CounterType.P1P1.createInstance(), PermanentTypesInGraveyardCount.instance, true), new AddCountersSourceEffect(CounterType.P1P1.createInstance(), PermanentTypesInGraveyardCount.instance, true)
false .setText("put X +1/+1 counters on {this}"),
false
); );
combatDamageAbility.addEffect(new DrawCardSourceControllerEffect(PermanentTypesInGraveyardCount.instance).setText("and draw X cards, where X is the number of permanent types among cards in your graveyard")); combatDamageAbility.addEffect(new DrawCardSourceControllerEffect(PermanentTypesInGraveyardCount.instance).setText("and draw X cards, where X is the number of permanent types among cards in your graveyard"));
combatDamageAbility.addHint(new ValueHint("Permanent types among cards in your graveyard", PermanentTypesInGraveyardCount.instance)); combatDamageAbility.addHint(new ValueHint("Permanent types among cards in your graveyard", PermanentTypesInGraveyardCount.instance));

View file

@ -34,10 +34,10 @@ public final class NymrisOonasTrickster extends CardImpl {
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// Whenever you cast your first spell during each opponent's turn, look at the top two cards of your library. // Whenever you cast your first spell during each opponent's turn, look at the top two cards of your library. Put one of those cards into your hand and the other into your graveyard.
// Put one of those cards into your hand and the other into your graveyard.
this.addAbility(new FirstSpellOpponentsTurnTriggeredAbility( this.addAbility(new FirstSpellOpponentsTurnTriggeredAbility(
new LookLibraryAndPickControllerEffect(2, 1, PutCards.HAND, PutCards.GRAVEYARD), new LookLibraryAndPickControllerEffect(2, 1, PutCards.HAND, PutCards.GRAVEYARD)
.setText("look at the top two cards of your library. Put one of those cards into your hand and the other into your graveyard"),
false)); false));
} }

View file

@ -18,7 +18,7 @@ import java.util.UUID;
*/ */
public final class PicklockPrankster extends AdventureCard { public final class PicklockPrankster extends AdventureCard {
private static final FilterCard filter = new FilterCard("instant, sorcery, or Faerie card"); private static final FilterCard filter = new FilterCard("an instant, sorcery, or Faerie card");
static { static {
filter.add(Predicates.or( filter.add(Predicates.or(
@ -44,7 +44,7 @@ public final class PicklockPrankster extends AdventureCard {
// Free the Fae // Free the Fae
// Mill four cards. Then put an instant, sorcery, or Faerie card from among the milled cards into your hand. // Mill four cards. Then put an instant, sorcery, or Faerie card from among the milled cards into your hand.
this.getSpellCard().getSpellAbility().addEffect(new MillThenPutInHandEffect(4, filter)); this.getSpellCard().getSpellAbility().addEffect(new MillThenPutInHandEffect(4, filter, true));
this.finalizeAdventure(); this.finalizeAdventure();
} }

View file

@ -22,7 +22,7 @@ import java.util.UUID;
*/ */
public final class TaintedIsle extends CardImpl { public final class TaintedIsle extends CardImpl {
private static final FilterLandPermanent filter = new FilterLandPermanent("you control a swamp"); private static final FilterLandPermanent filter = new FilterLandPermanent("you control a Swamp");
static { static {
filter.add(SubType.SWAMP.getPredicate()); filter.add(SubType.SWAMP.getPredicate());
} }

View file

@ -39,7 +39,7 @@ public final class TimelyWard extends CardImpl {
// You may cast this spell as though it had flash if it targets a commander. // You may cast this spell as though it had flash if it targets a commander.
this.addAbility(new CastAsThoughItHadFlashIfConditionAbility(condition, this.addAbility(new CastAsThoughItHadFlashIfConditionAbility(condition,
"You may cast this spell as though it had flash if it targets a commander." "You may cast {this} as though it had flash if it targets a commander."
)); ));
// Enchant creature // Enchant creature

View file

@ -63,7 +63,7 @@ public class VerifyCardDataTest {
private static final Logger logger = Logger.getLogger(VerifyCardDataTest.class); private static final Logger logger = Logger.getLogger(VerifyCardDataTest.class);
private static final String FULL_ABILITIES_CHECK_SET_CODES = "WOE"; // check ability text due mtgjson, can use multiple sets like MAT;CMD or * for all private static final String FULL_ABILITIES_CHECK_SET_CODES = "WOE;WOC"; // check ability text due mtgjson, can use multiple sets like MAT;CMD or * for all
private static final boolean CHECK_ONLY_ABILITIES_TEXT = false; // use when checking text locally, suppresses unnecessary checks and output messages private static final boolean CHECK_ONLY_ABILITIES_TEXT = false; // use when checking text locally, suppresses unnecessary checks and output messages
private static final boolean AUTO_FIX_SAMPLE_DECKS = false; // debug only: auto-fix sample decks by test_checkSampleDecks test run private static final boolean AUTO_FIX_SAMPLE_DECKS = false; // debug only: auto-fix sample decks by test_checkSampleDecks test run
@ -2153,8 +2153,10 @@ public class VerifyCardDataTest {
}*/ }*/
private static boolean compareText(String cardText, String refText, String name) { private static boolean compareText(String cardText, String refText, String name) {
return cardText.equals(refText) return cardText.equals(refText)
|| cardText.replace(name, name.split(", ")[0]).equals(refText) || cardText.replace(name, name.split(", ")[0])
|| cardText.replace(name, name.split(" ")[0]).equals(refText); .equals(refText.replace(name, name.split(", ")[0]))
|| cardText.replace(name, name.split(" ")[0])
.equals(refText.replace(name, name.split(" ")[0]));
} }
private static boolean checkForEffect(Card card, Class<? extends Effect> effectClazz) { private static boolean checkForEffect(Card card, Class<? extends Effect> effectClazz) {

View file

@ -21,6 +21,7 @@ import mage.util.CardUtil;
public class MillThenPutInHandEffect extends OneShotEffect { public class MillThenPutInHandEffect extends OneShotEffect {
private final int amount; private final int amount;
private final boolean mandatory; // If true, putting a card in hand is mandatory if possible.
private final FilterCard filter; private final FilterCard filter;
private final Effect otherwiseEffect; private final Effect otherwiseEffect;
@ -28,16 +29,26 @@ public class MillThenPutInHandEffect extends OneShotEffect {
this(amount, filter, null); this(amount, filter, null);
} }
public MillThenPutInHandEffect(int amount, FilterCard filter, boolean mandatory) {
this(amount, filter, null, mandatory);
}
public MillThenPutInHandEffect(int amount, FilterCard filter, Effect otherwiseEffect) { public MillThenPutInHandEffect(int amount, FilterCard filter, Effect otherwiseEffect) {
this(amount, filter, otherwiseEffect, false);
}
public MillThenPutInHandEffect(int amount, FilterCard filter, Effect otherwiseEffect, boolean mandatory) {
super(Outcome.Benefit); super(Outcome.Benefit);
this.amount = amount; this.amount = amount;
this.filter = filter; this.filter = filter;
this.mandatory = mandatory;
this.otherwiseEffect = otherwiseEffect; this.otherwiseEffect = otherwiseEffect;
} }
private MillThenPutInHandEffect(final MillThenPutInHandEffect effect) { private MillThenPutInHandEffect(final MillThenPutInHandEffect effect) {
super(effect); super(effect);
this.amount = effect.amount; this.amount = effect.amount;
this.mandatory = effect.mandatory;
this.filter = effect.filter; this.filter = effect.filter;
this.otherwiseEffect = effect.otherwiseEffect; this.otherwiseEffect = effect.otherwiseEffect;
} }
@ -57,7 +68,7 @@ public class MillThenPutInHandEffect extends OneShotEffect {
if (cards.isEmpty()) { if (cards.isEmpty()) {
return applyOtherwiseEffect(game, source); return applyOtherwiseEffect(game, source);
} }
TargetCard target = new TargetCard(0, 1, Zone.ALL, filter); TargetCard target = new TargetCard(this.mandatory ? 1 : 0, 1, Zone.ALL, filter);
player.choose(Outcome.DrawCard, cards, target, source, game); player.choose(Outcome.DrawCard, cards, target, source, game);
Card card = game.getCard(target.getFirstTarget()); Card card = game.getCard(target.getFirstTarget());
if (card == null) { if (card == null) {
@ -82,15 +93,12 @@ public class MillThenPutInHandEffect extends OneShotEffect {
if (staticText == null && !staticText.isEmpty()) { if (staticText == null && !staticText.isEmpty()) {
return staticText; return staticText;
} }
StringBuilder sb = new StringBuilder("mill "); String text = "mill " + CardUtil.numberToText(amount) + " cards. ";
sb.append(CardUtil.numberToText(amount)); text += this.mandatory ? "Then " : "You may ";
sb.append(" cards. You may put "); text += "put " + filter.getMessage() + " from among the milled cards into your hand";
sb.append(filter.getMessage());
sb.append(" from among the milled cards into your hand");
if (otherwiseEffect != null) { if (otherwiseEffect != null) {
sb.append(". If you don't, "); text += ". If you don't, " + otherwiseEffect.getText(mode);
sb.append(otherwiseEffect.getText(mode));
} }
return sb.toString(); return text;
} }
} }