SearchLibraryPutInHandEffect: add parameter for "that card" text

This commit is contained in:
xenohedron 2023-05-13 20:56:16 -04:00
parent ae7266efba
commit f5cbb2e224

View file

@ -21,16 +21,23 @@ import java.util.UUID;
public class SearchLibraryPutInHandEffect extends SearchEffect { public class SearchLibraryPutInHandEffect extends SearchEffect {
private boolean revealCards; private boolean revealCards;
private boolean textThatCard;
public SearchLibraryPutInHandEffect(TargetCardInLibrary target, boolean revealCards) { public SearchLibraryPutInHandEffect(TargetCardInLibrary target, boolean revealCards) {
this(target, revealCards, false);
}
public SearchLibraryPutInHandEffect(TargetCardInLibrary target, boolean revealCards, boolean textThatCard) {
super(target, Outcome.DrawCard); super(target, Outcome.DrawCard);
this.revealCards = revealCards; this.revealCards = revealCards;
this.textThatCard = textThatCard;
setText(); setText();
} }
public SearchLibraryPutInHandEffect(final SearchLibraryPutInHandEffect effect) { public SearchLibraryPutInHandEffect(final SearchLibraryPutInHandEffect effect) {
super(effect); super(effect);
this.revealCards = effect.revealCards; this.revealCards = effect.revealCards;
this.textThatCard = effect.textThatCard;
} }
@Override @Override
@ -77,13 +84,27 @@ public class SearchLibraryPutInHandEffect extends SearchEffect {
if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) { if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) {
sb.append("up to ").append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(' '); sb.append("up to ").append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(' ');
sb.append(target.getTargetName()); sb.append(target.getTargetName());
sb.append(revealCards ? ", reveal them" : ""); if (revealCards) {
sb.append(", put them into your hand, then shuffle"); sb.append(", reveal ");
sb.append(textThatCard ? "those cards" : "them");
sb.append(", put them");
} else {
sb.append(", put ");
sb.append(textThatCard ? "those cards" : "them");
}
} else { } else {
sb.append(CardUtil.addArticle(target.getTargetName())); sb.append(CardUtil.addArticle(target.getTargetName()));
sb.append(revealCards ? ", reveal it, put it" : ", put that card"); if (revealCards) {
sb.append(" into your hand, then shuffle"); sb.append(", reveal ");
sb.append(textThatCard ? "that card" : "it");
sb.append(", put it");
} else {
sb.append(", put ");
sb.append(textThatCard ? "that card" : "it");
}
} }
sb.append(" into your hand, then shuffle");
staticText = sb.toString(); staticText = sb.toString();
} }