diff --git a/Mage.Sets/src/mage/sets/apocalypse/LayOfTheLand.java b/Mage.Sets/src/mage/sets/apocalypse/LayOfTheLand.java index 3865efa3776..611e541e75c 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/LayOfTheLand.java +++ b/Mage.Sets/src/mage/sets/apocalypse/LayOfTheLand.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.common.FilterBasicLandCard; import mage.target.common.TargetCardInLibrary; @@ -47,7 +47,9 @@ public class LayOfTheLand extends CardImpl { super(ownerId, 81, "Lay of the Land", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{G}"); this.expansionSetCode = "APC"; this.color.setGreen(true); - this.getSpellAbility().addEffect(new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(1, 1, filter))); + + // Search your library for a basic land card, reveal that card, and put it into your hand. Then shuffle your library. + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(1, 1, filter), true)); } public LayOfTheLand(final LayOfTheLand card) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/EerieProcession.java b/Mage.Sets/src/mage/sets/championsofkamigawa/EerieProcession.java index d470dd375b4..864b6573127 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/EerieProcession.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/EerieProcession.java @@ -32,7 +32,7 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -54,8 +54,9 @@ public class EerieProcession extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); this.color.setBlue(true); - TargetCardInLibrary target = new TargetCardInLibrary(filter); - this.getSpellAbility().addEffect(new SearchLibraryRevealPutInHandEffect(target)); + + // Search your library for an Arcane card, reveal that card, and put it into your hand. Then shuffle your library. + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true)); } public EerieProcession(final EerieProcession card) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/JourneyersKite.java b/Mage.Sets/src/mage/sets/championsofkamigawa/JourneyersKite.java index 98c6c08f972..cb966cbacac 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/JourneyersKite.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/JourneyersKite.java @@ -30,14 +30,14 @@ package mage.sets.championsofkamigawa; import java.util.UUID; -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.common.FilterBasicLandCard; import mage.target.common.TargetCardInLibrary; @@ -53,8 +53,11 @@ public class JourneyersKite extends CardImpl { public JourneyersKite (UUID ownerId) { super(ownerId, 257, "Journeyer's Kite", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "CHK"; - TargetCardInLibrary target = new TargetCardInLibrary(filter); - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new SearchLibraryRevealPutInHandEffect(target),new GenericManaCost(3)); + + // {3}, {tap}: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true), + new GenericManaCost(3)); ability.addCost(new TapSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TimeOfNeed.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TimeOfNeed.java index fffecc350c5..a335064b5d2 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/TimeOfNeed.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TimeOfNeed.java @@ -32,7 +32,7 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -55,8 +55,10 @@ public class TimeOfNeed extends CardImpl { super(ownerId, 247, "Time of Need", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{G}"); this.expansionSetCode = "CHK"; this.color.setGreen(true); + + // Search your library for a legendary creature card, reveal it, and put it into your hand. Then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(filter); - this.getSpellAbility().addEffect(new SearchLibraryRevealPutInHandEffect(target)); + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(target, true)); } public TimeOfNeed(final TimeOfNeed card) { diff --git a/Mage.Sets/src/mage/sets/conflux/ArmillarySphere.java b/Mage.Sets/src/mage/sets/conflux/ArmillarySphere.java index d945cb23129..6cb19e35149 100644 --- a/Mage.Sets/src/mage/sets/conflux/ArmillarySphere.java +++ b/Mage.Sets/src/mage/sets/conflux/ArmillarySphere.java @@ -29,15 +29,15 @@ package mage.sets.conflux; import java.util.UUID; -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.common.FilterBasicLandCard; import mage.target.common.TargetCardInLibrary; @@ -53,7 +53,9 @@ public class ArmillarySphere extends CardImpl { this.expansionSetCode = "CON"; // {2}, {tap}, Sacrifice Armillary Sphere: Search your library for up to two basic land cards, reveal them, and put them into your hand. Then shuffle your library. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(0, 2, new FilterBasicLandCard())), new GenericManaCost(2)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 2, new FilterBasicLandCard()), true), + new GenericManaCost(2)); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/darksteel/SteelshaperApprentice.java b/Mage.Sets/src/mage/sets/darksteel/SteelshaperApprentice.java index 117b025326a..4e3e61f3061 100644 --- a/Mage.Sets/src/mage/sets/darksteel/SteelshaperApprentice.java +++ b/Mage.Sets/src/mage/sets/darksteel/SteelshaperApprentice.java @@ -30,16 +30,17 @@ package mage.sets.darksteel; import java.util.UUID; -import mage.Constants; import mage.Constants.CardType; +import mage.Constants.ColoredManaSymbol; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.ReturnToHandSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ColoredManaCost; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -66,7 +67,11 @@ public class SteelshaperApprentice extends CardImpl { this.color.setWhite(true); this.power = new MageInt(1); this.toughness = new MageInt(3); - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(1, 1, filter)), new ColoredManaCost(Constants.ColoredManaSymbol.W)); + + // {W}, {tap}, Return Steelshaper Apprentice to its owner's hand: Search your library for an Equipment card, reveal that card, and put it into your hand. Then shuffle your library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new SearchLibraryPutInHandEffect(new TargetCardInLibrary(1, 1, filter), true), + new ColoredManaCost(ColoredManaSymbol.W)); ability.addCost(new TapSourceCost()); ability.addCost(new ReturnToHandSourceCost()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/lorwyn/WanderersTwig.java b/Mage.Sets/src/mage/sets/lorwyn/WanderersTwig.java index 3d7b914814b..d1456d7f3e1 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/WanderersTwig.java +++ b/Mage.Sets/src/mage/sets/lorwyn/WanderersTwig.java @@ -27,14 +27,14 @@ */ package mage.sets.lorwyn; -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.common.FilterBasicLandCard; import mage.target.common.TargetCardInLibrary; @@ -50,8 +50,11 @@ public class WanderersTwig extends CardImpl { public WanderersTwig(UUID ownerId) { super(ownerId, 265, "Wanderer's Twig", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); this.expansionSetCode = "LRW"; + // {1}, Sacrifice Wanderer's Twig: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library. - Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(new FilterBasicLandCard())), new GenericManaCost(1)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true), + new GenericManaCost(1)); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/magic2010/BorderlandRanger.java b/Mage.Sets/src/mage/sets/magic2010/BorderlandRanger.java index 2b1586c4073..1ccb896a5a2 100644 --- a/Mage.Sets/src/mage/sets/magic2010/BorderlandRanger.java +++ b/Mage.Sets/src/mage/sets/magic2010/BorderlandRanger.java @@ -32,7 +32,7 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.common.FilterBasicLandCard; import mage.target.common.TargetCardInLibrary; @@ -53,7 +53,9 @@ public class BorderlandRanger extends CardImpl { this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(filter), false), true)); + + // When Borderland Ranger enters the battlefield, you may search your library for a basic land card, reveal it, and put it into your hand. If you do, shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true), true)); } public BorderlandRanger(final BorderlandRanger card) { diff --git a/Mage.Sets/src/mage/sets/magic2010/Fabricate.java b/Mage.Sets/src/mage/sets/magic2010/Fabricate.java index a843d41d785..b137f46b555 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Fabricate.java +++ b/Mage.Sets/src/mage/sets/magic2010/Fabricate.java @@ -30,7 +30,7 @@ package mage.sets.magic2010; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -52,7 +52,9 @@ public class Fabricate extends CardImpl { super(ownerId, 52, "Fabricate", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); this.expansionSetCode = "M10"; this.color.setBlue(true); - this.getSpellAbility().addEffect(new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(1, filter))); + + // Search your library for an artifact card, reveal it, and put it into your hand. Then shuffle your library. + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(1, filter), true)); } public Fabricate(final Fabricate card) { diff --git a/Mage.Sets/src/mage/sets/magic2011/FaunaShaman.java b/Mage.Sets/src/mage/sets/magic2011/FaunaShaman.java index e77516e6b30..80fb8c5f464 100644 --- a/Mage.Sets/src/mage/sets/magic2011/FaunaShaman.java +++ b/Mage.Sets/src/mage/sets/magic2011/FaunaShaman.java @@ -36,13 +36,10 @@ import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.Cost; -import mage.abilities.costs.Costs; -import mage.abilities.costs.CostsImpl; import mage.abilities.costs.common.DiscardTargetCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ColoredManaCost; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreatureCard; import mage.target.common.TargetCardInHand; @@ -63,11 +60,12 @@ public class FaunaShaman extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - Costs costs = new CostsImpl(); - costs.add(new TapSourceCost()); - costs.add(new DiscardTargetCost(new TargetCardInHand(new FilterCreatureCard()))); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(new FilterCreatureCard())), costs); - ability.addManaCost(new ColoredManaCost(ColoredManaSymbol.G)); + // {G}, {tap}, Discard a creature card: Search your library for a creature card, reveal it, and put it into your hand. Then shuffle your library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterCreatureCard()), true), + new ColoredManaCost(ColoredManaSymbol.G)); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardTargetCost(new TargetCardInHand(new FilterCreatureCard()))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/magic2011/SquadronHawk.java b/Mage.Sets/src/mage/sets/magic2011/SquadronHawk.java index 4fc951fbbf7..002ab917673 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SquadronHawk.java +++ b/Mage.Sets/src/mage/sets/magic2011/SquadronHawk.java @@ -33,7 +33,7 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; @@ -61,8 +61,9 @@ public class SquadronHawk extends CardImpl { this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); + // When Squadron Hawk enters the battlefield, you may search your library for up to three cards named Squadron Hawk, reveal them, put them into your hand, then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(0, 3, filter); - this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(target), true)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true), true)); } public SquadronHawk(final SquadronHawk card) { diff --git a/Mage.Sets/src/mage/sets/magic2011/SylvanRanger.java b/Mage.Sets/src/mage/sets/magic2011/SylvanRanger.java index d8f6db1dd04..b53df651fff 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SylvanRanger.java +++ b/Mage.Sets/src/mage/sets/magic2011/SylvanRanger.java @@ -33,7 +33,7 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.common.FilterBasicLandCard; import mage.target.common.TargetCardInLibrary; @@ -55,8 +55,9 @@ public class SylvanRanger extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); + // When Sylvan Ranger enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(filter); - this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(target))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true))); } public SylvanRanger(final SylvanRanger card) { diff --git a/Mage.Sets/src/mage/sets/magic2013/LilianaOfTheDarkRealms.java b/Mage.Sets/src/mage/sets/magic2013/LilianaOfTheDarkRealms.java index 8faf4c2dbab..658307c727a 100644 --- a/Mage.Sets/src/mage/sets/magic2013/LilianaOfTheDarkRealms.java +++ b/Mage.Sets/src/mage/sets/magic2013/LilianaOfTheDarkRealms.java @@ -83,7 +83,7 @@ public class LilianaOfTheDarkRealms extends CardImpl { this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), "")); // +1: Search your library for a Swamp card, reveal it, and put it into your hand. Then shuffle your library. - this.addAbility(new LoyaltyAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true), 1)); + this.addAbility(new LoyaltyAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true), 1)); // -3: Target creature gets +X/+X or -X/-X until end of turn, where X is the number of Swamps you control. LoyaltyAbility ability = new LoyaltyAbility(new LilianaOfTheDarkRealmsEffect(), -3); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/magic2013/LilianasShade.java b/Mage.Sets/src/mage/sets/magic2013/LilianasShade.java index a39a54136e2..44125f7d37b 100644 --- a/Mage.Sets/src/mage/sets/magic2013/LilianasShade.java +++ b/Mage.Sets/src/mage/sets/magic2013/LilianasShade.java @@ -37,7 +37,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.continious.BoostSourceEffect; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandCard; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -65,7 +65,7 @@ public class LilianasShade extends CardImpl { this.toughness = new MageInt(1); // When Liliana's Shade enters the battlefield, you may search your library for a Swamp card, reveal it, put it into your hand, then shuffle your library. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(filter)))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true))); // {B}: Liliana's Shade gets +1/+1 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/TreasureMage.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/TreasureMage.java index ec9f3738e23..2ac4c07a732 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/TreasureMage.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/TreasureMage.java @@ -34,7 +34,7 @@ import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.SearchEffect; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.FilterCard; @@ -63,8 +63,11 @@ public class TreasureMage extends CardImpl { this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(2); + + // When Treasure Mage enters the battlefield, you may search your library for an artifact card with converted mana cost 6 or greater, + // reveal that card, and put it into your hand. If you do, shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter); - SearchEffect effect = new SearchLibraryRevealPutInHandEffect(target, false); + SearchEffect effect = new SearchLibraryPutInHandEffect(target, true, true); this.addAbility(new EntersBattlefieldTriggeredAbility(effect, true)); } diff --git a/Mage.Sets/src/mage/sets/morningtide/IdyllicTutor.java b/Mage.Sets/src/mage/sets/morningtide/IdyllicTutor.java index 27d34129885..5351b3c35b3 100644 --- a/Mage.Sets/src/mage/sets/morningtide/IdyllicTutor.java +++ b/Mage.Sets/src/mage/sets/morningtide/IdyllicTutor.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -52,7 +52,9 @@ public class IdyllicTutor extends CardImpl { super(ownerId, 12, "Idyllic Tutor", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}"); this.expansionSetCode = "MOR"; this.color.setWhite(true); - this.getSpellAbility().addEffect(new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(filter))); + + // Search your library for an enchantment card, reveal it, and put it into your hand. Then shuffle your library. + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true)); } public IdyllicTutor(final IdyllicTutor card) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/MycosynthWellspring.java b/Mage.Sets/src/mage/sets/newphyrexia/MycosynthWellspring.java index f8e227f800c..a034602bfc8 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/MycosynthWellspring.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/MycosynthWellspring.java @@ -30,9 +30,9 @@ package mage.sets.newphyrexia; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.DiesTriggeredAbility; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.common.FilterBasicLandCard; import mage.target.common.TargetCardInLibrary; @@ -49,8 +49,10 @@ public class MycosynthWellspring extends CardImpl { super(ownerId, 145, "Mycosynth Wellspring", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "NPH"; - this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(filter)))); - this.addAbility(new DiesTriggeredAbility(new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(filter)))); + // When Mycosynth Wellspring enters the battlefield or is put into a graveyard from the battlefield, + // you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true), true)); + this.addAbility(new DiesTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true), true)); } public MycosynthWellspring(final MycosynthWellspring card) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SeekTheHorizon.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SeekTheHorizon.java index 87ac38f3419..7fe9a8e204a 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SeekTheHorizon.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SeekTheHorizon.java @@ -30,7 +30,7 @@ package mage.sets.saviorsofkamigawa; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.common.FilterBasicLandCard; import mage.target.common.TargetCardInLibrary; @@ -46,7 +46,7 @@ public class SeekTheHorizon extends CardImpl { this.expansionSetCode = "SOK"; this.color.setGreen(true); // Search your library for up to three basic land cards, reveal them, and put them into your hand. Then shuffle your library. - this.getSpellAbility().addEffect(new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(0, 3, new FilterBasicLandCard()))); + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 3, new FilterBasicLandCard()), true)); } public SeekTheHorizon(final SeekTheHorizon card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/HorizonSpellbomb.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/HorizonSpellbomb.java index f662821fc9d..8715ccf9cdc 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/HorizonSpellbomb.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/HorizonSpellbomb.java @@ -38,7 +38,7 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.effects.common.DrawCardControllerEffect; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.common.FilterBasicLandCard; import mage.target.common.TargetCardInLibrary; @@ -55,12 +55,14 @@ public class HorizonSpellbomb extends CardImpl { super(ownerId, 165, "Horizon Spellbomb", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); this.expansionSetCode = "SOM"; + // {2}, {tap}, Sacrifice Horizon Spellbomb: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(filter)), + new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true), new ManaCostsImpl("{2}")); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); + // When Horizon Spellbomb is put into a graveyard from the battlefield, you may pay {G}. If you do, draw a card. this.addAbility(new DiesTriggeredAbility(new DoIfCostPaid(new DrawCardControllerEffect(1), new ManaCostsImpl("{G}")))); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrinketMage.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrinketMage.java index 0d409da8235..a34b4e47577 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrinketMage.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrinketMage.java @@ -33,12 +33,12 @@ import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.SearchEffect; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.FilterCard; -import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.target.common.TargetCardInLibrary; import java.util.UUID; @@ -63,8 +63,10 @@ public class TrinketMage extends CardImpl { this.color.setBlue(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter); - SearchEffect effect = new SearchLibraryRevealPutInHandEffect(target, false); + + // When Trinket Mage enters the battlefield, you may search your library for an artifact card with converted mana cost 1 or less, reveal that card, and put it into your hand. If you do, shuffle your library. + TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter); + SearchEffect effect = new SearchLibraryPutInHandEffect(target, true, true); this.addAbility(new EntersBattlefieldTriggeredAbility(effect, true)); } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/SafewrightQuest.java b/Mage.Sets/src/mage/sets/shadowmoor/SafewrightQuest.java index d1092053c68..2453c1f840e 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/SafewrightQuest.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/SafewrightQuest.java @@ -30,7 +30,7 @@ package mage.sets.shadowmoor; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; @@ -57,7 +57,7 @@ public class SafewrightQuest extends CardImpl { this.color.setWhite(true); // Search your library for a Forest or Plains card, reveal it, and put it into your hand. Then shuffle your library. - this.getSpellAbility().addEffect(new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(filter))); + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true)); } public SafewrightQuest(final SafewrightQuest card) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/RangerOfEos.java b/Mage.Sets/src/mage/sets/shardsofalara/RangerOfEos.java index 1edef336abf..88e9bbc0fc8 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/RangerOfEos.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/RangerOfEos.java @@ -33,7 +33,7 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.Filter.ComparisonType; import mage.filter.FilterCard; @@ -63,8 +63,10 @@ public class RangerOfEos extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(2); + // When Ranger of Eos enters the battlefield, you may search your library for up to two creature cards with converted mana cost 1 or less, + // reveal them, and put them into your hand. If you do, shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(0, 2, filter); - this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(target, false), true)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true), true)); } public RangerOfEos(final RangerOfEos card) { diff --git a/Mage.Sets/src/mage/sets/tenth/CivicWayfinder.java b/Mage.Sets/src/mage/sets/tenth/CivicWayfinder.java index 07d1435dfe8..75364f06375 100644 --- a/Mage.Sets/src/mage/sets/tenth/CivicWayfinder.java +++ b/Mage.Sets/src/mage/sets/tenth/CivicWayfinder.java @@ -32,7 +32,7 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.common.FilterBasicLandCard; import mage.target.common.TargetCardInLibrary; @@ -52,7 +52,9 @@ public class CivicWayfinder extends CardImpl { this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(new FilterBasicLandCard()), false), true)); + + // When Civic Wayfinder enters the battlefield, you may search your library for a basic land card, reveal it, and put it into your hand. If you do, shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true, true), true)); } public CivicWayfinder(final CivicWayfinder card) { diff --git a/Mage.Sets/src/mage/sets/tenth/SylvanScrying.java b/Mage.Sets/src/mage/sets/tenth/SylvanScrying.java index c4a25cfe745..e4021495ad7 100644 --- a/Mage.Sets/src/mage/sets/tenth/SylvanScrying.java +++ b/Mage.Sets/src/mage/sets/tenth/SylvanScrying.java @@ -30,7 +30,7 @@ package mage.sets.tenth; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandCard; import mage.target.common.TargetCardInLibrary; @@ -47,7 +47,9 @@ public class SylvanScrying extends CardImpl { super(ownerId, 302, "Sylvan Scrying", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{G}"); this.expansionSetCode = "10E"; this.color.setGreen(true); - this.getSpellAbility().addEffect(new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(filter))); + + // Search your library for a land card, reveal it, and put it into your hand. Then shuffle your library. + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true)); } public SylvanScrying(final SylvanScrying card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/EyeOfUgin.java b/Mage.Sets/src/mage/sets/worldwake/EyeOfUgin.java index 78fecd8d52d..a4ac95eb089 100644 --- a/Mage.Sets/src/mage/sets/worldwake/EyeOfUgin.java +++ b/Mage.Sets/src/mage/sets/worldwake/EyeOfUgin.java @@ -41,7 +41,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.CostModificationEffectImpl; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.common.FilterCreatureCard; @@ -50,7 +50,6 @@ import mage.game.Game; import mage.target.common.TargetCardInLibrary; /** - * TODO: Implement this better. * * @author maurer.it_at_gmail.com */ @@ -69,8 +68,12 @@ public class EyeOfUgin extends CardImpl { this.supertype.add("Legendary"); this.subtype.add("Land"); + // Colorless Eldrazi spells you cast cost {2} less to cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new EyeOfUginCostReductionEffect())); - Ability searchAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(filter)), new TapSourceCost()); + // {7}, {tap}: Search your library for a colorless creature card, reveal it, and put it into your hand. Then shuffle your library. + Ability searchAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true), + new TapSourceCost()); searchAbility.addCost(new ManaCostsImpl("{7}")); this.addAbility(searchAbility); } diff --git a/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java b/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java index 9c75761e59d..95131c75813 100644 --- a/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java +++ b/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java @@ -33,7 +33,7 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; @@ -62,7 +62,8 @@ public class PilgrimsEye extends CardImpl { this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(filter)))); + // When Pilgrim's Eye enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true), true)); } public PilgrimsEye (final PilgrimsEye card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java b/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java index 67a0f611ed5..d1a749a5cbf 100644 --- a/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java +++ b/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java @@ -37,7 +37,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.PlayTargetWithoutPayingManaEffect; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -71,7 +71,7 @@ public class StoneforgeMystic extends CardImpl { // When Stoneforge Mystic enters the battlefield, you may search your library for an Equipment card, reveal it, put it into your hand, then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(1, 1, filter); - this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryRevealPutInHandEffect(target), true)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true), true)); // {1}{W}, {T}: You may put an Equipment card from your hand onto the battlefield. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PlayTargetWithoutPayingManaEffect(), new ManaCostsImpl("{1}{W}")); diff --git a/Mage.Sets/src/mage/sets/zendikar/ExpeditionMap.java b/Mage.Sets/src/mage/sets/zendikar/ExpeditionMap.java index c2feb2cd436..b4970e6a4b4 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ExpeditionMap.java +++ b/Mage.Sets/src/mage/sets/zendikar/ExpeditionMap.java @@ -35,7 +35,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandCard; import mage.target.common.TargetCardInLibrary; @@ -50,8 +50,11 @@ public class ExpeditionMap extends CardImpl { super(ownerId, 201, "Expedition Map", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); this.expansionSetCode = "ZEN"; + // {2}, {tap}, Sacrifice Expedition Map: Search your library for a land card, reveal it, and put it into your hand. Then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(new FilterLandCard()); - SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryRevealPutInHandEffect(target), new GenericManaCost(2)); + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new SearchLibraryPutInHandEffect(target, true), + new GenericManaCost(2)); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); diff --git a/Mage.Sets/src/mage/sets/zendikar/TrapmakersSnare.java b/Mage.Sets/src/mage/sets/zendikar/TrapmakersSnare.java index 44c49fe8bf3..8e1e2c79955 100644 --- a/Mage.Sets/src/mage/sets/zendikar/TrapmakersSnare.java +++ b/Mage.Sets/src/mage/sets/zendikar/TrapmakersSnare.java @@ -30,7 +30,7 @@ package mage.sets.zendikar; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -54,7 +54,8 @@ public class TrapmakersSnare extends CardImpl { this.color.setBlue(true); - this.getSpellAbility().addEffect(new SearchLibraryRevealPutInHandEffect(new TargetCardInLibrary(filter))); + // Search your library for a Trap card, reveal it, and put it into your hand. Then shuffle your library. + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true)); } public TrapmakersSnare(final TrapmakersSnare card) { diff --git a/Mage/src/mage/abilities/effects/common/search/SearchLibraryRevealPutInHandEffect.java b/Mage/src/mage/abilities/effects/common/search/SearchLibraryRevealPutInHandEffect.java deleted file mode 100644 index 10a010916d3..00000000000 --- a/Mage/src/mage/abilities/effects/common/search/SearchLibraryRevealPutInHandEffect.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ - -package mage.abilities.effects.common.search; - -import java.util.List; -import java.util.UUID; -import mage.Constants.Outcome; -import mage.Constants.Zone; -import mage.abilities.Ability; -import mage.abilities.effects.SearchEffect; -import mage.cards.Card; -import mage.cards.Cards; -import mage.cards.CardsImpl; -import mage.game.Game; -import mage.players.Player; -import mage.target.common.TargetCardInLibrary; - -/** - * - * @author BetaSteward_at_googlemail.com - */ -public class SearchLibraryRevealPutInHandEffect extends SearchEffect { - - boolean forceShuffle; - - public SearchLibraryRevealPutInHandEffect(TargetCardInLibrary target) { - this(target, true); - } - - public SearchLibraryRevealPutInHandEffect(TargetCardInLibrary target, boolean forceShuffle) { - super(target, Outcome.DrawCard); - this.forceShuffle = forceShuffle; - setText(); - } - - public SearchLibraryRevealPutInHandEffect(final SearchLibraryRevealPutInHandEffect effect) { - super(effect); - this.forceShuffle = effect.forceShuffle; - } - - @Override - public SearchLibraryRevealPutInHandEffect copy() { - return new SearchLibraryRevealPutInHandEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null) - return false; - if (player.searchLibrary(target, game)) { - if (target.getTargets().size() > 0) { - Cards revealed = new CardsImpl(); - for (UUID cardId: (List)target.getTargets()) { - Card card = player.getLibrary().getCard(cardId, game); - if (card != null) { - card.moveToZone(Zone.HAND, source.getId(), game, false); - revealed.add(card); - } - } - player.revealCards("Search", revealed, game); - } - player.shuffleLibrary(game); - return true; - } - if (forceShuffle) - player.shuffleLibrary(game); - return false; - } - - private void setText() { - StringBuilder sb = new StringBuilder(); - sb.append("Search your library for "); - if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) { - sb.append("up to ").append(target.getMaxNumberOfTargets()).append(" "); - sb.append(target.getTargetName()).append(", reveal them, and put them into your hand"); - } - else { - sb.append("a ").append(target.getTargetName()).append(", reveal that card, and put it into your hand"); - } - if (forceShuffle) - sb.append(". Then shuffle your library"); - else - sb.append(". If you do, shuffle your library"); - - staticText = sb.toString(); - } -}