[BRO] Implemented Demolition Field

This commit is contained in:
Daniel Bomar 2022-11-05 12:25:01 -05:00
parent 74dfbc053d
commit bd8612d25d
No known key found for this signature in database
GPG key ID: C86C8658F4023918
3 changed files with 84 additions and 1 deletions

View file

@ -19,6 +19,7 @@ public class SearchLibraryPutInPlayEffect extends SearchEffect {
protected boolean tapped;
protected boolean forceShuffle;
protected boolean optional;
public SearchLibraryPutInPlayEffect(TargetCardInLibrary target) {
this(target, false, true, Outcome.PutCardInPlay);
@ -37,10 +38,16 @@ public class SearchLibraryPutInPlayEffect extends SearchEffect {
}
public SearchLibraryPutInPlayEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle, Outcome outcome) {
this(target, tapped, forceShuffle, false, outcome);
}
public SearchLibraryPutInPlayEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle, boolean optional, Outcome outcome) {
super(target, outcome);
this.tapped = tapped;
this.forceShuffle = forceShuffle;
staticText = "search your library for "
this.optional = optional;
staticText = (optional ? "you may " : "")
+ "search your library for "
+ target.getDescription()
+ (forceShuffle ? ", " : " and ")
+ (target.getMaxNumberOfTargets() > 1 ? "put them onto the battlefield" : "put it onto the battlefield")
@ -52,6 +59,7 @@ public class SearchLibraryPutInPlayEffect extends SearchEffect {
super(effect);
this.tapped = effect.tapped;
this.forceShuffle = effect.forceShuffle;
this.optional = effect.optional;
}
@Override
@ -65,6 +73,9 @@ public class SearchLibraryPutInPlayEffect extends SearchEffect {
if (player == null) {
return false;
}
if (optional && !player.chooseUse(outcome, "Search your library for " + target.getDescription() + '?', source, game)) {
return true;
}
if (player.searchLibrary(target, source, game)) {
if (!target.getTargets().isEmpty()) {
player.moveCards(new CardsImpl(target.getTargets()).getCards(game),