mirror of
https://github.com/correl/mage.git
synced 2025-02-19 11:07:01 +00:00
[refactoring] removed SearchLibraryRevealPutInHandEffect (duplicate)
This commit is contained in:
parent
2a94f4b0c7
commit
c611983f57
30 changed files with 122 additions and 189 deletions
Mage.Sets/src/mage/sets
apocalypse
championsofkamigawa
conflux
darksteel
lorwyn
magic2010
magic2011
magic2013
mirrodinbesieged
morningtide
newphyrexia
saviorsofkamigawa
scarsofmirrodin
shadowmoor
shardsofalara
tenth
worldwake
zendikar
Mage/src/mage/abilities/effects/common/search
|
@ -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<LayOfTheLand> {
|
|||
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) {
|
||||
|
|
|
@ -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<EerieProcession> {
|
|||
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) {
|
||||
|
|
|
@ -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<JourneyersKite> {
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -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<TimeOfNeed> {
|
|||
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) {
|
||||
|
|
|
@ -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<ArmillarySphere> {
|
|||
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);
|
||||
|
|
|
@ -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<SteelshaperApprentice> {
|
|||
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);
|
||||
|
|
|
@ -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<WanderersTwig> {
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -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<BorderlandRanger> {
|
|||
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) {
|
||||
|
|
|
@ -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<Fabricate> {
|
|||
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) {
|
||||
|
|
|
@ -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<FaunaShaman> {
|
|||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
Costs<Cost> 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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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<SquadronHawk> {
|
|||
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) {
|
||||
|
|
|
@ -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<SylvanRanger> {
|
|||
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) {
|
||||
|
|
|
@ -83,7 +83,7 @@ public class LilianaOfTheDarkRealms extends CardImpl<LilianaOfTheDarkRealms> {
|
|||
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());
|
||||
|
|
|
@ -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<LilianasShade> {
|
|||
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}")));
|
||||
}
|
||||
|
|
|
@ -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<TreasureMage> {
|
|||
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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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<IdyllicTutor> {
|
|||
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) {
|
||||
|
|
|
@ -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<MycosynthWellspring> {
|
|||
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) {
|
||||
|
|
|
@ -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<SeekTheHorizon> {
|
|||
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) {
|
||||
|
|
|
@ -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<HorizonSpellbomb> {
|
|||
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}"))));
|
||||
}
|
||||
|
||||
|
|
|
@ -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<TrinketMage> {
|
|||
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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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<SafewrightQuest> {
|
|||
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) {
|
||||
|
|
|
@ -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<RangerOfEos> {
|
|||
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) {
|
||||
|
|
|
@ -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<CivicWayfinder> {
|
|||
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) {
|
||||
|
|
|
@ -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<SylvanScrying> {
|
|||
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) {
|
||||
|
|
|
@ -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<EyeOfUgin> {
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -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<PilgrimsEye> {
|
|||
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) {
|
||||
|
|
|
@ -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<StoneforgeMystic> {
|
|||
|
||||
// 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}"));
|
||||
|
|
|
@ -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<ExpeditionMap> {
|
|||
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());
|
||||
|
||||
|
|
|
@ -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<TrapmakersSnare> {
|
|||
|
||||
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) {
|
||||
|
|
|
@ -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<SearchLibraryRevealPutInHandEffect> {
|
||||
|
||||
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<UUID>)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();
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue