fixed text on wish effects

This commit is contained in:
Evan Kranzler 2021-03-12 15:05:37 -05:00
parent 9c56a98dc9
commit 19ec3e399e
4 changed files with 30 additions and 22 deletions

View file

@ -1,17 +1,16 @@
package mage.cards.d;
import java.util.UUID;
import mage.abilities.effects.common.ExileSpellEffect;
import mage.abilities.effects.common.LoseHalfLifeEffect;
import mage.abilities.effects.common.WishEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
*
* @author Plopman
*/
public final class DeathWish extends CardImpl {
@ -20,7 +19,7 @@ public final class DeathWish extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}{B}");
// You may choose a card you own from outside the game and put it into your hand.
this.getSpellAbility().addEffect(new WishEffect(new FilterCard(), false));
this.getSpellAbility().addEffect(new WishEffect(StaticFilters.FILTER_CARD_A, false));
// You lose half your life, rounded up.
this.getSpellAbility().addEffect(new LoseHalfLifeEffect());

View file

@ -16,7 +16,7 @@ import mage.filter.predicate.Predicates;
*/
public final class LivingWish extends CardImpl {
private static final FilterCard filter = new FilterCard("creature or land card");
private static final FilterCard filter = new FilterCard("a creature or land card");
static {
filter.add(Predicates.or(

View file

@ -1,32 +1,31 @@
package mage.cards.m;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.common.WishEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/**
*
* @author L_J
*/
public final class MastermindsAcquisition extends CardImpl {
public MastermindsAcquisition(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}{B}");
// Choose one -
// Search your library for a card and put that card into your hand. Then shuffle your library.
this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary()));
// Choose a card you own from outside the game and put it into your hand.
Mode mode = new Mode();
mode.addEffect(new WishEffect(new FilterCard(), false));
Mode mode = new Mode(new WishEffect(StaticFilters.FILTER_CARD_A, false)
.setText("Put a card you own from outside the game into your hand"));
this.getSpellAbility().addMode(mode);
}

View file

@ -27,10 +27,6 @@ public class WishEffect extends OneShotEffect {
private final String choiceText;
private final boolean topOfLibrary;
public WishEffect() {
this(new FilterCard());
}
public WishEffect(FilterCard filter) {
this(filter, true);
}
@ -49,13 +45,27 @@ public class WishEffect extends OneShotEffect {
this.alsoFromExile = alsoFromExile;
this.reveal = reveal;
this.topOfLibrary = topOfLibrary;
choiceText = (topOfLibrary ? "Put " : "Choose ") + filter.getMessage() + " you own from outside the game"
+ (alsoFromExile ? " or in exile" : "")
+ (reveal ? ", reveal that card," : "")
+ (topOfLibrary ? " on top of your library." : " and put it into your hand.");
if (!reveal) {
choiceText = "Put a card you own from outside the game "
+ (topOfLibrary ? "on top of your library." : "into your hand.");
} else {
choiceText = (topOfLibrary ? "Put " : "Reveal ") + filter.getMessage() + " you own from outside the game"
+ (alsoFromExile ? " or choose " + makeExileText(filter)
+ " you own in exile. Put that card into your hand." : " and put it into your hand.");
}
staticText = "You may " + Character.toLowerCase(choiceText.charAt(0)) + choiceText.substring(1, choiceText.length() - 1);
}
private static String makeExileText(FilterCard filter) {
String s = filter.getMessage();
if (s.startsWith("a ")) {
return s.replace("a ", "a face-up ");
} else if (s.startsWith("an ")) {
return s.replace("an ", "a face-up ");
}
return "a face-up " + s;
}
public WishEffect(final WishEffect effect) {
super(effect);
this.filter = effect.filter;