Merge pull request #10369 from xenohedron/refactor-search

Refactor search library effect classes to clean up text generation
This commit is contained in:
xenohedron 2023-06-04 22:18:18 +03:00 committed by GitHub
commit 807a6c95f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
286 changed files with 377 additions and 469 deletions

View file

@ -4,7 +4,6 @@ import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreatureCard;
@ -23,7 +22,7 @@ public final class GarrukCallerOfBeastsEmblem extends Emblem {
*/
public GarrukCallerOfBeastsEmblem() {
super("Emblem Garruk");
Effect effect = new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterCreatureCard("creature card")), false, true, Outcome.PutCreatureInPlay);
Effect effect = new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterCreatureCard("creature card")), false);
Ability ability = new SpellCastControllerTriggeredAbility(Zone.COMMAND, effect, StaticFilters.FILTER_SPELL_A_CREATURE, true, false);
this.getAbilities().add(ability);
}

View file

@ -3,7 +3,6 @@ package mage.game.command.emblems;
import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.command.Emblem;
@ -14,7 +13,7 @@ public class GarrukUnleashedEmblem extends Emblem {
// At the beginning of your end step, you may search your library for a creature card, put it onto the battlefield, then shuffle your library.
public GarrukUnleashedEmblem() {
super("Emblem Garruk");
Effect effect = new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), false, true, Outcome.PutCreatureInPlay)
Effect effect = new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), false)
.setText("search your library for a creature card, put it onto the battlefield, then shuffle");
this.getAbilities().add(new BeginningOfYourEndStepTriggeredAbility(Zone.COMMAND, effect, true));
}

View file

@ -49,7 +49,7 @@ public class TrailOfTheMageRingsPlane extends Plane {
this.getAbilities().add(ability);
// Active player can roll the planar die: Whenever you roll {CHAOS}, you may search your library for an instant or sorcery card, reveal it, put it into your hand, then shuffle your library
Effect chaosEffect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, new FilterInstantOrSorceryCard()), true, true);
Effect chaosEffect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, new FilterInstantOrSorceryCard()), true);
Target chaosTarget = null;
List<Effect> chaosEffects = new ArrayList<Effect>();