mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
Cleanup SearchLibraryPutOnLibraryEffect
This commit is contained in:
parent
f5cbb2e224
commit
a4616bc7ee
31 changed files with 33 additions and 45 deletions
|
@ -35,7 +35,7 @@ public final class AinokGuide extends CardImpl {
|
|||
Ability ability = new EntersBattlefieldTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
|
||||
|
||||
// * Search your library for a basic land card, reveal it, then shuffle your library and put that card on top of it.
|
||||
Mode mode = new Mode(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true, true));
|
||||
Mode mode = new Mode(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true));
|
||||
ability.addMode(mode);
|
||||
this.addAbility(ability);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ public final class BoggartHarbinger extends CardImpl {
|
|||
// When Boggart Harbinger enters the battlefield, you may search your library for a Goblin card, reveal it,
|
||||
// then shuffle your library and put that card on top of it.
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(target, true, true),true));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(target, true),true));
|
||||
}
|
||||
|
||||
private BoggartHarbinger(final BoggartHarbinger card) {
|
||||
|
|
|
@ -45,7 +45,7 @@ public final class BrutalizerExarch extends CardImpl {
|
|||
// When Brutalizer Exarch enters the battlefield, choose one
|
||||
// - Search your library for a creature card, reveal it, then shuffle your library and put that card on top of it;
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(new FilterCreatureCard("a creature card"));
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(target, true, true), false);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(target, true), false);
|
||||
// or put target noncreature permanent on the bottom of its owner's library.
|
||||
Mode mode = new Mode(new BrutalizerExarchEffect2());
|
||||
mode.addTarget(new TargetPermanent(filter));
|
||||
|
|
|
@ -26,7 +26,7 @@ public final class CampusGuide extends CardImpl {
|
|||
|
||||
// When Campus Guide enters the battlefield, you may search your library for a basic land card, reveal it, then shuffle and put that card on top.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(
|
||||
new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true, true
|
||||
new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true
|
||||
), true));
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ public final class ConduitOfRuin extends CardImpl {
|
|||
|
||||
// When you cast Conduit of Ruin, you may search your library for a colorless creature card with converted mana cost 7 or greater, then shuffle your library and put that card on top of it.
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
this.addAbility(new CastSourceTriggeredAbility(new SearchLibraryPutOnLibraryEffect(target, true, true), true));
|
||||
this.addAbility(new CastSourceTriggeredAbility(new SearchLibraryPutOnLibraryEffect(target, true), true));
|
||||
|
||||
// The first creature spell you cast each turn costs {2} less to cast.
|
||||
Effect effect = new SpellsCostReductionControllerEffect(filterCost, 2);
|
||||
|
|
|
@ -21,7 +21,7 @@ public final class CruelTutor extends CardImpl {
|
|||
|
||||
// Search your library for a card, then shuffle your library and put that card on top of it. You lose 2 life.
|
||||
TargetCardInLibrary target = new TargetCardInLibrary();
|
||||
this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(target, false, true));
|
||||
this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(target, false));
|
||||
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(2));
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public final class DuneMover extends CardImpl {
|
|||
|
||||
// When Dune Mover enters the battlefield, you may search your library for a basic land card, reveal it, then shuffle and put that card on top.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(
|
||||
new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND_A), true, true
|
||||
new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND_A), true
|
||||
), true));
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ public final class ElvishHarbinger extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Elvish Harbinger enters the battlefield, you may search your library for an Elf card, reveal it, then shuffle your library and put that card on top of it.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true), true));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true), true));
|
||||
// {tap}: Add one mana of any color.
|
||||
this.addAbility(new AnyColorManaAbility(new TapSourceCost()));
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public final class EnlightenedTutor extends CardImpl {
|
|||
|
||||
|
||||
// Search your library for an artifact or enchantment card and reveal that card. Shuffle your library, then put the card on top of it.
|
||||
this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true));
|
||||
this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true));
|
||||
}
|
||||
|
||||
private EnlightenedTutor(final EnlightenedTutor card) {
|
||||
|
|
|
@ -37,7 +37,7 @@ public final class FaerieHarbinger extends CardImpl {
|
|||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// When Faerie Harbinger enters the battlefield, you may search your library for a Faerie card, reveal it, then shuffle your library and put that card on top of it.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true), true));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true), true));
|
||||
}
|
||||
|
||||
private FaerieHarbinger(final FaerieHarbinger card) {
|
||||
|
|
|
@ -35,7 +35,7 @@ public final class FlamekinHarbinger extends CardImpl {
|
|||
// When Flamekin Harbinger enters the battlefield, you may search your library for an Elemental card,
|
||||
// reveal it, then shuffle your library and put that card on top of it.
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(target, true, true), true));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(target, true), true));
|
||||
}
|
||||
|
||||
private FlamekinHarbinger(final FlamekinHarbinger card) {
|
||||
|
|
|
@ -41,7 +41,7 @@ public final class ForerunnerOfTheCoalition extends CardImpl {
|
|||
this.addAbility(new EntersBattlefieldTriggeredAbility(
|
||||
new SearchLibraryPutOnLibraryEffect(
|
||||
new TargetCardInLibrary(new FilterBySubtypeCard(SubType.PIRATE)),
|
||||
true, true), true));
|
||||
true), true));
|
||||
|
||||
// Whenever another Pirate enters the battlefield under your control, each opponent loses 1 life.
|
||||
Ability ability = new EntersBattlefieldControlledTriggeredAbility(
|
||||
|
|
|
@ -43,7 +43,6 @@ public final class ForerunnerOfTheEmpire extends CardImpl {
|
|||
new EntersBattlefieldTriggeredAbility(
|
||||
new SearchLibraryPutOnLibraryEffect(
|
||||
new TargetCardInLibrary(new FilterBySubtypeCard(SubType.DINOSAUR)),
|
||||
true,
|
||||
true
|
||||
),
|
||||
true
|
||||
|
|
|
@ -45,7 +45,6 @@ public final class ForerunnerOfTheHeralds extends CardImpl {
|
|||
new EntersBattlefieldTriggeredAbility(
|
||||
new SearchLibraryPutOnLibraryEffect(
|
||||
new TargetCardInLibrary(new FilterBySubtypeCard(SubType.MERFOLK)),
|
||||
true,
|
||||
true
|
||||
),
|
||||
true
|
||||
|
|
|
@ -42,7 +42,6 @@ public final class ForerunnerOfTheLegion extends CardImpl {
|
|||
new EntersBattlefieldTriggeredAbility(
|
||||
new SearchLibraryPutOnLibraryEffect(
|
||||
new TargetCardInLibrary(new FilterBySubtypeCard(SubType.VAMPIRE)),
|
||||
true,
|
||||
true
|
||||
),
|
||||
true
|
||||
|
|
|
@ -31,7 +31,7 @@ public final class GiantHarbinger extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// When Giant Harbinger enters the battlefield, you may search your library for a Giant card, reveal it, then shuffle your library and put that card on top of it.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true), true));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true), true));
|
||||
}
|
||||
|
||||
private GiantHarbinger(final GiantHarbinger card) {
|
||||
|
|
|
@ -30,7 +30,7 @@ public final class GiantLadybug extends CardImpl {
|
|||
|
||||
// When Giant Ladybug enters the battlefield, you may search your library for a basic land card, reveal it, then shuffle and put that card on top.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(
|
||||
new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND_A), true, true
|
||||
new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND_A), true
|
||||
), true));
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public final class KithkinHarbinger extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// When Kithkin Harbinger enters the battlefield, you may search your library for a Kithkin card, reveal it, then shuffle your library and put that card on top of it.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true), true));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true), true));
|
||||
}
|
||||
|
||||
private KithkinHarbinger(final KithkinHarbinger card) {
|
||||
|
|
|
@ -27,7 +27,7 @@ public final class LoamLarva extends CardImpl {
|
|||
|
||||
// When Loam Larva enters the battlefield, you may search your library for a basic land card, reveal it, then shuffle your library and put that card on top of it.
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND);
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(target, true, true), true));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(target, true), true));
|
||||
}
|
||||
|
||||
private LoamLarva(final LoamLarva card) {
|
||||
|
|
|
@ -36,7 +36,7 @@ public final class MerrowHarbinger extends CardImpl {
|
|||
// Islandwalk
|
||||
this.addAbility(new IslandwalkAbility());
|
||||
// When Merrow Harbinger enters the battlefield, you may search your library for a Merfolk card, reveal it, then shuffle your library and put that card on top of it.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true), true));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true), true));
|
||||
}
|
||||
|
||||
private MerrowHarbinger(final MerrowHarbinger card) {
|
||||
|
|
|
@ -50,7 +50,7 @@ public final class MomirVigSimicVisionary extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever you cast a green creature spell, you may search your library for a creature card and reveal it. If you do, shuffle your library and put that card on top of it.
|
||||
Effect effect = new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), true, true);
|
||||
Effect effect = new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), true);
|
||||
effect.setText("search your library for a creature card, reveal it, then shuffle and put that card on top");
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(effect, filter, true));
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public final class MoonBlessedCleric extends CardImpl {
|
|||
// Divine Intervention — When Moon-Blessed Cleric enters the battlefield, you may search your library for an enchantment card, reveal it, then shuffle and put that card on top.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(
|
||||
new SearchLibraryPutOnLibraryEffect(
|
||||
new TargetCardInLibrary(filter), true, true
|
||||
new TargetCardInLibrary(filter), true
|
||||
), true
|
||||
).withFlavorWord("Divine Intervention"));
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public final class MwonvuliBeastTracker extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// When Mwonvuli Beast Tracker enters the battlefield, search your library for a creature card with deathtouch, hexproof, reach, or trample and reveal it. Shuffle your library and put that card on top of it.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true)));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true)));
|
||||
}
|
||||
|
||||
private MwonvuliBeastTracker(final MwonvuliBeastTracker card) {
|
||||
|
@ -56,4 +56,3 @@ public final class MwonvuliBeastTracker extends CardImpl {
|
|||
return new MwonvuliBeastTracker(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ public final class MysticalTutor extends CardImpl {
|
|||
|
||||
|
||||
// Search your library for an instant or sorcery card and reveal that card. Shuffle your library, then put the card on top of it.
|
||||
this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true));
|
||||
this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true));
|
||||
}
|
||||
|
||||
private MysticalTutor(final MysticalTutor card) {
|
||||
|
|
|
@ -24,7 +24,7 @@ public final class PersonalTutor extends CardImpl {
|
|||
|
||||
|
||||
// Search your library for a sorcery card and reveal that card. Shuffle your library, then put the card on top of it.
|
||||
this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true));
|
||||
this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true));
|
||||
}
|
||||
|
||||
private PersonalTutor(final PersonalTutor card) {
|
||||
|
|
|
@ -32,7 +32,7 @@ public final class SterlingGrove extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(ShroudAbility.getInstance(), Duration.WhileOnBattlefield, new FilterEnchantmentPermanent("enchantments"), true)));
|
||||
|
||||
// {1}, Sacrifice Sterling Grove: Search your library for an enchantment card and reveal that card. Shuffle your library, then put the card on top of it.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(new FilterEnchantmentCard("enchantment card")), true, true), new GenericManaCost(1));
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(new FilterEnchantmentCard("enchantment card")), true), new GenericManaCost(1));
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ public final class SylvanTutor extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}");
|
||||
|
||||
// Search your library for a creature card and reveal that card. Shuffle your library, then put the card on top of it.
|
||||
this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), true, true));
|
||||
this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), true));
|
||||
}
|
||||
|
||||
private SylvanTutor(final SylvanTutor card) {
|
||||
|
|
|
@ -33,7 +33,7 @@ public final class TreefolkHarbinger extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// When Treefolk Harbinger enters the battlefield, you may search your library for a Treefolk or Forest card, reveal it, then shuffle your library and put that card on top of it.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true), true));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true), true));
|
||||
}
|
||||
|
||||
private TreefolkHarbinger(final TreefolkHarbinger card) {
|
||||
|
|
|
@ -20,7 +20,7 @@ public final class VampiricTutor extends CardImpl {
|
|||
|
||||
|
||||
// Search your library for a card, then shuffle your library and put that card on top of it. You lose 2 life.
|
||||
this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(), false, true));
|
||||
this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(), false));
|
||||
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(2));
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ public final class WorldlyTutor extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}");
|
||||
|
||||
// Search your library for a creature card and reveal that card. Shuffle your library, then put the card on top of it.
|
||||
this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), true, true));
|
||||
this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), true));
|
||||
}
|
||||
|
||||
private WorldlyTutor(final WorldlyTutor card) {
|
||||
|
|
|
@ -18,24 +18,21 @@ import mage.util.CardUtil;
|
|||
public class SearchLibraryPutOnLibraryEffect extends SearchEffect {
|
||||
|
||||
private boolean reveal;
|
||||
private boolean forceShuffle;
|
||||
|
||||
public SearchLibraryPutOnLibraryEffect(TargetCardInLibrary target) {
|
||||
this(target, false, true);
|
||||
this(target, false);
|
||||
setText();
|
||||
}
|
||||
|
||||
public SearchLibraryPutOnLibraryEffect(TargetCardInLibrary target, boolean reveal, boolean forceShuffle) {
|
||||
public SearchLibraryPutOnLibraryEffect(TargetCardInLibrary target, boolean reveal) {
|
||||
super(target, Outcome.DrawCard);
|
||||
this.reveal = reveal;
|
||||
this.forceShuffle = forceShuffle;
|
||||
setText();
|
||||
}
|
||||
|
||||
public SearchLibraryPutOnLibraryEffect(final SearchLibraryPutOnLibraryEffect effect) {
|
||||
super(effect);
|
||||
this.reveal = effect.reveal;
|
||||
this.forceShuffle = effect.forceShuffle;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -55,16 +52,11 @@ public class SearchLibraryPutOnLibraryEffect extends SearchEffect {
|
|||
if (reveal && !foundCards.isEmpty()) {
|
||||
controller.revealCards(sourceObject.getIdName(), foundCards, game);
|
||||
}
|
||||
if (forceShuffle) {
|
||||
controller.shuffleLibrary(source, game);
|
||||
}
|
||||
controller.putCardsOnTopOfLibrary(foundCards, game, source, reveal);
|
||||
return true;
|
||||
}
|
||||
// shuffle
|
||||
if (forceShuffle) {
|
||||
controller.shuffleLibrary(source, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue