mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 21:02:08 -08:00
[BRO] Implemented Demolition Field
This commit is contained in:
parent
74dfbc053d
commit
bd8612d25d
3 changed files with 84 additions and 1 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue