various fixes to look and pick effect text

This commit is contained in:
Evan Kranzler 2022-03-03 18:33:04 -05:00
parent 2675b75c60
commit 84261a1731
8 changed files with 36 additions and 27 deletions

View file

@ -37,7 +37,7 @@ public final class AjanisInfluence extends CardImpl {
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
StaticValue.get(5), false, StaticValue.get(1), filter,
Zone.LIBRARY, false, true, false, Zone.HAND, true, false, false
).setBackInRandomOrder(true).setText("Look at the top five cards of your library. "
).setBackInRandomOrder(true).setText("<br>Look at the top five cards of your library. "
+ "You may reveal a white card from among them and put it into your hand. "
+ "Put the rest on the bottom of your library in a random order.")
);

View file

@ -23,7 +23,7 @@ import mage.filter.predicate.Predicates;
*/
public final class AzcantaTheSunkenRuin extends CardImpl {
private static final FilterCard filter = new FilterCard("noncreature, nonland card");
private static final FilterCard filter = new FilterCard("a noncreature, nonland card");
static {
filter.add(Predicates.not(CardType.CREATURE.getPredicate()));

View file

@ -25,8 +25,8 @@ public final class BloodPrice extends CardImpl {
StaticFilters.FILTER_CARD, Zone.LIBRARY, false,
false, false, Zone.HAND, false,
false, true
).setText("Look at at the top four cards of your library. " +
"Put two of them into your hand and the rest on the bottom of your library in any order "));
).setText("Look at the top four cards of your library. " +
"Put two of them into your hand and the rest on the bottom of your library in any order"));
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(2));
}

View file

@ -16,7 +16,7 @@ import java.util.UUID;
*/
public final class BondOfFlourishing extends CardImpl {
private static final FilterCard filter = new FilterPermanentCard();
private static final FilterCard filter = new FilterPermanentCard("a permanent card");
public BondOfFlourishing(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}");

View file

@ -36,7 +36,7 @@ public final class LilianasSpoils extends CardImpl {
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
StaticValue.get(5), false, StaticValue.get(1), filter,
Zone.LIBRARY, false, true, false, Zone.HAND, true, false, false
).setBackInRandomOrder(true).setText("Look at the top five cards of your library. "
).setBackInRandomOrder(true).setText("<br>Look at the top five cards of your library. "
+ "You may reveal a black card from among them and put it into your hand. "
+ "Put the rest on the bottom of your library in a random order.")
);

View file

@ -36,7 +36,7 @@ public final class SarkhansDragonfire extends CardImpl {
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
StaticValue.get(5), false, StaticValue.get(1), filter,
Zone.LIBRARY, false, true, false, Zone.HAND, true, false, false
).setBackInRandomOrder(true).setText("Look at the top five cards of your library. "
).setBackInRandomOrder(true).setText("<br>Look at the top five cards of your library. "
+ "You may reveal a red card from among them and put it into your hand. "
+ "Put the rest on the bottom of your library in a random order.")
);

View file

@ -7,7 +7,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.target.common.TargetOpponent;
import java.util.UUID;
@ -22,11 +22,12 @@ public final class SealedFate extends CardImpl {
// Look at the top X cards of target opponent's library. Exile one of those cards and put the rest back on top of that player's library in any order.
this.getSpellAbility().addTarget(new TargetOpponent());
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(ManacostVariableValue.REGULAR,
false, StaticValue.get(1),
new FilterCard("a card to exile"), Zone.LIBRARY, true,
false, false, Zone.EXILED,
false, true, true));
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
ManacostVariableValue.REGULAR, false, StaticValue.get(1),
StaticFilters.FILTER_CARD, Zone.LIBRARY, true, false,
false, Zone.EXILED, false, true, true
).setText("look at the top X cards of target opponent's library. Exile one of those cards " +
"and put the rest back on top of that player's library in any order"));
}
private SealedFate(final SealedFate card) {

View file

@ -290,11 +290,15 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
return staticText;
}
StringBuilder sb = new StringBuilder();
if (numberToPick.calculate(null, null, this) > 0) {
int pickCount=numberToPick.calculate(null, null, this);
int cardCount=numberOfCards.calculate(null, null, this);
if (pickCount > 0) {
if (revealPickedCards) {
sb.append(". You may reveal ");
sb.append(filter.getMessage()).append(" from among them and put it into your ");
sb.append(filter.getMessage());
sb.append(" from among them and put ");
sb.append(pickCount>1?"the revealed cards":"it");
sb.append(" into your ");
} else if (targetPickedCards == Zone.BATTLEFIELD) {
sb.append(". ");
if (optional) {
@ -305,15 +309,15 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
sb.append("ut ").append(filter.getMessage()).append(" from among them onto the ");
} else {
sb.append(". Put ");
if (numberToPick.calculate(null, null, this) > 1) {
if (pickCount > 1) {
if (upTo) {
if (numberToPick.calculate(null, null, this) == (numberOfCards.calculate(null, null, this))) {
if (pickCount == (cardCount)) {
sb.append("any number");
} else {
sb.append("up to ").append(CardUtil.numberToText(numberToPick.calculate(null, null, this)));
sb.append("up to ").append(CardUtil.numberToText(pickCount));
}
} else {
sb.append(CardUtil.numberToText(numberToPick.calculate(null, null, this)));
sb.append(CardUtil.numberToText(pickCount));
}
} else {
sb.append("one");
@ -324,19 +328,23 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
sb.append(targetPickedCards.toString().toLowerCase(Locale.ENGLISH));
if (targetZoneLookedCards == Zone.LIBRARY) {
sb.append(". Put the rest ");
sb.append(revealPickedCards?". Put ":" and ");
sb.append(cardCount-pickCount==1?"the other ":"the rest ");
if (putOnTop) {
sb.append("back on top");
} else {
sb.append("on the bottom");
}
sb.append(" of your library in ");
if (anyOrder && !backInRandomOrder) {
sb.append("any");
} else {
sb.append("a random");
sb.append(" of your library");
if (cardCount-pickCount>1) {
sb.append(" in ");
if (anyOrder && !backInRandomOrder) {
sb.append("any");
} else {
sb.append("a random");
}
sb.append(" order");
}
sb.append(" order");
} else if (targetZoneLookedCards == Zone.GRAVEYARD) {
sb.append(" and the");
if (numberOfCards instanceof StaticValue && numberToPick instanceof StaticValue