SearchLibraryPutInPlayEffect: automatic outcome

This commit is contained in:
xenohedron 2023-05-13 23:12:07 -04:00
parent 6de43dc06e
commit 3b02a42ddf
2 changed files with 9 additions and 4 deletions

View file

@ -54,7 +54,7 @@ public final class DemolitionField extends CardImpl {
)); ));
ability.addEffect(new SearchLibraryPutInPlayEffect( ability.addEffect(new SearchLibraryPutInPlayEffect(
new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND_A), new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND_A),
false, true, true, Outcome.PutLandInPlay false, true, true
)); ));
ability.addTarget(new TargetLandPermanent(filter)); ability.addTarget(new TargetLandPermanent(filter));
this.addAbility(ability); this.addAbility(ability);

View file

@ -38,14 +38,19 @@ public class SearchLibraryPutInPlayEffect extends SearchEffect {
} }
public SearchLibraryPutInPlayEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle, Outcome outcome) { public SearchLibraryPutInPlayEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle, Outcome outcome) {
this(target, tapped, forceShuffle, false, outcome); this(target, tapped, forceShuffle, false);
} }
public SearchLibraryPutInPlayEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle, boolean optional, Outcome outcome) { public SearchLibraryPutInPlayEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle, boolean optional) {
super(target, outcome); super(target, Outcome.PutCardInPlay);
this.tapped = tapped; this.tapped = tapped;
this.forceShuffle = forceShuffle; this.forceShuffle = forceShuffle;
this.optional = optional; this.optional = optional;
if (target.getDescription().contains("land")) {
this.outcome = Outcome.PutLandInPlay;
} else if (target.getDescription().contains("creature")) {
this.outcome = Outcome.PutCreatureInPlay;
}
staticText = (optional ? "you may " : "") staticText = (optional ? "you may " : "")
+ "search your library for " + "search your library for "
+ target.getDescription() + target.getDescription()