diff --git a/Mage.Sets/src/mage/cards/a/ALittleChat.java b/Mage.Sets/src/mage/cards/a/ALittleChat.java
index aeec6476a12..ff344510382 100644
--- a/Mage.Sets/src/mage/cards/a/ALittleChat.java
+++ b/Mage.Sets/src/mage/cards/a/ALittleChat.java
@@ -1,13 +1,11 @@
package mage.cards.a;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.CasualtyAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -23,10 +21,7 @@ public final class ALittleChat extends CardImpl {
this.addAbility(new CasualtyAbility(this, 1));
// Look at the top two cards of your library. Put one of them into your hand and the other on the bottom of your library.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(2), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false
- ));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(2, 1, PutCards.HAND, PutCards.BOTTOM_ANY));
}
private ALittleChat(final ALittleChat card) {
diff --git a/Mage.Sets/src/mage/cards/a/AcclaimedContender.java b/Mage.Sets/src/mage/cards/a/AcclaimedContender.java
index 9ffedd21655..51003c288d8 100644
--- a/Mage.Sets/src/mage/cards/a/AcclaimedContender.java
+++ b/Mage.Sets/src/mage/cards/a/AcclaimedContender.java
@@ -5,14 +5,13 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
@@ -56,9 +55,8 @@ public final class AcclaimedContender extends CardImpl {
// When Acclaimed Contender enters the battlefield, if you control another Knight, look at the top five cards of your library. You may reveal a Knight, Aura, Equipment, or legendary artifact card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), filter2, Zone.LIBRARY, false,
- true, false, Zone.HAND, true, false, false
- ).setBackInRandomOrder(true)), condition, "When {this} enters the battlefield, " +
+ 5, 1, filter2, PutCards.HAND, PutCards.BOTTOM_RANDOM
+ )), condition, "When {this} enters the battlefield, " +
"if you control another Knight, look at the top five cards of your library. " +
"You may reveal a Knight, Aura, Equipment, or legendary artifact card from among them " +
"and put it into your hand. Put the rest on the bottom of your library in a random order."
diff --git a/Mage.Sets/src/mage/cards/a/AdventureAwaits.java b/Mage.Sets/src/mage/cards/a/AdventureAwaits.java
index ec7fc5b76c9..52d331b8222 100644
--- a/Mage.Sets/src/mage/cards/a/AdventureAwaits.java
+++ b/Mage.Sets/src/mage/cards/a/AdventureAwaits.java
@@ -1,16 +1,14 @@
package mage.cards.a;
import mage.abilities.Ability;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.Mode;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.*;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
-import mage.target.TargetCard;
-import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
@@ -22,7 +20,8 @@ public final class AdventureAwaits extends CardImpl {
public AdventureAwaits(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}");
- // Look at the top five cards of your library. You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in a random order. If you don't put a card into your hand this way, draw a card.
+ // Look at the top five cards of your library. You may reveal a creature card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order. If you don't put a card into your hand this way, draw a card.
this.getSpellAbility().addEffect(new AdventureAwaitsEffect());
}
@@ -36,14 +35,10 @@ public final class AdventureAwaits extends CardImpl {
}
}
-class AdventureAwaitsEffect extends OneShotEffect {
+class AdventureAwaitsEffect extends LookLibraryAndPickControllerEffect {
AdventureAwaitsEffect() {
- super(Outcome.Benefit);
- staticText = "Look at the top five cards of your library. " +
- "You may reveal a creature card from among them and put it into your hand. " +
- "Put the rest on the bottom of your library in a random order. " +
- "If you didn't put a card into your hand this way, draw a card.";
+ super(5, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.BOTTOM_RANDOM);
}
private AdventureAwaitsEffect(final AdventureAwaitsEffect effect) {
@@ -56,25 +51,16 @@ class AdventureAwaitsEffect extends OneShotEffect {
}
@Override
- public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- if (player == null) {
- return false;
- }
- Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 5));
- TargetCard target = new TargetCardInLibrary(0, 1, StaticFilters.FILTER_CARD_CREATURE);
- player.choose(outcome, cards, target, game);
- Card card = game.getCard(target.getFirstTarget());
- if (card != null && player.chooseUse(outcome, "Put " + card.getName() + " into your hand?",
- "Otherwise draw a card", "Put into hand", "Draw a card", source, game
- )) {
- player.moveCards(card, Zone.HAND, source, game);
- cards.remove(card);
- player.putCardsOnBottomOfLibrary(cards, game, source, false);
- } else {
- player.putCardsOnBottomOfLibrary(cards, game, source, false);
+ public boolean actionWithPickedCards(Game game, Ability source, Player player, Cards pickedCards, Cards otherCards) {
+ super.actionWithPickedCards(game, source, player, pickedCards, otherCards);
+ if (pickedCards.isEmpty()) {
player.drawCards(1, source, game);
}
return true;
}
+
+ @Override
+ public String getText(Mode mode) {
+ return super.getText(mode).concat(". If you didn't put a card into your hand this way, draw a card");
+ }
}
diff --git a/Mage.Sets/src/mage/cards/a/AdventurousImpulse.java b/Mage.Sets/src/mage/cards/a/AdventurousImpulse.java
index afcafa4f6f3..4b447bd211e 100644
--- a/Mage.Sets/src/mage/cards/a/AdventurousImpulse.java
+++ b/Mage.Sets/src/mage/cards/a/AdventurousImpulse.java
@@ -1,14 +1,12 @@
-
package mage.cards.a;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.filter.FilterCard;
-import mage.filter.predicate.Predicates;
+import mage.filter.StaticFilters;
/**
*
@@ -16,18 +14,14 @@ import mage.filter.predicate.Predicates;
*/
public final class AdventurousImpulse extends CardImpl {
- private static final FilterCard filter = new FilterCard("a creature or land card");
-
- static {
- filter.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.LAND.getPredicate()));
- }
-
public AdventurousImpulse(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{G}");
- //Look at the top three cards of your library. You may reveal a creature or land card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(3), false, StaticValue.get(1), filter, false));
-
+ // Look at the top three cards of your library.
+ // You may reveal a creature or land card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in any order.
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
+ 3, 1, StaticFilters.FILTER_CARD_CREATURE_OR_LAND, PutCards.HAND, PutCards.BOTTOM_ANY));
}
private AdventurousImpulse(final AdventurousImpulse card) {
diff --git a/Mage.Sets/src/mage/cards/a/AdviceFromTheFae.java b/Mage.Sets/src/mage/cards/a/AdviceFromTheFae.java
index b6542288891..a4cd6e707c4 100644
--- a/Mage.Sets/src/mage/cards/a/AdviceFromTheFae.java
+++ b/Mage.Sets/src/mage/cards/a/AdviceFromTheFae.java
@@ -1,37 +1,36 @@
-
package mage.cards.a;
-import java.util.Objects;
-import java.util.Set;
import java.util.UUID;
-import mage.MageObject;
import mage.abilities.Ability;
-import mage.abilities.effects.OneShotEffect;
-import mage.cards.*;
+import mage.abilities.condition.Condition;
+import mage.abilities.decorator.ConditionalOneShotEffect;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
-import mage.filter.common.FilterControlledCreaturePermanent;
-import mage.filter.common.FilterCreaturePermanent;
-import mage.filter.predicate.permanent.ControllerIdPredicate;
+import mage.filter.StaticFilters;
import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
/**
*
- * @author jeffwadsworth
+ * @author awjackson
*/
public final class AdviceFromTheFae extends CardImpl {
public AdviceFromTheFae(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2/U}{2/U}{2/U}");
- // ({2U} can be paid with any two mana or with {U}. This card's converted mana cost is 6.)
- // Look at the top five cards of your library. If you control more creatures than each other player, put two of those cards into your hand. Otherwise, put one of them into your hand. Then put the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(new AdviceFromTheFaeEffect());
-
+ // Look at the top five cards of your library. If you control more creatures than each other player,
+ // put two of those cards into your hand. Otherwise, put one of them into your hand.
+ // Then put the rest on the bottom of your library in any order.
+ this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
+ new LookLibraryAndPickControllerEffect(5, 2, PutCards.HAND, PutCards.BOTTOM_ANY),
+ new LookLibraryAndPickControllerEffect(5, 1, PutCards.HAND, PutCards.BOTTOM_ANY),
+ AdviceFromTheFaeCondition.instance, "Look at the top five cards of your library. " +
+ "If you control more creatures than each other player, put two of those cards into your hand. " +
+ "Otherwise, put one of them into your hand. Then put the rest on the bottom of your library in any order."
+ ));
}
private AdviceFromTheFae(final AdviceFromTheFae card) {
@@ -44,52 +43,23 @@ public final class AdviceFromTheFae extends CardImpl {
}
}
-class AdviceFromTheFaeEffect extends OneShotEffect {
-
- public AdviceFromTheFaeEffect() {
- super(Outcome.DrawCard);
- this.staticText = "Look at the top five cards of your library. If you control more creatures than each other player, put two of those cards into your hand. Otherwise, put one of them into your hand. Then put the rest on the bottom of your library in any order";
- }
-
- public AdviceFromTheFaeEffect(final AdviceFromTheFaeEffect effect) {
- super(effect);
- }
-
- @Override
- public AdviceFromTheFaeEffect copy() {
- return new AdviceFromTheFaeEffect(this);
- }
+enum AdviceFromTheFaeCondition implements Condition {
+ instance;
@Override
public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- MageObject mageObject = game.getObject(source);
- if (controller != null && mageObject != null) {
- Set topCards = controller.getLibrary().getTopCards(game, 5);
- Cards cardsFromLibrary = new CardsImpl();
- for (Card card : topCards) {
- cardsFromLibrary.add(card);
+ int max = 0;
+ UUID controllerId = source.getControllerId();
+ for (UUID playerId : game.getState().getPlayersInRange(controllerId, game)) {
+ if (!playerId.equals(controllerId)) {
+ max = Math.max(max, game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, playerId, game));
}
- controller.lookAtCards(mageObject.getIdName(), cardsFromLibrary, game);
- int max = 0;
- for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
- FilterCreaturePermanent filter = new FilterCreaturePermanent();
- filter.add(new ControllerIdPredicate(playerId));
- if (!Objects.equals(playerId, controller.getId())) {
- if (max < game.getBattlefield().countAll(filter, playerId, game)) {
- max = game.getBattlefield().countAll(filter, playerId, game);
- }
- }
- }
- boolean moreCreatures = game.getBattlefield().countAll(new FilterControlledCreaturePermanent(), controller.getId(), game) > max;
- TargetCard target = new TargetCard(moreCreatures ? 2 : 1, Zone.LIBRARY, new FilterCard());
- if (controller.choose(Outcome.DrawCard, cardsFromLibrary, target, game)) {
- cardsFromLibrary.removeAll(target.getTargets());
- controller.moveCards(new CardsImpl(target.getTargets()), Zone.HAND, source, game);
- }
- controller.putCardsOnBottomOfLibrary(cardsFromLibrary, game, source, true);
- return true;
}
- return false;
+ return game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, controllerId, game) > max;
+ }
+
+ @Override
+ public String toString() {
+ return "you control more creatures than each other player";
}
}
diff --git a/Mage.Sets/src/mage/cards/a/AjaniMentorOfHeroes.java b/Mage.Sets/src/mage/cards/a/AjaniMentorOfHeroes.java
index d79182900b1..f3c9a18acd4 100644
--- a/Mage.Sets/src/mage/cards/a/AjaniMentorOfHeroes.java
+++ b/Mage.Sets/src/mage/cards/a/AjaniMentorOfHeroes.java
@@ -6,6 +6,7 @@ import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.counter.DistributeCountersEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@@ -13,7 +14,6 @@ import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.TargetController;
-import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreaturePermanent;
@@ -49,8 +49,9 @@ public final class AjaniMentorOfHeroes extends CardImpl {
ability.addTarget(new TargetCreaturePermanentAmount(3, filter));
this.addAbility(ability);
- // +1: Look at the top four cards of your library. You may reveal an Aura, creature, or planeswalker card from among them and put that card into your hand. Put the rest on the bottom of your library in any order.
- this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(4, 1, filterCard, true, false, Zone.HAND, true), 1));
+ // +1: Look at the top four cards of your library. You may reveal an Aura, creature, or planeswalker card
+ // from among them and put it into your hand. Put the rest on the bottom of your library in any order.
+ this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(4, 1, filterCard, PutCards.HAND, PutCards.BOTTOM_ANY), 1));
// -8: You gain 100 life.
this.addAbility(new LoyaltyAbility(new GainLifeEffect(100), -8));
diff --git a/Mage.Sets/src/mage/cards/a/AjanisInfluence.java b/Mage.Sets/src/mage/cards/a/AjanisInfluence.java
index d5c036b26f2..fd10941fba3 100644
--- a/Mage.Sets/src/mage/cards/a/AjanisInfluence.java
+++ b/Mage.Sets/src/mage/cards/a/AjanisInfluence.java
@@ -2,13 +2,12 @@ package mage.cards.a;
import java.util.UUID;
import mage.ObjectColor;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
@@ -35,12 +34,7 @@ public final class AjanisInfluence extends CardImpl {
// Look at the top five cards of your library. You may reveal a white card form among them and put it into your hand. Put the rest on the bottom of your library in a random order.
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), filter,
- Zone.LIBRARY, false, true, false, Zone.HAND, true, false, false
- ).setBackInRandomOrder(true).setText("
Look at the top five cards of your library. "
- + "You may reveal a white card from among them and put it into your hand. "
- + "Put the rest on the bottom of your library in a random order.")
- );
+ 5, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM).concatBy("
"));
}
private AjanisInfluence(final AjanisInfluence card) {
diff --git a/Mage.Sets/src/mage/cards/a/AncestralMemories.java b/Mage.Sets/src/mage/cards/a/AncestralMemories.java
index 031b0d8afdc..74f1b83ba39 100644
--- a/Mage.Sets/src/mage/cards/a/AncestralMemories.java
+++ b/Mage.Sets/src/mage/cards/a/AncestralMemories.java
@@ -1,12 +1,10 @@
package mage.cards.a;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -19,8 +17,7 @@ public final class AncestralMemories extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{U}{U}");
// Look at the top seven cards of your library. Put two of them into your hand and the rest into your graveyard.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(7), false, StaticValue.get(2),
- StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(7, 2, PutCards.HAND, PutCards.GRAVEYARD));
}
private AncestralMemories(final AncestralMemories card) {
@@ -31,4 +28,4 @@ public final class AncestralMemories extends CardImpl {
public AncestralMemories copy() {
return new AncestralMemories(this);
}
-}
\ No newline at end of file
+}
diff --git a/Mage.Sets/src/mage/cards/a/AncientStirrings.java b/Mage.Sets/src/mage/cards/a/AncientStirrings.java
index b3ca0d48bec..137ad672c1b 100644
--- a/Mage.Sets/src/mage/cards/a/AncientStirrings.java
+++ b/Mage.Sets/src/mage/cards/a/AncientStirrings.java
@@ -1,14 +1,11 @@
-
-
package mage.cards.a;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorlessPredicate;
@@ -23,15 +20,12 @@ public final class AncientStirrings extends CardImpl {
filter.add(ColorlessPredicate.instance);
}
-
public AncientStirrings(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{G}");
// Look at the top five cards of your library. You may reveal a colorless card from among them and put it into your hand.
// Then put the rest on the bottom of your library in any order. (Cards with no colored mana in their mana costs are colorless. Lands are also colorless.)
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(5), false, StaticValue.get(1), filter, Zone.LIBRARY,
- false, true, false, Zone.HAND, true));
-
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(5, 1, filter, PutCards.HAND, PutCards.BOTTOM_ANY));
}
private AncientStirrings(final AncientStirrings card) {
@@ -42,5 +36,4 @@ public final class AncientStirrings extends CardImpl {
public AncientStirrings copy() {
return new AncientStirrings(this);
}
-
}
diff --git a/Mage.Sets/src/mage/cards/a/Anticipate.java b/Mage.Sets/src/mage/cards/a/Anticipate.java
index 5883d7eef07..3e3bc99c5d3 100644
--- a/Mage.Sets/src/mage/cards/a/Anticipate.java
+++ b/Mage.Sets/src/mage/cards/a/Anticipate.java
@@ -1,12 +1,10 @@
package mage.cards.a;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -19,11 +17,7 @@ public final class Anticipate extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
// Look at the top three cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false
- ).setText("look at the top three cards of your library. " +
- "Put one of them into your hand and the rest on the bottom of your library in any order"));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.BOTTOM_ANY));
}
private Anticipate(final Anticipate card) {
diff --git a/Mage.Sets/src/mage/cards/a/ArcaneInfusion.java b/Mage.Sets/src/mage/cards/a/ArcaneInfusion.java
index 33cb5d8ca39..e8ab05a63a6 100644
--- a/Mage.Sets/src/mage/cards/a/ArcaneInfusion.java
+++ b/Mage.Sets/src/mage/cards/a/ArcaneInfusion.java
@@ -1,14 +1,12 @@
package mage.cards.a;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.TimingRule;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
import java.util.UUID;
@@ -23,13 +21,7 @@ public final class ArcaneInfusion extends CardImpl {
// Look at the top four cards of your library. You may reveal an instant or sorcery card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, Zone.LIBRARY,
- false, true, false, Zone.HAND,
- true, false, false
- ).setBackInRandomOrder(true).setText("Look at the top four cards of your library. " +
- "You may reveal an instant or sorcery card from among them and put it into your hand. " +
- "Put the rest on the bottom of your library in a random order."));
+ 4, 1, StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, PutCards.HAND, PutCards.BOTTOM_RANDOM));
// Flashback {3}{U}{R}
this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{3}{U}{R}")));
diff --git a/Mage.Sets/src/mage/cards/a/ArcaneInvestigator.java b/Mage.Sets/src/mage/cards/a/ArcaneInvestigator.java
index e863a6de6f2..4c499ef1578 100644
--- a/Mage.Sets/src/mage/cards/a/ArcaneInvestigator.java
+++ b/Mage.Sets/src/mage/cards/a/ArcaneInvestigator.java
@@ -3,16 +3,14 @@ package mage.cards.a;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.RollDieWithResultTableEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -39,11 +37,7 @@ public final class ArcaneInvestigator extends CardImpl {
effect.addTableEntry(1, 9, new DrawCardSourceControllerEffect(1));
// 10-20 | Look at the top three cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.
- effect.addTableEntry(10, 20, new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false
- ).setText("look at the top three cards of your library. Put one of them " +
- "into your hand and the rest on the bottom of your library in any order"));
+ effect.addTableEntry(10, 20, new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.BOTTOM_ANY));
}
private ArcaneInvestigator(final ArcaneInvestigator card) {
diff --git a/Mage.Sets/src/mage/cards/a/ArcanistsOwl.java b/Mage.Sets/src/mage/cards/a/ArcanistsOwl.java
index cd73ab26557..66b1f2b7c19 100644
--- a/Mage.Sets/src/mage/cards/a/ArcanistsOwl.java
+++ b/Mage.Sets/src/mage/cards/a/ArcanistsOwl.java
@@ -2,14 +2,13 @@ package mage.cards.a;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterArtifactOrEnchantmentCard;
@@ -32,16 +31,11 @@ public final class ArcanistsOwl extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
- // When Arcanist's Owl enters the battlefield, look at the top four cards of your library. You may reveal an artifact or enchantment card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
+ // When Arcanist's Owl enters the battlefield, look at the top four cards of your library.
+ // You may reveal an artifact or enchantment card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
this.addAbility(new EntersBattlefieldTriggeredAbility(
- new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(1), filter,
- Zone.LIBRARY, false, true, false, Zone.HAND,
- true, false, false
- ).setBackInRandomOrder(true).setText("look at the top four cards of your library. " +
- "You may reveal an artifact or enchantment card from among them and put it into your hand. " +
- "Put the rest on the bottom of your library in a random order.")
- ));
+ new LookLibraryAndPickControllerEffect(4, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM)));
}
private ArcanistsOwl(final ArcanistsOwl card) {
diff --git a/Mage.Sets/src/mage/cards/a/AugurOfBolas.java b/Mage.Sets/src/mage/cards/a/AugurOfBolas.java
index 7093d3ca9d2..61f0f9e82b7 100644
--- a/Mage.Sets/src/mage/cards/a/AugurOfBolas.java
+++ b/Mage.Sets/src/mage/cards/a/AugurOfBolas.java
@@ -1,36 +1,22 @@
package mage.cards.a;
import mage.MageInt;
-import mage.MageObject;
-import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.effects.OneShotEffect;
-import mage.cards.*;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Outcome;
import mage.constants.SubType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
-import mage.filter.common.FilterInstantOrSorceryCard;
-import mage.filter.predicate.Predicates;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
+import mage.filter.StaticFilters;
-import java.util.Set;
import java.util.UUID;
/**
- * @author jeffwadsworth
+ * @author awjackson
*/
public final class AugurOfBolas extends CardImpl {
- private static final FilterCard filter = new FilterCard("an instant or sorcery card");
-
- static {
- filter.add(Predicates.or(CardType.INSTANT.getPredicate(), CardType.SORCERY.getPredicate()));
- }
-
public AugurOfBolas(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.subtype.add(SubType.MERFOLK);
@@ -39,8 +25,11 @@ public final class AugurOfBolas extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(3);
- // When Augur of Bolas enters the battlefield, look at the top three cards of your library. You may reveal an instant or sorcery card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
- this.addAbility(new EntersBattlefieldTriggeredAbility(new AugurOfBolasEffect()));
+ // When Augur of Bolas enters the battlefield, look at the top three cards of your library.
+ // You may reveal an instant or sorcery card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in any order.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
+ 3, 1, StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, PutCards.HAND, PutCards.BOTTOM_ANY)));
}
private AugurOfBolas(final AugurOfBolas card) {
@@ -52,57 +41,3 @@ public final class AugurOfBolas extends CardImpl {
return new AugurOfBolas(this);
}
}
-
-class AugurOfBolasEffect extends OneShotEffect {
-
- public AugurOfBolasEffect() {
- super(Outcome.DrawCard);
- this.staticText = "look at the top three cards of your library. You may reveal an instant or sorcery card from among them and put it into your hand. Put the rest on the bottom of your library in any order";
- }
-
- public AugurOfBolasEffect(final AugurOfBolasEffect effect) {
- super(effect);
- }
-
- @Override
- public AugurOfBolasEffect copy() {
- return new AugurOfBolasEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- MageObject sourceObject = game.getObject(source);
- if (controller != null && sourceObject != null) {
- Cards topCards = new CardsImpl();
- topCards.addAll(controller.getLibrary().getTopCards(game, 3));
- if (!topCards.isEmpty()) {
- controller.lookAtCards(sourceObject.getIdName(), topCards, game);
- int number = topCards.count(new FilterInstantOrSorceryCard(), source.getControllerId(), source, game);
- if (number > 0) {
- if (controller.chooseUse(outcome, "Reveal an instant or sorcery card from the looked at cards and put it into your hand?", source, game)) {
- Card card = null;
- if (number == 1) {
- Set cards = topCards.getCards(new FilterInstantOrSorceryCard(), source.getControllerId(), source, game);
- if (!cards.isEmpty()) {
- card = cards.iterator().next();
- }
- } else {
- TargetCard target = new TargetCard(Zone.LIBRARY, new FilterInstantOrSorceryCard());
- controller.chooseTarget(outcome, topCards, target, source, game);
- card = topCards.get(target.getFirstTarget(), game);
- }
- if (card != null) {
- controller.moveCards(card, Zone.HAND, source, game);
- controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);
- topCards.remove(card);
- }
- }
- }
- controller.putCardsOnBottomOfLibrary(topCards, game, source, true);
- }
- return true;
- }
- return false;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/a/AzcantaTheSunkenRuin.java b/Mage.Sets/src/mage/cards/a/AzcantaTheSunkenRuin.java
index 782169ae2b3..fce92d1a56d 100644
--- a/Mage.Sets/src/mage/cards/a/AzcantaTheSunkenRuin.java
+++ b/Mage.Sets/src/mage/cards/a/AzcantaTheSunkenRuin.java
@@ -1,4 +1,3 @@
-
package mage.cards.a;
import java.util.UUID;
@@ -6,14 +5,13 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.mana.BlueManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SuperType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
@@ -44,11 +42,8 @@ public final class AzcantaTheSunkenRuin extends CardImpl {
// {2}{U} , {T} : Look at the top four cards of your library. You may reveal a noncreature, nonland card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
Ability ability = new SimpleActivatedAbility(
- Zone.BATTLEFIELD,
- new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(1),
- filter, Zone.LIBRARY, false, true, true
- ), new ManaCostsImpl<>("{2}{U}")
+ new LookLibraryAndPickControllerEffect(4, 1, filter, PutCards.HAND, PutCards.BOTTOM_ANY),
+ new ManaCostsImpl<>("{2}{U}")
);
ability.addCost(new TapSourceCost());
this.addAbility(ability);
diff --git a/Mage.Sets/src/mage/cards/b/BasicConjuration.java b/Mage.Sets/src/mage/cards/b/BasicConjuration.java
index b4ad758ab45..4c8e38d7fa1 100644
--- a/Mage.Sets/src/mage/cards/b/BasicConjuration.java
+++ b/Mage.Sets/src/mage/cards/b/BasicConjuration.java
@@ -2,11 +2,11 @@ package mage.cards.b;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
import java.util.UUID;
@@ -24,9 +24,7 @@ public final class BasicConjuration extends CardImpl {
// Look at the top six cards of your library. You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in a random order. You gain 3 life.
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- 6, 1, StaticFilters.FILTER_CARD_CREATURE_A,
- true, false, Zone.HAND, true
- ).setBackInRandomOrder(true));
+ 6, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.BOTTOM_RANDOM));
this.getSpellAbility().addEffect(new GainLifeEffect(3));
}
diff --git a/Mage.Sets/src/mage/cards/b/BitterRevelation.java b/Mage.Sets/src/mage/cards/b/BitterRevelation.java
index 531e91595f6..0e37f7fbaa2 100644
--- a/Mage.Sets/src/mage/cards/b/BitterRevelation.java
+++ b/Mage.Sets/src/mage/cards/b/BitterRevelation.java
@@ -1,14 +1,12 @@
-
package mage.cards.b;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
-import mage.cards.*;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
/**
*
@@ -20,8 +18,7 @@ public final class BitterRevelation extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}");
// Look at the top four cards of your library. Put two of them into your hand and the rest into your graveyard. You lose 2 life.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(4), false, StaticValue.get(2),
- StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(4, 2, PutCards.HAND, PutCards.GRAVEYARD));
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(2));
}
diff --git a/Mage.Sets/src/mage/cards/b/BlexVexingPest.java b/Mage.Sets/src/mage/cards/b/BlexVexingPest.java
index 0c0a87da95c..c67811db949 100644
--- a/Mage.Sets/src/mage/cards/b/BlexVexingPest.java
+++ b/Mage.Sets/src/mage/cards/b/BlexVexingPest.java
@@ -6,21 +6,18 @@ import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.GainLifeEffect;
-import mage.abilities.effects.common.LookLibraryControllerEffect;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.cards.Cards;
-import mage.cards.CardsImpl;
import mage.cards.ModalDoubleFacesCard;
import mage.constants.*;
import mage.cards.CardSetInfo;
-import mage.filter.FilterCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.game.Game;
import mage.players.Player;
-import mage.target.TargetCard;
/**
*
@@ -81,15 +78,11 @@ public final class BlexVexingPest extends ModalDoubleFacesCard {
}
}
-class SearchForBlexEffect extends LookLibraryControllerEffect {
+class SearchForBlexEffect extends LookLibraryAndPickControllerEffect {
- private static final FilterCard filter = new FilterCard("cards to put into your hand");
-
- public SearchForBlexEffect() {
- super(Outcome.DrawCard, StaticValue.get(5), false, Zone.GRAVEYARD, true);
- this.staticText = "Look at the top five cards of your library. "
- + "You may put any number of them into your hand and the rest into your graveyard. "
- + "You lose 3 life for each card you put into your hand this way";
+ SearchForBlexEffect() {
+ super(5, Integer.MAX_VALUE, PutCards.HAND, PutCards.GRAVEYARD);
+ this.optional = true;
}
private SearchForBlexEffect(final SearchForBlexEffect effect) {
@@ -102,21 +95,14 @@ class SearchForBlexEffect extends LookLibraryControllerEffect {
}
@Override
- protected void actionWithSelectedCards(Cards cards, Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- if (player != null) {
- TargetCard target = new TargetCard(0, 5, Zone.LIBRARY, filter);
- if (player.choose(outcome, cards, target, game)) {
- Cards pickedCards = new CardsImpl(target.getTargets());
- cards.removeAll(pickedCards);
- player.moveCards(pickedCards, Zone.HAND, source, game);
- player.loseLife(pickedCards.size() * 3, game, source, false);
- }
- }
+ protected boolean actionWithPickedCards(Game game, Ability source, Player player, Cards pickedCards, Cards otherCards) {
+ super.actionWithPickedCards(game, source, player, pickedCards, otherCards);
+ player.loseLife(pickedCards.size() * 3, game, source, false);
+ return true;
}
@Override
public String getText(Mode mode) {
- return staticText;
+ return super.getText(mode).concat(". You lose 3 life for each card you put into your hand this way");
}
}
diff --git a/Mage.Sets/src/mage/cards/b/BloodPrice.java b/Mage.Sets/src/mage/cards/b/BloodPrice.java
index 2d203102c46..93305849f4c 100644
--- a/Mage.Sets/src/mage/cards/b/BloodPrice.java
+++ b/Mage.Sets/src/mage/cards/b/BloodPrice.java
@@ -1,13 +1,11 @@
package mage.cards.b;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -20,13 +18,7 @@ public final class BloodPrice extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}");
// Look at the top four cards of your library. Put two of them into your hand and the rest on the bottom of your library in any order. You lose 2 life.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(2),
- StaticFilters.FILTER_CARD, Zone.LIBRARY, false,
- false, false, Zone.HAND, false,
- false, true
- ).setText("Look at the top four cards of your library. " +
- "Put two of them into your hand and the rest on the bottom of your library in any order"));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(4, 2, PutCards.HAND, PutCards.BOTTOM_ANY));
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(2));
}
diff --git a/Mage.Sets/src/mage/cards/b/BlossomPrancer.java b/Mage.Sets/src/mage/cards/b/BlossomPrancer.java
index d5de2f4e942..4cd309b21df 100644
--- a/Mage.Sets/src/mage/cards/b/BlossomPrancer.java
+++ b/Mage.Sets/src/mage/cards/b/BlossomPrancer.java
@@ -2,20 +2,18 @@ package mage.cards.b;
import mage.MageInt;
import mage.abilities.Ability;
+import mage.abilities.Mode;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.ReachAbility;
import mage.cards.*;
import mage.constants.CardType;
-import mage.constants.Outcome;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.game.Game;
import mage.players.Player;
-import mage.target.TargetCard;
-import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
@@ -34,7 +32,10 @@ public final class BlossomPrancer extends CardImpl {
// Reach
this.addAbility(ReachAbility.getInstance());
- // When Blossom Prancer enters the battlefield, look at the top five cards of your library. You may reveal a creature or enchantment card from among them and put it into your hand. Put the rest on the bottom of your library in a random order. If you didn't put a card into your hand this way, you gain 4 life.
+ // When Blossom Prancer enters the battlefield, look at the top five cards of your library.
+ // You may reveal a creature or enchantment card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
+ // If you didn't put a card into your hand this way, you gain 4 life.
this.addAbility(new EntersBattlefieldTriggeredAbility(new BlossomPrancerEffect()));
}
@@ -48,7 +49,7 @@ public final class BlossomPrancer extends CardImpl {
}
}
-class BlossomPrancerEffect extends OneShotEffect {
+class BlossomPrancerEffect extends LookLibraryAndPickControllerEffect {
private static final FilterCard filter = new FilterCard("creature or enchantment card");
@@ -60,10 +61,7 @@ class BlossomPrancerEffect extends OneShotEffect {
}
BlossomPrancerEffect() {
- super(Outcome.Benefit);
- staticText = "look at the top five cards of your library. You may reveal a creature or enchantment card from " +
- "among them and put it into your hand. Put the rest on the bottom of your library in a random order. " +
- "If you didn't put a card into your hand this way, you gain 4 life";
+ super(5, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM);
}
private BlossomPrancerEffect(final BlossomPrancerEffect effect) {
@@ -76,24 +74,16 @@ class BlossomPrancerEffect extends OneShotEffect {
}
@Override
- public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- if (player == null) {
- return false;
- }
- Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 5));
- TargetCard target = new TargetCardInLibrary(0, 1, filter);
- player.choose(outcome, cards, target, game);
- Card card = game.getCard(target.getFirstTarget());
- if (card != null) {
- player.revealCards(source, new CardsImpl(card), game);
- player.moveCards(card, Zone.HAND, source, game);
- cards.remove(card);
- player.putCardsOnBottomOfLibrary(cards, game, source, false);
- } else {
- player.putCardsOnBottomOfLibrary(cards, game, source, false);
+ public boolean actionWithPickedCards(Game game, Ability source, Player player, Cards pickedCards, Cards otherCards) {
+ super.actionWithPickedCards(game, source, player, pickedCards, otherCards);
+ if (pickedCards.isEmpty()) {
player.gainLife(4, game, source);
}
return true;
}
+
+ @Override
+ public String getText(Mode mode) {
+ return super.getText(mode).concat(". If you didn't put a card into your hand this way, you gain 4 life");
+ }
}
diff --git a/Mage.Sets/src/mage/cards/b/BoardTheWeatherlight.java b/Mage.Sets/src/mage/cards/b/BoardTheWeatherlight.java
index ebaa10ff365..f8539a32c22 100644
--- a/Mage.Sets/src/mage/cards/b/BoardTheWeatherlight.java
+++ b/Mage.Sets/src/mage/cards/b/BoardTheWeatherlight.java
@@ -1,12 +1,11 @@
package mage.cards.b;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.HistoricPredicate;
@@ -27,10 +26,7 @@ public final class BoardTheWeatherlight extends CardImpl {
// Look at the top five cards of your library. You may reveal a historic card from among them and put it into your hand. Put the rest on the bottom of your library in random order.
this.getSpellAbility().addEffect(
- new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), filter,
- Zone.LIBRARY, false, true, false, Zone.HAND, true, false, false)
- .setBackInRandomOrder(true)
+ new LookLibraryAndPickControllerEffect(5, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM)
.setText("Look at the top five cards of your library. You may reveal a historic card from among them"
+ " and put it into your hand. Put the rest on the bottom of your library in a random order. "
+ "(Artifacts, legendaries, and Sagas are historic.)")
diff --git a/Mage.Sets/src/mage/cards/b/BondOfFlourishing.java b/Mage.Sets/src/mage/cards/b/BondOfFlourishing.java
index 96581841a43..de08f840a85 100644
--- a/Mage.Sets/src/mage/cards/b/BondOfFlourishing.java
+++ b/Mage.Sets/src/mage/cards/b/BondOfFlourishing.java
@@ -1,8 +1,8 @@
package mage.cards.b;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@@ -22,11 +22,8 @@ public final class BondOfFlourishing extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}");
// Look at the top three card of your library. You may reveal a permanent card from among them and put it into your hand. Put the rest on the bottom of your library in any order. You gain 3 life.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false,
- StaticValue.get(1), filter, false
- ));
- this.getSpellAbility().addEffect(new GainLifeEffect(3).setText("You gain 3 life."));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(3, 1, filter, PutCards.HAND, PutCards.BOTTOM_ANY));
+ this.getSpellAbility().addEffect(new GainLifeEffect(3));
}
private BondOfFlourishing(final BondOfFlourishing card) {
diff --git a/Mage.Sets/src/mage/cards/b/BrazenUpstart.java b/Mage.Sets/src/mage/cards/b/BrazenUpstart.java
index d598fc55d70..2d6b63d5b15 100644
--- a/Mage.Sets/src/mage/cards/b/BrazenUpstart.java
+++ b/Mage.Sets/src/mage/cards/b/BrazenUpstart.java
@@ -3,12 +3,12 @@ package mage.cards.b;
import mage.MageInt;
import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
import java.util.UUID;
@@ -31,9 +31,7 @@ public final class BrazenUpstart extends CardImpl {
// When Brazen Upstart dies, look at the top five cards of your library. You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
this.addAbility(new DiesSourceTriggeredAbility(new LookLibraryAndPickControllerEffect(
- 5, 1, StaticFilters.FILTER_CARD_CREATURE_A,
- true, false, Zone.HAND, true
- ).setBackInRandomOrder(true)));
+ 5, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.BOTTOM_RANDOM)));
}
private BrazenUpstart(final BrazenUpstart card) {
diff --git a/Mage.Sets/src/mage/cards/b/BrightwoodTracker.java b/Mage.Sets/src/mage/cards/b/BrightwoodTracker.java
index 8f84a876eca..489ccb31177 100644
--- a/Mage.Sets/src/mage/cards/b/BrightwoodTracker.java
+++ b/Mage.Sets/src/mage/cards/b/BrightwoodTracker.java
@@ -6,11 +6,11 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
import java.util.UUID;
@@ -28,11 +28,11 @@ public final class BrightwoodTracker extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(4);
- // {5}{G}, {T}: Look at the top four cards of your library. You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
- Ability ability = new SimpleActivatedAbility(new LookLibraryAndPickControllerEffect(
- 4, 1, StaticFilters.FILTER_CARD_CREATURE_A,
- true, false, Zone.HAND, true
- ).setBackInRandomOrder(true), new ManaCostsImpl("{5}{G}"));
+ // {5}{G}, {T}: Look at the top four cards of your library. You may reveal a creature card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
+ Ability ability = new SimpleActivatedAbility(
+ new LookLibraryAndPickControllerEffect(4, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.BOTTOM_RANDOM),
+ new ManaCostsImpl("{5}{G}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
diff --git a/Mage.Sets/src/mage/cards/c/CalixDestinysHand.java b/Mage.Sets/src/mage/cards/c/CalixDestinysHand.java
index 544d46fbda1..15c7c64dc28 100644
--- a/Mage.Sets/src/mage/cards/c/CalixDestinysHand.java
+++ b/Mage.Sets/src/mage/cards/c/CalixDestinysHand.java
@@ -7,6 +7,7 @@ import mage.abilities.LoyaltyAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@@ -56,12 +57,11 @@ public final class CalixDestinysHand extends CardImpl {
this.subtype.add(SubType.CALIX);
this.setStartingLoyalty(4);
- // +1: Look at the top four cards of your library. You may reveal an enchantment card from among them and put that card into your hand. Put the rest on the bottom of your library in a random order.
+ // +1: Look at the top four cards of your library. You may reveal an enchantment card from among them and put that card into your hand.
+ // Put the rest on the bottom of your library in a random order.
this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(1), filter,
- Zone.LIBRARY, false, true, false,
- Zone.HAND, true, false, false
- ).setBackInRandomOrder(true).setText("Look at the top four cards of your library. "
+ 4, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM
+ ).setText("Look at the top four cards of your library. "
+ "You may reveal an enchantment card from among them and put that card into your hand. "
+ "Put the rest on the bottom of your library in a random order."), 1
));
diff --git a/Mage.Sets/src/mage/cards/c/CarthTheLion.java b/Mage.Sets/src/mage/cards/c/CarthTheLion.java
index aafed85ddf8..0cf232a649d 100644
--- a/Mage.Sets/src/mage/cards/c/CarthTheLion.java
+++ b/Mage.Sets/src/mage/cards/c/CarthTheLion.java
@@ -7,6 +7,7 @@ import mage.abilities.LoyaltyAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
import mage.constants.*;
import mage.cards.CardImpl;
@@ -56,9 +57,7 @@ class CarthTheLionTriggeredAbility extends TriggeredAbilityImpl {
public CarthTheLionTriggeredAbility() {
super(Zone.BATTLEFIELD, new LookLibraryAndPickControllerEffect(
- 7, 1, filter, true, false, Zone.HAND, true)
- .setBackInRandomOrder(true)
- );
+ 7, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM));
}
private CarthTheLionTriggeredAbility(final CarthTheLionTriggeredAbility ability) {
diff --git a/Mage.Sets/src/mage/cards/c/CartographersSurvey.java b/Mage.Sets/src/mage/cards/c/CartographersSurvey.java
index 3e4989f9623..47b0cfb460d 100644
--- a/Mage.Sets/src/mage/cards/c/CartographersSurvey.java
+++ b/Mage.Sets/src/mage/cards/c/CartographersSurvey.java
@@ -2,20 +2,12 @@ package mage.cards.c;
import java.util.UUID;
-import mage.abilities.Ability;
-import mage.abilities.dynamicvalue.common.StaticValue;
-import mage.abilities.effects.common.LookLibraryControllerEffect;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.cards.Cards;
-import mage.cards.CardsImpl;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
/**
*
@@ -27,7 +19,8 @@ public final class CartographersSurvey extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}");
// Look at the top seven cards of your library. Put up to two land cards from among them onto the battlefield tapped. Put the rest on the bottom of your library in a random order.
- this.getSpellAbility().addEffect(new CartographersSurveyEffect());
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
+ 7, 2, StaticFilters.FILTER_CARD_LANDS, PutCards.BATTLEFIELD_TAPPED, PutCards.BOTTOM_RANDOM, false));
}
private CartographersSurvey(final CartographersSurvey card) {
@@ -39,35 +32,3 @@ public final class CartographersSurvey extends CardImpl {
return new CartographersSurvey(this);
}
}
-
-class CartographersSurveyEffect extends LookLibraryControllerEffect {
-
- public CartographersSurveyEffect() {
- super(Outcome.PutLandInPlay, StaticValue.get(7), false, Zone.LIBRARY, false);
- this.setBackInRandomOrder(true);
- staticText = "Look at the top seven cards of your library. Put up to two land cards from among them onto the battlefield tapped. Put the rest on the bottom of your library in a random order";
- }
-
- private CartographersSurveyEffect(final CartographersSurveyEffect effect) {
- super(effect);
- }
-
- @Override
- public CartographersSurveyEffect copy() {
- return new CartographersSurveyEffect(this);
- }
-
- @Override
- protected void actionWithSelectedCards(Cards cards, Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- if (controller != null) {
- TargetCard target = new TargetCard(0, 2, Zone.LIBRARY, StaticFilters.FILTER_CARD_LANDS);
- controller.choose(outcome, cards, target, game);
- Cards pickedCards = new CardsImpl(target.getTargets());
- if (!pickedCards.isEmpty()) {
- cards.removeAll(pickedCards);
- controller.moveCards(pickedCards.getCards(game), Zone.BATTLEFIELD, source, game, true, false, false, null);
- }
- }
- }
-}
diff --git a/Mage.Sets/src/mage/cards/c/CavalierOfThorns.java b/Mage.Sets/src/mage/cards/c/CavalierOfThorns.java
index f6c56822f94..7277d9269f7 100644
--- a/Mage.Sets/src/mage/cards/c/CavalierOfThorns.java
+++ b/Mage.Sets/src/mage/cards/c/CavalierOfThorns.java
@@ -5,27 +5,24 @@ import mage.abilities.Ability;
import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.costs.common.ExileSourceFromGraveCost;
-import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DoIfCostPaid;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.PutOnLibraryTargetEffect;
+import mage.abilities.effects.common.RevealLibraryPickControllerEffect;
import mage.abilities.keyword.ReachAbility;
-import mage.cards.*;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Outcome;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
-import mage.filter.common.FilterLandCard;
+import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.AnotherPredicate;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
- * @author TheElk801
+ * @author awjackson
*/
public final class CavalierOfThorns extends CardImpl {
@@ -46,8 +43,10 @@ public final class CavalierOfThorns extends CardImpl {
// Reach
this.addAbility(ReachAbility.getInstance());
- // When Cavalier of Thorns enters the battlefield, reveal the top five cards of your library. You may put a land card from among them onto the battlefield. Put the rest into your graveyard.
- this.addAbility(new EntersBattlefieldTriggeredAbility(new CavalierOfThornsEffect()));
+ // When Cavalier of Thorns enters the battlefield, reveal the top five cards of your library.
+ // Put a land card from among them onto the battlefield and the rest into your graveyard.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new RevealLibraryPickControllerEffect(
+ 5, 1, StaticFilters.FILTER_CARD_LAND_A, PutCards.BATTLEFIELD, PutCards.GRAVEYARD, false)));
// When Cavalier of Thorns dies, you may exile it. If you do, put another target card from your graveyard on top of your library.
Ability ability = new DiesSourceTriggeredAbility(new DoIfCostPaid(
@@ -66,47 +65,3 @@ public final class CavalierOfThorns extends CardImpl {
return new CavalierOfThorns(this);
}
}
-
-class CavalierOfThornsEffect extends OneShotEffect {
-
- private static final FilterCard filter = new FilterLandCard("land card to put on the battlefield");
-
- CavalierOfThornsEffect() {
- super(Outcome.PutCreatureInPlay);
- this.staticText = "reveal the top five cards of your library. " +
- "Put a land card from among them onto the battlefield and the rest into your graveyard.";
- }
-
- private CavalierOfThornsEffect(final CavalierOfThornsEffect effect) {
- super(effect);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- if (controller == null) {
- return false;
- }
- Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 5));
- if (cards.isEmpty()) {
- return true;
- }
- controller.revealCards(source, cards, game);
- TargetCard target = new TargetCard(1, 1, Zone.LIBRARY, filter);
- if (cards.getCards(game).stream().anyMatch(card1 -> card1.isLand(game))
- && controller.choose(Outcome.PutCardInPlay, cards, target, game)) {
- Card card = cards.get(target.getFirstTarget(), game);
- if (card != null) {
- cards.remove(card);
- controller.moveCards(card, Zone.BATTLEFIELD, source, game);
- }
- }
- controller.moveCards(cards, Zone.GRAVEYARD, source, game);
- return true;
- }
-
- @Override
- public CavalierOfThornsEffect copy() {
- return new CavalierOfThornsEffect(this);
- }
-}
diff --git a/Mage.Sets/src/mage/cards/c/CelestusSanctifier.java b/Mage.Sets/src/mage/cards/c/CelestusSanctifier.java
index 2f14919631a..141461a4b0b 100644
--- a/Mage.Sets/src/mage/cards/c/CelestusSanctifier.java
+++ b/Mage.Sets/src/mage/cards/c/CelestusSanctifier.java
@@ -3,14 +3,12 @@ package mage.cards.c;
import mage.MageInt;
import mage.abilities.common.BecomeDayAsEntersAbility;
import mage.abilities.common.BecomesDayOrNightTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -31,10 +29,8 @@ public final class CelestusSanctifier extends CardImpl {
this.addAbility(new BecomeDayAsEntersAbility());
// Whenever day becomes night or night becomes day, look at the top two cards of your library. Put one of them into your graveyard.
- this.addAbility(new BecomesDayOrNightTriggeredAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(2), false, StaticValue.get(1), StaticFilters.FILTER_CARD,
- Zone.LIBRARY, true, false, false, Zone.GRAVEYARD, false
- ).setText("look at the top two cards of your library. Put one of them into your graveyard")));
+ this.addAbility(new BecomesDayOrNightTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(2, 1, PutCards.GRAVEYARD, PutCards.TOP_ANY)));
}
private CelestusSanctifier(final CelestusSanctifier card) {
diff --git a/Mage.Sets/src/mage/cards/c/CollectedCompany.java b/Mage.Sets/src/mage/cards/c/CollectedCompany.java
index 8035c40fd81..a41f1b164e0 100644
--- a/Mage.Sets/src/mage/cards/c/CollectedCompany.java
+++ b/Mage.Sets/src/mage/cards/c/CollectedCompany.java
@@ -1,14 +1,14 @@
-
package mage.cards.c;
import java.util.UUID;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
+import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.ManaValuePredicate;
/**
@@ -17,20 +17,18 @@ import mage.filter.predicate.mageobject.ManaValuePredicate;
*/
public final class CollectedCompany extends CardImpl {
- private static final FilterCard filter = new FilterCard("up to two creature cards with mana value 3 or less");
+ private static final FilterCard filter = new FilterCreatureCard("creature cards with mana value 3 or less");
static {
- filter.add(CardType.CREATURE.getPredicate());
filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, 4));
}
public CollectedCompany(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{G}");
- // Look at the top six cards of your library. Put up to two creature cards with converted mana cost 3 or less from among them onto the battlefield.
+ // Look at the top six cards of your library. Put up to two creature cards with mana value 3 or less from among them onto the battlefield.
// Put the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(6, 2, filter, false, true, Zone.BATTLEFIELD, false));
-
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(6, 2, filter, PutCards.BATTLEFIELD, PutCards.BOTTOM_ANY, false));
}
private CollectedCompany(final CollectedCompany card) {
diff --git a/Mage.Sets/src/mage/cards/c/CommuneWithDinosaurs.java b/Mage.Sets/src/mage/cards/c/CommuneWithDinosaurs.java
index c4609faa067..e9ec1c7786a 100644
--- a/Mage.Sets/src/mage/cards/c/CommuneWithDinosaurs.java
+++ b/Mage.Sets/src/mage/cards/c/CommuneWithDinosaurs.java
@@ -1,9 +1,8 @@
-
package mage.cards.c;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@@ -30,7 +29,7 @@ public final class CommuneWithDinosaurs extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}");
//Look at the top five cards of your library. You may reveal a Dinosaur or land card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(5), false, StaticValue.get(1), filter, false));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(5, 1, filter, PutCards.HAND, PutCards.BOTTOM_ANY));
}
private CommuneWithDinosaurs(final CommuneWithDinosaurs card) {
diff --git a/Mage.Sets/src/mage/cards/c/CommuneWithNature.java b/Mage.Sets/src/mage/cards/c/CommuneWithNature.java
index 69a5a27fd96..9b216d38738 100644
--- a/Mage.Sets/src/mage/cards/c/CommuneWithNature.java
+++ b/Mage.Sets/src/mage/cards/c/CommuneWithNature.java
@@ -1,13 +1,12 @@
-
package mage.cards.c;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.filter.common.FilterCreatureCard;
+import mage.filter.StaticFilters;
/**
*
@@ -18,12 +17,10 @@ public final class CommuneWithNature extends CardImpl {
public CommuneWithNature(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}");
- // Look at the top five cards of your library. You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(
- new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), new FilterCreatureCard("a creature card"), false
- )
- );
+ // Look at the top five cards of your library. You may reveal a creature card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in any order.
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
+ 5, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.BOTTOM_ANY));
}
private CommuneWithNature(final CommuneWithNature card) {
@@ -34,5 +31,4 @@ public final class CommuneWithNature extends CardImpl {
public CommuneWithNature copy() {
return new CommuneWithNature(this);
}
-
}
diff --git a/Mage.Sets/src/mage/cards/c/CommuneWithSpirits.java b/Mage.Sets/src/mage/cards/c/CommuneWithSpirits.java
index 1614cb95261..f51fc750c52 100644
--- a/Mage.Sets/src/mage/cards/c/CommuneWithSpirits.java
+++ b/Mage.Sets/src/mage/cards/c/CommuneWithSpirits.java
@@ -1,11 +1,10 @@
package mage.cards.c;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
@@ -28,13 +27,9 @@ public final class CommuneWithSpirits extends CardImpl {
public CommuneWithSpirits(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}");
- // Look at the top four cards of your library. You may reveal an enchantment or land card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(1), filter, Zone.LIBRARY, false,
- true, false, Zone.HAND, true, false, false
- ).setBackInRandomOrder(true).setText("look at the top four cards of your library. " +
- "You may reveal an enchantment or land card from among them and put it into your hand. " +
- "Put the rest on the bottom of your library in a random order"));
+ // Look at the top four cards of your library. You may reveal an enchantment or land card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(4, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM));
}
private CommuneWithSpirits(final CommuneWithSpirits card) {
diff --git a/Mage.Sets/src/mage/cards/c/CommuneWithTheGods.java b/Mage.Sets/src/mage/cards/c/CommuneWithTheGods.java
index bad93618d42..eb688a01ec6 100644
--- a/Mage.Sets/src/mage/cards/c/CommuneWithTheGods.java
+++ b/Mage.Sets/src/mage/cards/c/CommuneWithTheGods.java
@@ -1,31 +1,35 @@
-
package mage.cards.c;
import java.util.UUID;
-import mage.abilities.Ability;
-import mage.abilities.effects.OneShotEffect;
-import mage.cards.*;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.abilities.effects.common.RevealLibraryPickControllerEffect;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
/**
*
- * @author LevelX2
+ * @author awjackson
*/
public final class CommuneWithTheGods extends CardImpl {
+ private static final FilterCard filter = new FilterCard("a creature or enchantment card");
+
+ static {
+ filter.add(Predicates.or(
+ CardType.CREATURE.getPredicate(),
+ CardType.ENCHANTMENT.getPredicate()
+ ));
+ }
+
public CommuneWithTheGods(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}");
- // Reveal the top five cards of your library. You may put a creature or enchantment card from among them into your hand. Put the rest into your graveyard.
- this.getSpellAbility().addEffect(new CommuneWithTheGodsEffect());
-
+ // Reveal the top five cards of your library. You may put a creature or enchantment card from among them into your hand.
+ // Put the rest into your graveyard.
+ this.getSpellAbility().addEffect(new RevealLibraryPickControllerEffect(5, 1, filter, PutCards.HAND, PutCards.GRAVEYARD));
}
private CommuneWithTheGods(final CommuneWithTheGods card) {
@@ -37,47 +41,3 @@ public final class CommuneWithTheGods extends CardImpl {
return new CommuneWithTheGods(this);
}
}
-
-class CommuneWithTheGodsEffect extends OneShotEffect {
-
- public CommuneWithTheGodsEffect() {
- super(Outcome.DrawCard);
- this.staticText = "Reveal the top five cards of your library. You may put a creature or enchantment card from among them into your hand. Put the rest into your graveyard";
- }
-
- public CommuneWithTheGodsEffect(final CommuneWithTheGodsEffect effect) {
- super(effect);
- }
-
- @Override
- public CommuneWithTheGodsEffect copy() {
- return new CommuneWithTheGodsEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- if (controller != null) {
- Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 5));
- if (!cards.isEmpty()) {
- FilterCard filterPutInHand = new FilterCard("creature or enchantment card to put in hand");
- filterPutInHand.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.ENCHANTMENT.getPredicate()));
- controller.revealCards(source, cards, game);
- if (cards.count(filterPutInHand, source.getControllerId(), source, game) > 0) {
- TargetCard target = new TargetCard(0, 1, Zone.LIBRARY, filterPutInHand);
- if (controller.choose(Outcome.DrawCard, cards, target, game)) {
- Card card = game.getCard(target.getFirstTarget());
- if (card != null) {
- cards.remove(card);
- controller.moveCards(card, Zone.HAND, source, game);
- }
-
- }
- }
- controller.moveCards(cards, Zone.GRAVEYARD, source, game);
- }
- return true;
- }
- return false;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/c/ContingencyPlan.java b/Mage.Sets/src/mage/cards/c/ContingencyPlan.java
index 18cf5006f1e..e3aefc29b9e 100644
--- a/Mage.Sets/src/mage/cards/c/ContingencyPlan.java
+++ b/Mage.Sets/src/mage/cards/c/ContingencyPlan.java
@@ -1,14 +1,11 @@
-
package mage.cards.c;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
/**
*
@@ -20,9 +17,7 @@ public final class ContingencyPlan extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{U}");
// Look at the top five cards of your library. Put any number of them into your graveyard and the rest back on top of your library in any order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(5), false, StaticValue.get(5),
- new FilterCard("cards"), Zone.LIBRARY, true, false, true, Zone.GRAVEYARD, false));
-
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(5, Integer.MAX_VALUE, PutCards.GRAVEYARD, PutCards.TOP_ANY));
}
private ContingencyPlan(final ContingencyPlan card) {
diff --git a/Mage.Sets/src/mage/cards/c/CoralhelmChronicler.java b/Mage.Sets/src/mage/cards/c/CoralhelmChronicler.java
index e13ee671217..13a9d9baaf0 100644
--- a/Mage.Sets/src/mage/cards/c/CoralhelmChronicler.java
+++ b/Mage.Sets/src/mage/cards/c/CoralhelmChronicler.java
@@ -3,15 +3,14 @@ package mage.cards.c;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.DrawDiscardControllerEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.AbilityPredicate;
@@ -45,11 +44,7 @@ public final class CoralhelmChronicler extends CardImpl {
// When Coralhelm Chronicler enters the battlefield, look at the top five cards of your library. You may reveal a card with a kicker ability from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), filter, Zone.LIBRARY, false,
- true, false, Zone.HAND, true, false, false
- ).setBackInRandomOrder(true).setText("look at the top five cards of your library. " +
- "You may reveal a card with a kicker ability from among them and put it into your hand. " +
- "Put the rest on the bottom of your library in a random order")));
+ 5, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM)));
}
private CoralhelmChronicler(final CoralhelmChronicler card) {
diff --git a/Mage.Sets/src/mage/cards/c/CourageousOutrider.java b/Mage.Sets/src/mage/cards/c/CourageousOutrider.java
index 68d726c52ee..5ef2464947f 100644
--- a/Mage.Sets/src/mage/cards/c/CourageousOutrider.java
+++ b/Mage.Sets/src/mage/cards/c/CourageousOutrider.java
@@ -1,11 +1,10 @@
-
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@@ -33,7 +32,8 @@ public final class CourageousOutrider extends CardImpl {
// When Courageous Outrider enters the battlefield, look at the top four cards of your library. You may reveal a Human card from among them
// and put it into your hand. Put the rest on the bottom of your library in any order.
- this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(StaticValue.get(4), false, StaticValue.get(1), filter, false) , false));
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
+ 4, 1, filter, PutCards.HAND, PutCards.BOTTOM_ANY)));
}
private CourageousOutrider(final CourageousOutrider card) {
diff --git a/Mage.Sets/src/mage/cards/c/CourtHussar.java b/Mage.Sets/src/mage/cards/c/CourtHussar.java
index 4808edfac53..af4d720f610 100644
--- a/Mage.Sets/src/mage/cards/c/CourtHussar.java
+++ b/Mage.Sets/src/mage/cards/c/CourtHussar.java
@@ -1,12 +1,11 @@
-
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.ManaWasSpentCondition;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.SacrificeSourceUnlessConditionEffect;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
@@ -14,8 +13,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.ColoredManaSymbol;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
/**
*
@@ -34,9 +31,7 @@ public final class CourtHussar extends CardImpl {
// Vigilance
this.addAbility(VigilanceAbility.getInstance());
// When Court Hussar enters the battlefield, look at the top three cards of your library, then put one of them into your hand and the rest on the bottom of your library in any order.
- this.addAbility(new EntersBattlefieldTriggeredAbility(
- new LookLibraryAndPickControllerEffect(StaticValue.get(3), false, StaticValue.get(1), new FilterCard(), Zone.LIBRARY, false, false),
- false));
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.BOTTOM_ANY)));
// When Court Hussar enters the battlefield, sacrifice it unless {W} was spent to cast it.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.W)), false));
}
@@ -50,4 +45,3 @@ public final class CourtHussar extends CardImpl {
return new CourtHussar(this);
}
}
-
diff --git a/Mage.Sets/src/mage/cards/c/CourtOfBounty.java b/Mage.Sets/src/mage/cards/c/CourtOfBounty.java
index 3e6828b6f9f..392ba066553 100644
--- a/Mage.Sets/src/mage/cards/c/CourtOfBounty.java
+++ b/Mage.Sets/src/mage/cards/c/CourtOfBounty.java
@@ -10,9 +10,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
-import mage.filter.FilterCard;
import mage.filter.StaticFilters;
-import mage.filter.predicate.Predicates;
import java.util.UUID;
@@ -21,15 +19,6 @@ import java.util.UUID;
*/
public final class CourtOfBounty extends CardImpl {
- private static final FilterCard filter = new FilterCard("a creature or land card");
-
- static {
- filter.add(Predicates.or(
- CardType.CREATURE.getPredicate(),
- CardType.LAND.getPredicate()
- ));
- }
-
public CourtOfBounty(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}");
@@ -38,7 +27,7 @@ public final class CourtOfBounty extends CardImpl {
// At the beginning of your upkeep, you may put a land card from your hand onto the battlefield. If you're the monarch, instead you may put a creature or land card from your hand onto the battlefield.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ConditionalOneShotEffect(
- new PutCardFromHandOntoBattlefieldEffect(filter),
+ new PutCardFromHandOntoBattlefieldEffect(StaticFilters.FILTER_CARD_CREATURE_OR_LAND),
new PutCardFromHandOntoBattlefieldEffect(StaticFilters.FILTER_CARD_LAND_A),
MonarchIsSourceControllerCondition.instance, "you may put a land card " +
"from your hand onto the battlefield. If you're the monarch, " +
diff --git a/Mage.Sets/src/mage/cards/c/CreativeOutburst.java b/Mage.Sets/src/mage/cards/c/CreativeOutburst.java
index 2c39e9e4dfc..9dbe0bb2675 100644
--- a/Mage.Sets/src/mage/cards/c/CreativeOutburst.java
+++ b/Mage.Sets/src/mage/cards/c/CreativeOutburst.java
@@ -4,15 +4,14 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.DiscardSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
-import mage.filter.StaticFilters;
import mage.game.permanent.token.TreasureToken;
import mage.target.common.TargetAnyTarget;
@@ -28,11 +27,7 @@ public final class CreativeOutburst extends CardImpl {
// Creative Outburst deals 5 damage to any target. Look at the top five cards of your library. Put one of them into your hand and the rest on the bottom of your library in a random order.
this.getSpellAbility().addEffect(new DamageTargetEffect(5));
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false
- ).setBackInRandomOrder(true).setText("Look at the top five cards of your library. " +
- "Put one of them into your hand and the rest on the bottom of your library in a random order"));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(5, 1, PutCards.HAND, PutCards.BOTTOM_RANDOM));
this.getSpellAbility().addTarget(new TargetAnyTarget());
// {U/R}{U/R}, Discard Creative Outburst: Create a Treasure token.
diff --git a/Mage.Sets/src/mage/cards/c/CruelFate.java b/Mage.Sets/src/mage/cards/c/CruelFate.java
index b76e2edb42e..6c5a44dbaa6 100644
--- a/Mage.Sets/src/mage/cards/c/CruelFate.java
+++ b/Mage.Sets/src/mage/cards/c/CruelFate.java
@@ -40,7 +40,7 @@ public final class CruelFate extends CardImpl {
class CruelFateEffect extends OneShotEffect {
CruelFateEffect() {
- super(Outcome.DrawCard);
+ super(Outcome.Detriment);
this.staticText = "Look at the top five cards of target opponent's library. " +
"Put one of those cards into that player's graveyard and the rest on top of their library in any order";
}
@@ -75,6 +75,6 @@ class CruelFateEffect extends OneShotEffect {
controller.moveCards(card, Zone.GRAVEYARD, source, game);
cards.remove(card);
}
- return controller.putCardsOnTopOfLibrary(card, game, source, true);
+ return controller.putCardsOnTopOfLibrary(cards, game, source, true);
}
}
diff --git a/Mage.Sets/src/mage/cards/c/Curate.java b/Mage.Sets/src/mage/cards/c/Curate.java
index 0f171aa3bc0..cb246a89ec7 100644
--- a/Mage.Sets/src/mage/cards/c/Curate.java
+++ b/Mage.Sets/src/mage/cards/c/Curate.java
@@ -1,23 +1,16 @@
package mage.cards.c;
-import mage.abilities.Ability;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.DrawCardSourceControllerEffect;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.cards.Cards;
-import mage.cards.CardsImpl;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
import java.util.UUID;
/**
- * @author TheElk801
+ * @author awjackson
*/
public final class Curate extends CardImpl {
@@ -25,8 +18,10 @@ public final class Curate extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
// Look at the top two cards of your library. Put any number of them into your graveyard and the rest back on top of your library in any order.
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(2, Integer.MAX_VALUE, PutCards.GRAVEYARD, PutCards.TOP_ANY));
+
// Draw a card.
- this.getSpellAbility().addEffect(new CurateEffect());
+ this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).concatBy("
"));
}
private Curate(final Curate card) {
@@ -38,40 +33,3 @@ public final class Curate extends CardImpl {
return new Curate(this);
}
}
-
-class CurateEffect extends OneShotEffect {
-
- CurateEffect() {
- super(Outcome.Benefit);
- staticText = "look at the top two cards of your library. Put any number of them into your graveyard " +
- "and the rest back on top of your library in any order.
Draw a card";
- }
-
- private CurateEffect(final CurateEffect effect) {
- super(effect);
- }
-
- @Override
- public CurateEffect copy() {
- return new CurateEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- if (player == null) {
- return false;
- }
- Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 2));
- if (!cards.isEmpty()) {
- TargetCard target = new TargetCard(0, cards.size(), Zone.LIBRARY, StaticFilters.FILTER_CARD);
- target.withChooseHint("to graveyard");
- player.chooseTarget(Outcome.Benefit, cards, target, source, game);
- player.moveCards(new CardsImpl(target.getTargets()), Zone.GRAVEYARD, source, game);
- cards.removeAll(target.getTargets());
- player.putCardsOnTopOfLibrary(cards, game, source, true);
- }
- player.drawCards(1, source, game);
- return true;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/d/DarkBargain.java b/Mage.Sets/src/mage/cards/d/DarkBargain.java
index ba6656edc02..64746094866 100644
--- a/Mage.Sets/src/mage/cards/d/DarkBargain.java
+++ b/Mage.Sets/src/mage/cards/d/DarkBargain.java
@@ -1,32 +1,25 @@
-
package mage.cards.d;
import java.util.UUID;
-import mage.MageObject;
-import mage.abilities.Ability;
-import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageControllerEffect;
-import mage.cards.*;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
/**
*
- * @author Quercitron
+ * @author awjackson
*/
public final class DarkBargain extends CardImpl {
public DarkBargain(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{B}");
- // Look at the top three cards of your library. Put two of them into your hand and the rest into your graveyard.
+ // Look at the top three cards of your library. Put two of them into your hand and the other into your graveyard.
// Dark Bargain deals 2 damage to you.
- this.getSpellAbility().addEffect(new DarkBargainEffect());
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(3, 2, PutCards.HAND, PutCards.GRAVEYARD));
this.getSpellAbility().addEffect(new DamageControllerEffect(2));
}
@@ -39,47 +32,3 @@ public final class DarkBargain extends CardImpl {
return new DarkBargain(this);
}
}
-
-class DarkBargainEffect extends OneShotEffect {
-
- public DarkBargainEffect() {
- super(Outcome.Benefit);
- this.staticText = "Look at the top three cards of your library. Put two of them into your hand and the other into your graveyard";
- }
-
- public DarkBargainEffect(final DarkBargainEffect effect) {
- super(effect);
- }
-
- @Override
- public DarkBargainEffect copy() {
- return new DarkBargainEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- MageObject sourceOject = source.getSourceObject(game);
- if (player != null && sourceOject != null) {
- Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 3));
- if (!cards.isEmpty()) {
- Cards cardsToHand = new CardsImpl();
- player.lookAtCards(sourceOject.getIdName(), cards, game);
- TargetCard target = new TargetCard(Math.min(2, cards.size()), Zone.LIBRARY, new FilterCard("two cards to put in your hand"));
- if (player.choose(Outcome.DrawCard, cards, target, game)) {
- for (UUID targetId : target.getTargets()) {
- Card card = cards.get(targetId, game);
- if (card != null) {
- cardsToHand.add(card);
- cards.remove(card);
- }
- }
- }
- player.moveCards(cardsToHand, Zone.HAND, source, game);
- player.moveCards(cards, Zone.GRAVEYARD, source, game);
- }
- return true;
- }
- return false;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/d/DeployTheGatewatch.java b/Mage.Sets/src/mage/cards/d/DeployTheGatewatch.java
index 0b4b5919c00..9bd9d851b9b 100644
--- a/Mage.Sets/src/mage/cards/d/DeployTheGatewatch.java
+++ b/Mage.Sets/src/mage/cards/d/DeployTheGatewatch.java
@@ -2,29 +2,29 @@
package mage.cards.d;
import java.util.UUID;
-import mage.abilities.Ability;
-import mage.abilities.effects.OneShotEffect;
-import mage.cards.*;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
import mage.filter.FilterCard;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
+import mage.filter.common.FilterPlaneswalkerCard;
/**
*
- * @author fireshoes
+ * @author awjackson
*/
public final class DeployTheGatewatch extends CardImpl {
+ private static final FilterCard filter = new FilterPlaneswalkerCard("planeswalker cards");
+
public DeployTheGatewatch(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{W}{W}");
// Look at the top seven cards of your library. Put up to two planeswalker cards from among them onto the battlefield.
// Put the rest on the bottom of your library in a random order.
- this.getSpellAbility().addEffect(new DeployTheGatewatchEffect());
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
+ 7, 2, filter, PutCards.BATTLEFIELD, PutCards.BOTTOM_RANDOM, false));
}
private DeployTheGatewatch(final DeployTheGatewatch card) {
@@ -36,50 +36,3 @@ public final class DeployTheGatewatch extends CardImpl {
return new DeployTheGatewatch(this);
}
}
-
-class DeployTheGatewatchEffect extends OneShotEffect {
-
- private static final FilterCard filter = new FilterCard("up to two planeswalker cards");
-
- static {
- filter.add(CardType.PLANESWALKER.getPredicate());
- }
-
- public DeployTheGatewatchEffect() {
- super(Outcome.DrawCard);
- this.staticText = "Look at the top seven cards of your library. Put up to two planeswalker cards from among them onto the battlefield. "
- + "Put the rest on the bottom of your library in a random order";
- }
-
- public DeployTheGatewatchEffect(final DeployTheGatewatchEffect effect) {
- super(effect);
- }
-
- @Override
- public DeployTheGatewatchEffect copy() {
- return new DeployTheGatewatchEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- if (controller == null) {
- return false;
- }
- // Look at the top seven cards of your library.
- Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 7));
- controller.lookAtCards(source, null, cards, game);
- // Put up to two planeswalker cards from among them onto the battlefield.
- if (cards.count(filter, game) > 0) {
- TargetCard target = new TargetCard(0, 2, Zone.LIBRARY, filter);
- if (controller.choose(Outcome.DrawCard, cards, target, game)) {
- Cards pickedCards = new CardsImpl(target.getTargets());
- cards.removeAll(pickedCards);
- controller.moveCards(pickedCards.getCards(game), Zone.BATTLEFIELD, source, game);
- }
- }
- // Put the rest on the bottom of your library in a random order
- controller.putCardsOnBottomOfLibrary(cards, game, source, false);
- return true;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/d/DiabolicVision.java b/Mage.Sets/src/mage/cards/d/DiabolicVision.java
index dc05352ce62..8a422cfc068 100644
--- a/Mage.Sets/src/mage/cards/d/DiabolicVision.java
+++ b/Mage.Sets/src/mage/cards/d/DiabolicVision.java
@@ -1,13 +1,11 @@
-
package mage.cards.d;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.filter.FilterCard;
/**
*
@@ -19,7 +17,7 @@ public final class DiabolicVision extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}{B}");
// Look at the top five cards of your library. Put one of them into your hand and the rest on top of your library in any order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(5), false, StaticValue.get(1), new FilterCard(), true, false));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(5, 1, PutCards.HAND, PutCards.TOP_ANY));
}
private DiabolicVision(final DiabolicVision card) {
diff --git a/Mage.Sets/src/mage/cards/d/DigThroughTime.java b/Mage.Sets/src/mage/cards/d/DigThroughTime.java
index 743560efe5a..b9a8c554ca1 100644
--- a/Mage.Sets/src/mage/cards/d/DigThroughTime.java
+++ b/Mage.Sets/src/mage/cards/d/DigThroughTime.java
@@ -1,13 +1,11 @@
package mage.cards.d;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.DelveAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
import java.util.UUID;
@@ -23,7 +21,7 @@ public final class DigThroughTime extends CardImpl {
this.addAbility(new DelveAbility());
// Look at the top seven cards of your library. Put two of them into your hand and the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(7), false, StaticValue.get(2), new FilterCard(), Zone.LIBRARY, false, false));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(7, 2, PutCards.HAND, PutCards.BOTTOM_ANY));
}
private DigThroughTime(final DigThroughTime card) {
diff --git a/Mage.Sets/src/mage/cards/d/DiscerningTaste.java b/Mage.Sets/src/mage/cards/d/DiscerningTaste.java
index 7a1bf6eb6f9..af77e13612f 100644
--- a/Mage.Sets/src/mage/cards/d/DiscerningTaste.java
+++ b/Mage.Sets/src/mage/cards/d/DiscerningTaste.java
@@ -4,14 +4,13 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.constants.CardType;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
@@ -41,10 +40,8 @@ public final class DiscerningTaste extends CardImpl {
class DiscerningTasteEffect extends LookLibraryAndPickControllerEffect {
- public DiscerningTasteEffect() {
- super(StaticValue.get(4), false, StaticValue.get(1), StaticFilters.FILTER_CARD, Zone.GRAVEYARD,
- false, false, false, Zone.HAND, false, false, false
- );
+ DiscerningTasteEffect() {
+ super(4, 1, PutCards.HAND, PutCards.GRAVEYARD);
}
private DiscerningTasteEffect(final DiscerningTasteEffect effect) {
@@ -57,16 +54,17 @@ class DiscerningTasteEffect extends LookLibraryAndPickControllerEffect {
}
@Override
- protected void putCardsBack(Ability source, Player player, Cards cards, Game game) {
+ protected boolean actionWithPickedCards(Game game, Ability source, Player player, Cards pickedCards, Cards otherCards) {
+ super.actionWithPickedCards(game, source, player, pickedCards, otherCards);
int life = 0;
- for (Card card : cards.getCards(StaticFilters.FILTER_CARD_CREATURE, game)) {
+ for (Card card : otherCards.getCards(StaticFilters.FILTER_CARD_CREATURE, game)) {
int power = card.getPower().getValue();
if (power > life) {
life = power;
}
}
- player.moveCards(cards, Zone.GRAVEYARD, source, game);
player.gainLife(life, game, source);
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/cards/d/DomriChaosBringer.java b/Mage.Sets/src/mage/cards/d/DomriChaosBringer.java
index f2e5334c50f..7d4814aa1ec 100644
--- a/Mage.Sets/src/mage/cards/d/DomriChaosBringer.java
+++ b/Mage.Sets/src/mage/cards/d/DomriChaosBringer.java
@@ -5,10 +5,10 @@ import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.LoyaltyAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.mana.ManaEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledSpellsEffect;
import mage.abilities.effects.mana.BasicManaEffect;
@@ -46,15 +46,7 @@ public final class DomriChaosBringer extends CardImpl {
// creature cards from among them and put them into your hand. Put the rest
// on the bottom of your library in a random order.
this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(2),
- StaticFilters.FILTER_CARD_CREATURE, Zone.LIBRARY, false,
- true, true, Zone.HAND, false, false, false
- ).setText(
- "Look at the top four cards of your library. "
- + "You may reveal up to two creature cards from among them "
- + "and put them into your hand. Put the rest on the bottom of your library "
- + "in a random order."
- ), -3));
+ 4, 2, StaticFilters.FILTER_CARD_CREATURES, PutCards.HAND, PutCards.BOTTOM_RANDOM), -3));
// −8: You get an emblem with "At the beginning of each end step, create a 4/4 red
// and green Beast creature token with trample."
diff --git a/Mage.Sets/src/mage/cards/d/DovinGrandArbiter.java b/Mage.Sets/src/mage/cards/d/DovinGrandArbiter.java
index dae97514102..55c899a46b5 100644
--- a/Mage.Sets/src/mage/cards/d/DovinGrandArbiter.java
+++ b/Mage.Sets/src/mage/cards/d/DovinGrandArbiter.java
@@ -3,17 +3,16 @@ package mage.cards.d;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.LoyaltyAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
-import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
@@ -41,19 +40,13 @@ public final class DovinGrandArbiter extends CardImpl {
// -1: Create a 1/1 colorless Thopter artifact creature token with flying. You gain 1 life.
Ability ability = new LoyaltyAbility(new CreateTokenEffect(new ThopterColorlessToken()), -1);
- ability.addEffect(new GainLifeEffect(1).setText("You gain 1 life."));
+ ability.addEffect(new GainLifeEffect(1));
this.addAbility(ability);
- // -7: Look at the top ten cards of your library. Put three of them into your hand and the rest on the bottom of your library in a random order.
+ // -7: Look at the top ten cards of your library. Put three of them into your hand
+ // and the rest on the bottom of your library in a random order.
this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(10), false,
- StaticValue.get(3), StaticFilters.FILTER_CARD,
- Zone.LIBRARY, false, false, false,
- Zone.HAND, false, false, false
- ).setBackInRandomOrder(true).setText("Look at the top ten cards of your library. " +
- "Put three of them into your hand and the rest " +
- "on the bottom of your library in a random order."
- ), -7));
+ 10, 3, PutCards.HAND, PutCards.BOTTOM_RANDOM), -7));
}
private DovinGrandArbiter(final DovinGrandArbiter card) {
diff --git a/Mage.Sets/src/mage/cards/d/DragonlordOjutai.java b/Mage.Sets/src/mage/cards/d/DragonlordOjutai.java
index 8d9c750fe63..d2faf5617bb 100644
--- a/Mage.Sets/src/mage/cards/d/DragonlordOjutai.java
+++ b/Mage.Sets/src/mage/cards/d/DragonlordOjutai.java
@@ -1,26 +1,22 @@
-
package mage.cards.d;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.common.SourceTappedCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.HexproofAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.SubType;
import mage.constants.Duration;
+import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
/**
*
@@ -40,14 +36,15 @@ public final class DragonlordOjutai extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Dragonlord Ojutai has hexproof as long as it's untapped.
- this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
+ this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new GainAbilitySourceEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield),
SourceTappedCondition.UNTAPPED,
"{this} has hexproof as long as it's untapped")));
// Whenever Dragonlord Ojutai deals combat damage to a player, look at the top three cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.
- this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new LookLibraryAndPickControllerEffect
- (StaticValue.get(3), false, StaticValue.get(1), new FilterCard(), Zone.LIBRARY, false, false), false));
+ this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.BOTTOM_ANY),
+ false));
}
private DragonlordOjutai(final DragonlordOjutai card) {
diff --git a/Mage.Sets/src/mage/cards/d/DrawnFromDreams.java b/Mage.Sets/src/mage/cards/d/DrawnFromDreams.java
index a9777c29890..c55cc5520d2 100644
--- a/Mage.Sets/src/mage/cards/d/DrawnFromDreams.java
+++ b/Mage.Sets/src/mage/cards/d/DrawnFromDreams.java
@@ -1,12 +1,10 @@
package mage.cards.d;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -19,10 +17,7 @@ public final class DrawnFromDreams extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{U}");
// Look at the top seven cards of your library. Put two of them into your hand and the rest on the bottom of your library in a random order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(7), false, StaticValue.get(2),
- StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false
- ).setBackInRandomOrder(true));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(7, 2, PutCards.HAND, PutCards.BOTTOM_RANDOM));
}
private DrawnFromDreams(final DrawnFromDreams card) {
diff --git a/Mage.Sets/src/mage/cards/d/DuskwatchRecruiter.java b/Mage.Sets/src/mage/cards/d/DuskwatchRecruiter.java
index b7ea9403b6a..7844b2006e5 100644
--- a/Mage.Sets/src/mage/cards/d/DuskwatchRecruiter.java
+++ b/Mage.Sets/src/mage/cards/d/DuskwatchRecruiter.java
@@ -7,21 +7,19 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.WerewolfFrontTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
-import mage.filter.common.FilterCreatureCard;
+import mage.filter.StaticFilters;
/**
* @author fireshoes
*/
public final class DuskwatchRecruiter extends CardImpl {
- private static final FilterCreatureCard filter = new FilterCreatureCard("a creature card");
-
public DuskwatchRecruiter(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
this.subtype.add(SubType.HUMAN);
@@ -35,8 +33,8 @@ public final class DuskwatchRecruiter extends CardImpl {
// {2}{G}: Look at the top three cards of your library. You may reveal a creature card from among them and put it into your hand.
// Put the rest on the bottom of your library in any order.
- this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
- new LookLibraryAndPickControllerEffect(3, 1, filter, true, false, Zone.HAND, true),
+ this.addAbility(new SimpleActivatedAbility(
+ new LookLibraryAndPickControllerEffect(3, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.BOTTOM_ANY),
new ManaCostsImpl("{2}{G}")));
// At the beginning of each upkeep, if no spells were cast last turn, transform Duskwatch Recruiter.
@@ -52,5 +50,4 @@ public final class DuskwatchRecruiter extends CardImpl {
public DuskwatchRecruiter copy() {
return new DuskwatchRecruiter(this);
}
-
-}
\ No newline at end of file
+}
diff --git a/Mage.Sets/src/mage/cards/e/ElvishRejuvenator.java b/Mage.Sets/src/mage/cards/e/ElvishRejuvenator.java
index 5b15891c651..328ec0bfcc5 100644
--- a/Mage.Sets/src/mage/cards/e/ElvishRejuvenator.java
+++ b/Mage.Sets/src/mage/cards/e/ElvishRejuvenator.java
@@ -2,26 +2,18 @@ package mage.cards.e;
import java.util.UUID;
import mage.MageInt;
-import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.effects.OneShotEffect;
-import mage.cards.Card;
-import mage.constants.SubType;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.cards.Cards;
-import mage.cards.CardsImpl;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
-import mage.filter.common.FilterLandCard;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
+import mage.constants.SubType;
+import mage.filter.StaticFilters;
/**
*
- * @author TheElk801
+ * @author awjackson
*/
public final class ElvishRejuvenator extends CardImpl {
@@ -33,8 +25,11 @@ public final class ElvishRejuvenator extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(1);
- // Whenever Elvish Rejuvenator enters the battlefield, look at the top five cards of your library. You may put a land card from among them onto the battlefield tapped. Put the rest on the bottom of your library in a random order.
- this.addAbility(new EntersBattlefieldTriggeredAbility(new ElvishRejuvenatorEffect(), false));
+ // When Elvish Rejuvenator enters the battlefield, look at the top five cards of your library.
+ // You may put a land card from among them onto the battlefield tapped.
+ // Put the rest on the bottom of your library in a random order.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
+ 5, 1, StaticFilters.FILTER_CARD_LAND_A, PutCards.BATTLEFIELD_TAPPED, PutCards.BOTTOM_RANDOM)));
}
private ElvishRejuvenator(final ElvishRejuvenator card) {
@@ -46,49 +41,3 @@ public final class ElvishRejuvenator extends CardImpl {
return new ElvishRejuvenator(this);
}
}
-
-class ElvishRejuvenatorEffect extends OneShotEffect {
-
- public ElvishRejuvenatorEffect() {
- super(Outcome.PutCreatureInPlay);
- this.staticText = "look at the top five cards of your library. "
- + "You may put a land card from among them onto the battlefield tapped. "
- + "Put the rest on the bottom of your library in a random order";
- }
-
- public ElvishRejuvenatorEffect(final ElvishRejuvenatorEffect effect) {
- super(effect);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- if (controller == null) {
- return false;
- }
- Cards cards = new CardsImpl();
- cards.addAll(controller.getLibrary().getTopCards(game, 5));
- if (!cards.isEmpty()) {
- TargetCard target = new TargetCard(
- 0, 1, Zone.LIBRARY,
- new FilterLandCard("land card to put on the battlefield")
- );
- if (controller.choose(Outcome.PutCardInPlay, cards, target, game)) {
- Card card = cards.get(target.getFirstTarget(), game);
- if (card != null) {
- cards.remove(card);
- controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, true, null);
- }
- }
- if (!cards.isEmpty()) {
- controller.putCardsOnBottomOfLibrary(cards, game, source, false);
- }
- }
- return true;
- }
-
- @Override
- public ElvishRejuvenatorEffect copy() {
- return new ElvishRejuvenatorEffect(this);
- }
-}
diff --git a/Mage.Sets/src/mage/cards/f/FaerieMechanist.java b/Mage.Sets/src/mage/cards/f/FaerieMechanist.java
index 792d2b716b6..a5c66331411 100644
--- a/Mage.Sets/src/mage/cards/f/FaerieMechanist.java
+++ b/Mage.Sets/src/mage/cards/f/FaerieMechanist.java
@@ -1,18 +1,16 @@
-
-
package mage.cards.f;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.filter.FilterCard;
+import mage.filter.StaticFilters;
/**
*
@@ -20,11 +18,6 @@ import mage.filter.FilterCard;
*/
public final class FaerieMechanist extends CardImpl {
- private static final FilterCard filter = new FilterCard("an artifact card");
- static {
- filter.add(CardType.ARTIFACT.getPredicate());
- }
-
public FaerieMechanist(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{3}{U}");
@@ -36,7 +29,8 @@ public final class FaerieMechanist extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// When Faerie Mechanist enters the battlefield, look at the top three cards of your library.
// You may reveal an artifact card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
- this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(StaticValue.get(3), false, StaticValue.get(1), filter, false)));
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
+ 3, 1, StaticFilters.FILTER_CARD_ARTIFACT_AN, PutCards.HAND, PutCards.BOTTOM_ANY)));
}
private FaerieMechanist(final FaerieMechanist card) {
@@ -47,5 +41,4 @@ public final class FaerieMechanist extends CardImpl {
public FaerieMechanist copy() {
return new FaerieMechanist(this);
}
-
}
diff --git a/Mage.Sets/src/mage/cards/f/FirjaJudgeOfValor.java b/Mage.Sets/src/mage/cards/f/FirjaJudgeOfValor.java
index 7338716f68b..92d267fadce 100644
--- a/Mage.Sets/src/mage/cards/f/FirjaJudgeOfValor.java
+++ b/Mage.Sets/src/mage/cards/f/FirjaJudgeOfValor.java
@@ -2,8 +2,8 @@ package mage.cards.f;
import mage.MageInt;
import mage.abilities.common.CastSecondSpellTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
@@ -11,8 +11,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -36,11 +34,10 @@ public final class FirjaJudgeOfValor extends CardImpl {
// Lifelink
this.addAbility(LifelinkAbility.getInstance());
- // Whenever you cast your second spell each turn, look at the top three cards of your library. Put one of them into your hand and the rest into your graveyard.
+ // Whenever you cast your second spell each turn, look at the top three cards of your library.
+ // Put one of them into your hand and the rest into your graveyard.
this.addAbility(new CastSecondSpellTriggeredAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false, StaticValue.get(1), StaticFilters.FILTER_CARD,
- Zone.GRAVEYARD, false, false, false, Zone.HAND, false
- )));
+ 3, 1, PutCards.HAND, PutCards.GRAVEYARD)));
}
private FirjaJudgeOfValor(final FirjaJudgeOfValor card) {
diff --git a/Mage.Sets/src/mage/cards/f/FlashOfInsight.java b/Mage.Sets/src/mage/cards/f/FlashOfInsight.java
index d11bccc77b6..8d03d4fff0b 100644
--- a/Mage.Sets/src/mage/cards/f/FlashOfInsight.java
+++ b/Mage.Sets/src/mage/cards/f/FlashOfInsight.java
@@ -1,28 +1,26 @@
package mage.cards.f;
-import mage.MageObject;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.costs.Cost;
-import mage.abilities.costs.common.ExileFromGraveCost;
import mage.abilities.costs.common.ExileXFromYourGraveCost;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.dynamicvalue.DynamicValue;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.FlashbackAbility;
-import mage.cards.*;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
import java.util.UUID;
/**
- * @author LevelX2
+ * @author awjackson
*/
public final class FlashOfInsight extends CardImpl {
@@ -36,7 +34,8 @@ public final class FlashOfInsight extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{1}{U}");
// Look at the top X cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(new FlashOfInsightEffect());
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
+ FlashOfInsightValue.instance, 1, PutCards.HAND, PutCards.BOTTOM_ANY));
// Flashback-{1}{U}, Exile X blue cards from your graveyard.
Ability ability = new FlashbackAbility(this, new ManaCostsImpl<>("{1}{U}"));
@@ -54,51 +53,32 @@ public final class FlashOfInsight extends CardImpl {
}
}
-class FlashOfInsightEffect extends OneShotEffect {
+enum FlashOfInsightValue implements DynamicValue {
+ instance;
- public FlashOfInsightEffect() {
- super(Outcome.DrawCard);
- this.staticText = "Look at the top X cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order";
- }
-
- public FlashOfInsightEffect(final FlashOfInsightEffect effect) {
- super(effect);
+ @Override
+ public int calculate(Game game, Ability sourceAbility, Effect effect) {
+ int xValue = sourceAbility.getManaCostsToPay().getX();
+ for (Cost cost : sourceAbility.getCosts()) {
+ if (cost instanceof ExileXFromYourGraveCost) {
+ xValue = ((ExileXFromYourGraveCost) cost).getAmount();
+ }
+ }
+ return xValue;
}
@Override
- public FlashOfInsightEffect copy() {
- return new FlashOfInsightEffect(this);
+ public FlashOfInsightValue copy() {
+ return instance;
}
@Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- MageObject sourceObject = game.getObject(source);
- if (controller == null || sourceObject == null) {
- return false;
- }
+ public String toString() {
+ return "X";
+ }
- int xValue = source.getManaCostsToPay().getX();
-
- for (Cost cost : source.getCosts()) {
- if (cost instanceof ExileFromGraveCost) {
- xValue = ((ExileFromGraveCost) cost).getExiledCards().size();
- }
- }
-
- Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, xValue));
- controller.lookAtCards(sourceObject.getIdName(), cards, game);
-
- TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand"));
- target.setNotTarget(true);
- if (controller.chooseTarget(Outcome.DrawCard, cards, target, source, game)) {
- Card card = cards.get(target.getFirstTarget(), game);
- if (card != null) {
- controller.moveCards(card, Zone.HAND, source, game);
- cards.remove(card);
- }
- }
- controller.putCardsOnBottomOfLibrary(cards, game, source, true);
- return true;
+ @Override
+ public String getMessage() {
+ return "";
}
}
diff --git a/Mage.Sets/src/mage/cards/f/ForbiddenAlchemy.java b/Mage.Sets/src/mage/cards/f/ForbiddenAlchemy.java
index cdc2e92ae55..f8af6bdc37d 100644
--- a/Mage.Sets/src/mage/cards/f/ForbiddenAlchemy.java
+++ b/Mage.Sets/src/mage/cards/f/ForbiddenAlchemy.java
@@ -1,16 +1,13 @@
-
package mage.cards.f;
import java.util.UUID;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.FlashbackAbility;
-import mage.cards.*;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.TimingRule;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
/**
*
@@ -22,8 +19,7 @@ public final class ForbiddenAlchemy extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}");
// Look at the top four cards of your library. Put one of them into your hand and the rest into your graveyard.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(4), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(4, 1, PutCards.HAND, PutCards.GRAVEYARD));
// Flashback {6}{B}
this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{6}{B}")));
diff --git a/Mage.Sets/src/mage/cards/f/FoulEmissary.java b/Mage.Sets/src/mage/cards/f/FoulEmissary.java
index 5e0426843fa..16b296551e2 100644
--- a/Mage.Sets/src/mage/cards/f/FoulEmissary.java
+++ b/Mage.Sets/src/mage/cards/f/FoulEmissary.java
@@ -1,20 +1,19 @@
-
package mage.cards.f;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SacrificeSourceTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.EmergeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.filter.FilterCard;
+import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.token.EldraziHorrorToken;
@@ -26,12 +25,6 @@ import mage.game.stack.Spell;
*/
public final class FoulEmissary extends CardImpl {
- private static final FilterCard filter = new FilterCard("a creature card");
-
- static {
- filter.add(CardType.CREATURE.getPredicate());
- }
-
public FoulEmissary(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}");
this.subtype.add(SubType.HUMAN);
@@ -40,7 +33,8 @@ public final class FoulEmissary extends CardImpl {
this.toughness = new MageInt(1);
// When Foul Emissary enters the battlefield, look at the top four cards of your library. You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
- this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(StaticValue.get(4), false, StaticValue.get(1), filter, false)));
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
+ 4, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.BOTTOM_ANY)));
// When you sacrifice Foul Emissary while casting a spell with emerge, create a 3/2 colorless Eldrazi Horror creature token.
this.addAbility(new FoulEmissaryTriggeredAbility(new CreateTokenEffect(new EldraziHorrorToken()), false));
diff --git a/Mage.Sets/src/mage/cards/g/GarruksHarbinger.java b/Mage.Sets/src/mage/cards/g/GarruksHarbinger.java
index 1d21b265a21..76aa2ff778f 100644
--- a/Mage.Sets/src/mage/cards/g/GarruksHarbinger.java
+++ b/Mage.Sets/src/mage/cards/g/GarruksHarbinger.java
@@ -1,20 +1,17 @@
package mage.cards.g;
import mage.MageInt;
-import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.dynamicvalue.common.SavedDamageValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.HexproofFromBlackAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
-import mage.game.Game;
import java.util.UUID;
@@ -24,9 +21,20 @@ import java.util.UUID;
*/
public final class GarruksHarbinger extends CardImpl {
+ private static final FilterCard filter = new FilterCard("creature card or Garruk planeswalker card");
+ static {
+ filter.add(Predicates.or(
+ CardType.CREATURE.getPredicate(),
+ Predicates.and(
+ CardType.PLANESWALKER.getPredicate(),
+ SubType.GARRUK.getPredicate()
+ )
+ ));
+ }
+
public GarruksHarbinger(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{G}");
-
+
this.subtype.add(SubType.BEAST);
this.power = new MageInt(4);
this.toughness = new MageInt(3);
@@ -34,11 +42,12 @@ public final class GarruksHarbinger extends CardImpl {
// Hexproof from Black
this.addAbility(HexproofFromBlackAbility.getInstance());
- // Whenever Garruk's Harbinger deals combat damage to a player or planeswalker, look at that many cards from the top of your library. You may reveal a creature card or Garruk planeswalker card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
- this.addAbility(
- new DealsCombatDamageToAPlayerTriggeredAbility(new GarruksHarbingerEffect(), false, true)
- .setOrPlaneswalker(true)
- );
+ // Whenever Garruk's Harbinger deals combat damage to a player or planeswalker, look at that many cards from the top of your library.
+ // You may reveal a creature card or Garruk planeswalker card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
+ this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(SavedDamageValue.MANY, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM),
+ false, true).setOrPlaneswalker(true));
}
private GarruksHarbinger(final GarruksHarbinger card) {
@@ -50,37 +59,3 @@ public final class GarruksHarbinger extends CardImpl {
return new GarruksHarbinger(this);
}
}
-
-class GarruksHarbingerEffect extends OneShotEffect {
-
- private static final FilterCard filter = new FilterCard("a creature or Garruk planeswalker card");
-
- static {
- filter.add(Predicates.or(CardType.CREATURE.getPredicate(), Predicates.and(CardType.PLANESWALKER.getPredicate(), SubType.GARRUK.getPredicate())));
- }
-
- GarruksHarbingerEffect() {
- super(Outcome.Benefit);
- staticText = "look at that many cards from the top of your library. You may reveal a creature card or Garruk planeswalker card from among them and put it into your hand. Put the rest on the bottom of your library in a random order";
- }
-
- private GarruksHarbingerEffect(GarruksHarbingerEffect effect) {
- super(effect);
- }
-
- @Override
- public GarruksHarbingerEffect copy() {
- return new GarruksHarbingerEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Integer damage = (Integer) getValue("damage");
- if (damage != null) {
- LookLibraryAndPickControllerEffect effect = new LookLibraryAndPickControllerEffect(StaticValue.get(damage), false, StaticValue.get(1), filter, false);
- effect.setBackInRandomOrder(true);
- return effect.apply(game, source);
- }
- return false;
- }
-}
\ No newline at end of file
diff --git a/Mage.Sets/src/mage/cards/g/GatherThePack.java b/Mage.Sets/src/mage/cards/g/GatherThePack.java
index 27edb597ded..f5a462cbe3e 100644
--- a/Mage.Sets/src/mage/cards/g/GatherThePack.java
+++ b/Mage.Sets/src/mage/cards/g/GatherThePack.java
@@ -1,35 +1,37 @@
package mage.cards.g;
import java.util.UUID;
-import mage.MageObject;
-import mage.abilities.Ability;
import mage.abilities.condition.common.SpellMasteryCondition;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.decorator.ConditionalOneShotEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.abilities.effects.common.RevealLibraryPickControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.cards.Cards;
-import mage.cards.CardsImpl;
+import mage.constants.AbilityWord;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
-import mage.filter.common.FilterCreatureCard;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
/**
*
- * @author LevelX2
+ * @author awjackson
*/
public final class GatherThePack extends CardImpl {
+ private static final String rule = "Reveal the top five cards of your library. " +
+ "You may put a creature card from among them into your hand. Put the rest into your graveyard.
" +
+ AbilityWord.SPELL_MASTERY.formatWord() + "If " + SpellMasteryCondition.instance.toString() +
+ ", put up to two creature cards from among the revealed cards into your hand instead of one";
+
public GatherThePack(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}");
// Reveal the top five cards of your library. You may put a creature card from among them into your hand. Put the rest into your graveyard.
// Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, put up to two creature cards from among the revealed cards into your hand instead of one.
- this.getSpellAbility().addEffect(new GatherThePackEffect());
+ this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
+ new RevealLibraryPickControllerEffect(5, 2, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.GRAVEYARD),
+ new RevealLibraryPickControllerEffect(5, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.GRAVEYARD),
+ SpellMasteryCondition.instance, rule
+ ));
}
private GatherThePack(final GatherThePack card) {
@@ -41,53 +43,3 @@ public final class GatherThePack extends CardImpl {
return new GatherThePack(this);
}
}
-
-class GatherThePackEffect extends OneShotEffect {
-
- public GatherThePackEffect(final GatherThePackEffect effect) {
- super(effect);
- }
-
- public GatherThePackEffect() {
- super(Outcome.PutCreatureInPlay);
- this.staticText = "Reveal the top five cards of your library. You may put a creature card from among them into your hand. Put the rest into your graveyard."
- + "
Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, put up to two creature cards from among the revealed cards into your hand instead of one";
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- MageObject sourceObject = source.getSourceObject(game);
- if (controller == null || sourceObject == null) {
- return false;
- }
- Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 5));
- if (!cards.isEmpty()) {
- controller.revealCards(sourceObject.getIdName(), cards, game);
- int creatures = cards.count(StaticFilters.FILTER_CARD_CREATURE, source.getControllerId(), source, game);
- if (creatures > 0) {
- int max = 1;
- if (SpellMasteryCondition.instance.apply(game, source) && creatures > 1) {
- max++;
- }
- TargetCard target = new TargetCard(0, max, Zone.LIBRARY, new FilterCreatureCard("creature card" + (max > 1 ? "s" : "") + " to put into your hand"));
- if (controller.choose(Outcome.PutCreatureInPlay, cards, target, game)) {
- Cards cardsToHand = new CardsImpl(target.getTargets());
- if (!cardsToHand.isEmpty()) {
- cards.removeAll(cardsToHand);
- controller.moveCards(cardsToHand, Zone.HAND, source, game);
- }
- }
- }
- if (!cards.isEmpty()) {
- controller.moveCards(cards, Zone.GRAVEYARD, source, game);
- }
- }
- return true;
- }
-
- @Override
- public GatherThePackEffect copy() {
- return new GatherThePackEffect(this);
- }
-}
diff --git a/Mage.Sets/src/mage/cards/g/GavonyDawnguard.java b/Mage.Sets/src/mage/cards/g/GavonyDawnguard.java
index 88f5cce5f93..9042e4536ad 100644
--- a/Mage.Sets/src/mage/cards/g/GavonyDawnguard.java
+++ b/Mage.Sets/src/mage/cards/g/GavonyDawnguard.java
@@ -3,16 +3,15 @@ package mage.cards.g;
import mage.MageInt;
import mage.abilities.common.BecomeDayAsEntersAbility;
import mage.abilities.common.BecomesDayOrNightTriggeredAbility;
-import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
+import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.WardAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.ManaValuePredicate;
@@ -24,7 +23,7 @@ import java.util.UUID;
*/
public final class GavonyDawnguard extends CardImpl {
- private static final FilterCard filter = new FilterCreatureCard("creature card with mana value 3 or less");
+ private static final FilterCard filter = new FilterCreatureCard("a creature card with mana value 3 or less");
static {
filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, 4));
@@ -39,18 +38,14 @@ public final class GavonyDawnguard extends CardImpl {
this.toughness = new MageInt(3);
// Ward {1}
- this.addAbility(new WardAbility(new ManaCostsImpl<>("{1}")));
+ this.addAbility(new WardAbility(new GenericManaCost(1)));
// If it's neither day nor night, it becomes day as Gavony Dawnguard enters the battlefield.
this.addAbility(new BecomeDayAsEntersAbility());
// Whenever day becomes night or night becomes day, look at the top four cards of your library. You may reveal a creature card with mana value 3 or less from among them and put it into your hand. Put the rest on the bottom of your library in any order.
this.addAbility(new BecomesDayOrNightTriggeredAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(1), filter, Zone.LIBRARY, false,
- true, false, Zone.HAND, true, false, false
- ).setBackInRandomOrder(true).setText("look at the top four cards of your library. " +
- "You may reveal a creature card with mana value 3 or less from among them " +
- "and put it into your hand. Put the rest on the bottom of your library in any order")));
+ 4, 1, filter, PutCards.HAND, PutCards.BOTTOM_ANY)));
}
private GavonyDawnguard(final GavonyDawnguard card) {
diff --git a/Mage.Sets/src/mage/cards/g/GenesisUltimatum.java b/Mage.Sets/src/mage/cards/g/GenesisUltimatum.java
index 210cf9f1683..bc52296d2c8 100644
--- a/Mage.Sets/src/mage/cards/g/GenesisUltimatum.java
+++ b/Mage.Sets/src/mage/cards/g/GenesisUltimatum.java
@@ -1,34 +1,32 @@
package mage.cards.g;
-import mage.abilities.Ability;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.ExileSpellEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.cards.Cards;
-import mage.cards.CardsImpl;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterPermanentCard;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
-import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/**
- * @author TheElk801
+ * @author awjackson
*/
public final class GenesisUltimatum extends CardImpl {
+ private static final FilterCard filter = new FilterPermanentCard("permanent cards");
+
public GenesisUltimatum(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}{G}{U}{U}{U}{R}{R}");
- // Look at the top five cards of your library. Put any number of permanent cards from among them onto the battlefield and the rest into your hand. Exile Genesis Ultimatum.
- this.getSpellAbility().addEffect(new GenesisUltimatumEffect());
+ // Look at the top five cards of your library.
+ // Put any number of permanent cards from among them onto the battlefield and the rest into your hand.
+ // Exile Genesis Ultimatum.
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
+ 5, Integer.MAX_VALUE, filter, PutCards.BATTLEFIELD, PutCards.HAND, false
+ ).setText("look at the top five cards of your library. Put any number of permanent cards from among them onto the battlefield and the rest into your hand"));
this.getSpellAbility().addEffect(new ExileSpellEffect());
}
@@ -41,45 +39,3 @@ public final class GenesisUltimatum extends CardImpl {
return new GenesisUltimatum(this);
}
}
-
-class GenesisUltimatumEffect extends OneShotEffect {
-
- private static final FilterCard filter = new FilterPermanentCard("any number of permanent cards");
-
- GenesisUltimatumEffect() {
- super(Outcome.PutCardInPlay);
- staticText = "Look at the top five cards of your library. Put any number of permanent cards " +
- "from among them onto the battlefield and the rest into your hand";
- }
-
- private GenesisUltimatumEffect(final GenesisUltimatumEffect effect) {
- super(effect);
- }
-
- @Override
- public GenesisUltimatumEffect copy() {
- return new GenesisUltimatumEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- if (player == null) {
- return false;
- }
- Cards toHand = new CardsImpl(player.getLibrary().getTopCards(game, 5));
- player.lookAtCards(source, null, toHand, game);
- TargetCard targetCard = new TargetCardInLibrary(0, 5, filter);
- targetCard.withChooseHint("put to battlefield");
- player.choose(outcome, toHand, targetCard, game);
- Cards toBattlefield = new CardsImpl(targetCard.getTargets());
- if (player.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game)) {
- toBattlefield
- .stream()
- .filter(id -> Zone.BATTLEFIELD.equals(game.getState().getZone(id)))
- .forEach(toHand::remove);
- }
- player.moveCards(toHand, Zone.HAND, source, game);
- return true;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/g/GlacialRevelation.java b/Mage.Sets/src/mage/cards/g/GlacialRevelation.java
index 0c14bd38de4..18da214a7c3 100644
--- a/Mage.Sets/src/mage/cards/g/GlacialRevelation.java
+++ b/Mage.Sets/src/mage/cards/g/GlacialRevelation.java
@@ -1,33 +1,35 @@
package mage.cards.g;
-import mage.abilities.Ability;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.abilities.effects.common.RevealLibraryPickControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.cards.Cards;
-import mage.cards.CardsImpl;
import mage.constants.CardType;
-import mage.constants.Outcome;
import mage.constants.SuperType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterPermanentCard;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
import java.util.UUID;
/**
- * @author TheElk801
+ * @author awjackson
*/
public final class GlacialRevelation extends CardImpl {
+ private static final FilterCard filter = new FilterPermanentCard("snow permanent cards");
+
+ static {
+ filter.add(SuperType.SNOW.getPredicate());
+ }
+
public GlacialRevelation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}");
- // Reveal the top six cards of your library. You may put any number of snow permanent cards from among them into your hand. Put the rest into your graveyard.
- this.getSpellAbility().addEffect(new GlacialRevelationEffect());
+ // Reveal the top six cards of your library.
+ // You may put any number of snow permanent cards from among them into your hand.
+ // Put the rest into your graveyard.
+ this.getSpellAbility().addEffect(new RevealLibraryPickControllerEffect(
+ 6, Integer.MAX_VALUE, filter, PutCards.HAND, PutCards.GRAVEYARD));
}
private GlacialRevelation(final GlacialRevelation card) {
@@ -39,45 +41,3 @@ public final class GlacialRevelation extends CardImpl {
return new GlacialRevelation(this);
}
}
-
-class GlacialRevelationEffect extends OneShotEffect {
-
- private static final FilterCard filter = new FilterPermanentCard("snow permanent cards");
-
- static {
- filter.add(SuperType.SNOW.getPredicate());
- }
-
- GlacialRevelationEffect() {
- super(Outcome.Benefit);
- staticText = "Reveal the top six cards of your library. You may put any number of snow permanent cards " +
- "from among them into your hand. Put the rest into your graveyard.";
- }
-
- private GlacialRevelationEffect(final GlacialRevelationEffect effect) {
- super(effect);
- }
-
- @Override
- public GlacialRevelationEffect copy() {
- return new GlacialRevelationEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- if (player == null) {
- return false;
- }
- Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 6));
- player.revealCards(source, cards, game);
- TargetCard targetCard = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, filter);
- targetCard.setNotTarget(true);
- if (player.choose(outcome, cards, targetCard, game)) {
- Cards toHand = new CardsImpl(targetCard.getTargets());
- cards.removeAll(targetCard.getTargets());
- player.moveCards(toHand, Zone.HAND, source, game);
- }
- return player.moveCards(cards, Zone.GRAVEYARD, source, game);
- }
-}
\ No newline at end of file
diff --git a/Mage.Sets/src/mage/cards/g/GlimpseTheCosmos.java b/Mage.Sets/src/mage/cards/g/GlimpseTheCosmos.java
index b60d98f16df..67ef251b584 100644
--- a/Mage.Sets/src/mage/cards/g/GlimpseTheCosmos.java
+++ b/Mage.Sets/src/mage/cards/g/GlimpseTheCosmos.java
@@ -4,14 +4,13 @@ import java.util.HashSet;
import java.util.Set;
import mage.abilities.Ability;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
-import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -35,12 +34,7 @@ public class GlimpseTheCosmos extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}");
// Look at the top three cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.LIBRARY, false,
- false, false, Zone.HAND, false
- ).setText("look at the top three cards of your library. "
- + "Put one of them into your hand and the rest on the bottom of your library in any order"));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.BOTTOM_ANY));
//As long as you control a Giant, you may cast Glimpse the Cosmos from your graveyard by paying {U} rather than paying its mana cost. If you cast Glimpse the Cosmos this way and it would be put into your graveyard, exile it instead.
this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD,
diff --git a/Mage.Sets/src/mage/cards/g/GlimpseTheFuture.java b/Mage.Sets/src/mage/cards/g/GlimpseTheFuture.java
index b4c84cc801a..3cbac75e0cc 100644
--- a/Mage.Sets/src/mage/cards/g/GlimpseTheFuture.java
+++ b/Mage.Sets/src/mage/cards/g/GlimpseTheFuture.java
@@ -1,13 +1,11 @@
-
package mage.cards.g;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
-import mage.cards.*;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
/**
*
@@ -19,9 +17,7 @@ public final class GlimpseTheFuture extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}");
// Look at the top three cards of your library. Put one of them into your hand and the rest into your graveyard.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(3), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false));
-
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.GRAVEYARD));
}
private GlimpseTheFuture(final GlimpseTheFuture card) {
diff --git a/Mage.Sets/src/mage/cards/g/GlintNestCrane.java b/Mage.Sets/src/mage/cards/g/GlintNestCrane.java
index 3a0a5d6d2f7..0edbeddcb23 100644
--- a/Mage.Sets/src/mage/cards/g/GlintNestCrane.java
+++ b/Mage.Sets/src/mage/cards/g/GlintNestCrane.java
@@ -1,17 +1,15 @@
-
package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
/**
@@ -29,11 +27,11 @@ public final class GlintNestCrane extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
- // When Glint-Nest Crane enters the battlefield, look at the top four cards of your library. You may reveal an artifact card from among them and
- // put it into your hand. Put the rest on the bottom of your library in any order.
- this.addAbility(new EntersBattlefieldTriggeredAbility(
- new LookLibraryAndPickControllerEffect(StaticValue.get(4), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD_ARTIFACT_AN, Zone.LIBRARY, false, true, false, Zone.HAND, true)));
+ // When Glint-Nest Crane enters the battlefield, look at the top four cards of your library.
+ // You may reveal an artifact card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in any order.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
+ 4, 1, StaticFilters.FILTER_CARD_ARTIFACT_AN, PutCards.HAND, PutCards.BOTTOM_ANY)));
}
private GlintNestCrane(final GlintNestCrane card) {
diff --git a/Mage.Sets/src/mage/cards/g/GrimFlayer.java b/Mage.Sets/src/mage/cards/g/GrimFlayer.java
index dd720fda3c0..e145da19f8c 100644
--- a/Mage.Sets/src/mage/cards/g/GrimFlayer.java
+++ b/Mage.Sets/src/mage/cards/g/GrimFlayer.java
@@ -7,19 +7,17 @@ import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.DeliriumCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
-import mage.abilities.dynamicvalue.common.StaticValue;
-import mage.abilities.effects.Effect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.hint.common.CardTypesInGraveyardHint;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
+import mage.constants.AbilityWord;
import mage.constants.CardType;
-import mage.constants.SubType;
import mage.constants.Duration;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
+import mage.constants.SubType;
/**
* @author fireshoes
@@ -36,19 +34,18 @@ public final class GrimFlayer extends CardImpl {
// Trample
this.addAbility(TrampleAbility.getInstance());
- // Whenever Grim Flayer deals combat damage to a player, look at the top three cards of your library. Put any number of them into your graveyard
- // and the rest back on top of your library in any order.
- Effect effect = new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false, StaticValue.get(3), new FilterCard(), Zone.LIBRARY, true, false, true, Zone.GRAVEYARD, false);
- effect.setText("look at the top three cards of your library. Put any number of them into your graveyard and the rest back on top of your library in any order");
- this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(effect, false));
+ // Whenever Grim Flayer deals combat damage to a player, look at the top three cards of your library.
+ // Put any number of them into your graveyard and the rest back on top of your library in any order.
+ this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(3, Integer.MAX_VALUE, PutCards.GRAVEYARD, PutCards.TOP_ANY),
+ false));
// Delirium — Grim Flayer gets +2/+2 as long as there are four or more card types among cards in your graveyard.
- this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
+ this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield),
DeliriumCondition.instance,
- "Delirium — {this} gets +2/+2 as long as there are four or more card types among cards in your graveyard"))
- .addHint(CardTypesInGraveyardHint.YOU));
+ "{this} gets +2/+2 as long as there are four or more card types among cards in your graveyard"))
+ .setAbilityWord(AbilityWord.DELIRIUM).addHint(CardTypesInGraveyardHint.YOU));
}
private GrimFlayer(final GrimFlayer card) {
diff --git a/Mage.Sets/src/mage/cards/g/GrislySalvage.java b/Mage.Sets/src/mage/cards/g/GrislySalvage.java
index d2941a50269..2ab1d716f62 100644
--- a/Mage.Sets/src/mage/cards/g/GrislySalvage.java
+++ b/Mage.Sets/src/mage/cards/g/GrislySalvage.java
@@ -1,30 +1,28 @@
-
package mage.cards.g;
import java.util.UUID;
-import mage.abilities.Ability;
-import mage.abilities.effects.OneShotEffect;
-import mage.cards.*;
+
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.abilities.effects.common.RevealLibraryPickControllerEffect;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
-import mage.filter.predicate.Predicates;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
+import mage.filter.StaticFilters;
/**
*
- * @author LevelX2
+ * @author awjackson
*/
public final class GrislySalvage extends CardImpl {
public GrislySalvage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}{G}");
- // Reveal the top five cards of your library. You may put a creature or land card from among them into your hand. Put the rest into your graveyard.
- this.getSpellAbility().addEffect(new GrislySalvageEffect());
+ // Reveal the top five cards of your library.
+ // You may put a creature or land card from among them into your hand.
+ // Put the rest into your graveyard.
+ this.getSpellAbility().addEffect(new RevealLibraryPickControllerEffect(
+ 5, 1, StaticFilters.FILTER_CARD_CREATURE_OR_LAND, PutCards.HAND, PutCards.GRAVEYARD));
}
private GrislySalvage(final GrislySalvage card) {
@@ -36,50 +34,3 @@ public final class GrislySalvage extends CardImpl {
return new GrislySalvage(this);
}
}
-
-class GrislySalvageEffect extends OneShotEffect {
-
- private static final FilterCard filterPutInHand = new FilterCard("creature or land card to put in hand");
-
- static {
- filterPutInHand.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.LAND.getPredicate()));
- }
-
- public GrislySalvageEffect() {
- super(Outcome.DrawCard);
- this.staticText = "Reveal the top five cards of your library. You may put a creature or land card from among them into your hand. Put the rest into your graveyard";
- }
-
- public GrislySalvageEffect(final GrislySalvageEffect effect) {
- super(effect);
- }
-
- @Override
- public GrislySalvageEffect copy() {
- return new GrislySalvageEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- if (controller != null) {
- Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 5));
- boolean properCardFound = cards.count(filterPutInHand, game) > 0;
- if (!cards.isEmpty()) {
- controller.revealCards(source, cards, game);
- TargetCard target = new TargetCard(Zone.LIBRARY, filterPutInHand);
- if (properCardFound && controller.chooseUse(outcome, "Put a creature or land card from the revealed cards into your hand?", source, game)
- && controller.choose(Outcome.DrawCard, cards, target, game)) {
- Card card = game.getCard(target.getFirstTarget());
- if (card != null) {
- controller.moveCards(card, Zone.HAND, source, game);
- cards.remove(card);
- }
- }
- controller.moveCards(cards, Zone.GRAVEYARD, source, game);
- }
- return true;
- }
- return false;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/g/GrowingRitesOfItlimoc.java b/Mage.Sets/src/mage/cards/g/GrowingRitesOfItlimoc.java
index a4216f7cb5b..c39a4047953 100644
--- a/Mage.Sets/src/mage/cards/g/GrowingRitesOfItlimoc.java
+++ b/Mage.Sets/src/mage/cards/g/GrowingRitesOfItlimoc.java
@@ -1,4 +1,3 @@
-
package mage.cards.g;
import java.util.UUID;
@@ -8,6 +7,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
@@ -16,8 +16,6 @@ import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.SuperType;
import mage.constants.TargetController;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
import mage.filter.StaticFilters;
/**
@@ -25,12 +23,6 @@ import mage.filter.StaticFilters;
*/
public final class GrowingRitesOfItlimoc extends CardImpl {
- private static final FilterCard filter = new FilterCard("a creature card");
-
- static {
- filter.add(CardType.CREATURE.getPredicate());
- }
-
public GrowingRitesOfItlimoc(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
@@ -41,7 +33,8 @@ public final class GrowingRitesOfItlimoc extends CardImpl {
// When Growing Rites of Itlimoc enters the battlefield, look at the top four cards of your library.
// You may reveal a creature card from among them and put it into your hand.
// Put the rest on the bottom of your library in any order.
- this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(4, 1, filter, true, true, Zone.HAND, false)));
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
+ 4, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.BOTTOM_ANY)));
// At the beginning of your end step, if you control four or more creatures, transform Growing Rites of Itlimoc.
this.addAbility(new TransformAbility());
@@ -59,4 +52,4 @@ public final class GrowingRitesOfItlimoc extends CardImpl {
public GrowingRitesOfItlimoc copy() {
return new GrowingRitesOfItlimoc(this);
}
-}
\ No newline at end of file
+}
diff --git a/Mage.Sets/src/mage/cards/g/GurmagDrowner.java b/Mage.Sets/src/mage/cards/g/GurmagDrowner.java
index ebd7cb33103..93cb5bef3a7 100644
--- a/Mage.Sets/src/mage/cards/g/GurmagDrowner.java
+++ b/Mage.Sets/src/mage/cards/g/GurmagDrowner.java
@@ -1,17 +1,15 @@
-
package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.ExploitCreatureTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.ExploitAbility;
-import mage.cards.*;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
/**
*
@@ -29,9 +27,10 @@ public final class GurmagDrowner extends CardImpl {
// Exploit
this.addAbility(new ExploitAbility());
- // When Gurmag Drowner exploits a creature, look at the top four cards of your library. Put one of them into your hand and the rest into your graveyard.
- this.addAbility(new ExploitCreatureTriggeredAbility(new LookLibraryAndPickControllerEffect(StaticValue.get(4), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false), false));
+ // When Gurmag Drowner exploits a creature, look at the top four cards of your library.
+ // Put one of them into your hand and the rest into your graveyard.
+ this.addAbility(new ExploitCreatureTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(4, 1, PutCards.HAND, PutCards.GRAVEYARD)));
}
private GurmagDrowner(final GurmagDrowner card) {
diff --git a/Mage.Sets/src/mage/cards/h/HaraldKingOfSkemfar.java b/Mage.Sets/src/mage/cards/h/HaraldKingOfSkemfar.java
index c5aaaccb7ba..65586694fc0 100644
--- a/Mage.Sets/src/mage/cards/h/HaraldKingOfSkemfar.java
+++ b/Mage.Sets/src/mage/cards/h/HaraldKingOfSkemfar.java
@@ -2,15 +2,14 @@ package mage.cards.h;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.MenaceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
@@ -43,13 +42,11 @@ public final class HaraldKingOfSkemfar extends CardImpl {
// Menace
this.addAbility(new MenaceAbility());
- // When Harald, King of Skemfar enters the battlefield, look at the top five cards of your library. You may reveal an Elf, Warrior, or Tyvar card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
+ // When Harald, King of Skemfar enters the battlefield, look at the top five cards of your library.
+ // You may reveal an Elf, Warrior, or Tyvar card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), filter, Zone.LIBRARY, false,
- true, false, Zone.HAND, true, false, false
- ).setBackInRandomOrder(true).setText("look at the top five cards of your library." +
- " You may reveal an Elf, Warrior, or Tyvar card from among them and put it into your hand. " +
- "Put the rest on the bottom of your library in a random order")));
+ 5, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM)));
}
private HaraldKingOfSkemfar(final HaraldKingOfSkemfar card) {
diff --git a/Mage.Sets/src/mage/cards/h/HatcherySpider.java b/Mage.Sets/src/mage/cards/h/HatcherySpider.java
index 42b491682c4..93e9e7591ff 100644
--- a/Mage.Sets/src/mage/cards/h/HatcherySpider.java
+++ b/Mage.Sets/src/mage/cards/h/HatcherySpider.java
@@ -5,18 +5,18 @@ import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CastSourceTriggeredAbility;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.abilities.effects.common.RevealLibraryPickControllerEffect;
import mage.abilities.keyword.ReachAbility;
-import mage.cards.*;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.*;
-import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.filter.common.FilterPermanentCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.Game;
import mage.players.Player;
-import mage.target.TargetCard;
-import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
@@ -52,7 +52,7 @@ public final class HatcherySpider extends CardImpl {
class HatcherySpiderEffect extends OneShotEffect {
public HatcherySpiderEffect() {
- super(Outcome.Benefit);
+ super(Outcome.PutCardInPlay);
this.staticText = "reveal the top X cards of your library, "
+ "where X is the number of creature cards in your graveyard. "
+ "You may put a green permanent card with mana value "
@@ -77,19 +77,9 @@ class HatcherySpiderEffect extends OneShotEffect {
return false;
}
int xValue = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game);
- FilterCard filter = new FilterPermanentCard("green permanent card with mana value " + xValue + " or less");
+ FilterPermanentCard filter = new FilterPermanentCard("green permanent card with mana value " + xValue + " or less");
filter.add(new ColorPredicate(ObjectColor.GREEN));
filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, xValue + 1));
- Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, xValue));
- player.revealCards(source, cards, game);
- TargetCard target = new TargetCardInLibrary(0, 1, filter);
- player.choose(outcome, cards, target, game);
- Card card = game.getCard(target.getFirstTarget());
- if (card != null) {
- player.moveCards(card, Zone.BATTLEFIELD, source, game);
- }
- cards.retainZone(Zone.LIBRARY, game);
- player.putCardsOnBottomOfLibrary(cards, game, source, false);
- return true;
+ return new RevealLibraryPickControllerEffect(xValue, 1, filter, PutCards.BATTLEFIELD, PutCards.BOTTOM_RANDOM).apply(game, source);
}
}
diff --git a/Mage.Sets/src/mage/cards/h/HeroesPodium.java b/Mage.Sets/src/mage/cards/h/HeroesPodium.java
index c79f3eafbac..7895ad60f50 100644
--- a/Mage.Sets/src/mage/cards/h/HeroesPodium.java
+++ b/Mage.Sets/src/mage/cards/h/HeroesPodium.java
@@ -1,25 +1,26 @@
-
package mage.cards.h;
import java.util.UUID;
-import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.DynamicValue;
+import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.Effect;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
-import mage.cards.*;
-import mage.constants.*;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.SuperType;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreatureCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
/**
*
@@ -27,10 +28,12 @@ import mage.target.TargetCard;
*/
public final class HeroesPodium extends CardImpl {
- private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Each legendary creature you control");
+ private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("each legendary creature");
+ private static final FilterCreatureCard filter2 = new FilterCreatureCard("a legendary creature card");
static {
filter.add(SuperType.LEGENDARY.getPredicate());
+ filter2.add(SuperType.LEGENDARY.getPredicate());
}
public HeroesPodium(UUID ownerId, CardSetInfo setInfo) {
@@ -38,15 +41,16 @@ public final class HeroesPodium extends CardImpl {
addSuperType(SuperType.LEGENDARY);
// Each legendary creature you control gets +1/+1 for each other legendary creature you control.
- DynamicValue xValue = new HeroesPodiumLegendaryCount();
- Effect effect = new BoostControlledEffect(xValue, xValue, Duration.WhileOnBattlefield, filter, false);
- effect.setText("Each legendary creature you control gets +1/+1 for each other legendary creature you control");
- this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
- // {X}, {T}: Look at the top X cards of your library. You may reveal a legendary creature card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
- Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new HeroesPodiumEffect(), new ManaCostsImpl("{X}"));
+ this.addAbility(new SimpleStaticAbility(
+ new BoostControlledEffect(HeroesPodiumValue.instance, HeroesPodiumValue.instance, Duration.WhileOnBattlefield, filter, false)));
+ // {X}, {T}: Look at the top X cards of your library.
+ // You may reveal a legendary creature card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
+ Ability ability = new SimpleActivatedAbility(
+ new LookLibraryAndPickControllerEffect(ManacostVariableValue.REGULAR, 1, filter2, PutCards.HAND, PutCards.BOTTOM_RANDOM),
+ new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
-
}
private HeroesPodium(final HeroesPodium card) {
@@ -59,7 +63,8 @@ public final class HeroesPodium extends CardImpl {
}
}
-class HeroesPodiumLegendaryCount implements DynamicValue {
+enum HeroesPodiumValue implements DynamicValue {
+ instance;
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("other legendary creature you control");
@@ -69,16 +74,12 @@ class HeroesPodiumLegendaryCount implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
- int value = game.getBattlefield().count(filter, sourceAbility.getControllerId(), sourceAbility, game);
- if (value > 0) {
- value--;
- }
- return value;
+ return Math.max(game.getBattlefield().count(filter, sourceAbility.getControllerId(), sourceAbility, game) - 1, 0);
}
@Override
public String toString() {
- return "X";
+ return "1";
}
@Override
@@ -87,64 +88,7 @@ class HeroesPodiumLegendaryCount implements DynamicValue {
}
@Override
- public HeroesPodiumLegendaryCount copy() {
- return new HeroesPodiumLegendaryCount();
- }
-}
-
-class HeroesPodiumEffect extends OneShotEffect {
-
- private static final FilterCreatureCard filter = new FilterCreatureCard("a legendary creature card");
-
- static {
- filter.add(SuperType.LEGENDARY.getPredicate());
- }
-
- public HeroesPodiumEffect() {
- super(Outcome.DrawCard);
- this.staticText = "Look at the top X cards of your library. You may reveal a legendary creature card from among them and put it into your hand. Put the rest on the bottom of your library in a random order";
- }
-
- public HeroesPodiumEffect(final HeroesPodiumEffect effect) {
- super(effect);
- }
-
- @Override
- public HeroesPodiumEffect copy() {
- return new HeroesPodiumEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- MageObject sourceObject = source.getSourceObject(game);
- if (controller == null || sourceObject == null) {
- return false;
- }
-
- Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, source.getManaCostsToPay().getX()));
- boolean legendaryIncluded = cards.count(filter, game) > 0;
- controller.lookAtCards(sourceObject.getIdName(), cards, game);
-
- // You may reveal a legendary creature card from among them and put it into your hand.
- if (!cards.isEmpty() && legendaryIncluded && controller.chooseUse(outcome, "Put a legendary creature card into your hand?", source, game)) {
- if (cards.size() == 1) {
- controller.moveCards(cards, Zone.HAND, source, game);
- return true;
- } else {
- TargetCard target = new TargetCard(Zone.LIBRARY, filter);
- if (controller.choose(outcome, cards, target, game)) {
- Card card = cards.get(target.getFirstTarget(), game);
- if (card != null) {
- cards.remove(card);
- controller.moveCards(card, Zone.HAND, source, game);
- }
- }
- }
- }
-
- // Put the rest on the bottom of your library in a random order
- controller.putCardsOnBottomOfLibrary(cards, game, source, false);
- return true;
+ public HeroesPodiumValue copy() {
+ return instance;
}
}
diff --git a/Mage.Sets/src/mage/cards/i/IconOfAncestry.java b/Mage.Sets/src/mage/cards/i/IconOfAncestry.java
index ac44440de24..57ff868cd12 100644
--- a/Mage.Sets/src/mage/cards/i/IconOfAncestry.java
+++ b/Mage.Sets/src/mage/cards/i/IconOfAncestry.java
@@ -6,9 +6,10 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
-import mage.abilities.dynamicvalue.common.StaticValue;
+import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@@ -61,15 +62,10 @@ public final class IconOfAncestry extends CardImpl {
}
}
-class IconOfAncestryEffect extends LookLibraryAndPickControllerEffect {
+class IconOfAncestryEffect extends OneShotEffect {
public IconOfAncestryEffect() {
- super(StaticValue.get(3), false, StaticValue.get(1), new FilterCreatureCard(
- "creature card that matches the chosen subtype"
- ), Zone.LIBRARY, false, true, false,
- Zone.HAND, true, false, false);
- this.setOutcome(Outcome.AIDontUseIt);
- this.setBackInRandomOrder(true);
+ super(Outcome.AIDontUseIt);
staticText = "look at the top three cards of your library. " +
"You may reveal a creature card of the chosen type from among them and put it into your hand. " +
"Put the rest on the bottom of your library in a random order";
@@ -77,13 +73,13 @@ class IconOfAncestryEffect extends LookLibraryAndPickControllerEffect {
@Override
public boolean apply(Game game, Ability source) {
- SubType subtype = (SubType) game.getState().getValue(source.getSourceId() + "_type");
+ SubType subtype = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game);
if (subtype == null) {
return false;
}
+ FilterCreatureCard filter = new FilterCreatureCard(subtype.toString() + " creature card");
filter.add(subtype.getPredicate());
- filter.setMessage(subtype.toString() + " creature card");
- return super.apply(game, source);
+ return new LookLibraryAndPickControllerEffect(3, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM).apply(game, source);
}
public IconOfAncestryEffect(final IconOfAncestryEffect effect) {
diff --git a/Mage.Sets/src/mage/cards/i/Impulse.java b/Mage.Sets/src/mage/cards/i/Impulse.java
index 3bc1465fd98..23a5e015893 100644
--- a/Mage.Sets/src/mage/cards/i/Impulse.java
+++ b/Mage.Sets/src/mage/cards/i/Impulse.java
@@ -1,14 +1,11 @@
-
package mage.cards.i;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
/**
*
@@ -20,8 +17,7 @@ public final class Impulse extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}");
// Look at the top four cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(4), false, StaticValue.get(1), new FilterCard(), Zone.LIBRARY, false, false));
-
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(4, 1, PutCards.HAND, PutCards.BOTTOM_ANY));
}
private Impulse(final Impulse card) {
diff --git a/Mage.Sets/src/mage/cards/i/IncubationIncongruity.java b/Mage.Sets/src/mage/cards/i/IncubationIncongruity.java
index 3d035fe3e61..5ef822d0757 100644
--- a/Mage.Sets/src/mage/cards/i/IncubationIncongruity.java
+++ b/Mage.Sets/src/mage/cards/i/IncubationIncongruity.java
@@ -1,16 +1,15 @@
package mage.cards.i;
import mage.abilities.Ability;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardSetInfo;
import mage.cards.SplitCard;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SpellAbilityType;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
@@ -28,13 +27,10 @@ public final class IncubationIncongruity extends SplitCard {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, new CardType[]{CardType.INSTANT}, "{G/U}", "{1}{G}{U}", SpellAbilityType.SPLIT);
// Incubation
- // Look at the top five cards of your library. You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
+ // Look at the top five cards of your library. You may reveal a creature card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
this.getLeftHalfCard().getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false,
- StaticValue.get(1), StaticFilters.FILTER_CARD_CREATURE_A,
- Zone.LIBRARY, false, true, false,
- Zone.HAND, false, false, false
- ).setBackInRandomOrder(true));
+ 5, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.BOTTOM_RANDOM));
// Incongruity
// Exile target creature. That creature's controller creates a 3/3 green Frog Lizard creature token.
diff --git a/Mage.Sets/src/mage/cards/i/IngeniousSmith.java b/Mage.Sets/src/mage/cards/i/IngeniousSmith.java
index 8fd5859aad8..a2cb43b3d2b 100644
--- a/Mage.Sets/src/mage/cards/i/IngeniousSmith.java
+++ b/Mage.Sets/src/mage/cards/i/IngeniousSmith.java
@@ -4,14 +4,13 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
-import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
+import mage.constants.SubType;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterArtifactPermanent;
@@ -36,10 +35,7 @@ public final class IngeniousSmith extends CardImpl {
// You may reveal an artifact card from among them and put it into your hand.
// Put the rest on the bottom of your library in a random order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(1), StaticFilters.FILTER_CARD_ARTIFACT_AN,
- Zone.LIBRARY, false, true, false, Zone.HAND,
- true, false, false).setBackInRandomOrder(true)
- ));
+ 4, 1, StaticFilters.FILTER_CARD_ARTIFACT_AN, PutCards.HAND, PutCards.BOTTOM_RANDOM)));
// Whenever one or more artifacts enter the battlefield under your control, put a +1/+1 counter on Ingenious Smith.
// This ability triggers only once each turn.
diff --git a/Mage.Sets/src/mage/cards/j/JaceTheLivingGuildpact.java b/Mage.Sets/src/mage/cards/j/JaceTheLivingGuildpact.java
index 3aa4233e08b..f79268e9ec2 100644
--- a/Mage.Sets/src/mage/cards/j/JaceTheLivingGuildpact.java
+++ b/Mage.Sets/src/mage/cards/j/JaceTheLivingGuildpact.java
@@ -2,10 +2,9 @@ package mage.cards.j;
import java.util.UUID;
import mage.abilities.LoyaltyAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
-import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.effects.common.ShuffleHandGraveyardAllEffect;
import mage.cards.CardImpl;
@@ -13,8 +12,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterNonlandPermanent;
import mage.filter.predicate.mageobject.AnotherPredicate;
@@ -40,10 +37,7 @@ public final class JaceTheLivingGuildpact extends CardImpl {
this.setStartingLoyalty(5);
// +1: Look at the top two cards of your library. Put one of them into your graveyard.
- Effect effect = new LookLibraryAndPickControllerEffect(
- StaticValue.get(2), false, StaticValue.get(1), new FilterCard(), Zone.LIBRARY, true, false, false, Zone.GRAVEYARD, false);
- effect.setText("Look at the top two cards of your library. Put one of them into your graveyard");
- this.addAbility(new LoyaltyAbility(effect, 1));
+ this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(2, 1, PutCards.GRAVEYARD, PutCards.TOP_ANY), 1));
// -3: Return another target nonland permanent to its owner's hand.
LoyaltyAbility ability = new LoyaltyAbility(new ReturnToHandTargetEffect(), -3);
@@ -52,9 +46,8 @@ public final class JaceTheLivingGuildpact extends CardImpl {
// -8: Each player shuffles their hand and graveyard into their library. You draw seven cards.
ability = new LoyaltyAbility(new ShuffleHandGraveyardAllEffect(), -8);
- ability.addEffect(new DrawCardSourceControllerEffect(7).setText("You draw seven cards"));
+ ability.addEffect(new DrawCardSourceControllerEffect(7, "you"));
this.addAbility(ability);
-
}
private JaceTheLivingGuildpact(final JaceTheLivingGuildpact card) {
diff --git a/Mage.Sets/src/mage/cards/j/JarOfEyeballs.java b/Mage.Sets/src/mage/cards/j/JarOfEyeballs.java
index 880fd0e703c..9bceed2e19d 100644
--- a/Mage.Sets/src/mage/cards/j/JarOfEyeballs.java
+++ b/Mage.Sets/src/mage/cards/j/JarOfEyeballs.java
@@ -7,26 +7,22 @@ import mage.abilities.costs.Cost;
import mage.abilities.costs.common.RemoveAllCountersSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.dynamicvalue.DynamicValue;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.cards.Cards;
-import mage.cards.CardsImpl;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
import mage.counters.CounterType;
-import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
import java.util.UUID;
/**
- * @author North
+ * @author awjackson
*/
public final class JarOfEyeballs extends CardImpl {
@@ -42,7 +38,9 @@ public final class JarOfEyeballs extends CardImpl {
// {3}, {tap}, Remove all eyeball counters from Jar of Eyeballs:
// Look at the top X cards of your library, where X is the number of eyeball counters removed this way.
// Put one of them into your hand and the rest on the bottom of your library in any order.
- SimpleActivatedAbility ability = new SimpleActivatedAbility(new JarOfEyeballsEffect(), new GenericManaCost(3));
+ SimpleActivatedAbility ability = new SimpleActivatedAbility(
+ new LookLibraryAndPickControllerEffect(JarOfEyeballsValue.instance, 1, PutCards.HAND, PutCards.BOTTOM_ANY),
+ new GenericManaCost(3));
ability.addCost(new TapSourceCost());
ability.addCost(new RemoveAllCountersSourceCost(CounterType.EYEBALL));
this.addAbility(ability);
@@ -58,43 +56,32 @@ public final class JarOfEyeballs extends CardImpl {
}
}
-class JarOfEyeballsEffect extends OneShotEffect {
-
- public JarOfEyeballsEffect() {
- super(Outcome.DrawCard);
- this.staticText = "Look at the top X cards of your library, where X is the number of eyeball counters removed this way. Put one of them into your hand and the rest on the bottom of your library in any order";
- }
-
- public JarOfEyeballsEffect(final JarOfEyeballsEffect effect) {
- super(effect);
- }
+enum JarOfEyeballsValue implements DynamicValue {
+ instance;
@Override
- public JarOfEyeballsEffect copy() {
- return new JarOfEyeballsEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- if (controller == null) {
- return false;
- }
+ public int calculate(Game game, Ability sourceAbility, Effect effect) {
int countersRemoved = 0;
- for (Cost cost : source.getCosts()) {
+ for (Cost cost : sourceAbility.getCosts()) {
if (cost instanceof RemoveAllCountersSourceCost) {
countersRemoved = ((RemoveAllCountersSourceCost) cost).getRemovedCounters();
}
}
- Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, countersRemoved));
- controller.lookAtCards(source, null, cards, game);
- TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand"));
- if (controller.choose(Outcome.DrawCard, cards, target, game)) {
- Cards targetCards = new CardsImpl(target.getTargets());
- controller.moveCards(targetCards, Zone.HAND, source, game);
- cards.removeAll(targetCards);
- }
- controller.putCardsOnBottomOfLibrary(cards, game, source, true);
- return true;
+ return countersRemoved;
+ }
+
+ @Override
+ public JarOfEyeballsValue copy() {
+ return instance;
+ }
+
+ @Override
+ public String toString() {
+ return "X";
+ }
+
+ @Override
+ public String getMessage() {
+ return "the number of eyeball counters removed this way";
}
}
diff --git a/Mage.Sets/src/mage/cards/k/KeskitTheFleshSculptor.java b/Mage.Sets/src/mage/cards/k/KeskitTheFleshSculptor.java
index f1a3716bd85..862b79d8209 100644
--- a/Mage.Sets/src/mage/cards/k/KeskitTheFleshSculptor.java
+++ b/Mage.Sets/src/mage/cards/k/KeskitTheFleshSculptor.java
@@ -5,16 +5,14 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.common.TapSourceCost;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.PartnerAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.AnotherPredicate;
@@ -48,11 +46,11 @@ public final class KeskitTheFleshSculptor extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(3);
- // {T}, Sacrifice three other artifacts and/or creatures: Look at the top three cards of your library. Put two of them into your hand and the other into your graveyard.
- Ability ability = new SimpleActivatedAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false, StaticValue.get(2), StaticFilters.FILTER_CARD,
- Zone.GRAVEYARD, false, false
- ), new TapSourceCost());
+ // {T}, Sacrifice three other artifacts and/or creatures: Look at the top three cards of your library.
+ // Put two of them into your hand and the other into your graveyard.
+ Ability ability = new SimpleActivatedAbility(
+ new LookLibraryAndPickControllerEffect(3, 2, PutCards.HAND, PutCards.GRAVEYARD),
+ new TapSourceCost());
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(3, filter)));
this.addAbility(ability);
diff --git a/Mage.Sets/src/mage/cards/k/KinnanBonderProdigy.java b/Mage.Sets/src/mage/cards/k/KinnanBonderProdigy.java
index 857260f64d6..267302a2d7f 100644
--- a/Mage.Sets/src/mage/cards/k/KinnanBonderProdigy.java
+++ b/Mage.Sets/src/mage/cards/k/KinnanBonderProdigy.java
@@ -4,8 +4,8 @@ import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.TapForManaAllTriggeredManaAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.mana.AddManaOfAnyTypeProducedEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@@ -47,14 +47,12 @@ public final class KinnanBonderProdigy extends CardImpl {
effect, filter, SetTargetPointer.PERMANENT
));
- // {5}{G}{U}: Look at the top five cards of your library. You may put a non-Human creature card from among them onto the battlefield. Put the rest on the bottom of your library in a random order.
- this.addAbility(new SimpleActivatedAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), filter2, Zone.LIBRARY, false,
- true, false, Zone.BATTLEFIELD, true, false, false
- ).setBackInRandomOrder(true).setText("Look at the top five cards of your library. " +
- "You may put a non-Human creature card from among them onto the battlefield. " +
- "Put the rest on the bottom of your library in a random order."
- ), new ManaCostsImpl("{5}{G}{U}")));
+ // {5}{G}{U}: Look at the top five cards of your library.
+ // You may put a non-Human creature card from among them onto the battlefield.
+ // Put the rest on the bottom of your library in a random order.
+ this.addAbility(new SimpleActivatedAbility(
+ new LookLibraryAndPickControllerEffect(5, 1, filter2, PutCards.BATTLEFIELD, PutCards.BOTTOM_RANDOM),
+ new ManaCostsImpl("{5}{G}{U}")));
}
private KinnanBonderProdigy(final KinnanBonderProdigy card) {
diff --git a/Mage.Sets/src/mage/cards/k/KolvoriGodOfKinship.java b/Mage.Sets/src/mage/cards/k/KolvoriGodOfKinship.java
index 3c4f82e7a47..bf25793fed7 100644
--- a/Mage.Sets/src/mage/cards/k/KolvoriGodOfKinship.java
+++ b/Mage.Sets/src/mage/cards/k/KolvoriGodOfKinship.java
@@ -14,9 +14,9 @@ import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalContinuousEffect;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.VigilanceAbility;
@@ -73,11 +73,9 @@ public final class KolvoriGodOfKinship extends ModalDoubleFacesCard {
// {1}{G}, {T}: Look at the top six cards of your library.
// You may reveal a legendary creature card from among them and put it into your hand.
// Put the rest on the bottom of your library in a random order.
- ability = new SimpleActivatedAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(6), false, StaticValue.get(1), filter2,
- Zone.LIBRARY, false, true, false, Zone.HAND,
- true, false, false).setBackInRandomOrder(true), new ManaCostsImpl("{1}{G}")
- );
+ ability = new SimpleActivatedAbility(
+ new LookLibraryAndPickControllerEffect(6, 1, filter2, PutCards.HAND, PutCards.BOTTOM_RANDOM),
+ new ManaCostsImpl("{1}{G}"));
ability.addCost(new TapSourceCost());
this.getLeftHalfCard().addAbility(ability);
diff --git a/Mage.Sets/src/mage/cards/k/KruphixsInsight.java b/Mage.Sets/src/mage/cards/k/KruphixsInsight.java
index 435a61613df..7d9103fa6fa 100644
--- a/Mage.Sets/src/mage/cards/k/KruphixsInsight.java
+++ b/Mage.Sets/src/mage/cards/k/KruphixsInsight.java
@@ -1,13 +1,12 @@
-
package mage.cards.k;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
-import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.abilities.effects.common.RevealLibraryPickControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
/**
@@ -16,7 +15,7 @@ import mage.filter.FilterCard;
*/
public final class KruphixsInsight extends CardImpl {
- private static final FilterCard filter = new FilterCard("up to three enchantment cards");
+ private static final FilterCard filter = new FilterCard("enchantment cards");
static {
filter.add(CardType.ENCHANTMENT.getPredicate());
@@ -25,9 +24,13 @@ public final class KruphixsInsight extends CardImpl {
public KruphixsInsight(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}");
-
- // Reveal the top six cards of your library. Put up to three enchantment cards from among them into your hand and the rest of the revealed cards into your graveyard.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(6), false, StaticValue.get(3), filter, Zone.GRAVEYARD, false, true, true,Zone.HAND, false));
+ // Reveal the top six cards of your library. Put up to three enchantment cards from among them into your hand
+ // and the rest of the revealed cards into your graveyard.
+ Effect effect = new RevealLibraryPickControllerEffect(6, 3, filter, PutCards.HAND, PutCards.GRAVEYARD, false);
+ effect.setText("reveal the top six cards of your library. " +
+ "Put up to three enchantment cards from among them into your hand " +
+ "and the rest of the revealed cards into your graveyard");
+ this.getSpellAbility().addEffect(effect);
}
private KruphixsInsight(final KruphixsInsight card) {
diff --git a/Mage.Sets/src/mage/cards/l/LeadTheStampede.java b/Mage.Sets/src/mage/cards/l/LeadTheStampede.java
index 7b5a8bd81a4..23840ef293e 100644
--- a/Mage.Sets/src/mage/cards/l/LeadTheStampede.java
+++ b/Mage.Sets/src/mage/cards/l/LeadTheStampede.java
@@ -1,10 +1,12 @@
package mage.cards.l;
+import mage.abilities.effects.Effect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.filter.FilterCard;
+import mage.filter.StaticFilters;
import java.util.UUID;
@@ -13,22 +15,16 @@ import java.util.UUID;
*/
public final class LeadTheStampede extends CardImpl {
- private static final FilterCard filter = new FilterCard("any number of creature cards");
-
- static {
- filter.add(CardType.CREATURE.getPredicate());
- }
-
public LeadTheStampede(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}");
// Look at the top five cards of your library. You may reveal any number of creature cards from among them and put the revealed cards into your hand. Put the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- 5, 5, filter, true
- ).setText("Look at the top five cards of your library. " +
- "You may reveal any number of creature cards from among them " +
- "and put the revealed cards into your hand. " +
- "Put the rest on the bottom of your library in any order."));
+ Effect effect = new LookLibraryAndPickControllerEffect(
+ 5, Integer.MAX_VALUE, StaticFilters.FILTER_CARD_CREATURES, PutCards.HAND, PutCards.BOTTOM_ANY);
+ effect.setText("look at the top five cards of your library. " +
+ "You may reveal any number of creature cards from among them and put the revealed cards into your hand. " +
+ "Put the rest on the bottom of your library in any order");
+ this.getSpellAbility().addEffect(effect);
}
private LeadTheStampede(final LeadTheStampede card) {
diff --git a/Mage.Sets/src/mage/cards/l/LilianasSpoils.java b/Mage.Sets/src/mage/cards/l/LilianasSpoils.java
index 623568c1822..53ce1878388 100644
--- a/Mage.Sets/src/mage/cards/l/LilianasSpoils.java
+++ b/Mage.Sets/src/mage/cards/l/LilianasSpoils.java
@@ -2,13 +2,12 @@ package mage.cards.l;
import java.util.UUID;
import mage.ObjectColor;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.common.TargetOpponent;
@@ -34,12 +33,7 @@ public final class LilianasSpoils extends CardImpl {
// Look at the top five cards of your library. You may reveal a black card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), filter,
- Zone.LIBRARY, false, true, false, Zone.HAND, true, false, false
- ).setBackInRandomOrder(true).setText("
Look at the top five cards of your library. "
- + "You may reveal a black card from among them and put it into your hand. "
- + "Put the rest on the bottom of your library in a random order.")
- );
+ 5, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM).concatBy("
"));
}
private LilianasSpoils(final LilianasSpoils card) {
diff --git a/Mage.Sets/src/mage/cards/l/LivingWish.java b/Mage.Sets/src/mage/cards/l/LivingWish.java
index 908e848bd46..c57235bde5f 100644
--- a/Mage.Sets/src/mage/cards/l/LivingWish.java
+++ b/Mage.Sets/src/mage/cards/l/LivingWish.java
@@ -8,8 +8,7 @@ import mage.abilities.hint.common.OpenSideboardHint;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.filter.FilterCard;
-import mage.filter.predicate.Predicates;
+import mage.filter.StaticFilters;
/**
*
@@ -17,19 +16,11 @@ import mage.filter.predicate.Predicates;
*/
public final class LivingWish extends CardImpl {
- private static final FilterCard filter = new FilterCard("creature or land card");
-
- static {
- filter.add(Predicates.or(
- CardType.CREATURE.getPredicate(),
- CardType.LAND.getPredicate()));
- }
-
public LivingWish(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}");
// You may reveal a creature or land card you own from outside the game and put it into your hand.
- this.getSpellAbility().addEffect(new WishEffect(filter));
+ this.getSpellAbility().addEffect(new WishEffect(StaticFilters.FILTER_CARD_CREATURE_OR_LAND));
this.getSpellAbility().addHint(OpenSideboardHint.instance);
// Exile Living Wish.
diff --git a/Mage.Sets/src/mage/cards/l/LoneRevenant.java b/Mage.Sets/src/mage/cards/l/LoneRevenant.java
index 3da6350b8e5..0e5bf3f7e80 100644
--- a/Mage.Sets/src/mage/cards/l/LoneRevenant.java
+++ b/Mage.Sets/src/mage/cards/l/LoneRevenant.java
@@ -1,31 +1,30 @@
-
package mage.cards.l;
import java.util.UUID;
import mage.MageInt;
-import mage.abilities.TriggeredAbilityImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
+import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
+import mage.abilities.condition.Condition;
+import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
+import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.HexproofAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
+import mage.constants.ComparisonType;
import mage.constants.SubType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
-import mage.filter.common.FilterControlledCreaturePermanent;
-import mage.game.Game;
-import mage.game.events.DamagedPlayerEvent;
-import mage.game.events.GameEvent;
-import mage.game.events.GameEvent.EventType;
-import mage.game.permanent.Permanent;
+import mage.filter.StaticFilters;
/**
*
- * @author jeffwadsworth
+ * @author awjackson
*/
public final class LoneRevenant extends CardImpl {
+ private static final Condition condition = new PermanentsOnTheBattlefieldCondition(
+ StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE, ComparisonType.EQUAL_TO, 0);
+
public LoneRevenant(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}{U}");
this.subtype.add(SubType.SPIRIT);
@@ -35,8 +34,17 @@ public final class LoneRevenant extends CardImpl {
this.addAbility(HexproofAbility.getInstance());
- // Whenever Lone Revenant deals combat damage to a player, if you control no other creatures, look at the top four cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.
- this.addAbility(new LoneRevenantTriggeredAbility());
+ // Whenever Lone Revenant deals combat damage to a player,
+ // if you control no other creatures, look at the top four cards of your library.
+ // Put one of them into your hand and the rest on the bottom of your library in any order.
+ this.addAbility(new ConditionalInterveningIfTriggeredAbility(
+ new DealsCombatDamageToAPlayerTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(4, 1, PutCards.HAND, PutCards.BOTTOM_ANY),
+ false
+ ), condition, "Whenever {this} deals combat damage to a player, " +
+ "if you control no other creatures, look at the top four cards of your library. " +
+ "Put one of them into your hand and the rest on the bottom of your library in any order."
+ ));
}
private LoneRevenant(final LoneRevenant card) {
@@ -48,46 +56,3 @@ public final class LoneRevenant extends CardImpl {
return new LoneRevenant(this);
}
}
-
-class LoneRevenantTriggeredAbility extends TriggeredAbilityImpl {
-
- private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
-
- public LoneRevenantTriggeredAbility() {
- super(Zone.BATTLEFIELD, new LookLibraryAndPickControllerEffect(StaticValue.get(4), false, StaticValue.get(1), new FilterCard(), Zone.LIBRARY, false, false));
- }
-
- public LoneRevenantTriggeredAbility(final LoneRevenantTriggeredAbility ability) {
- super(ability);
- }
-
- @Override
- public LoneRevenantTriggeredAbility copy() {
- return new LoneRevenantTriggeredAbility(this);
- }
-
- @Override
- public boolean checkEventType(GameEvent event, Game game) {
- return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
- }
-
- @Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) {
- Permanent permanent = game.getPermanent(event.getSourceId());
- int number = game.getBattlefield().countAll(filter, controllerId, game);
-
- if (permanent != null && number != 1) {
- return false;
- }
- return permanent != null || number == 0;
- }
- return false;
- }
-
- @Override
- public String getTriggerPhrase() {
- return "Whenever {this} deals combat damage to a player, if you control no other creatures, " ;
- }
-
-}
diff --git a/Mage.Sets/src/mage/cards/m/Machinate.java b/Mage.Sets/src/mage/cards/m/Machinate.java
index 7d1914214a5..d5523806106 100644
--- a/Mage.Sets/src/mage/cards/m/Machinate.java
+++ b/Mage.Sets/src/mage/cards/m/Machinate.java
@@ -1,36 +1,31 @@
-
package mage.cards.m;
import java.util.UUID;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
-import mage.abilities.dynamicvalue.common.StaticValue;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.abilities.effects.Effect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
-import mage.filter.common.FilterControlledPermanent;
+import mage.filter.StaticFilters;
/**
*
* @author Alexsandr0x
*/
public final class Machinate extends CardImpl {
- private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifacts you control");
- static {
- filter.add(CardType.ARTIFACT.getPredicate());
- }
+ private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACTS, null);
public Machinate(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}{U}");
// Look at the top X cards of your library, where X is the number of artifacts you control. Put one of those cards into your hand and the rest on the bottom of your library in any order.
- DynamicValue artifactsOnControl = new PermanentsOnBattlefieldCount(filter);
- LookLibraryAndPickControllerEffect effect = new LookLibraryAndPickControllerEffect(artifactsOnControl, false, StaticValue.get(1), new FilterCard(), Zone.LIBRARY, false, false);
- effect.setText("Look at the top X cards of your library, where X is the number of artifacts you control. Put one of those cards into your hand and the rest on the bottom of your library in any order.");
+ Effect effect = new LookLibraryAndPickControllerEffect(xValue, 1, PutCards.HAND, PutCards.BOTTOM_ANY);
+ effect.setText("look at the top X cards of your library, where X is the number of artifacts you control. " +
+ "Put one of those cards into your hand and the rest on the bottom of your library in any order");
this.getSpellAbility().addEffect(effect);
}
diff --git a/Mage.Sets/src/mage/cards/m/MaestrosCharm.java b/Mage.Sets/src/mage/cards/m/MaestrosCharm.java
index be692e84515..4539577dd4f 100644
--- a/Mage.Sets/src/mage/cards/m/MaestrosCharm.java
+++ b/Mage.Sets/src/mage/cards/m/MaestrosCharm.java
@@ -1,16 +1,14 @@
package mage.cards.m;
import mage.abilities.Mode;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import mage.target.common.TargetCreatureOrPlaneswalker;
import java.util.UUID;
@@ -25,10 +23,9 @@ public final class MaestrosCharm extends CardImpl {
// Choose one —
// • Look at the top five cards of your library. Put one of those cards into your hand and the rest into your graveyard.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), StaticFilters.FILTER_CARD,
- Zone.GRAVEYARD, false, false, false, Zone.HAND, false
- ));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(5, 1, PutCards.HAND, PutCards.GRAVEYARD)
+ .setText("look at the top five cards of your library. " +
+ "Put one of those cards into your hand and the rest into your graveyard"));
// • Each opponent loses 3 life and you gain 3 life.
Mode mode = new Mode(new LoseLifeOpponentsEffect(3));
diff --git a/Mage.Sets/src/mage/cards/m/MayaelTheAnima.java b/Mage.Sets/src/mage/cards/m/MayaelTheAnima.java
index 4ce1b241f7c..65806b51bb1 100644
--- a/Mage.Sets/src/mage/cards/m/MayaelTheAnima.java
+++ b/Mage.Sets/src/mage/cards/m/MayaelTheAnima.java
@@ -7,13 +7,13 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.SubType;
import mage.constants.ComparisonType;
+import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.PowerPredicate;
@@ -41,8 +41,8 @@ public final class MayaelTheAnima extends CardImpl {
// {3}{R}{G}{W}, {tap}: Look at the top five cards of your library.
// You may put a creature card with power 5 or greater from among them onto the battlefield.
// Put the rest on the bottom of your library in any order.
- SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
- new LookLibraryAndPickControllerEffect(5,1, filter,false, false, Zone.BATTLEFIELD, true),
+ SimpleActivatedAbility ability = new SimpleActivatedAbility(
+ new LookLibraryAndPickControllerEffect(5, 1, filter, PutCards.BATTLEFIELD, PutCards.BOTTOM_ANY),
new ManaCostsImpl("{3}{R}{G}{W}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
diff --git a/Mage.Sets/src/mage/cards/m/MeletisAstronomer.java b/Mage.Sets/src/mage/cards/m/MeletisAstronomer.java
index 1ed62998eef..74c2d17d17b 100644
--- a/Mage.Sets/src/mage/cards/m/MeletisAstronomer.java
+++ b/Mage.Sets/src/mage/cards/m/MeletisAstronomer.java
@@ -1,16 +1,16 @@
-
package mage.cards.m;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.HeroicAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
+import mage.filter.common.FilterEnchantmentCard;
/**
*
@@ -18,11 +18,8 @@ import mage.filter.FilterCard;
*/
public final class MeletisAstronomer extends CardImpl {
- private static final FilterCard filter = new FilterCard("an enchantment card");
- static {
- filter.add(CardType.ENCHANTMENT.getPredicate());
- }
-
+ private static final FilterCard filter = new FilterEnchantmentCard("an enchantment card");
+
public MeletisAstronomer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}");
this.subtype.add(SubType.HUMAN);
@@ -32,7 +29,7 @@ public final class MeletisAstronomer extends CardImpl {
this.toughness = new MageInt(3);
// Heroic — Whenever you cast a spell that targets Meletis Astronomer, look at the top three cards of your library. You may reveal an enchantment card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
- this.addAbility(new HeroicAbility(new LookLibraryAndPickControllerEffect(3, 1, filter, true, false, Zone.HAND, true), false));
+ this.addAbility(new HeroicAbility(new LookLibraryAndPickControllerEffect(3, 1, filter, PutCards.HAND, PutCards.BOTTOM_ANY)));
}
private MeletisAstronomer(final MeletisAstronomer card) {
diff --git a/Mage.Sets/src/mage/cards/m/MemorialToUnity.java b/Mage.Sets/src/mage/cards/m/MemorialToUnity.java
index 20218b09d23..40ee1b646e0 100644
--- a/Mage.Sets/src/mage/cards/m/MemorialToUnity.java
+++ b/Mage.Sets/src/mage/cards/m/MemorialToUnity.java
@@ -1,4 +1,3 @@
-
package mage.cards.m;
import mage.abilities.Ability;
@@ -7,15 +6,13 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
-import mage.abilities.effects.Effect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.mana.GreenManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.common.FilterCreatureCard;
+import mage.filter.StaticFilters;
import java.util.UUID;
@@ -27,21 +24,20 @@ public final class MemorialToUnity extends CardImpl {
public MemorialToUnity(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
- // Memorial to Uniity enters the battlefield tapped.
+ // Memorial to Unity enters the battlefield tapped.
this.addAbility(new EntersBattlefieldTappedAbility());
this.addAbility(new GreenManaAbility());
- // {2}{G}, {T}, Sacrifice Memorial to Unity: Look at the top five cards of your library. You may reveal a creature card from among them and put it into your hand. Then put the rest on the bottom of your library in a random order.
- Effect effect = new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), new FilterCreatureCard("a creature card"), false, true
- ).setBackInRandomOrder(true);
-
- Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{G}"));
+ // {2}{G}, {T}, Sacrifice Memorial to Unity: Look at the top five cards of your library.
+ // You may reveal a creature card from among them and put it into your hand.
+ // Then put the rest on the bottom of your library in a random order.
+ Ability ability = new SimpleActivatedAbility(
+ new LookLibraryAndPickControllerEffect(5, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.BOTTOM_RANDOM),
+ new ManaCostsImpl("{2}{G}"));
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
-
}
private MemorialToUnity(final MemorialToUnity card) {
@@ -52,5 +48,4 @@ public final class MemorialToUnity extends CardImpl {
public MemorialToUnity copy() {
return new MemorialToUnity(this);
}
-
}
diff --git a/Mage.Sets/src/mage/cards/m/MemoryDeluge.java b/Mage.Sets/src/mage/cards/m/MemoryDeluge.java
index 76bd75248d6..c713c1bb139 100644
--- a/Mage.Sets/src/mage/cards/m/MemoryDeluge.java
+++ b/Mage.Sets/src/mage/cards/m/MemoryDeluge.java
@@ -2,14 +2,12 @@ package mage.cards.m;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.ManaSpentToCastCount;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -23,9 +21,8 @@ public final class MemoryDeluge extends CardImpl {
// Look at the top X cards of your library, where X is the amount of mana spent to cast this spell. Put two of them into your hand and the rest on the bottom of your library in a random order.
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- ManaSpentToCastCount.instance, false, StaticValue.get(2),
- StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false
- ).setBackInRandomOrder(true).setText("look at the top X cards of your library, where X " +
+ ManaSpentToCastCount.instance, 2, PutCards.HAND, PutCards.BOTTOM_RANDOM
+ ).setText("look at the top X cards of your library, where X " +
"is the amount of mana spent to cast this spell. Put two of them into your " +
"hand and the rest on the bottom of your library in a random order"));
diff --git a/Mage.Sets/src/mage/cards/m/MilitiaBugler.java b/Mage.Sets/src/mage/cards/m/MilitiaBugler.java
index d7802ae4c39..6cdf4d5ecb3 100644
--- a/Mage.Sets/src/mage/cards/m/MilitiaBugler.java
+++ b/Mage.Sets/src/mage/cards/m/MilitiaBugler.java
@@ -2,15 +2,14 @@ package mage.cards.m;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.PowerPredicate;
@@ -38,11 +37,11 @@ public final class MilitiaBugler extends CardImpl {
// Vigilance
this.addAbility(VigilanceAbility.getInstance());
- // When Militia Bugler enters the battlefield, look at the top four cards of your library. You may reveal a creature card with power 2 or less from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
- this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(1), filter, Zone.LIBRARY, false,
- true, true, Zone.HAND, false, true, false
- ), false));
+ // When Militia Bugler enters the battlefield, look at the top four cards of your library.
+ // You may reveal a creature card with power 2 or less from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(4, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM)));
}
private MilitiaBugler(final MilitiaBugler card) {
diff --git a/Mage.Sets/src/mage/cards/m/MundaAmbushLeader.java b/Mage.Sets/src/mage/cards/m/MundaAmbushLeader.java
index a6caec000a5..644b8144d59 100644
--- a/Mage.Sets/src/mage/cards/m/MundaAmbushLeader.java
+++ b/Mage.Sets/src/mage/cards/m/MundaAmbushLeader.java
@@ -1,29 +1,31 @@
-
package mage.cards.m;
import java.util.UUID;
import mage.MageInt;
-import mage.MageObject;
-import mage.abilities.Ability;
import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.cards.Cards;
-import mage.cards.CardsImpl;
-import mage.constants.*;
+import mage.constants.CardType;
+import mage.constants.SubType;
+import mage.constants.SuperType;
import mage.filter.FilterCard;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
/**
*
- * @author LevelX2
+ * @author awjackson
*/
public final class MundaAmbushLeader extends CardImpl {
+ private static final FilterCard filter = new FilterCard("Ally cards");
+
+ static {
+ filter.add(SubType.ALLY.getPredicate());
+ }
+
public MundaAmbushLeader(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{W}");
addSuperType(SuperType.LEGENDARY);
@@ -34,9 +36,13 @@ public final class MundaAmbushLeader extends CardImpl {
// Haste
this.addAbility(HasteAbility.getInstance());
- // Rally-Whenever Munda, Ambush Leader or another Ally enters the battlefield under your control, you may look at the top four cards of your library. If you do, reveal any number of Ally cards from among them, then put those cards on top of your library in any order and the rest on the bottom in any order.
- this.addAbility(new AllyEntersBattlefieldTriggeredAbility(new MundaAmbushLeaderEffect(), true));
-
+ // Rally-Whenever Munda, Ambush Leader or another Ally enters the battlefield under your control,
+ // you may look at the top four cards of your library. If you do, reveal any number of Ally cards from among them,
+ // then put those cards on top of your library in any order and the rest on the bottom in any order.
+ Effect effect = new LookLibraryAndPickControllerEffect(4, Integer.MAX_VALUE, filter, PutCards.TOP_ANY, PutCards.BOTTOM_ANY, false);
+ effect.setText("look at the top four cards of your library. If you do, reveal any number of Ally cards from among them, "
+ + "then put those cards on top of your library in any order and the rest on the bottom in any order");
+ this.addAbility(new AllyEntersBattlefieldTriggeredAbility(effect, true));
}
private MundaAmbushLeader(final MundaAmbushLeader card) {
@@ -48,53 +54,3 @@ public final class MundaAmbushLeader extends CardImpl {
return new MundaAmbushLeader(this);
}
}
-
-class MundaAmbushLeaderEffect extends OneShotEffect {
-
- private static final FilterCard filter = new FilterCard("Ally cards to reveal and put on top of your library");
-
- static {
- filter.add(SubType.ALLY.getPredicate());
- }
-
- public MundaAmbushLeaderEffect() {
- super(Outcome.Benefit);
- this.staticText = "you may look at the top four cards of your library. If you do, reveal any number of Ally cards from among them, then put those cards on top of your library in any order and the rest on the bottom in any order";
- }
-
- public MundaAmbushLeaderEffect(final MundaAmbushLeaderEffect effect) {
- super(effect);
- }
-
- @Override
- public MundaAmbushLeaderEffect copy() {
- return new MundaAmbushLeaderEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- MageObject sourceObject = game.getObject(source);
- if (controller != null && sourceObject != null) {
- Cards allCards = new CardsImpl();
- allCards.addAll(controller.getLibrary().getTopCards(game, 4));
- controller.lookAtCards(sourceObject.getIdName(), allCards, game);
- if (!allCards.isEmpty()) {
- Cards cardsToReveal = new CardsImpl();
- TargetCard target = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, filter);
- controller.chooseTarget(outcome, allCards, target, source, game);
- cardsToReveal.addAll(target.getTargets());
- if (!cardsToReveal.isEmpty()) {
- controller.revealCards(sourceObject.getIdName(), cardsToReveal, game, true);
- allCards.removeAll(cardsToReveal);
- }
- controller.putCardsOnTopOfLibrary(cardsToReveal, game, source, true);
- }
- if (!allCards.isEmpty()) {
- controller.putCardsOnBottomOfLibrary(allCards, game, source, true);
- }
- return true;
- }
- return false;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/n/NagaOracle.java b/Mage.Sets/src/mage/cards/n/NagaOracle.java
index e8d771134e5..1f57bd3d922 100644
--- a/Mage.Sets/src/mage/cards/n/NagaOracle.java
+++ b/Mage.Sets/src/mage/cards/n/NagaOracle.java
@@ -1,18 +1,14 @@
-
package mage.cards.n;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
-import mage.abilities.effects.Effect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
/**
*
@@ -30,21 +26,8 @@ public final class NagaOracle extends CardImpl {
// When Naga Oracle enters the battlefield, look at the top three cards of your library. Put any number of them into your graveyard
// and the rest back on top of your library in any order.
- Effect effect = new LookLibraryAndPickControllerEffect(
- /* oh god, Microsoft looks conservative with their function parameters in comparison */
- StaticValue.get(3),
- false,
- StaticValue.get(3),
- new FilterCard("cards"),
- Zone.LIBRARY,
- true,
- false,
- true,
- Zone.GRAVEYARD,
- false);
- effect.setText("look at the top three cards of your library. Put any number of them into your graveyard "
- + "and the rest back on top of your library in any order");
- addAbility(new EntersBattlefieldTriggeredAbility(effect));
+ addAbility(new EntersBattlefieldTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(3, Integer.MAX_VALUE, PutCards.GRAVEYARD, PutCards.TOP_ANY)));
}
private NagaOracle(final NagaOracle card) {
diff --git a/Mage.Sets/src/mage/cards/n/NaggingThoughts.java b/Mage.Sets/src/mage/cards/n/NaggingThoughts.java
index f8d7545ae72..c7d95dac3a8 100644
--- a/Mage.Sets/src/mage/cards/n/NaggingThoughts.java
+++ b/Mage.Sets/src/mage/cards/n/NaggingThoughts.java
@@ -1,16 +1,13 @@
-
package mage.cards.n;
import java.util.UUID;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.MadnessAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
/**
*
@@ -22,7 +19,7 @@ public final class NaggingThoughts extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{U}");
// Look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(2), false, StaticValue.get(1), new FilterCard(), Zone.GRAVEYARD, false, false));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(2, 1, PutCards.HAND, PutCards.GRAVEYARD));
// Madness {1}{U}
this.addAbility(new MadnessAbility(new ManaCostsImpl("{1}{U}")));
diff --git a/Mage.Sets/src/mage/cards/n/NahiriHeirOfTheAncients.java b/Mage.Sets/src/mage/cards/n/NahiriHeirOfTheAncients.java
index 439371b43a0..969bc16a968 100644
--- a/Mage.Sets/src/mage/cards/n/NahiriHeirOfTheAncients.java
+++ b/Mage.Sets/src/mage/cards/n/NahiriHeirOfTheAncients.java
@@ -5,10 +5,10 @@ import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
@@ -35,7 +35,7 @@ import java.util.stream.Collectors;
*/
public final class NahiriHeirOfTheAncients extends CardImpl {
- private static final FilterCard filter = new FilterCard("Warrior or Equipment card");
+ private static final FilterCard filter = new FilterCard("a Warrior or Equipment card");
static {
filter.add(Predicates.or(
@@ -57,15 +57,10 @@ public final class NahiriHeirOfTheAncients extends CardImpl {
// +1: Create a 1/1 white Kor Warrior creature token. You may attach an Equipment you control to it.
this.addAbility(new LoyaltyAbility(new NahiriHeirOfTheAncientsEffect(), 1));
- // −2: Look at the top six cards of your library. You may reveal a Warrior or Equipment card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
- this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(6), false, StaticValue.get(1), filter,
- Zone.LIBRARY, false, true, false, Zone.HAND,
- true, false, false
- ).setBackInRandomOrder(true).setText("Look at the top six cards of your library. " +
- "You may reveal a Warrior or Equipment card from among them and put it into your hand. " +
- "Put the rest on the bottom of your library in a random order."
- ), -2));
+ // −2: Look at the top six cards of your library.
+ // You may reveal a Warrior or Equipment card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
+ this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(6, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM), -2));
// −3: Nahiri, Heir of the Ancients deals damage to target creature or planeswalker equal to twice the number of Equipment you control.
Ability ability = new LoyaltyAbility(new DamageTargetEffect(xValue)
diff --git a/Mage.Sets/src/mage/cards/n/NarsetParterOfVeils.java b/Mage.Sets/src/mage/cards/n/NarsetParterOfVeils.java
index fec48a5f7d8..19fde5784e0 100644
--- a/Mage.Sets/src/mage/cards/n/NarsetParterOfVeils.java
+++ b/Mage.Sets/src/mage/cards/n/NarsetParterOfVeils.java
@@ -3,9 +3,9 @@ package mage.cards.n;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
@@ -23,7 +23,7 @@ import java.util.UUID;
*/
public final class NarsetParterOfVeils extends CardImpl {
- private static final FilterCard filter = new FilterCard("noncreature, nonland card");
+ private static final FilterCard filter = new FilterCard("a noncreature, nonland card");
static {
filter.add(Predicates.not(CardType.CREATURE.getPredicate()));
@@ -40,15 +40,10 @@ public final class NarsetParterOfVeils extends CardImpl {
// Each opponent can't draw more than one card each turn.
this.addAbility(new SimpleStaticAbility(new NarsetParterOfVeilsEffect()), new CardsAmountDrawnThisTurnWatcher());
- // -2: Look at the top four cards of your library. You may reveal a noncreature, nonland card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
- this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(1), filter,
- Zone.LIBRARY, false, true, false, Zone.HAND,
- true, false, false
- ).setBackInRandomOrder(true).setText("Look at the top four cards of your library. " +
- "You may reveal a noncreature, nonland card from among them and put it into your hand. " +
- "Put the rest on the bottom of your library in a random order."
- ), -2));
+ // -2: Look at the top four cards of your library.
+ // You may reveal a noncreature, nonland card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
+ this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(4, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM), -2));
}
private NarsetParterOfVeils(final NarsetParterOfVeils card) {
diff --git a/Mage.Sets/src/mage/cards/n/Necrosynthesis.java b/Mage.Sets/src/mage/cards/n/Necrosynthesis.java
index e3338e09093..5059b112918 100644
--- a/Mage.Sets/src/mage/cards/n/Necrosynthesis.java
+++ b/Mage.Sets/src/mage/cards/n/Necrosynthesis.java
@@ -5,10 +5,10 @@ import mage.abilities.common.DiesAttachedTriggeredAbility;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.EnchantAbility;
@@ -16,7 +16,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
-import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
@@ -47,12 +46,10 @@ public final class Necrosynthesis extends CardImpl {
effect.setText("Enchanted creature has \"Whenever another creature dies, put a +1/+1 counter on this creature.\"");
this.addAbility(new SimpleStaticAbility(effect));
- // When enchanted creature dies, look at the top X cards of your library, where X is its power. Put one of those cards into your hand and the rest on the bottom of your library in a random order.
+ // When enchanted creature dies, look at the top X cards of your library, where X is its power.
+ // Put one of those cards into your hand and the rest on the bottom of your library in a random order.
DynamicValue attachedPower = new NecrosynthesisAttachedPermanentPowerCount();
- effect = new LookLibraryAndPickControllerEffect(
- attachedPower, false, StaticValue.get(1), StaticFilters.FILTER_CARD, false,
- false
- ).setBackInRandomOrder(true);
+ effect = new LookLibraryAndPickControllerEffect(attachedPower, 1, PutCards.HAND, PutCards.BOTTOM_RANDOM);
effect.setText("look at the top X cards of your library, where X is its power. " +
"Put one of those cards into your hand and the rest on the bottom of your library in a random order");
ability = new DiesAttachedTriggeredAbility(effect, "enchanted creature");
diff --git a/Mage.Sets/src/mage/cards/n/NessianGameWarden.java b/Mage.Sets/src/mage/cards/n/NessianGameWarden.java
index d508ca3422c..63a4aca5c46 100644
--- a/Mage.Sets/src/mage/cards/n/NessianGameWarden.java
+++ b/Mage.Sets/src/mage/cards/n/NessianGameWarden.java
@@ -1,34 +1,33 @@
-
package mage.cards.n;
import java.util.UUID;
import mage.MageInt;
-import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
-import mage.abilities.effects.OneShotEffect;
-import mage.cards.Card;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.cards.Cards;
-import mage.cards.CardsImpl;
import mage.constants.CardType;
-import mage.constants.Outcome;
import mage.constants.SubType;
-import mage.constants.Zone;
+import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledPermanent;
-import mage.filter.common.FilterCreatureCard;
-import mage.game.Game;
-import mage.game.permanent.Permanent;
-import mage.players.Player;
-import mage.target.TargetCard;
/**
*
- * @author LevelX2
+ * @author awjackson
*/
public final class NessianGameWarden extends CardImpl {
+ private static final FilterControlledPermanent filter = new FilterControlledPermanent("Forests you control");
+
+ static {
+ filter.add(SubType.FOREST.getPredicate());
+ }
+
+ private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(filter, null);
+
public NessianGameWarden(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
this.subtype.add(SubType.BEAST);
@@ -36,8 +35,10 @@ public final class NessianGameWarden extends CardImpl {
this.power = new MageInt(4);
this.toughness = new MageInt(5);
- // When Nessian Game Warden enters the battlefield, look at the top X cards of your library, where X is the number of forests you control. You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
- this.addAbility(new EntersBattlefieldTriggeredAbility(new NessianGameWardenEffect(), false));
+ // When Nessian Game Warden enters the battlefield, look at the top X cards of your library, where X is the number of forests you control.
+ // You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
+ xValue, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.BOTTOM_ANY)));
}
private NessianGameWarden(final NessianGameWarden card) {
@@ -49,55 +50,3 @@ public final class NessianGameWarden extends CardImpl {
return new NessianGameWarden(this);
}
}
-
-class NessianGameWardenEffect extends OneShotEffect {
-
- private static final FilterControlledPermanent filter = new FilterControlledPermanent("forests you control");
-
- static {
- filter.add(SubType.FOREST.getPredicate());
- }
-
- public NessianGameWardenEffect() {
- super(Outcome.DrawCard);
- this.staticText = "look at the top X cards of your library, where X is the number of Forests you control. You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in any order";
- }
-
- public NessianGameWardenEffect(final NessianGameWardenEffect effect) {
- super(effect);
- }
-
- @Override
- public NessianGameWardenEffect copy() {
- return new NessianGameWardenEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
- if (controller == null || sourcePermanent == null) {
- return false;
- }
-
- int count = new PermanentsOnBattlefieldCount(filter).calculate(game, source, this);
- Cards cards = new CardsImpl();
- cards.addAll(controller.getLibrary().getTopCards(game, count));
- controller.lookAtCards(sourcePermanent.getIdName(), cards, game);
-
- if (!cards.isEmpty()) {
- TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCreatureCard("creature card to put into your hand"));
- if (target.canChoose(controller.getId(), source, game) && controller.choose(Outcome.DrawCard, cards, target, game)) {
- Card card = cards.get(target.getFirstTarget(), game);
- if (card != null) {
- controller.revealCards(sourcePermanent.getName(), new CardsImpl(card), game);
- cards.remove(card);
- controller.moveCards(card, Zone.HAND, source, game);
- }
- }
- }
-
- controller.putCardsOnBottomOfLibrary(cards, game, source, true);
- return true;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/n/NessianWanderer.java b/Mage.Sets/src/mage/cards/n/NessianWanderer.java
index 1ca21b900c2..9cd28428e9b 100644
--- a/Mage.Sets/src/mage/cards/n/NessianWanderer.java
+++ b/Mage.Sets/src/mage/cards/n/NessianWanderer.java
@@ -2,13 +2,12 @@ package mage.cards.n;
import mage.MageInt;
import mage.abilities.abilityword.ConstellationAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
import java.util.UUID;
@@ -26,15 +25,14 @@ public final class NessianWanderer extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(3);
- // Constellation — Whenever an enchantment enters the battelfield under your control, look at the top three cards of your library. You may reveal a land card from among them and put that card into your hand. Put the rest on the bottom of your library in a random order.
- this.addAbility(new ConstellationAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD_LAND_A, Zone.LIBRARY, false,
- true, false, Zone.HAND, true, false, false
- ).setBackInRandomOrder(true).setText("look at the top three cards of your library. " +
- "You may reveal a land card from among them and put that card into your hand. " +
- "Put the rest on the bottom of your library in a random order"), false, false
- ));
+ // Constellation — Whenever an enchantment enters the battelfield under your control, look at the top three cards of your library.
+ // You may reveal a land card from among them and put that card into your hand. Put the rest on the bottom of your library in a random order.
+ this.addAbility(new ConstellationAbility(
+ new LookLibraryAndPickControllerEffect(3, 1, StaticFilters.FILTER_CARD_LAND_A, PutCards.HAND, PutCards.BOTTOM_RANDOM)
+ .setText("look at the top three cards of your library. " +
+ "You may reveal a land card from among them and put that card into your hand. " +
+ "Put the rest on the bottom of your library in a random order"),
+ false, false));
}
private NessianWanderer(final NessianWanderer card) {
diff --git a/Mage.Sets/src/mage/cards/n/NissaGenesisMage.java b/Mage.Sets/src/mage/cards/n/NissaGenesisMage.java
index c3e4e70a211..d3d255eff1f 100644
--- a/Mage.Sets/src/mage/cards/n/NissaGenesisMage.java
+++ b/Mage.Sets/src/mage/cards/n/NissaGenesisMage.java
@@ -3,9 +3,9 @@ package mage.cards.n;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl;
@@ -14,7 +14,6 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.filter.predicate.Predicates;
@@ -28,7 +27,7 @@ import mage.target.targetpointer.EachTargetPointer;
*/
public final class NissaGenesisMage extends CardImpl {
- private static final FilterCard filter = new FilterCard("any number of creature and/or land cards");
+ private static final FilterCard filter = new FilterCard("creature and/or land cards");
static {
filter.add(Predicates.or(
@@ -57,10 +56,11 @@ public final class NissaGenesisMage extends CardImpl {
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
- //-10: Look at the top ten cards of your library. You may put any number of creature and/or land cards from among them onto the battlefield. Put the rest on the bottom of your library in a random order.);
+ //-10: Look at the top ten cards of your library.
+ //You may put any number of creature and/or land cards from among them onto the battlefield.
+ //Put the rest on the bottom of your library in a random order.);
this.addAbility(new LoyaltyAbility(
- new LookLibraryAndPickControllerEffect(StaticValue.get(10), false, StaticValue.get(10), filter,
- Zone.LIBRARY, true, false, true, Zone.BATTLEFIELD, true, true, false).setBackInRandomOrder(true),
+ new LookLibraryAndPickControllerEffect(10, Integer.MAX_VALUE, filter, PutCards.BATTLEFIELD, PutCards.BOTTOM_RANDOM),
-10));
}
diff --git a/Mage.Sets/src/mage/cards/n/NymrisOonasTrickster.java b/Mage.Sets/src/mage/cards/n/NymrisOonasTrickster.java
index 424adf5aea2..06b8ee0f064 100644
--- a/Mage.Sets/src/mage/cards/n/NymrisOonasTrickster.java
+++ b/Mage.Sets/src/mage/cards/n/NymrisOonasTrickster.java
@@ -2,8 +2,8 @@ package mage.cards.n;
import mage.MageInt;
import mage.abilities.common.FirstSpellOpponentsTurnTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.FlashAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@@ -11,8 +11,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -36,13 +34,11 @@ public final class NymrisOonasTrickster extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
- // Whenever you cast your first spell during each opponent's turn, look at the top two cards of your library. Put one of those cards into your hand and the other into your graveyard.
+ // Whenever you cast your first spell during each opponent's turn, look at the top two cards of your library.
+ // Put one of those cards into your hand and the other into your graveyard.
this.addAbility(new FirstSpellOpponentsTurnTriggeredAbility(
- new LookLibraryAndPickControllerEffect(
- StaticValue.get(2), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false
- ), false
- ));
+ new LookLibraryAndPickControllerEffect(2, 1, PutCards.HAND, PutCards.GRAVEYARD),
+ false));
}
private NymrisOonasTrickster(final NymrisOonasTrickster card) {
diff --git a/Mage.Sets/src/mage/cards/o/OathOfNissa.java b/Mage.Sets/src/mage/cards/o/OathOfNissa.java
index a7ee75b304a..7a2efc70754 100644
--- a/Mage.Sets/src/mage/cards/o/OathOfNissa.java
+++ b/Mage.Sets/src/mage/cards/o/OathOfNissa.java
@@ -6,18 +6,18 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.AsThoughManaEffect;
-import mage.abilities.effects.OneShotEffect;
-import mage.cards.*;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.game.Game;
import mage.players.ManaPoolItem;
import mage.players.Player;
-import mage.target.TargetCard;
import mage.util.CardUtil;
-import java.util.Set;
import java.util.UUID;
/**
@@ -25,12 +25,23 @@ import java.util.UUID;
*/
public final class OathOfNissa extends CardImpl {
+ private static final FilterCard filter = new FilterCard("a creature, land, or planeswalker card");
+
+ static {
+ filter.add(Predicates.or(CardType.CREATURE.getPredicate(),
+ CardType.LAND.getPredicate(),
+ CardType.PLANESWALKER.getPredicate()));
+ }
+
public OathOfNissa(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}");
addSuperType(SuperType.LEGENDARY);
- // When Oath of Nissa enters the battlefield, look at the top three cards of your library. You may reveal a creature, land, or planeswalker card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
- this.addAbility(new EntersBattlefieldTriggeredAbility(new OathOfNissaEffect()));
+ // When Oath of Nissa enters the battlefield, look at the top three cards of your library.
+ // You may reveal a creature, land, or planeswalker card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in any order.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
+ 3, 1, filter, PutCards.HAND, PutCards.BOTTOM_ANY)));
// You may spend mana as though it were mana of any color to cast planeswalker spells.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OathOfNissaSpendAnyManaEffect()));
@@ -46,66 +57,6 @@ public final class OathOfNissa extends CardImpl {
}
}
-class OathOfNissaEffect extends OneShotEffect {
-
- private static final FilterCard filter = new FilterCard("a creature, land, or planeswalker card");
-
- static {
- filter.add(Predicates.or(CardType.CREATURE.getPredicate(),
- CardType.PLANESWALKER.getPredicate(),
- CardType.LAND.getPredicate()));
- }
-
- public OathOfNissaEffect() {
- super(Outcome.DrawCard);
- this.staticText = "look at the top three cards of your library. You may reveal a creature, land, or planeswalker card from among them and put it into your hand. Put the rest on the bottom of your library in any order";
- }
-
- public OathOfNissaEffect(final OathOfNissaEffect effect) {
- super(effect);
- }
-
- @Override
- public OathOfNissaEffect copy() {
- return new OathOfNissaEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- MageObject sourceObject = game.getObject(source);
- if (controller != null && sourceObject != null) {
- Cards topCards = new CardsImpl();
- topCards.addAll(controller.getLibrary().getTopCards(game, 3));
- if (!topCards.isEmpty()) {
- controller.lookAtCards(sourceObject.getIdName(), topCards, game);
- int number = topCards.count(filter, source.getControllerId(), source, game);
- if (number > 0) {
- if (controller.chooseUse(outcome, "Reveal a creature, land, or planeswalker card from the looked at cards and put it into your hand?", source, game)) {
- Card card;
- if (number == 1) {
- Set cards = topCards.getCards(filter, source.getControllerId(), source, game);
- card = cards.isEmpty() ? null : cards.iterator().next();
- } else {
- TargetCard target = new TargetCard(Zone.LIBRARY, filter);
- controller.choose(outcome, topCards, target, game);
- card = topCards.get(target.getFirstTarget(), game);
- }
- if (card != null) {
- controller.moveCards(card, Zone.HAND, source, game);
- controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);
- topCards.remove(card);
- }
- }
- }
- controller.putCardsOnBottomOfLibrary(topCards, game, source, true);
- }
- return true;
- }
- return false;
- }
-}
-
class OathOfNissaSpendAnyManaEffect extends AsThoughEffectImpl implements AsThoughManaEffect {
public OathOfNissaSpendAnyManaEffect() {
diff --git a/Mage.Sets/src/mage/cards/o/Omen.java b/Mage.Sets/src/mage/cards/o/Omen.java
index 0b1ab731f96..9811470dbb3 100644
--- a/Mage.Sets/src/mage/cards/o/Omen.java
+++ b/Mage.Sets/src/mage/cards/o/Omen.java
@@ -1,9 +1,9 @@
-
package mage.cards.o;
import java.util.UUID;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.LookLibraryControllerEffect;
+import mage.abilities.effects.common.ShuffleLibrarySourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@@ -17,11 +17,12 @@ public final class Omen extends CardImpl {
public Omen(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{U}");
- // Look at the top three cards of your library, then put them back in any order. You may shuffle your library.
- this.getSpellAbility().addEffect(new LookLibraryControllerEffect(3, true));
-
+ // Look at the top three cards of your library, then put them back in any order.
+ this.getSpellAbility().addEffect(new LookLibraryControllerEffect(3));
+ // You may shuffle.
+ this.getSpellAbility().addEffect(new ShuffleLibrarySourceEffect(true));
// Draw a card.
- this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
+ this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).concatBy("
"));
}
private Omen(final Omen card) {
diff --git a/Mage.Sets/src/mage/cards/o/OnceUponATime.java b/Mage.Sets/src/mage/cards/o/OnceUponATime.java
index 52ef52fb3b8..041e220c258 100644
--- a/Mage.Sets/src/mage/cards/o/OnceUponATime.java
+++ b/Mage.Sets/src/mage/cards/o/OnceUponATime.java
@@ -3,15 +3,13 @@ package mage.cards.o;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.WatcherScope;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
-import mage.filter.predicate.Predicates;
+import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.watchers.Watcher;
@@ -25,15 +23,6 @@ import java.util.UUID;
*/
public final class OnceUponATime extends CardImpl {
- private static final FilterCard filter = new FilterCard("a creature or land card");
-
- static {
- filter.add(Predicates.or(
- CardType.CREATURE.getPredicate(),
- CardType.LAND.getPredicate()
- ));
- }
-
public OnceUponATime(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
@@ -45,13 +34,7 @@ public final class OnceUponATime extends CardImpl {
// Look at the top five cards of your library. You may reveal a creature or land card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), filter,
- Zone.LIBRARY, false, true, false, Zone.HAND,
- true, false, false
- ).setBackInRandomOrder(true).setText("Look at the top five cards of your library. " +
- "You may reveal a creature or land card from among them and put it into your hand. " +
- "Put the rest on the bottom of your library in a random order."
- ));
+ 5, 1, StaticFilters.FILTER_CARD_CREATURE_OR_LAND, PutCards.HAND, PutCards.BOTTOM_RANDOM));
}
private OnceUponATime(final OnceUponATime card) {
diff --git a/Mage.Sets/src/mage/cards/o/OrbOfDragonkind.java b/Mage.Sets/src/mage/cards/o/OrbOfDragonkind.java
index 40aefdca939..089f8a0ae62 100644
--- a/Mage.Sets/src/mage/cards/o/OrbOfDragonkind.java
+++ b/Mage.Sets/src/mage/cards/o/OrbOfDragonkind.java
@@ -9,16 +9,16 @@ import mage.abilities.condition.Condition;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
-import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
+import mage.abilities.costs.mana.ColoredManaCost;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.mana.ConditionalAnyColorManaAbility;
import mage.abilities.mana.builder.ConditionalManaBuilder;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
+import mage.constants.ColoredManaSymbol;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
@@ -45,12 +45,9 @@ public final class OrbOfDragonkind extends CardImpl {
// {R}, {T}, Sacrifice Orb of Dragonkind: Look at the top seven cards of your library.
// You may reveal a Dragon card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
- ability = new SimpleActivatedAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(7), false, StaticValue.get(1), filter,
- Zone.LIBRARY, false, true, false, Zone.HAND,
- true, false, false).setBackInRandomOrder(true),
- new ManaCostsImpl<>("{R}")
- );
+ ability = new SimpleActivatedAbility(
+ new LookLibraryAndPickControllerEffect(7, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM),
+ new ColoredManaCost(ColoredManaSymbol.R));
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
diff --git a/Mage.Sets/src/mage/cards/o/OrganHoarder.java b/Mage.Sets/src/mage/cards/o/OrganHoarder.java
index e72aad0f934..02f6c9468bd 100644
--- a/Mage.Sets/src/mage/cards/o/OrganHoarder.java
+++ b/Mage.Sets/src/mage/cards/o/OrganHoarder.java
@@ -2,14 +2,12 @@ package mage.cards.o;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -27,8 +25,7 @@ public final class OrganHoarder extends CardImpl {
// When Organ Hoarder enters the battlefield, look at the top three cards of your library, then put one of them into your hand and the rest into you graveyard.
this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false, StaticValue.get(1), StaticFilters.FILTER_CARD,
- Zone.GRAVEYARD, false, false, false, Zone.HAND, false
+ 3, 1, PutCards.HAND, PutCards.GRAVEYARD
).setText("look at the top three cards of your library, then put one of them into your hand and the rest into your graveyard")));
}
diff --git a/Mage.Sets/src/mage/cards/o/OtherworldlyGaze.java b/Mage.Sets/src/mage/cards/o/OtherworldlyGaze.java
index 687b1aa3ef5..7cbb0193113 100644
--- a/Mage.Sets/src/mage/cards/o/OtherworldlyGaze.java
+++ b/Mage.Sets/src/mage/cards/o/OtherworldlyGaze.java
@@ -1,14 +1,12 @@
package mage.cards.o;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -21,10 +19,7 @@ public final class OtherworldlyGaze extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}");
// Look at the top three cards of your library. Put any number of them into your graveyard and the rest back on top of your library in any order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false, StaticValue.get(5), StaticFilters.FILTER_CARD_CARDS,
- Zone.LIBRARY, true, false, true, Zone.GRAVEYARD, false
- ).setText("look at the top three cards of your library. Put any number of them into your graveyard and the rest back on top of your library in any order"));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(3, Integer.MAX_VALUE, PutCards.GRAVEYARD, PutCards.TOP_ANY));
// Flashback {1}{U}
this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{1}{U}")));
diff --git a/Mage.Sets/src/mage/cards/p/PeerThroughDepths.java b/Mage.Sets/src/mage/cards/p/PeerThroughDepths.java
index 70f82788391..3213b29761c 100644
--- a/Mage.Sets/src/mage/cards/p/PeerThroughDepths.java
+++ b/Mage.Sets/src/mage/cards/p/PeerThroughDepths.java
@@ -1,9 +1,7 @@
-
-
package mage.cards.p;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@@ -31,10 +29,9 @@ public final class PeerThroughDepths extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}");
this.subtype.add(SubType.ARCANE);
-
// Look at the top five cards of your library. You may reveal an instant or sorcery card from among them and put it into your hand.
// Put the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(5), false, StaticValue.get(1), filter, false));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(5, 1, filter, PutCards.HAND, PutCards.BOTTOM_ANY));
}
public PeerThroughDepths (final PeerThroughDepths card) {
@@ -45,6 +42,4 @@ public final class PeerThroughDepths extends CardImpl {
public PeerThroughDepths copy() {
return new PeerThroughDepths(this);
}
-
}
-
diff --git a/Mage.Sets/src/mage/cards/p/PiecesOfThePuzzle.java b/Mage.Sets/src/mage/cards/p/PiecesOfThePuzzle.java
index 51eb1ca084e..af1bc7a5c5f 100644
--- a/Mage.Sets/src/mage/cards/p/PiecesOfThePuzzle.java
+++ b/Mage.Sets/src/mage/cards/p/PiecesOfThePuzzle.java
@@ -1,14 +1,12 @@
-
package mage.cards.p;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
-import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.abilities.effects.common.RevealLibraryPickControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
@@ -18,18 +16,19 @@ import mage.filter.predicate.Predicates;
*/
public final class PiecesOfThePuzzle extends CardImpl {
- private static final FilterCard FILTER = new FilterCard("up to two instant and/or sorcery cards");
+ private static final FilterCard filter = new FilterCard("instant and/or sorcery cards");
static {
- FILTER.add(Predicates.or(CardType.INSTANT.getPredicate(), CardType.SORCERY.getPredicate()));
+ filter.add(Predicates.or(CardType.INSTANT.getPredicate(), CardType.SORCERY.getPredicate()));
}
public PiecesOfThePuzzle(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{U}");
// Reveal the top five cards of your library. Put up to two instant and/or sorcery cards from among them into your hand and the rest into your graveyard.
- Effect effect = new LookLibraryAndPickControllerEffect(StaticValue.get(5), false, StaticValue.get(2), FILTER, Zone.GRAVEYARD, false, true, true, Zone.HAND, false);
- effect.setText("Reveal the top five cards of your library. Put up to two instant and/or sorcery cards from among them into your hand and the rest into your graveyard");
+ Effect effect = new RevealLibraryPickControllerEffect(5, 2, filter, PutCards.HAND, PutCards.GRAVEYARD, false);
+ effect.setText("reveal the top five cards of your library. " +
+ "Put up to two instant and/or sorcery cards from among them into your hand and the rest into your graveyard");
this.getSpellAbility().addEffect(effect);
}
diff --git a/Mage.Sets/src/mage/cards/p/Ponder.java b/Mage.Sets/src/mage/cards/p/Ponder.java
index 67f7965df86..7191766552c 100644
--- a/Mage.Sets/src/mage/cards/p/Ponder.java
+++ b/Mage.Sets/src/mage/cards/p/Ponder.java
@@ -1,9 +1,9 @@
-
package mage.cards.p;
import java.util.UUID;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.LookLibraryControllerEffect;
+import mage.abilities.effects.common.ShuffleLibrarySourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@@ -16,9 +16,10 @@ public final class Ponder extends CardImpl {
public Ponder(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{U}");
-
- // Look at the top three cards of your library, then put them back in any order. You may shuffle your library.
- this.getSpellAbility().addEffect(new LookLibraryControllerEffect(3, true, true));
+ // Look at the top three cards of your library, then put them back in any order.
+ this.getSpellAbility().addEffect(new LookLibraryControllerEffect(3));
+ // You may shuffle.
+ this.getSpellAbility().addEffect(new ShuffleLibrarySourceEffect(true));
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).concatBy("
"));
}
@@ -31,4 +32,4 @@ public final class Ponder extends CardImpl {
public Ponder copy() {
return new Ponder(this);
}
-}
\ No newline at end of file
+}
diff --git a/Mage.Sets/src/mage/cards/p/PonderingMage.java b/Mage.Sets/src/mage/cards/p/PonderingMage.java
index b9e38f3eb74..b8fe061f66d 100644
--- a/Mage.Sets/src/mage/cards/p/PonderingMage.java
+++ b/Mage.Sets/src/mage/cards/p/PonderingMage.java
@@ -5,6 +5,7 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.LookLibraryControllerEffect;
+import mage.abilities.effects.common.ShuffleLibrarySourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@@ -26,9 +27,8 @@ public final class PonderingMage extends CardImpl {
this.toughness = new MageInt(4);
// When Pondering Mage enters the battlefield, look at the top three cards of your library, then put them back in any order. You may shuffle your library. Draw a card.
- Ability ability = new EntersBattlefieldTriggeredAbility(
- new LookLibraryControllerEffect(3, true, true)
- );
+ Ability ability = new EntersBattlefieldTriggeredAbility(new LookLibraryControllerEffect(3));
+ ability.addEffect(new ShuffleLibrarySourceEffect(true));
ability.addEffect(new DrawCardSourceControllerEffect(1));
this.addAbility(ability);
}
diff --git a/Mage.Sets/src/mage/cards/p/PreferredSelection.java b/Mage.Sets/src/mage/cards/p/PreferredSelection.java
index 46bd3918406..f020d5f41ee 100644
--- a/Mage.Sets/src/mage/cards/p/PreferredSelection.java
+++ b/Mage.Sets/src/mage/cards/p/PreferredSelection.java
@@ -6,10 +6,10 @@ import mage.abilities.costs.CompositeCost;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
@@ -17,8 +17,6 @@ import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
@@ -52,7 +50,7 @@ class PreferredSelectionEffect extends OneShotEffect {
PreferredSelectionEffect() {
super(Outcome.Benefit);
- staticText = "At the beginning of your upkeep, look at the top two cards of your library. " +
+ staticText = "look at the top two cards of your library. " +
"You may sacrifice {this} and pay {2}{G}{G}. If you do, put one of those cards into your hand. " +
"If you don't, put one of those cards on the bottom of your library.";
}
@@ -79,15 +77,9 @@ class PreferredSelectionEffect extends OneShotEffect {
"sacrifice this permanent and pay {2}{G}{G}"
);
return new DoIfCostPaid(
- new LookLibraryAndPickControllerEffect(
- StaticValue.get(2), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.HAND, true, false
- ),
- new LookLibraryAndPickControllerEffect(
- StaticValue.get(2), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.HAND, true, false,
- false, Zone.LIBRARY, false, true, false
- ), cost
+ new LookLibraryAndPickControllerEffect(2, 1, PutCards.HAND, PutCards.TOP_ANY),
+ new LookLibraryAndPickControllerEffect(2, 1, PutCards.BOTTOM_ANY, PutCards.TOP_ANY),
+ cost
).apply(game, source);
}
}
diff --git a/Mage.Sets/src/mage/cards/p/ProfessorOnyx.java b/Mage.Sets/src/mage/cards/p/ProfessorOnyx.java
index 1a1d3aa264f..b5f4a36bd55 100644
--- a/Mage.Sets/src/mage/cards/p/ProfessorOnyx.java
+++ b/Mage.Sets/src/mage/cards/p/ProfessorOnyx.java
@@ -5,9 +5,13 @@ import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.MagecraftAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
-import mage.abilities.effects.common.*;
+import mage.abilities.effects.common.GainLifeEffect;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.abilities.effects.common.LoseLifeOpponentsEffect;
+import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
+import mage.abilities.effects.common.SacrificeOpponentsEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@@ -53,10 +57,7 @@ public final class ProfessorOnyx extends CardImpl {
// +1: You lose 1 life. Look at the top three cards of your library. Put one of them into your hand and the rest into your graveyard.
ability = new LoyaltyAbility(new LoseLifeSourceControllerEffect(1), 1);
- ability.addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false, StaticValue.get(1), StaticFilters.FILTER_CARD,
- Zone.GRAVEYARD, false, false, false, Zone.HAND, false
- ).setText("Look at the top three cards of your library. Put one of them into your hand and the rest into your graveyard"));
+ ability.addEffect(new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.GRAVEYARD));
this.addAbility(ability);
// −3: Each opponent sacrifices a creature with the greatest power among creatures that player controls.
diff --git a/Mage.Sets/src/mage/cards/p/PropheticBolt.java b/Mage.Sets/src/mage/cards/p/PropheticBolt.java
index d8661e219a7..d52add9501e 100644
--- a/Mage.Sets/src/mage/cards/p/PropheticBolt.java
+++ b/Mage.Sets/src/mage/cards/p/PropheticBolt.java
@@ -1,15 +1,12 @@
-
package mage.cards.p;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
import mage.target.common.TargetAnyTarget;
/**
@@ -25,7 +22,7 @@ public final class PropheticBolt extends CardImpl {
// Prophetic Bolt deals 4 damage to any target. Look at the top four cards of your library. Put one of those cards into your hand and the rest on the bottom of your library in any order.
this.getSpellAbility().addEffect(new DamageTargetEffect(4));
this.getSpellAbility().addTarget(new TargetAnyTarget());
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(4), false, StaticValue.get(1), new FilterCard(), Zone.LIBRARY, false, false));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(4, 1, PutCards.HAND, PutCards.BOTTOM_ANY));
}
private PropheticBolt(final PropheticBolt card) {
diff --git a/Mage.Sets/src/mage/cards/p/PropheticTitan.java b/Mage.Sets/src/mage/cards/p/PropheticTitan.java
index 648bf296302..eda7d02bfba 100644
--- a/Mage.Sets/src/mage/cards/p/PropheticTitan.java
+++ b/Mage.Sets/src/mage/cards/p/PropheticTitan.java
@@ -4,16 +4,15 @@ import mage.MageInt;
import mage.abilities.Mode;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.DeliriumCondition;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.hint.common.CardTypesInGraveyardHint;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
+import mage.constants.AbilityWord;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.common.TargetAnyTarget;
@@ -54,16 +53,13 @@ class PropheticTitanTriggeredAbility extends EntersBattlefieldTriggeredAbility {
public PropheticTitanTriggeredAbility() {
super(new DamageTargetEffect(4), false);
this.addMode(new Mode(new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false
- ).setBackInRandomOrder(true).setText("look at the top four cards of your library. " +
- "Put one of them into your hand and the rest on the bottom of your library in a random order")));
+ 4, 1, PutCards.HAND, PutCards.BOTTOM_RANDOM)));
this.getModes().setChooseText(
"choose one. If there are four or more card types among cards in your graveyard, choose both instead."
);
this.addTarget(new TargetAnyTarget());
this.addHint(CardTypesInGraveyardHint.YOU);
- this.withFlavorWord("Delirium");
+ this.setAbilityWord(AbilityWord.DELIRIUM);
}
private PropheticTitanTriggeredAbility(final PropheticTitanTriggeredAbility ability) {
@@ -85,4 +81,4 @@ class PropheticTitanTriggeredAbility extends EntersBattlefieldTriggeredAbility {
this.getModes().setMaxModes(modes);
return true;
}
-}
\ No newline at end of file
+}
diff --git a/Mage.Sets/src/mage/cards/q/QuandrixApprentice.java b/Mage.Sets/src/mage/cards/q/QuandrixApprentice.java
index 8c4e470d11b..93d6e53ad55 100644
--- a/Mage.Sets/src/mage/cards/q/QuandrixApprentice.java
+++ b/Mage.Sets/src/mage/cards/q/QuandrixApprentice.java
@@ -2,13 +2,12 @@ package mage.cards.q;
import mage.MageInt;
import mage.abilities.common.MagecraftAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
import java.util.UUID;
@@ -28,9 +27,7 @@ public final class QuandrixApprentice extends CardImpl {
// Magecraft — Whenever you cast or copy an instant or sorcery spell, look at the top three cards of your library. You may reveal a land card from among them and put that card into your hand. Put the rest on the bottom of your library in any order.
this.addAbility(new MagecraftAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false, StaticValue.get(1), StaticFilters.FILTER_CARD_LAND_A,
- Zone.LIBRARY, false, true, false, Zone.HAND, true
- )));
+ 3, 1, StaticFilters.FILTER_CARD_LAND_A, PutCards.HAND, PutCards.BOTTOM_ANY)));
}
private QuandrixApprentice(final QuandrixApprentice card) {
diff --git a/Mage.Sets/src/mage/cards/r/RalIzzetViceroy.java b/Mage.Sets/src/mage/cards/r/RalIzzetViceroy.java
index 9839f1948ad..ce751defc3c 100644
--- a/Mage.Sets/src/mage/cards/r/RalIzzetViceroy.java
+++ b/Mage.Sets/src/mage/cards/r/RalIzzetViceroy.java
@@ -3,10 +3,10 @@ package mage.cards.r;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.dynamicvalue.common.InstantSorceryExileGraveyardCount;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.hint.Hint;
import mage.abilities.hint.ValueHint;
import mage.cards.CardImpl;
@@ -14,8 +14,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import mage.game.command.emblems.RalIzzetViceroyEmblem;
import mage.target.common.TargetCreaturePermanent;
@@ -38,12 +36,7 @@ public final class RalIzzetViceroy extends CardImpl {
this.setStartingLoyalty(5);
// +1: Look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.
- this.addAbility(new LoyaltyAbility(
- new LookLibraryAndPickControllerEffect(
- StaticValue.get(2), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false
- ), 1
- ));
+ this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(2, 1, PutCards.HAND, PutCards.GRAVEYARD), 1));
// -3: Ral, Izzet Viceroy deals damage to target creature equal to the total number of instant and sorcery cards you own in exile and in your graveyard.
Ability ability = new LoyaltyAbility(new DamageTargetEffect(
diff --git a/Mage.Sets/src/mage/cards/r/RalsOutburst.java b/Mage.Sets/src/mage/cards/r/RalsOutburst.java
index 43c5dffb7c0..af16157c2b5 100644
--- a/Mage.Sets/src/mage/cards/r/RalsOutburst.java
+++ b/Mage.Sets/src/mage/cards/r/RalsOutburst.java
@@ -1,13 +1,11 @@
package mage.cards.r;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import mage.target.common.TargetAnyTarget;
import java.util.UUID;
@@ -23,10 +21,7 @@ public final class RalsOutburst extends CardImpl {
// Ral's Outburst deals 3 damage to any target. Look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.
this.getSpellAbility().addEffect(new DamageTargetEffect(3));
this.getSpellAbility().addTarget(new TargetAnyTarget());
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(2), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false
- ));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(2, 1, PutCards.HAND, PutCards.GRAVEYARD));
}
private RalsOutburst(final RalsOutburst card) {
diff --git a/Mage.Sets/src/mage/cards/r/RansackTheLab.java b/Mage.Sets/src/mage/cards/r/RansackTheLab.java
index 7242bd300a1..047fe23ddb9 100644
--- a/Mage.Sets/src/mage/cards/r/RansackTheLab.java
+++ b/Mage.Sets/src/mage/cards/r/RansackTheLab.java
@@ -1,12 +1,10 @@
package mage.cards.r;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -19,8 +17,7 @@ public final class RansackTheLab extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}");
// Look at the top three cards of your library. Put one of them into your hand and the rest into your graveyard.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(3), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.GRAVEYARD));
}
private RansackTheLab(final RansackTheLab card) {
diff --git a/Mage.Sets/src/mage/cards/r/RavenFamiliar.java b/Mage.Sets/src/mage/cards/r/RavenFamiliar.java
index 33c9c17c898..87b38a3bd4f 100644
--- a/Mage.Sets/src/mage/cards/r/RavenFamiliar.java
+++ b/Mage.Sets/src/mage/cards/r/RavenFamiliar.java
@@ -1,18 +1,16 @@
-
package mage.cards.r;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.EchoAbility;
import mage.abilities.keyword.FlyingAbility;
-import mage.cards.*;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
/**
*
@@ -31,10 +29,10 @@ public final class RavenFamiliar extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Echo {2}{U}
this.addAbility(new EchoAbility("{2}{U}"));
- // When Raven Familiar enters the battlefield, look at the top three cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.
+ // When Raven Familiar enters the battlefield, look at the top three cards of your library.
+ // Put one of them into your hand and the rest on the bottom of your library in any order.
this.addAbility(new EntersBattlefieldTriggeredAbility(
- new LookLibraryAndPickControllerEffect(StaticValue.get(3), false, StaticValue.get(1), StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false),
- false));
+ new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.BOTTOM_ANY)));
}
private RavenFamiliar(final RavenFamiliar card) {
diff --git a/Mage.Sets/src/mage/cards/r/RealityHeist.java b/Mage.Sets/src/mage/cards/r/RealityHeist.java
index 5df4ca20370..395f1864f63 100644
--- a/Mage.Sets/src/mage/cards/r/RealityHeist.java
+++ b/Mage.Sets/src/mage/cards/r/RealityHeist.java
@@ -2,8 +2,8 @@ package mage.cards.r;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.ArtifactYouControlCount;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.cost.SpellCostReductionForEachSourceEffect;
import mage.abilities.hint.common.ArtifactYouControlHint;
import mage.cards.CardImpl;
@@ -28,16 +28,8 @@ public final class RealityHeist extends CardImpl {
).addHint(ArtifactYouControlHint.instance));
// Look at the top seven cards of your library. You may reveal up to two artifact cards from among them and put them into your hand. Put the rest on the bottom of your library in a random order.
- this.getSpellAbility().addEffect(
- new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD_ARTIFACT, Zone.LIBRARY, false, true,
- false, Zone.HAND, true, false, false
- ).setBackInRandomOrder(true)
- .setText("look at the top seven cards of your library. You may reveal up to " +
- "two artifact cards from among them and put them into your hand. " +
- "Put the rest on the bottom of your library in a random order")
- );
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
+ 7, 2, StaticFilters.FILTER_CARD_ARTIFACTS, PutCards.HAND, PutCards.BOTTOM_RANDOM));
}
private RealityHeist(final RealityHeist card) {
diff --git a/Mage.Sets/src/mage/cards/s/SalvageTitan.java b/Mage.Sets/src/mage/cards/s/SalvageTitan.java
index ee2ecba633e..2c163626e44 100644
--- a/Mage.Sets/src/mage/cards/s/SalvageTitan.java
+++ b/Mage.Sets/src/mage/cards/s/SalvageTitan.java
@@ -13,7 +13,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
-import mage.filter.common.FilterArtifactCard;
+import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledArtifactPermanent;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetControlledPermanent;
@@ -32,10 +32,10 @@ public final class SalvageTitan extends CardImpl {
this.toughness = new MageInt(4);
// You may sacrifice three artifacts rather than pay Salvage Titan's mana cost.
- this.addAbility(new AlternativeCostSourceAbility(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledArtifactPermanent("three artifacts"), true))));
+ this.addAbility(new AlternativeCostSourceAbility(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledArtifactPermanent("artifacts"), true))));
// Exile three artifact cards from your graveyard: Return Salvage Titan from your graveyard to your hand.
- this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new ExileFromGraveCost(new TargetCardInYourGraveyard(3, new FilterArtifactCard("artifact cards")))));
+ this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new ExileFromGraveCost(new TargetCardInYourGraveyard(3, StaticFilters.FILTER_CARD_ARTIFACTS))));
}
private SalvageTitan(final SalvageTitan card) {
diff --git a/Mage.Sets/src/mage/cards/s/SarkhansDragonfire.java b/Mage.Sets/src/mage/cards/s/SarkhansDragonfire.java
index a818b96cdb3..68d78728e62 100644
--- a/Mage.Sets/src/mage/cards/s/SarkhansDragonfire.java
+++ b/Mage.Sets/src/mage/cards/s/SarkhansDragonfire.java
@@ -2,13 +2,12 @@ package mage.cards.s;
import java.util.UUID;
import mage.ObjectColor;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.common.TargetAnyTarget;
@@ -34,12 +33,7 @@ public final class SarkhansDragonfire extends CardImpl {
// Look at the top five cards of your library. You may reveal a red card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), filter,
- Zone.LIBRARY, false, true, false, Zone.HAND, true, false, false
- ).setBackInRandomOrder(true).setText("
Look at the top five cards of your library. "
- + "You may reveal a red card from among them and put it into your hand. "
- + "Put the rest on the bottom of your library in a random order.")
- );
+ 5, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM).concatBy("
"));
}
private SarkhansDragonfire(final SarkhansDragonfire card) {
diff --git a/Mage.Sets/src/mage/cards/s/SatoruUmezawa.java b/Mage.Sets/src/mage/cards/s/SatoruUmezawa.java
index ebb07c03d22..d96baf284ea 100644
--- a/Mage.Sets/src/mage/cards/s/SatoruUmezawa.java
+++ b/Mage.Sets/src/mage/cards/s/SatoruUmezawa.java
@@ -4,9 +4,9 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.NinjutsuAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
@@ -34,7 +34,9 @@ public final class SatoruUmezawa extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(4);
- // Whenever you activate a ninjutsu ability, look at the top three cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order. This ability triggers only once each turn.
+ // Whenever you activate a ninjutsu ability, look at the top three cards of your library.
+ // Put one of them into your hand and the rest on the bottom of your library in any order.
+ // This ability triggers only once each turn.
this.addAbility(new SatoruUmezawaTriggeredAbility());
// Each creature card in your hand has ninjutsu {2}{U}{B}.
@@ -54,10 +56,7 @@ public final class SatoruUmezawa extends CardImpl {
class SatoruUmezawaTriggeredAbility extends TriggeredAbilityImpl {
SatoruUmezawaTriggeredAbility() {
- super(Zone.BATTLEFIELD, new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false
- ));
+ super(Zone.BATTLEFIELD, new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.BOTTOM_ANY));
this.setTriggersOnce(true);
}
@@ -85,10 +84,8 @@ class SatoruUmezawaTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public String getRule() {
- return "Whenever you activate a ninjutsu ability, look at the top three cards of your library. " +
- "Put one of them into your hand and the rest on the bottom of your library in any order. " +
- "This ability triggers only once each turn.";
+ public String getTriggerPhrase() {
+ return "Whenever you activate a ninjutsu ability, ";
}
}
diff --git a/Mage.Sets/src/mage/cards/s/SatyrWayfinder.java b/Mage.Sets/src/mage/cards/s/SatyrWayfinder.java
index 847c2ad4b04..bff86473e60 100644
--- a/Mage.Sets/src/mage/cards/s/SatyrWayfinder.java
+++ b/Mage.Sets/src/mage/cards/s/SatyrWayfinder.java
@@ -3,27 +3,18 @@ package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
-import mage.MageObject;
-import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.effects.OneShotEffect;
-import mage.cards.Card;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.abilities.effects.common.RevealLibraryPickControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.cards.Cards;
-import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
-import mage.filter.common.FilterLandCard;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
+import mage.filter.StaticFilters;
/**
*
- * @author LevelX2
+ * @author awjackson
*/
public final class SatyrWayfinder extends CardImpl {
@@ -34,8 +25,10 @@ public final class SatyrWayfinder extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(1);
- // When Satyr Wayfinder enters the battlefield, reveal the top four cards of your library. You may put a land card from among them into your hand. Put the rest into your graveyard.
- this.addAbility(new EntersBattlefieldTriggeredAbility(new SatyrWayfinderEffect()));
+ // When Satyr Wayfinder enters the battlefield, reveal the top four cards of your library.
+ // You may put a land card from among them into your hand. Put the rest into your graveyard.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new RevealLibraryPickControllerEffect(
+ 4, 1, StaticFilters.FILTER_CARD_LAND_A, PutCards.HAND, PutCards.GRAVEYARD)));
}
private SatyrWayfinder(final SatyrWayfinder card) {
@@ -47,49 +40,3 @@ public final class SatyrWayfinder extends CardImpl {
return new SatyrWayfinder(this);
}
}
-
-class SatyrWayfinderEffect extends OneShotEffect {
-
- private static final FilterLandCard filterPutInHand = new FilterLandCard("land card to put in hand");
-
- public SatyrWayfinderEffect() {
- super(Outcome.DrawCard);
- this.staticText = "reveal the top four cards of your library. You may put a land card from among them into your hand. Put the rest into your graveyard";
- }
-
- public SatyrWayfinderEffect(final SatyrWayfinderEffect effect) {
- super(effect);
- }
-
- @Override
- public SatyrWayfinderEffect copy() {
- return new SatyrWayfinderEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- MageObject sourceObject = game.getObject(source);
- if (controller != null && sourceObject != null) {
- Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 4));
- boolean properCardFound = cards.count(filterPutInHand, source.getSourceId(), source, game) > 0;
- if (!cards.isEmpty()) {
- controller.revealCards(sourceObject.getIdName(), cards, game);
- TargetCard target = new TargetCard(Zone.LIBRARY, filterPutInHand);
- if (properCardFound
- && controller.chooseUse(outcome, "Put a land card into your hand?", source, game)
- && controller.choose(Outcome.DrawCard, cards, target, game)) {
- Card card = game.getCard(target.getFirstTarget());
- if (card != null) {
- cards.remove(card);
- controller.moveCards(card, Zone.HAND, source, game);
- }
-
- }
- controller.moveCards(cards, Zone.GRAVEYARD, source, game);
- }
- return true;
- }
- return false;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/s/ScatteredThoughts.java b/Mage.Sets/src/mage/cards/s/ScatteredThoughts.java
index 50d1799fe40..494804c3547 100644
--- a/Mage.Sets/src/mage/cards/s/ScatteredThoughts.java
+++ b/Mage.Sets/src/mage/cards/s/ScatteredThoughts.java
@@ -1,12 +1,10 @@
package mage.cards.s;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -19,10 +17,7 @@ public final class ScatteredThoughts extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}");
// Look at the top four cards of your library. Put two of those cards into your hand and the rest into your graveyard.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(2),
- StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false
- ));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(4, 2, PutCards.HAND, PutCards.GRAVEYARD));
}
private ScatteredThoughts(final ScatteredThoughts card) {
diff --git a/Mage.Sets/src/mage/cards/s/ScoutTheBorders.java b/Mage.Sets/src/mage/cards/s/ScoutTheBorders.java
index 11b0cf7849b..fbf0a092825 100644
--- a/Mage.Sets/src/mage/cards/s/ScoutTheBorders.java
+++ b/Mage.Sets/src/mage/cards/s/ScoutTheBorders.java
@@ -1,26 +1,16 @@
-
package mage.cards.s;
import java.util.UUID;
-import mage.abilities.Ability;
-import mage.abilities.effects.OneShotEffect;
-import mage.cards.Card;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.abilities.effects.common.RevealLibraryPickControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.cards.Cards;
-import mage.cards.CardsImpl;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
-import mage.filter.predicate.Predicates;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
+import mage.filter.StaticFilters;
/**
*
- * @author LevelX2
+ * @author awjackson
*/
public final class ScoutTheBorders extends CardImpl {
@@ -28,7 +18,8 @@ public final class ScoutTheBorders extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}");
// Reveal the top five cards of your library. You may put a creature or land card from among them into your hand. Put the rest into your graveyard.
- this.getSpellAbility().addEffect(new ScoutTheBordersEffect());
+ this.getSpellAbility().addEffect(new RevealLibraryPickControllerEffect(
+ 5, 1, StaticFilters.FILTER_CARD_CREATURE_OR_LAND, PutCards.HAND, PutCards.GRAVEYARD));
}
private ScoutTheBorders(final ScoutTheBorders card) {
@@ -40,50 +31,3 @@ public final class ScoutTheBorders extends CardImpl {
return new ScoutTheBorders(this);
}
}
-
-class ScoutTheBordersEffect extends OneShotEffect {
-
- private static final FilterCard filterPutInHand = new FilterCard("creature or land card to put in hand");
-
- static {
- filterPutInHand.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.LAND.getPredicate()));
- }
-
- public ScoutTheBordersEffect() {
- super(Outcome.DrawCard);
- this.staticText = "Reveal the top five cards of your library. You may put a creature or land card from among them into your hand. Put the rest into your graveyard";
- }
-
- public ScoutTheBordersEffect(final ScoutTheBordersEffect effect) {
- super(effect);
- }
-
- @Override
- public ScoutTheBordersEffect copy() {
- return new ScoutTheBordersEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- if (controller != null) {
- Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 5));
- boolean properCardFound = cards.count(filterPutInHand, game) > 0;
- if (!cards.isEmpty()) {
- controller.revealCards(source, cards, game);
- TargetCard target = new TargetCard(Zone.LIBRARY, filterPutInHand);
- if (properCardFound && controller.choose(Outcome.DrawCard, cards, target, game)) {
- Card card = game.getCard(target.getFirstTarget());
- if (card != null) {
- controller.moveCards(card, Zone.HAND, source, game);
- cards.remove(card);
- }
-
- }
- controller.moveCards(cards, Zone.GRAVEYARD, source, game);
- }
- return true;
- }
- return false;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/s/SeaGateOracle.java b/Mage.Sets/src/mage/cards/s/SeaGateOracle.java
index 1a39dc8b122..9f4ad41b7d0 100644
--- a/Mage.Sets/src/mage/cards/s/SeaGateOracle.java
+++ b/Mage.Sets/src/mage/cards/s/SeaGateOracle.java
@@ -1,18 +1,14 @@
-
-
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
/**
*
@@ -28,7 +24,10 @@ public final class SeaGateOracle extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(3);
- this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(StaticValue.get(2), false, StaticValue.get(1), new FilterCard(), Zone.LIBRARY, false, false), false));
+ // When Sea Gate Oracle enters the battlefield, look at the top two cards of your library.
+ // Put one of them into your hand and the other on the bottom of your library.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(2, 1, PutCards.HAND, PutCards.BOTTOM_ANY)));
}
diff --git a/Mage.Sets/src/mage/cards/s/SealedFate.java b/Mage.Sets/src/mage/cards/s/SealedFate.java
index ff9c4e84afd..ee8a9cbc91a 100644
--- a/Mage.Sets/src/mage/cards/s/SealedFate.java
+++ b/Mage.Sets/src/mage/cards/s/SealedFate.java
@@ -1,19 +1,21 @@
package mage.cards.s;
-import mage.abilities.dynamicvalue.common.ManacostVariableValue;
-import mage.abilities.dynamicvalue.common.StaticValue;
-import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
-import mage.cards.CardImpl;
-import mage.cards.CardSetInfo;
+import mage.abilities.Ability;
+import mage.abilities.effects.OneShotEffect;
+import mage.cards.*;
import mage.constants.CardType;
+import mage.constants.Outcome;
import mage.constants.Zone;
-import mage.filter.StaticFilters;
+import mage.game.Game;
+import mage.players.Player;
+import mage.target.TargetCard;
+import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetOpponent;
import java.util.UUID;
/**
- * @author jeffwadsworth
+ * @author awjackson
*/
public final class SealedFate extends CardImpl {
@@ -22,12 +24,7 @@ public final class SealedFate extends CardImpl {
// Look at the top X cards of target opponent's library. Exile one of those cards and put the rest back on top of that player's library in any order.
this.getSpellAbility().addTarget(new TargetOpponent());
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- ManacostVariableValue.REGULAR, false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.LIBRARY, true, false,
- false, Zone.EXILED, false, true, true
- ).setText("look at the top X cards of target opponent's library. Exile one of those cards " +
- "and put the rest back on top of that player's library in any order"));
+ this.getSpellAbility().addEffect(new SealedFateEffect());
}
private SealedFate(final SealedFate card) {
@@ -39,3 +36,48 @@ public final class SealedFate extends CardImpl {
return new SealedFate(this);
}
}
+
+class SealedFateEffect extends OneShotEffect {
+
+ SealedFateEffect() {
+ super(Outcome.Detriment);
+ this.staticText = "Look at the top X cards of target opponent's library. " +
+ "Exile one of those cards and put the rest back on top of that player's library in any order";
+ }
+
+ private SealedFateEffect(final SealedFateEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public SealedFateEffect copy() {
+ return new SealedFateEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ Player opponent = game.getPlayer(source.getFirstTarget());
+ int xValue = source.getManaCostsToPay().getX();
+
+ if (controller == null || opponent == null) {
+ return false;
+ }
+
+ Cards cards = new CardsImpl(opponent.getLibrary().getTopCards(game, xValue));
+ if (cards.isEmpty()) {
+ return false;
+ }
+ if (cards.size() == 1) {
+ return controller.moveCards(cards, Zone.EXILED, source, game);
+ }
+ TargetCard targetCard = new TargetCardInLibrary();
+ controller.choose(outcome, cards, targetCard, game);
+ Card card = game.getCard(targetCard.getFirstTarget());
+ if (card != null) {
+ controller.moveCards(card, Zone.EXILED, source, game);
+ cards.remove(card);
+ }
+ return controller.putCardsOnTopOfLibrary(cards, game, source, true);
+ }
+}
diff --git a/Mage.Sets/src/mage/cards/s/SeeTheUnwritten.java b/Mage.Sets/src/mage/cards/s/SeeTheUnwritten.java
index a7f687d95fa..b491278f6ef 100644
--- a/Mage.Sets/src/mage/cards/s/SeeTheUnwritten.java
+++ b/Mage.Sets/src/mage/cards/s/SeeTheUnwritten.java
@@ -1,41 +1,38 @@
package mage.cards.s;
-import mage.abilities.Ability;
-import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.common.FerociousCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.abilities.effects.common.RevealLibraryPickControllerEffect;
import mage.abilities.hint.common.FerociousHint;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.cards.Cards;
-import mage.cards.CardsImpl;
+import mage.constants.AbilityWord;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
import java.util.UUID;
/**
- * @author LevelX2
+ * @author awjackson
*/
public final class SeeTheUnwritten extends CardImpl {
+ private static final String rule = "Reveal the top eight cards of your library. " +
+ "You may put a creature card from among them onto the battlefield. Put the rest into your graveyard.
" +
+ AbilityWord.FEROCIOUS.formatWord() + "If " + FerociousCondition.instance.toString() +
+ ", you may put two creature cards onto the battlefield instead of one";
+
public SeeTheUnwritten(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}{G}");
// Reveal the top eight cards of your library. You may put a creature card from among them onto the battlefield. Put the rest into your graveyard.
// Ferocious — If you control a creature with power 4 or greater, you may put two creature cards onto the battlefield instead of one.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
- new SeeTheUnwrittenEffect(1),
- new SeeTheUnwrittenEffect(2),
- new InvertCondition(FerociousCondition.instance),
- "Reveal the top eight cards of your library. You may put a creature card from among them onto the battlefield. Put the rest into your graveyard."
- + "
Ferocious — If you control a creature with power 4 or greater, you may put two creature cards onto the battlefield instead of one"));
+ new RevealLibraryPickControllerEffect(8, 2, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.BATTLEFIELD, PutCards.GRAVEYARD),
+ new RevealLibraryPickControllerEffect(8, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.BATTLEFIELD, PutCards.GRAVEYARD),
+ FerociousCondition.instance, rule
+ ));
this.getSpellAbility().addHint(FerociousHint.instance);
}
@@ -48,51 +45,3 @@ public final class SeeTheUnwritten extends CardImpl {
return new SeeTheUnwritten(this);
}
}
-
-class SeeTheUnwrittenEffect extends OneShotEffect {
-
- private final int numberOfCardsToPutIntoPlay;
-
- public SeeTheUnwrittenEffect(int numberOfCardsToPutIntoPlay) {
- super(Outcome.DrawCard);
- this.numberOfCardsToPutIntoPlay = numberOfCardsToPutIntoPlay;
- this.staticText = "Reveal the top eight cards of your library. You may put "
- + (numberOfCardsToPutIntoPlay == 1 ? "a creature card" : "two creature cards")
- + " from among them onto the battlefield. Put the rest into your graveyard";
- }
-
- public SeeTheUnwrittenEffect(final SeeTheUnwrittenEffect effect) {
- super(effect);
- this.numberOfCardsToPutIntoPlay = effect.numberOfCardsToPutIntoPlay;
- }
-
- @Override
- public SeeTheUnwrittenEffect copy() {
- return new SeeTheUnwrittenEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- if (controller != null) {
- Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 8));
- int creatureCardsFound = cards.count(StaticFilters.FILTER_CARD_CREATURE, game);
- if (!cards.isEmpty()) {
- controller.revealCards(source, cards, game);
- if (creatureCardsFound > 0 && controller.chooseUse(outcome, "Put creature(s) into play?", source, game)) {
- int cardsToChoose = Math.min(numberOfCardsToPutIntoPlay, creatureCardsFound);
- TargetCard target = new TargetCard(cardsToChoose, cardsToChoose, Zone.LIBRARY, StaticFilters.FILTER_CARD_CREATURE);
- if (controller.choose(Outcome.PutCreatureInPlay, cards, target, game)) {
- Cards toBattlefield = new CardsImpl(target.getTargets());
- controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game);
- cards.removeAll(toBattlefield);
- }
- }
- controller.moveCards(cards, Zone.GRAVEYARD, source, game);
- }
- return true;
- }
- return false;
- }
-
-}
diff --git a/Mage.Sets/src/mage/cards/s/SeekTheWilds.java b/Mage.Sets/src/mage/cards/s/SeekTheWilds.java
index 2e03bc00e8d..e7ed6ed28f7 100644
--- a/Mage.Sets/src/mage/cards/s/SeekTheWilds.java
+++ b/Mage.Sets/src/mage/cards/s/SeekTheWilds.java
@@ -1,14 +1,12 @@
-
package mage.cards.s;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.filter.FilterCard;
-import mage.filter.predicate.Predicates;
+import mage.filter.StaticFilters;
/**
*
@@ -16,18 +14,12 @@ import mage.filter.predicate.Predicates;
*/
public final class SeekTheWilds extends CardImpl {
- private static final FilterCard filter = new FilterCard("a creature or land card");
-
- static {
- filter.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.LAND.getPredicate()));
- }
-
public SeekTheWilds(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{G}");
// Look at the top four cards of your library. You may reveal a creature or land card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(4), false, StaticValue.get(1), filter, false));
-
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
+ 4, 1, StaticFilters.FILTER_CARD_CREATURE_OR_LAND, PutCards.HAND, PutCards.BOTTOM_ANY));
}
private SeekTheWilds(final SeekTheWilds card) {
diff --git a/Mage.Sets/src/mage/cards/s/SenseisDiviningTop.java b/Mage.Sets/src/mage/cards/s/SenseisDiviningTop.java
index cf5c4aefbb6..57086f00417 100644
--- a/Mage.Sets/src/mage/cards/s/SenseisDiviningTop.java
+++ b/Mage.Sets/src/mage/cards/s/SenseisDiviningTop.java
@@ -4,7 +4,7 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
-import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.LookLibraryControllerEffect;
@@ -26,7 +26,7 @@ public final class SenseisDiviningTop extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
// {1}: Look at the top three cards of your library, then put them back in any order.
- this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(3, false, true), new ManaCostsImpl("{1}")));
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(3), new GenericManaCost(1)));
// {T}: Draw a card, then put Sensei's Divining Top on top of its owner's library.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new TapSourceCost());
ability.addEffect(new SenseisDiviningTopEffect());
diff --git a/Mage.Sets/src/mage/cards/s/ShigekiJukaiVisionary.java b/Mage.Sets/src/mage/cards/s/ShigekiJukaiVisionary.java
index 78a3a3d5870..7a2cab81925 100644
--- a/Mage.Sets/src/mage/cards/s/ShigekiJukaiVisionary.java
+++ b/Mage.Sets/src/mage/cards/s/ShigekiJukaiVisionary.java
@@ -6,18 +6,17 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
+import mage.abilities.effects.common.RevealLibraryPickControllerEffect;
import mage.abilities.keyword.ChannelAbility;
-import mage.cards.*;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.filter.predicate.Predicates;
import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
-import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetadjustment.TargetAdjuster;
@@ -37,8 +36,15 @@ public final class ShigekiJukaiVisionary extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(3);
- // {1}{G}, {T}, Return Shigeki, Jukai Visionary to its owner's hand: Reveal the top four cards of your library. You may put a land card from among them onto the battlefield tapped. Put the rest into your graveyard.
- Ability ability = new SimpleActivatedAbility(new ShigekiJukaiVisionaryEffect(), new ManaCostsImpl<>("{1}{G}"));
+ // {1}{G}, {T}, Return Shigeki, Jukai Visionary to its owner's hand: Reveal the top four cards of your library.
+ // You may put a land card from among them onto the battlefield tapped. Put the rest into your graveyard.
+ Ability ability = new SimpleActivatedAbility(
+ new RevealLibraryPickControllerEffect(
+ 4, 1,
+ StaticFilters.FILTER_CARD_LAND_A,
+ PutCards.BATTLEFIELD_TAPPED,
+ PutCards.GRAVEYARD),
+ new ManaCostsImpl<>("{1}{G}"));
ability.addCost(new TapSourceCost());
ability.addCost(new ReturnToHandFromBattlefieldSourceCost());
this.addAbility(ability);
@@ -74,40 +80,3 @@ enum ShigekiJukaiVisionaryAdjuster implements TargetAdjuster {
ability.addTarget(new TargetCardInYourGraveyard(ability.getManaCostsToPay().getX(), filter));
}
}
-
-class ShigekiJukaiVisionaryEffect extends OneShotEffect {
-
- ShigekiJukaiVisionaryEffect() {
- super(Outcome.Benefit);
- staticText = "reveal the top four cards of your library. You may put a land card " +
- "from among them onto the battlefield tapped. Put the rest into your graveyard";
- }
-
- private ShigekiJukaiVisionaryEffect(final ShigekiJukaiVisionaryEffect effect) {
- super(effect);
- }
-
- @Override
- public ShigekiJukaiVisionaryEffect copy() {
- return new ShigekiJukaiVisionaryEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- if (player == null) {
- return false;
- }
- Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 4));
- player.revealCards(source, cards, game);
- TargetCard target = new TargetCardInLibrary(0, 1, StaticFilters.FILTER_CARD_LAND);
- player.choose(outcome, cards, target, game);
- Card card = game.getCard(target.getFirstTarget());
- if (card != null) {
- player.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, true, null);
- cards.remove(card);
- }
- player.moveCards(cards, Zone.GRAVEYARD, source, game);
- return true;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/s/ShimmerOfPossibility.java b/Mage.Sets/src/mage/cards/s/ShimmerOfPossibility.java
index 5b3056dc541..9cd5ddfc375 100644
--- a/Mage.Sets/src/mage/cards/s/ShimmerOfPossibility.java
+++ b/Mage.Sets/src/mage/cards/s/ShimmerOfPossibility.java
@@ -1,12 +1,10 @@
package mage.cards.s;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -19,10 +17,7 @@ public final class ShimmerOfPossibility extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}");
// Look at the top four cards of your library. Put one of them into your hand and the rest on the bottom of your library in a random order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(1), StaticFilters.FILTER_CARD, Zone.LIBRARY,
- false, false, false, Zone.HAND, false, false, false
- ).setBackInRandomOrder(true));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(4, 1, PutCards.HAND, PutCards.BOTTOM_RANDOM));
}
private ShimmerOfPossibility(final ShimmerOfPossibility card) {
diff --git a/Mage.Sets/src/mage/cards/s/SigardaChampionOfLight.java b/Mage.Sets/src/mage/cards/s/SigardaChampionOfLight.java
index 7875c82d9c8..b56554d104b 100644
--- a/Mage.Sets/src/mage/cards/s/SigardaChampionOfLight.java
+++ b/Mage.Sets/src/mage/cards/s/SigardaChampionOfLight.java
@@ -5,8 +5,8 @@ import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.CovenCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.hint.common.CovenHint;
import mage.abilities.keyword.FlyingAbility;
@@ -51,12 +51,11 @@ public final class SigardaChampionOfLight extends CardImpl {
1, 1, Duration.WhileOnBattlefield, filter
)));
- // Coven — Whenever Sigarda attacks, if you control three or more creatures with different powers, look at the top five cards of your library. You may reveal a Human creature card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
+ // Coven — Whenever Sigarda attacks, if you control three or more creatures with different powers,
+ // look at the top five cards of your library. You may reveal a Human creature card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
- new AttacksTriggeredAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), filter2,
- Zone.LIBRARY, false, true, false, Zone.HAND, true
- ).setBackInRandomOrder(true)), CovenCondition.instance, "Whenever {this} attacks, " +
+ new AttacksTriggeredAbility(new LookLibraryAndPickControllerEffect(5, 1, filter2, PutCards.HAND, PutCards.BOTTOM_RANDOM)), CovenCondition.instance, "Whenever {this} attacks, " +
"if you control three or more creatures with different powers, look at the top five cards " +
"of your library. You may reveal a Human creature card from among them and put it into your hand. " +
"Put the rest on the bottom of your library in a random order."
diff --git a/Mage.Sets/src/mage/cards/s/SightBeyondSight.java b/Mage.Sets/src/mage/cards/s/SightBeyondSight.java
index d04c88983cb..3fe8b4a48e1 100644
--- a/Mage.Sets/src/mage/cards/s/SightBeyondSight.java
+++ b/Mage.Sets/src/mage/cards/s/SightBeyondSight.java
@@ -1,15 +1,12 @@
-
package mage.cards.s;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.ReboundAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
/**
*
@@ -20,9 +17,9 @@ public final class SightBeyondSight extends CardImpl {
public SightBeyondSight(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{U}");
- // Look at the top two cards of your library. Put of them into your hand and the other on the bottom of your library.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(2), false, StaticValue.get(1), new FilterCard(), Zone.LIBRARY, false, false));
-
+ // Look at the top two cards of your library. Put one of them into your hand and the other on the bottom of your library.
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(2, 1, PutCards.HAND, PutCards.BOTTOM_ANY));
+
// Rebound
this.addAbility(new ReboundAbility());
}
diff --git a/Mage.Sets/src/mage/cards/s/SilhanaWayfinder.java b/Mage.Sets/src/mage/cards/s/SilhanaWayfinder.java
index 34d46a83aee..9b8114685b9 100644
--- a/Mage.Sets/src/mage/cards/s/SilhanaWayfinder.java
+++ b/Mage.Sets/src/mage/cards/s/SilhanaWayfinder.java
@@ -2,15 +2,13 @@ package mage.cards.s;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
-import mage.filter.predicate.Predicates;
+import mage.filter.StaticFilters;
import java.util.UUID;
@@ -19,16 +17,6 @@ import java.util.UUID;
*/
public final class SilhanaWayfinder extends CardImpl {
- private static final FilterCard filter
- = new FilterCard("a creature or land card");
-
- static {
- filter.add(Predicates.or(
- CardType.CREATURE.getPredicate(),
- CardType.LAND.getPredicate()
- ));
- }
-
public SilhanaWayfinder(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
@@ -37,15 +25,11 @@ public final class SilhanaWayfinder extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(1);
- // When Silhana Wayfinder enters the battlefield, look at the top four cards of your library. You may reveal a creature or land card from among them and put it on top of your library. Put the rest on the bottom of your library in a random order.
+ // When Silhana Wayfinder enters the battlefield, look at the top four cards of your library.
+ // You may reveal a creature or land card from among them and put it on top of your library.
+ // Put the rest on the bottom of your library in a random order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(1), filter, Zone.LIBRARY, false,
- true, true, Zone.LIBRARY, false, true, false
- ).setBackInRandomOrder(true).setText("look at the top four cards of your library. " +
- "You may reveal a creature or land card from among them " +
- "and put it on top of your library. Put the rest " +
- "on the bottom of your library in a random order."), false
- ));
+ 4, 1, StaticFilters.FILTER_CARD_CREATURE_OR_LAND, PutCards.TOP_ANY, PutCards.BOTTOM_RANDOM)));
}
private SilhanaWayfinder(final SilhanaWayfinder card) {
diff --git a/Mage.Sets/src/mage/cards/s/SilundiVision.java b/Mage.Sets/src/mage/cards/s/SilundiVision.java
index bcf1340b10a..463c0506526 100644
--- a/Mage.Sets/src/mage/cards/s/SilundiVision.java
+++ b/Mage.Sets/src/mage/cards/s/SilundiVision.java
@@ -1,15 +1,13 @@
package mage.cards.s;
import mage.abilities.common.EntersBattlefieldTappedAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.mana.BlueManaAbility;
-import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.ModalDoubleFacesCard;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
import java.util.UUID;
@@ -30,16 +28,8 @@ public final class SilundiVision extends ModalDoubleFacesCard {
// Instant
// Look at the top six cards of your library. You may reveal an instant or sorcery card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
- this.getLeftHalfCard().getSpellAbility().addEffect(
- new LookLibraryAndPickControllerEffect(
- StaticValue.get(6), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, Zone.LIBRARY,
- false, true, false, Zone.HAND,
- true, false, false
- ).setBackInRandomOrder(true).setText("Look at the top six cards of your library. " +
- "You may reveal an instant or sorcery card from among them " +
- "and put it into your hand. Put the rest on the bottom of your library in a random order.")
- );
+ this.getLeftHalfCard().getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
+ 6, 1, StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, PutCards.HAND, PutCards.BOTTOM_RANDOM));
// 2.
// Silundi Isle
diff --git a/Mage.Sets/src/mage/cards/s/SionaCaptainOfThePyleas.java b/Mage.Sets/src/mage/cards/s/SionaCaptainOfThePyleas.java
index aa0f10339fa..b1c6047c7e6 100644
--- a/Mage.Sets/src/mage/cards/s/SionaCaptainOfThePyleas.java
+++ b/Mage.Sets/src/mage/cards/s/SionaCaptainOfThePyleas.java
@@ -3,9 +3,9 @@ package mage.cards.s;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@@ -42,14 +42,7 @@ public final class SionaCaptainOfThePyleas extends CardImpl {
// When Siona, Captain of the Pyleas enters the battlefield, look at the top seven cards of your library. You may reveal an Aura card among them and put it into your hand. Put the rest on the bottom of your library in a random order.
this.addAbility(new EntersBattlefieldTriggeredAbility(
- new LookLibraryAndPickControllerEffect(
- StaticValue.get(7), false, StaticValue.get(1), filter,
- Zone.LIBRARY, false, true, false, Zone.HAND,
- true, false, false
- ).setBackInRandomOrder(true).setText("look at the top seven cards of your library. " +
- "You may reveal an Aura card from among them and put it into your hand. " +
- "Put the rest on the bottom of your library in a random order.")
- ));
+ new LookLibraryAndPickControllerEffect(7, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM)));
// Whenever an Aura you control becomes attached to a creature you control, create a 1/1 white Human Soldier creature token.
this.addAbility(new SionaCaptainOfThePyleasAbility());
diff --git a/Mage.Sets/src/mage/cards/s/SkallaWolf.java b/Mage.Sets/src/mage/cards/s/SkallaWolf.java
index 71f039f4d08..c2ac49b9363 100644
--- a/Mage.Sets/src/mage/cards/s/SkallaWolf.java
+++ b/Mage.Sets/src/mage/cards/s/SkallaWolf.java
@@ -4,13 +4,12 @@ import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
@@ -34,15 +33,11 @@ public final class SkallaWolf extends CardImpl {
this.power = new MageInt(3);
this.toughness = new MageInt(3);
- // When Skalla Wolf enters the battlefield, look at the top five cards of your library. You may reveal a green card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
+ // When Skalla Wolf enters the battlefield, look at the top five cards of your library.
+ // You may reveal a green card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
this.addAbility(new EntersBattlefieldTriggeredAbility(
- new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), filter,
- Zone.LIBRARY, false, true, false, Zone.HAND, true, false, false
- ).setBackInRandomOrder(true).setText("look at the top five cards of your library. "
- + "You may reveal a green card from among them and put it into your hand. "
- + "Put the rest on the bottom of your library in a random order.")
- ));
+ new LookLibraryAndPickControllerEffect(5, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM)));
}
private SkallaWolf(final SkallaWolf card) {
diff --git a/Mage.Sets/src/mage/cards/s/SleightOfHand.java b/Mage.Sets/src/mage/cards/s/SleightOfHand.java
index ce6f17b1af2..bc85f30e586 100644
--- a/Mage.Sets/src/mage/cards/s/SleightOfHand.java
+++ b/Mage.Sets/src/mage/cards/s/SleightOfHand.java
@@ -1,12 +1,10 @@
package mage.cards.s;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import java.util.UUID;
@@ -19,10 +17,7 @@ public final class SleightOfHand extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}");
// Look at the top two cards of your library. Put one of them into your hand and the other on the bottom of your library.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(2), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false
- ));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(2, 1, PutCards.HAND, PutCards.BOTTOM_ANY));
}
private SleightOfHand(final SleightOfHand card) {
diff --git a/Mage.Sets/src/mage/cards/s/SoulcipherBoard.java b/Mage.Sets/src/mage/cards/s/SoulcipherBoard.java
index 1f476a6b796..3566861d1b3 100644
--- a/Mage.Sets/src/mage/cards/s/SoulcipherBoard.java
+++ b/Mage.Sets/src/mage/cards/s/SoulcipherBoard.java
@@ -9,8 +9,8 @@ import mage.abilities.condition.common.SourceHasCounterCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalOneShotEffect;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
@@ -19,7 +19,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
-import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
@@ -43,10 +42,9 @@ public final class SoulcipherBoard extends CardImpl {
));
// {1}{U}, {T}: Look at the top two cards of your library. Put one of them into your graveyard.
- Ability ability = new SimpleActivatedAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(2), false, StaticValue.get(1), StaticFilters.FILTER_CARD,
- Zone.LIBRARY, true, false, false, Zone.GRAVEYARD, false
- ).setText("look at the top two cards of your library. Put one of them into your graveyard"), new ManaCostsImpl<>("{1}{U}"));
+ Ability ability = new SimpleActivatedAbility(
+ new LookLibraryAndPickControllerEffect(2, 1, PutCards.GRAVEYARD, PutCards.TOP_ANY),
+ new ManaCostsImpl<>("{1}{U}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
diff --git a/Mage.Sets/src/mage/cards/s/SpyNetwork.java b/Mage.Sets/src/mage/cards/s/SpyNetwork.java
index f97bf66c14e..4be5d8353fd 100644
--- a/Mage.Sets/src/mage/cards/s/SpyNetwork.java
+++ b/Mage.Sets/src/mage/cards/s/SpyNetwork.java
@@ -35,7 +35,7 @@ public final class SpyNetwork extends CardImpl {
this.getSpellAbility().addEffect(new SpyNetworkLookAtTargetPlayerHandEffect());
this.getSpellAbility().addEffect(new LookLibraryTopCardTargetPlayerEffect().setText(" the top card of that player's library"));
this.getSpellAbility().addEffect(new SpyNetworkFaceDownEffect());
- this.getSpellAbility().addEffect(new LookLibraryControllerEffect(4, false, true));
+ this.getSpellAbility().addEffect(new LookLibraryControllerEffect(4));
this.getSpellAbility().addTarget(new TargetPlayer());
}
diff --git a/Mage.Sets/src/mage/cards/s/StoneforgeAcolyte.java b/Mage.Sets/src/mage/cards/s/StoneforgeAcolyte.java
index 3b5ae227335..01aa39b17ca 100644
--- a/Mage.Sets/src/mage/cards/s/StoneforgeAcolyte.java
+++ b/Mage.Sets/src/mage/cards/s/StoneforgeAcolyte.java
@@ -7,14 +7,13 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.common.TapTargetCost;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AbilityWord;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.permanent.TappedPredicate;
@@ -45,8 +44,8 @@ public final class StoneforgeAcolyte extends CardImpl {
// Cohort — {T}, Tap an untapped Ally you control: Look at the top four cards of your library.
// You may reveal an Equipment card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
- Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
- new LookLibraryAndPickControllerEffect(StaticValue.get(4), false, StaticValue.get(1), filterEquipment, false),
+ Ability ability = new SimpleActivatedAbility(
+ new LookLibraryAndPickControllerEffect(4, 1, filterEquipment, PutCards.HAND, PutCards.BOTTOM_ANY),
new TapSourceCost());
ability.addCost(new TapTargetCost(new TargetControlledPermanent(filterAlly)));
ability.setAbilityWord(AbilityWord.COHORT);
diff --git a/Mage.Sets/src/mage/cards/s/StormTheFestival.java b/Mage.Sets/src/mage/cards/s/StormTheFestival.java
index 185b64c24a7..921184cec88 100644
--- a/Mage.Sets/src/mage/cards/s/StormTheFestival.java
+++ b/Mage.Sets/src/mage/cards/s/StormTheFestival.java
@@ -2,12 +2,12 @@ package mage.cards.s;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterPermanentCard;
import mage.filter.predicate.mageobject.ManaValuePredicate;
@@ -20,7 +20,7 @@ import java.util.UUID;
public final class StormTheFestival extends CardImpl {
private static final FilterCard filter = new FilterPermanentCard(
- "up to two permanent cards with mana value 5 or less"
+ "permanent cards with mana value 5 or less"
);
static {
@@ -30,10 +30,10 @@ public final class StormTheFestival extends CardImpl {
public StormTheFestival(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}{G}{G}");
- // Look at the top five cards of your library. Put up to two permanent cards with mana value 5 or less from among them onto the battlefield. Put the rest on the bottom of your library in a random order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- 5, 2, filter, false, true, Zone.BATTLEFIELD, true
- ).setBackInRandomOrder(true));
+ // Look at the top five cards of your library.
+ // You may put up to two permanent cards with mana value 5 or less from among them onto the battlefield.
+ // Put the rest on the bottom of your library in a random order.
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(5, 2, filter, PutCards.BATTLEFIELD, PutCards.BOTTOM_RANDOM));
// Flashback {7}{G}{G}{G}
this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{7}{G}{G}{G}")));
diff --git a/Mage.Sets/src/mage/cards/s/StrategicPlanning.java b/Mage.Sets/src/mage/cards/s/StrategicPlanning.java
index 6e25ff17394..1a20bb62d75 100644
--- a/Mage.Sets/src/mage/cards/s/StrategicPlanning.java
+++ b/Mage.Sets/src/mage/cards/s/StrategicPlanning.java
@@ -1,14 +1,11 @@
-
package mage.cards.s;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
/**
*
@@ -20,8 +17,7 @@ public final class StrategicPlanning extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}");
// Look at the top three cards of your library. Put one of them into your hand and the rest into your graveyard.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(3), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.GRAVEYARD));
}
private StrategicPlanning(final StrategicPlanning card) {
diff --git a/Mage.Sets/src/mage/cards/s/SultaiAscendancy.java b/Mage.Sets/src/mage/cards/s/SultaiAscendancy.java
index 7fbcaaddab9..abacba8a0e9 100644
--- a/Mage.Sets/src/mage/cards/s/SultaiAscendancy.java
+++ b/Mage.Sets/src/mage/cards/s/SultaiAscendancy.java
@@ -1,17 +1,13 @@
-
package mage.cards.s;
import java.util.UUID;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
-import mage.abilities.effects.Effect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
/**
*
@@ -22,11 +18,11 @@ public final class SultaiAscendancy extends CardImpl {
public SultaiAscendancy(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}{G}{U}");
- // At the beginning of your upkeep, look at the top two cards of your library. Put any number of them into your graveyard and the rest on top of your library in any order.
- Effect effect = new LookLibraryAndPickControllerEffect(
- StaticValue.get(2), false, StaticValue.get(2), new FilterCard(), Zone.LIBRARY, true, false, true, Zone.GRAVEYARD, false);
- effect.setText("look at the top two cards of your library. Put any number of them into your graveyard and the rest on top of your library in any order");
- this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false));
+ // At the beginning of your upkeep, look at the top two cards of your library.
+ // Put any number of them into your graveyard and the rest back on top of your library in any order.
+ this.addAbility(new BeginningOfUpkeepTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(2, Integer.MAX_VALUE, PutCards.GRAVEYARD, PutCards.TOP_ANY),
+ TargetController.YOU, false));
}
private SultaiAscendancy(final SultaiAscendancy card) {
diff --git a/Mage.Sets/src/mage/cards/s/SultaiSoothsayer.java b/Mage.Sets/src/mage/cards/s/SultaiSoothsayer.java
index c962951bbd4..1bf2e150147 100644
--- a/Mage.Sets/src/mage/cards/s/SultaiSoothsayer.java
+++ b/Mage.Sets/src/mage/cards/s/SultaiSoothsayer.java
@@ -1,17 +1,14 @@
-
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
/**
*
@@ -27,9 +24,10 @@ public final class SultaiSoothsayer extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(5);
- // When Sultai Soothsayer enters the battlefield, look at the top four cards of your library. Put one of them into your hand and the rest into your graveyard.
- this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(StaticValue.get(4), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false), false));
+ // When Sultai Soothsayer enters the battlefield, look at the top four cards of your library.
+ // Put one of them into your hand and the rest into your graveyard.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(4, 1, PutCards.HAND, PutCards.GRAVEYARD)));
}
private SultaiSoothsayer(final SultaiSoothsayer card) {
diff --git a/Mage.Sets/src/mage/cards/s/SumalaWoodshaper.java b/Mage.Sets/src/mage/cards/s/SumalaWoodshaper.java
index 4c6ad7aa68d..aac25d74ece 100644
--- a/Mage.Sets/src/mage/cards/s/SumalaWoodshaper.java
+++ b/Mage.Sets/src/mage/cards/s/SumalaWoodshaper.java
@@ -2,13 +2,12 @@ package mage.cards.s;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
@@ -37,11 +36,11 @@ public final class SumalaWoodshaper extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(1);
- // When Sumala Woodshaper enters the battlefield, look at the top four cards of your library. You may reveal a creature or enchantment card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
- this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(1), filter, Zone.LIBRARY, false,
- true, false, Zone.HAND, false, false, false
- ).setBackInRandomOrder(true), false));
+ // When Sumala Woodshaper enters the battlefield, look at the top four cards of your library.
+ // You may reveal a creature or enchantment card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(4, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM)));
}
private SumalaWoodshaper(final SumalaWoodshaper card) {
diff --git a/Mage.Sets/src/mage/cards/s/SummoningTrap.java b/Mage.Sets/src/mage/cards/s/SummoningTrap.java
index dadc579e069..4339ce56bae 100644
--- a/Mage.Sets/src/mage/cards/s/SummoningTrap.java
+++ b/Mage.Sets/src/mage/cards/s/SummoningTrap.java
@@ -5,10 +5,12 @@ import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.effects.OneShotEffect;
-import mage.cards.*;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.*;
-import mage.filter.common.FilterCreatureCard;
+import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.stack.Spell;
@@ -34,8 +36,10 @@ public final class SummoningTrap extends CardImpl {
// If a creature spell you cast this turn was countered by a spell or ability an opponent controlled, you may pay {0} rather than pay Summoning Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{0}"), SummoningTrapCondition.instance), new SummoningTrapWatcher());
- // Look at the top seven cards of your library. You may put a creature card from among them onto the battlefield. Put the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(new SummoningTrapEffect());
+ // Look at the top seven cards of your library. You may put a creature card from among them onto the battlefield.
+ // Put the rest on the bottom of your library in any order.
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
+ 7, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.BATTLEFIELD, PutCards.BOTTOM_ANY));
}
private SummoningTrap(final SummoningTrap card) {
@@ -104,45 +108,3 @@ class SummoningTrapWatcher extends Watcher {
players.clear();
}
}
-
-class SummoningTrapEffect extends OneShotEffect {
-
- public SummoningTrapEffect(final SummoningTrapEffect effect) {
- super(effect);
- }
-
- public SummoningTrapEffect() {
- super(Outcome.PutCreatureInPlay);
- this.staticText = "Look at the top seven cards of your library. You may put a creature card from among them onto the battlefield. Put the rest on the bottom of your library in any order";
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- if (controller == null) {
- return false;
- }
- Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 7));
- if (!cards.isEmpty()) {
- TargetCard target = new TargetCard(Zone.LIBRARY,
- new FilterCreatureCard(
- "creature card to put on the battlefield"));
- if (controller.choose(Outcome.PutCreatureInPlay, cards, target, game)) {
- Card card = cards.get(target.getFirstTarget(), game);
- if (card != null) {
- cards.remove(card);
- controller.moveCards(card, Zone.BATTLEFIELD, source, game);
- }
- }
- if (!cards.isEmpty()) {
- controller.putCardsOnBottomOfLibrary(cards, game, source, true);
- }
- }
- return true;
- }
-
- @Override
- public SummoningTrapEffect copy() {
- return new SummoningTrapEffect(this);
- }
-}
diff --git a/Mage.Sets/src/mage/cards/s/SupremeWill.java b/Mage.Sets/src/mage/cards/s/SupremeWill.java
index 58766028ffb..d7c70baa919 100644
--- a/Mage.Sets/src/mage/cards/s/SupremeWill.java
+++ b/Mage.Sets/src/mage/cards/s/SupremeWill.java
@@ -1,17 +1,14 @@
-
package mage.cards.s;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.costs.mana.GenericManaCost;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.CounterUnlessPaysEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import mage.target.TargetSpell;
/**
@@ -28,7 +25,7 @@ public final class SupremeWill extends CardImpl {
this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(3)));
// or Look at the top four cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.
- Mode mode = new Mode(new LookLibraryAndPickControllerEffect(StaticValue.get(4), false, StaticValue.get(1), StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false));
+ Mode mode = new Mode(new LookLibraryAndPickControllerEffect(4, 1, PutCards.HAND, PutCards.BOTTOM_ANY));
this.getSpellAbility().addMode(mode);
}
diff --git a/Mage.Sets/src/mage/cards/t/TaigamSidisisHand.java b/Mage.Sets/src/mage/cards/t/TaigamSidisisHand.java
index 945448bd291..b7a40e13288 100644
--- a/Mage.Sets/src/mage/cards/t/TaigamSidisisHand.java
+++ b/Mage.Sets/src/mage/cards/t/TaigamSidisisHand.java
@@ -6,39 +6,30 @@ import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.costs.Cost;
-import mage.abilities.costs.common.ExileFromGraveCost;
+import mage.abilities.costs.common.ExileXFromYourGraveCost;
import mage.abilities.costs.common.TapSourceCost;
-import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
-import mage.abilities.effects.ContinuousEffect;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.costs.mana.ColoredManaCost;
+import mage.abilities.dynamicvalue.DynamicValue;
+import mage.abilities.dynamicvalue.common.GetXValue;
+import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.SkipDrawStepEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Outcome;
-import mage.constants.SubType;
-import mage.constants.SuperType;
-import mage.constants.TargetController;
-import mage.constants.Zone;
+import mage.constants.*;
import mage.filter.StaticFilters;
-import mage.game.Game;
-import mage.game.permanent.Permanent;
-import mage.players.Player;
-import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetCreaturePermanent;
-import mage.target.targetpointer.FixedTarget;
/**
*
- * @author spjspj
+ * @author awjackson
*/
public final class TaigamSidisisHand extends CardImpl {
+ private static final DynamicValue xValue = new SignInversionDynamicValue(GetXValue.instance);
+
public TaigamSidisisHand(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{B}");
@@ -49,16 +40,20 @@ public final class TaigamSidisisHand extends CardImpl {
this.toughness = new MageInt(4);
// Skip your draw step.
- this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipDrawStepEffect()));
+ this.addAbility(new SimpleStaticAbility(new SkipDrawStepEffect()));
- // At the beginning of your upkeep, look at the top three cards of your library. Put one of them into your hand and the rest into your graveyard.
- this.addAbility(new BeginningOfUpkeepTriggeredAbility(new LookLibraryAndPickControllerEffect(StaticValue.get(3), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false), TargetController.YOU, false));
+ // At the beginning of your upkeep, look at the top three cards of your library.
+ // Put one of them into your hand and the rest into your graveyard.
+ this.addAbility(new BeginningOfUpkeepTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.GRAVEYARD),
+ TargetController.YOU, false));
// {B}, {T}, Exile X cards from your graveyard: Target creature gets -X/-X until end of turn.
- Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TaigamSidisisHandEffect(), new ManaCostsImpl("{B}"));
+ Ability ability = new SimpleActivatedAbility(
+ new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn),
+ new ColoredManaCost(ColoredManaSymbol.B));
ability.addCost(new TapSourceCost());
- ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, StaticFilters.FILTER_CARDS_FROM_YOUR_GRAVEYARD)));
+ ability.addCost(new ExileXFromYourGraveCost(StaticFilters.FILTER_CARDS_FROM_YOUR_GRAVEYARD));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
@@ -72,41 +67,3 @@ public final class TaigamSidisisHand extends CardImpl {
return new TaigamSidisisHand(this);
}
}
-
-class TaigamSidisisHandEffect extends OneShotEffect {
-
- public TaigamSidisisHandEffect() {
- super(Outcome.Benefit);
- this.staticText = "creature gets -X/-X until end of turn";
- }
-
- public TaigamSidisisHandEffect(final TaigamSidisisHandEffect effect) {
- super(effect);
- }
-
- @Override
- public TaigamSidisisHandEffect copy() {
- return new TaigamSidisisHandEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- if (controller != null) {
- Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
-
- if (targetCreature != null) {
- int amount = 0;
- for (Cost cost : source.getCosts()) {
- if (cost instanceof ExileFromGraveCost) {
- amount = ((ExileFromGraveCost) cost).getExiledCards().size();
- ContinuousEffect effect = new BoostTargetEffect(-amount, -amount, Duration.EndOfTurn);
- effect.setTargetPointer(new FixedTarget(source.getTargets().getFirstTarget(), game));
- game.addEffect(effect, source);
- }
- }
- }
- }
- return false;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/t/TaigamsScheming.java b/Mage.Sets/src/mage/cards/t/TaigamsScheming.java
index 21646bd1a01..746d8cf2e05 100644
--- a/Mage.Sets/src/mage/cards/t/TaigamsScheming.java
+++ b/Mage.Sets/src/mage/cards/t/TaigamsScheming.java
@@ -1,14 +1,11 @@
-
package mage.cards.t;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
/**
*
@@ -20,8 +17,7 @@ public final class TaigamsScheming extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{U}");
// Look at the top five cards of your library. Put any number of them into your graveyard and the rest back on top of your library in any order
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(5), false, StaticValue.get(5),
- new FilterCard("cards"), Zone.LIBRARY, true, false, true, Zone.GRAVEYARD, false));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(5, Integer.MAX_VALUE, PutCards.GRAVEYARD, PutCards.TOP_ANY));
}
private TaigamsScheming(final TaigamsScheming card) {
diff --git a/Mage.Sets/src/mage/cards/t/TappingAtTheWindow.java b/Mage.Sets/src/mage/cards/t/TappingAtTheWindow.java
index 5b6fa979fbc..6e0604fc50e 100644
--- a/Mage.Sets/src/mage/cards/t/TappingAtTheWindow.java
+++ b/Mage.Sets/src/mage/cards/t/TappingAtTheWindow.java
@@ -1,18 +1,13 @@
package mage.cards.t;
-import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.FlashbackAbility;
-import mage.cards.*;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
-import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
@@ -24,8 +19,11 @@ public final class TappingAtTheWindow extends CardImpl {
public TappingAtTheWindow(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}");
- // Look at the top three cards of your library. You may reveal a creature card from among them and put it into your hand. Put the rest into your graveyard.
- this.getSpellAbility().addEffect(new TappingAtTheWindowEffect());
+ // Look at the top three cards of your library.
+ // You may reveal a creature card from among them and put it into your hand.
+ // Put the rest into your graveyard.
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
+ 3, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.GRAVEYARD));
// Flashback {2}{G}
this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{2}{G}")));
@@ -40,42 +38,3 @@ public final class TappingAtTheWindow extends CardImpl {
return new TappingAtTheWindow(this);
}
}
-
-class TappingAtTheWindowEffect extends OneShotEffect {
-
- TappingAtTheWindowEffect() {
- super(Outcome.Benefit);
- staticText = "look at the top three cards of your library. You may reveal a creature card " +
- "from among them and put it into your hand. Put the rest into your graveyard";
- }
-
- private TappingAtTheWindowEffect(final TappingAtTheWindowEffect effect) {
- super(effect);
- }
-
- @Override
- public TappingAtTheWindowEffect copy() {
- return new TappingAtTheWindowEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- if (player == null) {
- return false;
- }
- Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 3));
- TargetCard target = new TargetCardInLibrary(
- 0, 1, StaticFilters.FILTER_CARD_CREATURE
- );
- player.choose(outcome, cards, target, game);
- Card card = game.getCard(target.getFirstTarget());
- if (card != null) {
- player.revealCards(source, new CardsImpl(card), game);
- player.moveCards(card, Zone.HAND, source, game);
- }
- cards.retainZone(Zone.LIBRARY, game);
- player.moveCards(card, Zone.GRAVEYARD, source, game);
- return true;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/t/TazriBeaconOfUnity.java b/Mage.Sets/src/mage/cards/t/TazriBeaconOfUnity.java
index 034ee4d1b4c..f38d11082a1 100644
--- a/Mage.Sets/src/mage/cards/t/TazriBeaconOfUnity.java
+++ b/Mage.Sets/src/mage/cards/t/TazriBeaconOfUnity.java
@@ -7,8 +7,8 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.PartyCount;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.cost.SpellCostReductionForEachSourceEffect;
import mage.abilities.hint.common.PartyCountHint;
import mage.constants.SubType;
@@ -52,13 +52,9 @@ public final class TazriBeaconOfUnity extends CardImpl {
).addHint(PartyCountHint.instance));
// {2/U}{2/B}{2/R}{2/G}: Look at the top six cards of your library. You may reveal up to two Cleric, Rogue, Warrior, Wizard, and/or Ally cards from among them and put them into your hand. Put the rest on the bottom of your library in a random order.
- this.addAbility(new SimpleActivatedAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(6), false, StaticValue.get(2), filter, Zone.LIBRARY, false,
- true, true, Zone.HAND, true, false, false
- ).setBackInRandomOrder(true).setText("Look at the top six cards of your library. You may reveal up to two " +
- "Cleric, Rogue, Warrior, Wizard, and/or Ally cards from among them and put them into your hand. " +
- "Put the rest on the bottom of your library in a random order."
- ), new ManaCostsImpl<>("{2/U}{2/B}{2/R}{2/G}")));
+ this.addAbility(new SimpleActivatedAbility(
+ new LookLibraryAndPickControllerEffect(6, 2, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM),
+ new ManaCostsImpl<>("{2/U}{2/B}{2/R}{2/G}")));
}
private TazriBeaconOfUnity(final TazriBeaconOfUnity card) {
diff --git a/Mage.Sets/src/mage/cards/t/TeferiTemporalArchmage.java b/Mage.Sets/src/mage/cards/t/TeferiTemporalArchmage.java
index d8b152d4d62..cf3a8b8610d 100644
--- a/Mage.Sets/src/mage/cards/t/TeferiTemporalArchmage.java
+++ b/Mage.Sets/src/mage/cards/t/TeferiTemporalArchmage.java
@@ -1,20 +1,17 @@
-
package mage.cards.t;
import java.util.UUID;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.CanBeYourCommanderAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.game.command.emblems.TeferiTemporalArchmageEmblem;
import mage.target.TargetPermanent;
@@ -33,8 +30,7 @@ public final class TeferiTemporalArchmage extends CardImpl {
this.setStartingLoyalty(5);
// +1: Look at the top two cards of your library. Put one of them into your hand and the other on the bottom of your library.
- this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(2), false, StaticValue.get(1), new FilterCard(), Zone.LIBRARY, false, false), 1));
+ this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(2, 1, PutCards.HAND, PutCards.BOTTOM_ANY), 1));
// -1: Untap up to four target permanents.
LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new UntapTargetEffect(), -1);
diff --git a/Mage.Sets/src/mage/cards/t/TeferiWhoSlowsTheSunset.java b/Mage.Sets/src/mage/cards/t/TeferiWhoSlowsTheSunset.java
index faa9180f894..58a0e3f0603 100644
--- a/Mage.Sets/src/mage/cards/t/TeferiWhoSlowsTheSunset.java
+++ b/Mage.Sets/src/mage/cards/t/TeferiWhoSlowsTheSunset.java
@@ -2,18 +2,17 @@ package mage.cards.t;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.command.emblems.TeferiWhoSlowsTheSunsetEmblem;
import mage.game.permanent.Permanent;
@@ -45,10 +44,7 @@ public final class TeferiWhoSlowsTheSunset extends CardImpl {
this.addAbility(ability);
// −2: Look at the top three cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.
- this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, false, false
- ), -2));
+ this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.BOTTOM_ANY), -2));
// −7: You get an emblem with "Untap all permanents you control during each opponent's untap step" and "You draw a card during each opponent's draw step."
this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new TeferiWhoSlowsTheSunsetEmblem()), -7));
diff --git a/Mage.Sets/src/mage/cards/t/TezzeretAgentOfBolas.java b/Mage.Sets/src/mage/cards/t/TezzeretAgentOfBolas.java
index 3efbb5d90a3..4a5b9295ce4 100644
--- a/Mage.Sets/src/mage/cards/t/TezzeretAgentOfBolas.java
+++ b/Mage.Sets/src/mage/cards/t/TezzeretAgentOfBolas.java
@@ -8,6 +8,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
import mage.cards.CardImpl;
@@ -17,7 +18,6 @@ import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
@@ -30,12 +30,6 @@ import mage.target.common.TargetArtifactPermanent;
*/
public final class TezzeretAgentOfBolas extends CardImpl {
- private static final FilterCard filter = new FilterCard("an artifact card");
-
- static {
- filter.add(CardType.ARTIFACT.getPredicate());
- }
-
public TezzeretAgentOfBolas(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{U}{B}");
this.addSuperType(SuperType.LEGENDARY);
@@ -43,8 +37,10 @@ public final class TezzeretAgentOfBolas extends CardImpl {
this.setStartingLoyalty(3);
- // +1: Look at the top five cards of your library. You may reveal an artifact card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
- this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(5, 1, filter, true), 1));
+ // +1: Look at the top five cards of your library. You may reveal an artifact card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in any order.
+ this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(
+ 5, 1, StaticFilters.FILTER_CARD_ARTIFACT_AN, PutCards.HAND, PutCards.BOTTOM_ANY), 1));
// -1: Target artifact becomes an artifact creature with base power and toughness 5/5.
Effect effect = new AddCardTypeTargetEffect(Duration.EndOfGame, CardType.ARTIFACT, CardType.CREATURE);
diff --git a/Mage.Sets/src/mage/cards/t/TezzeretsGatebreaker.java b/Mage.Sets/src/mage/cards/t/TezzeretsGatebreaker.java
index 8be6e01f08e..cc18ad958e4 100644
--- a/Mage.Sets/src/mage/cards/t/TezzeretsGatebreaker.java
+++ b/Mage.Sets/src/mage/cards/t/TezzeretsGatebreaker.java
@@ -8,14 +8,13 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.combat.CantBeBlockedAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.filter.predicate.Predicates;
@@ -41,13 +40,7 @@ public final class TezzeretsGatebreaker extends CardImpl {
// When Tezzeret's Gatebreaker enters the battlefield, look at the top five cards of your library. You may reveal a blue or artifact card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
this.addAbility(new EntersBattlefieldTriggeredAbility(
- new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), filter,
- Zone.LIBRARY, false, true, false, Zone.HAND, true, false, false
- ).setBackInRandomOrder(true).setText("look at the top five cards of your library. "
- + "You may reveal a blue or artifact card from among them and put it into your hand. "
- + "Put the rest on the bottom of your library in a random order.")
- ));
+ new LookLibraryAndPickControllerEffect(5, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM)));
// {5}{U}, {T}, Sacrifice Tezzeret's Gatebreaker: Creatures you control can't be blocked this turn.
Ability ability = new SimpleActivatedAbility(
diff --git a/Mage.Sets/src/mage/cards/t/ThassasIntervention.java b/Mage.Sets/src/mage/cards/t/ThassasIntervention.java
index 1f9db130bc2..55a5ba1b9fe 100644
--- a/Mage.Sets/src/mage/cards/t/ThassasIntervention.java
+++ b/Mage.Sets/src/mage/cards/t/ThassasIntervention.java
@@ -4,14 +4,12 @@ import mage.abilities.Mode;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.MultipliedValue;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.CounterUnlessPaysEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import mage.target.TargetSpell;
import java.util.UUID;
@@ -29,14 +27,7 @@ public final class ThassasIntervention extends CardImpl {
// Choose one-
// • Look at the top X cards of your library. Put up to two of them into your hand and the rest on the bottom of your library in a random order.
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- ManacostVariableValue.REGULAR, false, StaticValue.get(2),
- StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false,
- true, Zone.HAND, true, false, false
- ).setBackInRandomOrder(true).setText(
- "Look at the top X cards of your library. Put up to two of them into your hand " +
- "and the rest on the bottom of your library in a random order."
- )
- );
+ ManacostVariableValue.REGULAR, 2, PutCards.HAND, PutCards.BOTTOM_RANDOM, true));
// • Counter target spell unless its controller pays twice {X}.
Mode mode = new Mode(new CounterUnlessPaysEffect(xValue)
diff --git a/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java b/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java
index 39291aab6c4..f5b79931e3c 100644
--- a/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java
+++ b/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java
@@ -1,13 +1,12 @@
-
package mage.cards.t;
import java.util.UUID;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.common.SagaAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@@ -17,7 +16,6 @@ import mage.constants.Outcome;
import mage.constants.SagaChapter;
import mage.constants.SubLayer;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
@@ -36,10 +34,10 @@ public final class TheAntiquitiesWar extends CardImpl {
// (As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.)
SagaAbility sagaAbility = new SagaAbility(this);
- // I, II — Look at the top five cards of your library. You may reveal an artifact card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
+ // I, II — Look at the top five cards of your library. You may reveal an artifact card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_I, SagaChapter.CHAPTER_II,
- new LookLibraryAndPickControllerEffect(StaticValue.get(5), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD_ARTIFACT_AN, Zone.LIBRARY, false, true, false, Zone.HAND, true, true, false).setBackInRandomOrder(true));
+ new LookLibraryAndPickControllerEffect(5, 1, StaticFilters.FILTER_CARD_ARTIFACT_AN, PutCards.HAND, PutCards.BOTTOM_RANDOM));
// III — Artifacts you control become artifact creatures with base power and toughness 5/5 until end of turn.
sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_III, new TheAntiquitiesWarEffect());
diff --git a/Mage.Sets/src/mage/cards/t/ThievesFortune.java b/Mage.Sets/src/mage/cards/t/ThievesFortune.java
index 4730b51465c..27e9fdf5779 100644
--- a/Mage.Sets/src/mage/cards/t/ThievesFortune.java
+++ b/Mage.Sets/src/mage/cards/t/ThievesFortune.java
@@ -1,16 +1,13 @@
-
package mage.cards.t;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.ProwlAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
/**
*
@@ -26,7 +23,7 @@ public final class ThievesFortune extends CardImpl {
this.addAbility(new ProwlAbility(this, "{U}"));
// Look at the top four cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(StaticValue.get(4), false, StaticValue.get(1), StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(4, 1, PutCards.HAND, PutCards.BOTTOM_ANY));
}
private ThievesFortune(final ThievesFortune card) {
diff --git a/Mage.Sets/src/mage/cards/t/TomorrowAzamisFamiliar.java b/Mage.Sets/src/mage/cards/t/TomorrowAzamisFamiliar.java
index 97c9c3284ce..a054f43c034 100644
--- a/Mage.Sets/src/mage/cards/t/TomorrowAzamisFamiliar.java
+++ b/Mage.Sets/src/mage/cards/t/TomorrowAzamisFamiliar.java
@@ -1,17 +1,15 @@
-
package mage.cards.t;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
-import mage.filter.FilterCard;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -30,7 +28,7 @@ public final class TomorrowAzamisFamiliar extends CardImpl {
this.toughness = new MageInt(5);
// If you would draw a card, look at the top three cards of your library instead. Put one of those cards into your hand and the rest on the bottom of your library in any order.
- this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TomorrowAzamisFamiliarReplacementEffect()));
+ this.addAbility(new SimpleStaticAbility(new TomorrowAzamisFamiliarReplacementEffect()));
}
private TomorrowAzamisFamiliar(final TomorrowAzamisFamiliar card) {
@@ -66,8 +64,7 @@ class TomorrowAzamisFamiliarReplacementEffect extends ReplacementEffectImpl {
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
- new LookLibraryAndPickControllerEffect(StaticValue.get(3), false, StaticValue.get(1), new FilterCard(), Zone.LIBRARY, false, false)
- .apply(game, source);
+ new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.BOTTOM_ANY).apply(game, source);
return true;
}
diff --git a/Mage.Sets/src/mage/cards/t/TowerGeist.java b/Mage.Sets/src/mage/cards/t/TowerGeist.java
index 05a0d666c27..1e6b89582e6 100644
--- a/Mage.Sets/src/mage/cards/t/TowerGeist.java
+++ b/Mage.Sets/src/mage/cards/t/TowerGeist.java
@@ -32,15 +32,13 @@ package mage.cards.t;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
/**
*
@@ -58,9 +56,10 @@ public final class TowerGeist extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
- // When Tower Geist enters the battlefield, look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.
+ // When Tower Geist enters the battlefield, look at the top two cards of your library.
+ // Put one of them into your hand and the other into your graveyard.
this.addAbility(new EntersBattlefieldTriggeredAbility(
- new LookLibraryAndPickControllerEffect(StaticValue.get(2), false, StaticValue.get(1), new FilterCard(), Zone.GRAVEYARD, false, false)));
+ new LookLibraryAndPickControllerEffect(2, 1, PutCards.HAND, PutCards.GRAVEYARD)));
}
private TowerGeist(final TowerGeist card) {
diff --git a/Mage.Sets/src/mage/cards/t/TrackersInstincts.java b/Mage.Sets/src/mage/cards/t/TrackersInstincts.java
index a224dec3fec..55591bf01dd 100644
--- a/Mage.Sets/src/mage/cards/t/TrackersInstincts.java
+++ b/Mage.Sets/src/mage/cards/t/TrackersInstincts.java
@@ -1,29 +1,18 @@
-
package mage.cards.t;
import java.util.UUID;
-import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.abilities.effects.common.RevealLibraryPickControllerEffect;
import mage.abilities.keyword.FlashbackAbility;
-import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.cards.Cards;
-import mage.cards.CardsImpl;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.TimingRule;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
-import mage.filter.common.FilterCreatureCard;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
/**
*
- * @author North
+ * @author awjackson
*/
public final class TrackersInstincts extends CardImpl {
@@ -31,7 +20,9 @@ public final class TrackersInstincts extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}");
// Reveal the top four cards of your library. Put a creature card from among them into your hand and the rest into your graveyard.
- this.getSpellAbility().addEffect(new TrackersInstinctsEffect());
+ this.getSpellAbility().addEffect(new RevealLibraryPickControllerEffect(
+ 4, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.GRAVEYARD, false));
+
// Flashback {2}{U}
this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{2}{U}")));
}
@@ -45,43 +36,3 @@ public final class TrackersInstincts extends CardImpl {
return new TrackersInstincts(this);
}
}
-
-class TrackersInstinctsEffect extends OneShotEffect {
-
- public TrackersInstinctsEffect() {
- super(Outcome.DrawCard);
- this.staticText = "Reveal the top four cards of your library. Put a creature card from among them into your hand and the rest into your graveyard";
- }
-
- public TrackersInstinctsEffect(final TrackersInstinctsEffect effect) {
- super(effect);
- }
-
- @Override
- public TrackersInstinctsEffect copy() {
- return new TrackersInstinctsEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- if (controller != null) {
- Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 4));
- boolean creaturesFound = cards.count(StaticFilters.FILTER_CARD_CREATURE, game) > 0;
- if (!cards.isEmpty()) {
- controller.revealCards(source, cards, game);
- TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCreatureCard("creature card to put in hand"));
- if (creaturesFound && controller.choose(Outcome.DrawCard, cards, target, game)) {
- Card card = game.getCard(target.getFirstTarget());
- if (card != null) {
- controller.moveCards(card, Zone.HAND, source, game);
- cards.remove(card);
- }
- }
- controller.moveCards(cards, Zone.GRAVEYARD, source, game);
- }
- return true;
- }
- return false;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/t/TrailOfCrumbs.java b/Mage.Sets/src/mage/cards/t/TrailOfCrumbs.java
index 707eaa50630..7639faa551e 100644
--- a/Mage.Sets/src/mage/cards/t/TrailOfCrumbs.java
+++ b/Mage.Sets/src/mage/cards/t/TrailOfCrumbs.java
@@ -6,13 +6,13 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
-import mage.filter.FilterCard;
-import mage.filter.common.FilterPermanentCard;
+import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
@@ -31,7 +31,9 @@ public final class TrailOfCrumbs extends CardImpl {
// When Trail of Crumbs enters the battlefield, create a Food token.
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new FoodToken())));
- // Whenever you sacrifice a Food, you may pay {1}. If you do, look at the top two cards of your library. You may reveal a permanent card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
+ // Whenever you sacrifice a Food, you may pay {1}. If you do, look at the top two cards of your library.
+ // You may reveal a permanent card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in any order.
this.addAbility(new TrailOfCrumbsTriggeredAbility());
}
@@ -47,11 +49,9 @@ public final class TrailOfCrumbs extends CardImpl {
class TrailOfCrumbsTriggeredAbility extends TriggeredAbilityImpl {
- private static final FilterCard filter = new FilterPermanentCard();
-
TrailOfCrumbsTriggeredAbility() {
super(Zone.BATTLEFIELD, new DoIfCostPaid(new LookLibraryAndPickControllerEffect(
- 2, 1, filter, true, true, Zone.HAND, true
+ 2, 1, StaticFilters.FILTER_CARD_PERMANENT, PutCards.HAND, PutCards.BOTTOM_ANY
), new GenericManaCost(1)));
}
@@ -78,9 +78,7 @@ class TrailOfCrumbsTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public String getRule() {
- return "Whenever you sacrifice a Food, you may pay {1}. If you do, " +
- "look at the top two cards of your library. You may reveal a permanent card from among them " +
- "and put it into your hand. Put the rest on the bottom of your library in any order.";
+ public String getTriggerPhrase() {
+ return "Whenever you sacrifice a Food, ";
}
}
diff --git a/Mage.Sets/src/mage/cards/t/TraverseTheUlvenwald.java b/Mage.Sets/src/mage/cards/t/TraverseTheUlvenwald.java
index 865a23dffbd..3f1bf860b31 100644
--- a/Mage.Sets/src/mage/cards/t/TraverseTheUlvenwald.java
+++ b/Mage.Sets/src/mage/cards/t/TraverseTheUlvenwald.java
@@ -1,16 +1,14 @@
package mage.cards.t;
-import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.common.DeliriumCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.abilities.hint.common.CardTypesInGraveyardHint;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
+import mage.constants.AbilityWord;
import mage.constants.CardType;
-import mage.filter.FilterCard;
import mage.filter.StaticFilters;
-import mage.filter.predicate.Predicates;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
@@ -20,29 +18,19 @@ import java.util.UUID;
*/
public final class TraverseTheUlvenwald extends CardImpl {
- private static final FilterCard filter = new FilterCard("a creature or land card");
-
- static {
- filter.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.LAND.getPredicate()));
- }
+ private static final String rule = "Search your library for a basic land card, reveal it, put it into your hand, then shuffle.
" +
+ AbilityWord.DELIRIUM.formatWord() + "If " + DeliriumCondition.instance.toString() +
+ ", instead search your library for a creature or land card, reveal it, put it into your hand, then shuffle.";
public TraverseTheUlvenwald(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}");
// Search your library for a basic land card, reveal it, put it into your hand, then shuffle your library.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
+ new SearchLibraryPutInHandEffect(new TargetCardInLibrary(1, 1, StaticFilters.FILTER_CARD_CREATURE_OR_LAND), true),
new SearchLibraryPutInHandEffect(new TargetCardInLibrary(1, 1, StaticFilters.FILTER_CARD_BASIC_LAND), true),
- new InvertCondition(DeliriumCondition.instance),
- "Search your library for a basic land card, reveal it, put it into your hand, then shuffle."));
-
- // Delirium — If there are four or more card types among cards in your graveyard, instead search your library
- // for a creature or land card, reveal it, put it into your hand, then shuffle your library.
- this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
- new SearchLibraryPutInHandEffect(new TargetCardInLibrary(1, 1, filter), true),
- DeliriumCondition.instance,
- "
Delirium — If there are four or more card types among cards in your graveyard, instead search your library for a creature or land card, "
- + "reveal it, put it into your hand, then shuffle."));
- this.getSpellAbility().addHint(CardTypesInGraveyardHint.YOU);
+ DeliriumCondition.instance, rule
+ ));
}
private TraverseTheUlvenwald(final TraverseTheUlvenwald card) {
diff --git a/Mage.Sets/src/mage/cards/u/UncoveredClues.java b/Mage.Sets/src/mage/cards/u/UncoveredClues.java
index 8acbbdf3868..976afa743f2 100644
--- a/Mage.Sets/src/mage/cards/u/UncoveredClues.java
+++ b/Mage.Sets/src/mage/cards/u/UncoveredClues.java
@@ -1,14 +1,13 @@
-
-
package mage.cards.u;
import java.util.UUID;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterCard;
-import mage.filter.predicate.Predicates;
+import mage.filter.common.FilterInstantOrSorceryCard;
/**
*
@@ -18,17 +17,13 @@ import mage.filter.predicate.Predicates;
public final class UncoveredClues extends CardImpl {
- private static final FilterCard filter = new FilterCard("up to two instant and/or sorcery cards");
- static {
- filter.add(Predicates.or(CardType.INSTANT.getPredicate(), CardType.SORCERY.getPredicate()));
- }
+ private static final FilterCard filter = new FilterInstantOrSorceryCard("instant and/or sorcery cards");
public UncoveredClues(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{U}");
-
// Look at the top four cards of your library. You may reveal up to two instant and/or sorcery cards from among them and put the revealed cards into your hand. Put the rest on the bottom of your library in any order.
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(4, 2, filter, true));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(4, 2, filter, PutCards.HAND, PutCards.BOTTOM_ANY));
}
private UncoveredClues(final UncoveredClues card) {
diff --git a/Mage.Sets/src/mage/cards/u/UnderrealmLich.java b/Mage.Sets/src/mage/cards/u/UnderrealmLich.java
index 088531f5378..1ca93be83fd 100644
--- a/Mage.Sets/src/mage/cards/u/UnderrealmLich.java
+++ b/Mage.Sets/src/mage/cards/u/UnderrealmLich.java
@@ -6,9 +6,9 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.PayLifeCost;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.IndestructibleAbility;
@@ -18,8 +18,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -39,13 +37,10 @@ public final class UnderrealmLich extends CardImpl {
this.toughness = new MageInt(3);
// If you would draw a card, instead look at the top three cards of your library, then put one into your hand and the rest into your graveyard.
- this.addAbility(new SimpleStaticAbility(
- Zone.BATTLEFIELD, new UnderrealmLichReplacementEffect()
- ));
+ this.addAbility(new SimpleStaticAbility(new UnderrealmLichReplacementEffect()));
// Pay 4 life: Underrealm Lich gains indestructible until end of turn. Tap it.
Ability ability = new SimpleActivatedAbility(
- Zone.BATTLEFIELD,
new GainAbilitySourceEffect(
IndestructibleAbility.getInstance(),
Duration.EndOfTurn
@@ -90,11 +85,8 @@ class UnderrealmLichReplacementEffect extends ReplacementEffectImpl {
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
- return new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.GRAVEYARD,
- false, false, false, Zone.HAND, false
- ).apply(game, source);
+ new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.GRAVEYARD).apply(game, source);
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/cards/u/UnityOfTheDroids.java b/Mage.Sets/src/mage/cards/u/UnityOfTheDroids.java
index 8b66cc0190d..381930217f4 100644
--- a/Mage.Sets/src/mage/cards/u/UnityOfTheDroids.java
+++ b/Mage.Sets/src/mage/cards/u/UnityOfTheDroids.java
@@ -1,18 +1,15 @@
-
package mage.cards.u;
import java.util.UUID;
import mage.abilities.Mode;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.PreventDamageToTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.target.common.TargetCreaturePermanent;
@@ -40,7 +37,7 @@ public final class UnityOfTheDroids extends CardImpl {
this.getSpellAbility().addTarget(new TargetCreaturePermanent(artifactCreatureFilter));
// Look at the top four cards of your library. Put one of them into your hand and the rest into your graveyard.
- Mode mode = new Mode(new LookLibraryAndPickControllerEffect(StaticValue.get(4), false, StaticValue.get(1), new FilterCard(), Zone.GRAVEYARD, false, false));
+ Mode mode = new Mode(new LookLibraryAndPickControllerEffect(4, 1, PutCards.HAND, PutCards.GRAVEYARD));
this.getSpellAbility().addMode(mode);
// Destroy target nonartifact creature.
diff --git a/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java b/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java
index ef83c36aa2d..5e24861e04c 100644
--- a/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java
+++ b/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java
@@ -10,6 +10,7 @@ import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.*;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.continuous.*;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.DistributeCountersEffect;
@@ -212,7 +213,7 @@ class UrzaAcademyHeadmasterRandomEffect extends OneShotEffect {
break;
case 17: // TEZZERET AGENT OF BOLAS 1
sb.append("Look at the top five cards of your library. You may reveal an artifact card from among them and put it into your hand. Put the rest on the bottom of your library in any order.");
- effects.add(new LookLibraryAndPickControllerEffect(5, 1, new FilterArtifactCard(), true));
+ effects.add(new LookLibraryAndPickControllerEffect(5, 1, StaticFilters.FILTER_CARD_ARTIFACT_AN, PutCards.HAND, PutCards.BOTTOM_ANY));
break;
case 18: // UGIN 1
sb.append("Urza deals 3 damage to any target.");
diff --git a/Mage.Sets/src/mage/cards/v/VesselOfNascency.java b/Mage.Sets/src/mage/cards/v/VesselOfNascency.java
index ab32f4d9eff..16672da473c 100644
--- a/Mage.Sets/src/mage/cards/v/VesselOfNascency.java
+++ b/Mage.Sets/src/mage/cards/v/VesselOfNascency.java
@@ -1,39 +1,43 @@
-
package mage.cards.v;
import java.util.UUID;
-import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.effects.OneShotEffect;
-import mage.cards.Card;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.abilities.effects.common.RevealLibraryPickControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.cards.Cards;
-import mage.cards.CardsImpl;
import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.TargetCard;
/**
*
- * @author fireshoes
+ * @author awjackson
*/
public final class VesselOfNascency extends CardImpl {
+ private static final FilterCard filter = new FilterCard("an artifact, creature, enchantment, land, or planeswalker card");
+
+ static {
+ filter.add(Predicates.or(CardType.ARTIFACT.getPredicate(),
+ CardType.CREATURE.getPredicate(),
+ CardType.ENCHANTMENT.getPredicate(),
+ CardType.LAND.getPredicate(),
+ CardType.PLANESWALKER.getPredicate()
+ ));
+ }
+
public VesselOfNascency(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}");
// {1}{G}, Sacrifice Vessel of Nascency: Reveal the top four cards of your library. You may put an artifact, creature, enchantment, land, or
// planeswalker card from among them into your hand. Put the rest into your graveyard.
- Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new VesselOfNascencyEffect(), new ManaCostsImpl("{1}{G}"));
+ Ability ability = new SimpleActivatedAbility(
+ new RevealLibraryPickControllerEffect(4, 1, filter, PutCards.HAND, PutCards.GRAVEYARD),
+ new ManaCostsImpl("{1}{G}"));
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
}
@@ -47,58 +51,3 @@ public final class VesselOfNascency extends CardImpl {
return new VesselOfNascency(this);
}
}
-
-class VesselOfNascencyEffect extends OneShotEffect {
-
- private static final FilterCard filterPutInHand = new FilterCard("an artifact, creature, enchantment, land, or planeswalker card");
-
- static {
- filterPutInHand.add(Predicates.or(CardType.ARTIFACT.getPredicate(),
- CardType.CREATURE.getPredicate(),
- CardType.ENCHANTMENT.getPredicate(),
- CardType.LAND.getPredicate(),
- CardType.PLANESWALKER.getPredicate()));
- }
-
- public VesselOfNascencyEffect() {
- super(Outcome.DrawCard);
- this.staticText = "reveal the top four cards of your library. You may put artifact, creature, enchantment, land, or planeswalker card from among "
- + "them into your hand. Put the rest into your graveyard";
- }
-
- public VesselOfNascencyEffect(final VesselOfNascencyEffect effect) {
- super(effect);
- }
-
- @Override
- public VesselOfNascencyEffect copy() {
- return new VesselOfNascencyEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- MageObject sourceObject = game.getObject(source);
- if (controller != null && sourceObject != null) {
- Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 4));
- boolean properCardFound = cards.count(filterPutInHand, source.getSourceId(), source, game) > 0;
- if (!cards.isEmpty()) {
- controller.revealCards(sourceObject.getName(), cards, game);
- TargetCard target = new TargetCard(Zone.LIBRARY, filterPutInHand);
- if (properCardFound
- && controller.chooseUse(outcome, "Put an artifact, creature, enchantment, land, or planeswalker card into your hand?", source, game)
- && controller.choose(Outcome.DrawCard, cards, target, game)) {
- Card card = game.getCard(target.getFirstTarget());
- if (card != null) {
- cards.remove(card);
- controller.moveCards(card, Zone.HAND, source, game);
- }
-
- }
- controller.moveCards(cards, Zone.GRAVEYARD, source, game);
- }
- return true;
- }
- return false;
- }
-}
diff --git a/Mage.Sets/src/mage/cards/v/VivienReid.java b/Mage.Sets/src/mage/cards/v/VivienReid.java
index f104b84fcda..afc38b1b9c2 100644
--- a/Mage.Sets/src/mage/cards/v/VivienReid.java
+++ b/Mage.Sets/src/mage/cards/v/VivienReid.java
@@ -3,18 +3,17 @@ package mage.cards.v;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.FlyingAbility;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
+import mage.filter.StaticFilters;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.AbilityPredicate;
@@ -27,15 +26,10 @@ import mage.target.TargetPermanent;
*/
public final class VivienReid extends CardImpl {
- private static final FilterCard filter = new FilterCard("a creature or land card");
- private static final FilterPermanent filter2 = new FilterPermanent("artifact, enchantment, or creature with flying");
+ private static final FilterPermanent filter = new FilterPermanent("artifact, enchantment, or creature with flying");
static {
filter.add(Predicates.or(
- CardType.CREATURE.getPredicate(),
- CardType.LAND.getPredicate()
- ));
- filter2.add(Predicates.or(
CardType.ARTIFACT.getPredicate(),
CardType.ENCHANTMENT.getPredicate(),
Predicates.and(
@@ -52,19 +46,14 @@ public final class VivienReid extends CardImpl {
this.subtype.add(SubType.VIVIEN);
this.setStartingLoyalty(5);
- // +1: Look at the top four cards of your library. You may reveal a creature or land card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
- this.addAbility(new LoyaltyAbility(
- new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(1), filter,
- Zone.LIBRARY, false, true, false, Zone.HAND, true, false, false)
- .setBackInRandomOrder(true)
- .setText("Look at the top four cards of your library. You may reveal a creature or land card from among them"
- + " and put it into your hand. Put the rest on the bottom of your library in a random order."), 1
- ));
+ // +1: Look at the top four cards of your library. You may reveal a creature or land card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
+ this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(
+ 4, 1, StaticFilters.FILTER_CARD_CREATURE_OR_LAND, PutCards.HAND, PutCards.BOTTOM_RANDOM), 1));
// -3: Destroy target artifact, enchantment, or creature with flying.
Ability ability = new LoyaltyAbility(new DestroyTargetEffect(), -3);
- ability.addTarget(new TargetPermanent(filter2));
+ ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
// -8: You get an emblem with "Creatures you control get +2/+2 and have vigilance, trample, and indestructible.
diff --git a/Mage.Sets/src/mage/cards/w/WakerOfWaves.java b/Mage.Sets/src/mage/cards/w/WakerOfWaves.java
index 7f843ae618e..5edb03419ca 100644
--- a/Mage.Sets/src/mage/cards/w/WakerOfWaves.java
+++ b/Mage.Sets/src/mage/cards/w/WakerOfWaves.java
@@ -1,4 +1,3 @@
-
package mage.cards.w;
import mage.MageInt;
@@ -7,13 +6,12 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.DiscardSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
-import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import java.util.UUID;
@@ -38,11 +36,12 @@ public final class WakerOfWaves extends CardImpl {
this.toughness = new MageInt(7);
// Creatures your opponents control get -1/-0.
- this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -0, Duration.WhileOnBattlefield, filter, false)));
+ this.addAbility(new SimpleStaticAbility(new BoostAllEffect(-1, -0, Duration.WhileOnBattlefield, filter, false)));
// {1}{U}, Discard Waker of Waves: Look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.
- Ability ability = new SimpleActivatedAbility(Zone.HAND, new LookLibraryAndPickControllerEffect(StaticValue.get(2), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false), new ManaCostsImpl("{1}{U}"));
+ Ability ability = new SimpleActivatedAbility(Zone.HAND,
+ new LookLibraryAndPickControllerEffect(2, 1, PutCards.HAND, PutCards.GRAVEYARD),
+ new ManaCostsImpl("{1}{U}"));
ability.addCost(new DiscardSourceCost());
this.addAbility(ability);
}
@@ -56,4 +55,3 @@ public final class WakerOfWaves extends CardImpl {
return new WakerOfWaves(this);
}
}
-
diff --git a/Mage.Sets/src/mage/cards/w/WanderingMind.java b/Mage.Sets/src/mage/cards/w/WanderingMind.java
index a1eb906b85d..bea533fceaf 100644
--- a/Mage.Sets/src/mage/cards/w/WanderingMind.java
+++ b/Mage.Sets/src/mage/cards/w/WanderingMind.java
@@ -2,14 +2,13 @@ package mage.cards.w;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterNonlandCard;
import mage.filter.predicate.Predicates;
@@ -21,7 +20,7 @@ import java.util.UUID;
*/
public final class WanderingMind extends CardImpl {
- private static final FilterCard filter = new FilterNonlandCard("noncreature, nonland card");
+ private static final FilterCard filter = new FilterNonlandCard("a noncreature, nonland card");
static {
filter.add(Predicates.not(CardType.CREATURE.getPredicate()));
@@ -38,12 +37,8 @@ public final class WanderingMind extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// When Wandering Mind enters the battlefield, look at the top six cards of your library. You may reveal a noncreature, nonland card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
- this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(6), false, StaticValue.get(1), filter, Zone.LIBRARY, false,
- true, false, Zone.HAND, true, false, false
- ).setBackInRandomOrder(true).setText("look at the top six cards of your library. " +
- "You may reveal a noncreature, nonland card from among them and put it into your hand. " +
- "Put the rest on the bottom of your library in a random order")));
+ this.addAbility(new EntersBattlefieldTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(6, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM)));
}
private WanderingMind(final WanderingMind card) {
diff --git a/Mage.Sets/src/mage/cards/w/WarlockClass.java b/Mage.Sets/src/mage/cards/w/WarlockClass.java
index 8b325b0cf87..a4e89a1e33d 100644
--- a/Mage.Sets/src/mage/cards/w/WarlockClass.java
+++ b/Mage.Sets/src/mage/cards/w/WarlockClass.java
@@ -6,9 +6,9 @@ import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.MorbidCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
import mage.abilities.effects.common.continuous.GainClassAbilitySourceEffect;
import mage.abilities.hint.common.MorbidHint;
@@ -17,7 +17,6 @@ import mage.abilities.keyword.ClassReminderAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
-import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
import mage.watchers.common.PlayerLostLifeWatcher;
@@ -49,10 +48,8 @@ public final class WarlockClass extends CardImpl {
this.addAbility(new ClassLevelAbility(2, "{1}{B}"));
// When this Class becomes level 2, look at the top three cards of your library. Put one of them into your hand and the rest into your graveyard.
- this.addAbility(new BecomesClassLevelTriggeredAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(3), false, StaticValue.get(1), StaticFilters.FILTER_CARD,
- Zone.GRAVEYARD, false, false, false, Zone.HAND, false
- ), 2));
+ this.addAbility(new BecomesClassLevelTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(3, 1, PutCards.HAND, PutCards.GRAVEYARD), 2));
// {6}{B}: Level 3
this.addAbility(new ClassLevelAbility(3, "{6}{B}"));
diff --git a/Mage.Sets/src/mage/cards/w/WarmWelcome.java b/Mage.Sets/src/mage/cards/w/WarmWelcome.java
new file mode 100644
index 00000000000..7627fdd79f4
--- /dev/null
+++ b/Mage.Sets/src/mage/cards/w/WarmWelcome.java
@@ -0,0 +1,40 @@
+package mage.cards.w;
+
+import mage.abilities.effects.common.CreateTokenEffect;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
+import mage.cards.CardImpl;
+import mage.cards.CardSetInfo;
+import mage.constants.CardType;
+import mage.filter.StaticFilters;
+import mage.game.permanent.token.CitizenGreenWhiteToken;
+
+import java.util.UUID;
+
+/**
+ * @author awjackson
+ */
+public final class WarmWelcome extends CardImpl {
+
+ public WarmWelcome(UUID ownerId, CardSetInfo setInfo) {
+ super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}");
+
+ // Look at the top five cards of your library.
+ // You may reveal a creature card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
+ 5, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.BOTTOM_RANDOM));
+
+ // Create a 1/1 green and white Citizen creature token.
+ this.getSpellAbility().addEffect(new CreateTokenEffect(new CitizenGreenWhiteToken()));
+ }
+
+ private WarmWelcome(final WarmWelcome card) {
+ super(card);
+ }
+
+ @Override
+ public WarmWelcome copy() {
+ return new WarmWelcome(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/cards/w/Weatherlight.java b/Mage.Sets/src/mage/cards/w/Weatherlight.java
index bb2e15f3467..a88e76e3a28 100644
--- a/Mage.Sets/src/mage/cards/w/Weatherlight.java
+++ b/Mage.Sets/src/mage/cards/w/Weatherlight.java
@@ -1,10 +1,9 @@
-
package mage.cards.w;
import mage.MageInt;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.CrewAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@@ -12,7 +11,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
-import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.HistoricPredicate;
@@ -40,14 +38,12 @@ public final class Weatherlight extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
- // Whenever Weatherlight deals combat damage to a player, look at the top five cards of your library. You may reveal a historic card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
+ // Whenever Weatherlight deals combat damage to a player, look at the top five cards of your library.
+ // You may reveal a historic card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(
- new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1), filter,
- Zone.LIBRARY, false, true, false, Zone.HAND,
- true, false, false
- ).setBackInRandomOrder(true), false
- ));
+ new LookLibraryAndPickControllerEffect(5, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM),
+ false));
// Crew 3
this.addAbility(new CrewAbility(3));
diff --git a/Mage.Sets/src/mage/cards/w/WildsongHowler.java b/Mage.Sets/src/mage/cards/w/WildsongHowler.java
index 39ef19a7e50..263b258493f 100644
--- a/Mage.Sets/src/mage/cards/w/WildsongHowler.java
+++ b/Mage.Sets/src/mage/cards/w/WildsongHowler.java
@@ -2,14 +2,13 @@ package mage.cards.w;
import mage.MageInt;
import mage.abilities.common.TransformsOrEntersTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.keyword.NightboundAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
import java.util.UUID;
@@ -28,12 +27,12 @@ public final class WildsongHowler extends CardImpl {
this.color.setGreen(true);
this.nightCard = true;
- // Whenever this creature enters the battlefield or transforms into Wildsong Howler, look at the top six cards of your library. You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
- this.addAbility(new TransformsOrEntersTriggeredAbility(new LookLibraryAndPickControllerEffect(
- StaticValue.get(5), false, StaticValue.get(1),
- StaticFilters.FILTER_CARD_CREATURE, Zone.LIBRARY, false,
- true, false, Zone.HAND, true, false, false
- ).setText("look at the top six cards of your library. You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in a random order"), false));
+ // Whenever this creature enters the battlefield or transforms into Wildsong Howler, look at the top six cards of your library.
+ // You may reveal a creature card from among them and put it into your hand.
+ // Put the rest on the bottom of your library in a random order.
+ this.addAbility(new TransformsOrEntersTriggeredAbility(
+ new LookLibraryAndPickControllerEffect(6, 1, StaticFilters.FILTER_CARD_CREATURE_A, PutCards.HAND, PutCards.BOTTOM_RANDOM),
+ false));
// Nightbound
this.addAbility(new NightboundAbility());
diff --git a/Mage.Sets/src/mage/cards/w/WitnessTheFuture.java b/Mage.Sets/src/mage/cards/w/WitnessTheFuture.java
index c5d103a3730..8f994100c71 100644
--- a/Mage.Sets/src/mage/cards/w/WitnessTheFuture.java
+++ b/Mage.Sets/src/mage/cards/w/WitnessTheFuture.java
@@ -2,14 +2,12 @@ package mage.cards.w;
import java.util.UUID;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.TargetPlayerShufflesTargetCardsEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
-import mage.constants.Zone;
-import mage.filter.StaticFilters;
import mage.target.TargetPlayer;
import mage.target.common.TargetCardInTargetPlayersGraveyard;
@@ -23,14 +21,12 @@ public final class WitnessTheFuture extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}");
// Target player shuffles up to four target cards from their graveyard into their library.
- // You look at the top four cards of your library, then put one of those cards into your hand and the rest on the bottom of your library in a random order.
+ // You look at the top four cards of your library, then put one of those cards into your hand
+ // and the rest on the bottom of your library in a random order.
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addTarget(new TargetCardInTargetPlayersGraveyard(4));
this.getSpellAbility().addEffect(new TargetPlayerShufflesTargetCardsEffect());
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
- StaticValue.get(4), false, StaticValue.get(1), StaticFilters.FILTER_CARD,
- Zone.LIBRARY, false, false, false, Zone.HAND, false, false, false
- ).setBackInRandomOrder(true));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(4, 1, PutCards.HAND, PutCards.BOTTOM_RANDOM).concatBy("You"));
}
private WitnessTheFuture(final WitnessTheFuture card) {
diff --git a/Mage.Sets/src/mage/cards/y/YodaJediMaster.java b/Mage.Sets/src/mage/cards/y/YodaJediMaster.java
index 9da18dcf9cc..b8e80a18156 100644
--- a/Mage.Sets/src/mage/cards/y/YodaJediMaster.java
+++ b/Mage.Sets/src/mage/cards/y/YodaJediMaster.java
@@ -5,11 +5,11 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
-import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@@ -18,8 +18,6 @@ import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Outcome;
import mage.constants.TargetController;
-import mage.constants.Zone;
-import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.game.Game;
@@ -49,10 +47,7 @@ public final class YodaJediMaster extends CardImpl {
this.setStartingLoyalty(3);
// +1: Look at the top two cards of your library. Put one on the bottom of your library.
- Effect effect = new LookLibraryAndPickControllerEffect(StaticValue.get(2), false, StaticValue.get(1),
- new FilterCard(), Zone.LIBRARY, true, false, false, Zone.LIBRARY, false, false, true);
- effect.setText("Look at the top two cards of your library. Put one on the bottom of your library");
- this.addAbility(new LoyaltyAbility(effect, 1));
+ this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(2, 1, PutCards.BOTTOM_ANY, PutCards.TOP_ANY), 1));
// 0: Exile another target permanent you own. Return that card to the battlefield under your control at the beggining of your next end step.
Ability ability = new LoyaltyAbility(new YodaJediMasterEffect(), 0);
diff --git a/Mage.Sets/src/mage/cards/y/YouMeetInATavern.java b/Mage.Sets/src/mage/cards/y/YouMeetInATavern.java
index fb4e0857a82..60ccfa10dad 100644
--- a/Mage.Sets/src/mage/cards/y/YouMeetInATavern.java
+++ b/Mage.Sets/src/mage/cards/y/YouMeetInATavern.java
@@ -1,21 +1,14 @@
package mage.cards.y;
-import mage.abilities.Ability;
import mage.abilities.Mode;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
+import mage.abilities.effects.common.LookLibraryControllerEffect.PutCards;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
-import mage.cards.Cards;
-import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Duration;
-import mage.constants.Outcome;
-import mage.constants.Zone;
import mage.filter.StaticFilters;
-import mage.game.Game;
-import mage.players.Player;
-import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
@@ -29,7 +22,8 @@ public final class YouMeetInATavern extends CardImpl {
// Choose one —
// • Form a Party — Look at the top five cards of your library. You may reveal any number of creature cards from among them and put them into your hand. Put the rest on the bottom of your library in a random order.
- this.getSpellAbility().addEffect(new YouMeetInATavernEffect());
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(
+ 5, Integer.MAX_VALUE, StaticFilters.FILTER_CARD_CREATURES, PutCards.HAND, PutCards.BOTTOM_RANDOM));
this.getSpellAbility().withFirstModeFlavorWord("Form a Party");
// • Start a Brawl — Creatures you control get +2/+2 until end of turn.
@@ -47,41 +41,3 @@ public final class YouMeetInATavern extends CardImpl {
return new YouMeetInATavern(this);
}
}
-
-class YouMeetInATavernEffect extends OneShotEffect {
-
- YouMeetInATavernEffect() {
- super(Outcome.Benefit);
- staticText = "look at the top five cards of your library. You may reveal " +
- "any number of creature cards from among them and put them into your hand. " +
- "Put the rest on the bottom of your library in a random order";
- }
-
- private YouMeetInATavernEffect(final YouMeetInATavernEffect effect) {
- super(effect);
- }
-
- @Override
- public YouMeetInATavernEffect copy() {
- return new YouMeetInATavernEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- if (player == null) {
- return false;
- }
- Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 5));
- TargetCardInLibrary target = new TargetCardInLibrary(
- 0, Integer.MAX_VALUE, StaticFilters.FILTER_CARD_CREATURE
- );
- player.choose(outcome, cards, target, game);
- Cards toHand = new CardsImpl(target.getTargets());
- cards.removeAll(toHand);
- player.revealCards(source, toHand, game);
- player.moveCards(toHand, Zone.HAND, source, game);
- player.putCardsOnBottomOfLibrary(cards, game, source, false);
- return true;
- }
-}
diff --git a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java
index b7052857ee1..1d42132bc55 100644
--- a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java
+++ b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java
@@ -211,6 +211,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet {
cards.add(new SetCardInfo("Vivien on the Hunt", 162, Rarity.MYTHIC, mage.cards.v.VivienOnTheHunt.class));
cards.add(new SetCardInfo("Voice of the Vermin", 163, Rarity.UNCOMMON, mage.cards.v.VoiceOfTheVermin.class));
cards.add(new SetCardInfo("Void Rend", 230, Rarity.RARE, mage.cards.v.VoidRend.class));
+ cards.add(new SetCardInfo("Warm Welcome", 164, Rarity.COMMON, mage.cards.w.WarmWelcome.class));
cards.add(new SetCardInfo("Waterfront District", 259, Rarity.COMMON, mage.cards.w.WaterfrontDistrict.class));
cards.add(new SetCardInfo("Whack", 99, Rarity.UNCOMMON, mage.cards.w.Whack.class));
cards.add(new SetCardInfo("Witness Protection", 66, Rarity.COMMON, mage.cards.w.WitnessProtection.class));
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/eld/OnceUponATimeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/eld/OnceUponATimeTest.java
index 2982fe655c5..fb702e3d2c5 100644
--- a/Mage.Tests/src/test/java/org/mage/test/cards/single/eld/OnceUponATimeTest.java
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/eld/OnceUponATimeTest.java
@@ -35,7 +35,7 @@ public class OnceUponATimeTest extends CardTestPlayerBase {
setChoice(playerA, false); // Cast without paying its mana cost?
setChoice(playerA, true); // Do you wish to reveal a creature or land card and put into your hand?
- setChoice(playerA, "Silvercoat Lion");
+ addTarget(playerA, "Silvercoat Lion");
setStopAt(2, PhaseStep.END_TURN);
execute();
@@ -68,12 +68,12 @@ public class OnceUponATimeTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Once Upon a Time");
setChoice(playerA, true); // Cast without paying its mana cost?
setChoice(playerA, true); // Do you wish to reveal a creature or land card and put into your hand?
- setChoice(playerA, "Silvercoat Lion");
+ addTarget(playerA, "Silvercoat Lion");
castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Once Upon a Time");
setChoice(playerB, true); // Cast without paying its mana cost?
setChoice(playerB, true); // Do you wish to reveal a creature or land card and put into your hand?
- setChoice(playerB, "Silvercoat Lion");
+ addTarget(playerB, "Silvercoat Lion");
setStopAt(2, PhaseStep.END_TURN);
execute();
@@ -86,4 +86,4 @@ public class OnceUponATimeTest extends CardTestPlayerBase {
assertHandCount(playerA, "Silvercoat Lion", 1);
assertHandCount(playerB, "Silvercoat Lion", 2);
}
-}
\ No newline at end of file
+}
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/GenesisUltimatumTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/GenesisUltimatumTest.java
index c780e34c0b9..d1385bfadb2 100644
--- a/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/GenesisUltimatumTest.java
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/iko/GenesisUltimatumTest.java
@@ -30,7 +30,7 @@ public class GenesisUltimatumTest extends CardTestPlayerBase {
// cast spell and put 3 cards to battle
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Genesis Ultimatum");
- setChoice(playerA, "Grizzly Bears^Kitesail Corsair^Riverglide Pathway");
+ addTarget(playerA, "Grizzly Bears^Kitesail Corsair^Riverglide Pathway");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
@@ -44,4 +44,4 @@ public class GenesisUltimatumTest extends CardTestPlayerBase {
assertHandCount(playerA, "Alpha Tyrranax", 1);
assertLibraryCount(playerA, 0);
}
-}
\ No newline at end of file
+}
diff --git a/Mage/src/main/java/mage/abilities/condition/common/DeliriumCondition.java b/Mage/src/main/java/mage/abilities/condition/common/DeliriumCondition.java
index 4e45afbc2b5..3ab16641907 100644
--- a/Mage/src/main/java/mage/abilities/condition/common/DeliriumCondition.java
+++ b/Mage/src/main/java/mage/abilities/condition/common/DeliriumCondition.java
@@ -19,7 +19,7 @@ public enum DeliriumCondition implements Condition {
@Override
public String toString() {
- return "if there are four or more card types among cards in your graveyard";
+ return "there are four or more card types among cards in your graveyard";
}
}
diff --git a/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java
index 29cc28dcf9d..c2fbfd25086 100644
--- a/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java
+++ b/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java
@@ -35,253 +35,134 @@ import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.cards.Cards;
import mage.cards.CardsImpl;
-import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
+import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
import mage.util.CardUtil;
-import java.util.Locale;
-
-import static java.lang.Integer.min;
-
/**
- * @author LevelX
+ * @author LevelX, awjackson
*/
public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEffect {
- protected FilterCard filter; // which kind of cards to reveal
- protected DynamicValue numberToPick;
- protected boolean revealPickedCards = true;
- protected Zone targetPickedCards = Zone.HAND; // HAND
- protected int foundCardsToPick = 0;
+ protected int numberToPick;
+ protected PutCards putPickedCards;
+ protected FilterCard filter;
+ protected boolean revealPickedCards;
protected boolean optional;
- private boolean upTo;
- private boolean putOnTopSelected;
- private boolean anyOrder;
+ protected boolean upTo;
- //TODO: These constructors are a mess
- public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards,
- boolean mayShuffleAfter, DynamicValue numberToPick,
- FilterCard pickFilter, boolean putOnTop) {
- this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter,
- putOnTop, true);
+ public LookLibraryAndPickControllerEffect(int numberOfCards, int numberToPick,
+ PutCards putPickedCards, PutCards putLookedCards) {
+ this(numberOfCards, numberToPick, putPickedCards, putLookedCards, false);
}
- public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards,
- boolean mayShuffleAfter, DynamicValue numberToPick,
- FilterCard pickFilter, boolean putOnTop, boolean reveal) {
- this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter,
- Zone.LIBRARY, putOnTop, reveal);
+ public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, int numberToPick,
+ PutCards putPickedCards, PutCards putLookedCards) {
+ this(numberOfCards, numberToPick, putPickedCards, putLookedCards, false);
}
- public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards,
- boolean mayShuffleAfter, DynamicValue numberToPick,
- FilterCard pickFilter, Zone targetZoneLookedCards,
- boolean putOnTop, boolean reveal) {
- this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter,
- targetZoneLookedCards, putOnTop, reveal, reveal);
+ public LookLibraryAndPickControllerEffect(int numberOfCards, int numberToPick,
+ PutCards putPickedCards, PutCards putLookedCards, boolean upTo) {
+ this(StaticValue.get(numberOfCards), numberToPick, putPickedCards, putLookedCards, upTo);
}
- public LookLibraryAndPickControllerEffect(int numberOfCards,
- int numberToPick, FilterCard pickFilter, boolean upTo) {
- this(StaticValue.get(numberOfCards), false,
- StaticValue.get(numberToPick), pickFilter, Zone.LIBRARY, false,
- true, upTo);
- }
-
- /**
- * @param numberOfCards
- * @param numberToPick
- * @param pickFilter
- * @param reveal
- * @param upTo
- * @param targetZonePickedCards
- * @param optional
- */
- public LookLibraryAndPickControllerEffect(int numberOfCards,
- int numberToPick, FilterCard pickFilter, boolean reveal,
- boolean upTo, Zone targetZonePickedCards, boolean optional) {
- this(StaticValue.get(numberOfCards), false,
- StaticValue.get(numberToPick), pickFilter, Zone.LIBRARY, false,
- reveal, upTo, targetZonePickedCards, optional, true, true);
-
- }
-
- /**
- * @param numberOfCards
- * @param mayShuffleAfter
- * @param numberToPick
- * @param pickFilter
- * @param targetZoneLookedCards
- * @param putOnTop if zone for the rest is library decide if cards go to top
- * or bottom
- * @param reveal
- * @param upTo
- */
- public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards,
- boolean mayShuffleAfter, DynamicValue numberToPick,
- FilterCard pickFilter, Zone targetZoneLookedCards,
- boolean putOnTop, boolean reveal, boolean upTo) {
- this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter,
- targetZoneLookedCards, putOnTop, reveal, upTo, Zone.HAND,
- false, true, true);
- }
-
- /**
- * @param numberOfCards
- * @param mayShuffleAfter
- * @param numberToPick
- * @param pickFilter
- * @param targetZoneLookedCards
- * @param putOnTop if zone for the rest is library decide if cards go to top
- * or bottom
- * @param reveal
- * @param upTo
- * @param targetZonePickedCards
- * @param optional
- */
- public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards,
- boolean mayShuffleAfter, DynamicValue numberToPick,
- FilterCard pickFilter, Zone targetZoneLookedCards, boolean putOnTop,
- boolean reveal, boolean upTo, Zone targetZonePickedCards,
- boolean optional) {
-
- this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter,
- targetZoneLookedCards, putOnTop, reveal, upTo,
- targetZonePickedCards, optional, true, true);
- }
-
- /**
- * @param numberOfCards
- * @param mayShuffleAfter
- * @param numberToPick
- * @param pickFilter
- * @param targetZoneLookedCards
- * @param putOnTop if zone for the rest is library decide if cards go to top
- * or bottom
- * @param reveal
- * @param upTo
- * @param targetZonePickedCards
- * @param optional
- * @param putOnTopSelected
- * @param anyOrder
- */
- public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards,
- boolean mayShuffleAfter, DynamicValue numberToPick,
- FilterCard pickFilter, Zone targetZoneLookedCards, boolean putOnTop,
- boolean reveal, boolean upTo, Zone targetZonePickedCards,
- boolean optional, boolean putOnTopSelected, boolean anyOrder) {
- super(Outcome.DrawCard, numberOfCards, mayShuffleAfter,
- targetZoneLookedCards, putOnTop);
+ public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, int numberToPick,
+ PutCards putPickedCards, PutCards putLookedCards, boolean upTo) {
+ super(putPickedCards.getOutcome(), numberOfCards, putLookedCards);
this.numberToPick = numberToPick;
- this.filter = pickFilter;
- this.revealPickedCards = reveal;
- this.targetPickedCards = targetZonePickedCards;
- this.upTo = upTo;
+ this.putPickedCards = putPickedCards;
+ this.filter = (numberToPick > 1) ? StaticFilters.FILTER_CARD_CARDS : StaticFilters.FILTER_CARD_A;
+ this.revealPickedCards = false;
+ this.optional = false;
+ this.upTo = upTo || numberToPick == Integer.MAX_VALUE;
+ }
+
+ public LookLibraryAndPickControllerEffect(int numberOfCards, int numberToPick, FilterCard filter,
+ PutCards putPickedCards, PutCards putLookedCards) {
+ this(numberOfCards, numberToPick, filter, putPickedCards, putLookedCards, true);
+ }
+
+ public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, int numberToPick, FilterCard filter,
+ PutCards putPickedCards, PutCards putLookedCards) {
+ this(numberOfCards, numberToPick, filter, putPickedCards, putLookedCards, true);
+ }
+
+ public LookLibraryAndPickControllerEffect(int numberOfCards, int numberToPick, FilterCard filter,
+ PutCards putPickedCards, PutCards putLookedCards, boolean optional) {
+ this(StaticValue.get(numberOfCards), numberToPick, filter, putPickedCards, putLookedCards, optional);
+ }
+
+ public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, int numberToPick, FilterCard filter,
+ PutCards putPickedCards, PutCards putLookedCards, boolean optional) {
+ super(putPickedCards.getOutcome(), numberOfCards, putLookedCards);
+ this.numberToPick = numberToPick;
+ this.putPickedCards = putPickedCards;
+ this.filter = filter;
+ this.revealPickedCards = !putPickedCards.getZone().isPublicZone();
this.optional = optional;
- this.putOnTopSelected = putOnTopSelected;
- this.anyOrder = anyOrder;
+ this.upTo = (numberToPick > 1);
}
public LookLibraryAndPickControllerEffect(final LookLibraryAndPickControllerEffect effect) {
super(effect);
- this.numberToPick = effect.numberToPick.copy();
+ this.numberToPick = effect.numberToPick;
+ this.putPickedCards = effect.putPickedCards;
this.filter = effect.filter.copy();
this.revealPickedCards = effect.revealPickedCards;
- this.targetPickedCards = effect.targetPickedCards;
- this.upTo = effect.upTo;
this.optional = effect.optional;
- this.putOnTopSelected = effect.putOnTopSelected;
- this.anyOrder = effect.anyOrder;
+ this.upTo = effect.upTo;
}
@Override
public LookLibraryAndPickControllerEffect copy() {
return new LookLibraryAndPickControllerEffect(this);
-
}
@Override
- protected void actionWithSelectedCards(Cards cards, Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- if (player != null && numberToPick.calculate(game, source, this) > 0
- && cards.count(filter, source.getControllerId(), source, game) > 0) {
- if (!optional || player.chooseUse(Outcome.DrawCard, getMayText(), source, game)) {
- FilterCard pickFilter = filter.copy();
- pickFilter.setMessage(getPickText());
- int number = min(cards.size(), numberToPick.calculate(game, source, this));
- TargetCard target = new TargetCard((upTo ? 0 : number), number, Zone.LIBRARY, pickFilter);
- if (player.choose(Outcome.DrawCard, cards, target, game)) {
- Cards pickedCards = new CardsImpl(target.getTargets());
- cards.removeAll(pickedCards);
- if (targetPickedCards == Zone.LIBRARY && !putOnTopSelected) {
- player.putCardsOnBottomOfLibrary(pickedCards, game, source, anyOrder);
- } else {
- player.moveCards(pickedCards.getCards(game), targetPickedCards, source, game);
- }
- if (revealPickedCards) {
- player.revealCards(source, pickedCards, game);
- }
-
- }
- }
+ protected boolean actionWithLookedCards(Game game, Ability source, Player player, Cards cards) {
+ int number = Math.min(numberToPick, cards.count(filter, source.getControllerId(), source, game));
+ if (number < 1
+ || optional && !player.chooseUse(putPickedCards.getOutcome(), getMayText(), source, game)) {
+ return actionWithPickedCards(game, source, player, new CardsImpl(), cards);
}
-
+ TargetCard target = new TargetCard((upTo ? 0 : number), number, Zone.LIBRARY, filter);
+ target.withChooseHint(getChooseHint());
+ if (!player.chooseTarget(putPickedCards.getOutcome(), cards, target, source, game)) {
+ return actionWithPickedCards(game, source, player, new CardsImpl(), cards);
+ }
+ Cards pickedCards = new CardsImpl(target.getTargets());
+ if (revealPickedCards) {
+ player.revealCards(source, pickedCards, game);
+ }
+ cards.removeAll(pickedCards);
+ return actionWithPickedCards(game, source, player, pickedCards, cards);
}
- private String getMayText() {
- StringBuilder sb = new StringBuilder();
- switch (targetPickedCards) {
- case HAND:
- if (revealPickedCards) {
- sb.append("Reveal ").append(filter.getMessage()).append(" and put into your hand");
- } else {
- sb.append("Put ").append(filter.getMessage()).append(" into your hand");
- }
- break;
- case BATTLEFIELD:
- sb.append("Put ").append(filter.getMessage()).append(" onto the battlefield");
- break;
- case GRAVEYARD:
- sb.append("Put ").append(filter.getMessage()).append(" into your graveyard");
- break;
- }
- return sb.append('?').toString();
+ protected boolean actionWithPickedCards(Game game, Ability source, Player player, Cards pickedCards, Cards otherCards) {
+ boolean result = moveCards(game, source, player, pickedCards, putPickedCards);
+ result |= moveCards(game, source, player, otherCards, putLookedCards);
+ return result;
}
- private String getPickText() {
- StringBuilder sb = new StringBuilder(filter.getMessage()).append(" to ");
- switch (targetPickedCards) {
- case LIBRARY:
- if (putOnTopSelected) {
- sb.append("put on the top of your library");
- } else {
- sb.append("put on the bottom of your library");
- }
- if (anyOrder) {
- sb.append(" in any order");
- } else {
- sb.append(" in a random order");
- }
- break;
- case HAND:
- if (revealPickedCards) {
- sb.append("reveal and put into your hand");
- } else {
- sb.append("put into your hand");
- }
- break;
- case BATTLEFIELD:
- sb.append("put onto the battlefield");
- break;
- case GRAVEYARD:
- sb.append("put into the graveyard");
- break;
+ protected String getMayText() {
+ boolean plural = numberToPick > 1;
+ StringBuilder sb = new StringBuilder(revealPickedCards ? "Reveal " : "Put ");
+ sb.append(plural ? filter.getMessage() : CardUtil.addArticle(filter.getMessage()));
+ if (revealPickedCards) {
+ sb.append(" and put ");
+ sb.append(plural ? "them" : "it");
}
- return sb.toString();
+ sb.append(" ");
+ sb.append(putPickedCards.getMessage(plural));
+ return sb.append("?").toString();
+ }
+
+ protected String getChooseHint() {
+ return "to put " + putPickedCards.getMessage(numberToPick > 1);
}
@Override
@@ -289,75 +170,57 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
if (staticText != null && !staticText.isEmpty()) {
return staticText;
}
- StringBuilder sb = new StringBuilder();
- int pickCount=numberToPick.calculate(null, null, this);
- int cardCount=numberOfCards.calculate(null, null, this);
- if (pickCount > 0) {
- if (revealPickedCards) {
- sb.append(". You may reveal ");
- sb.append(filter.getMessage());
- sb.append(" from among them and put ");
- sb.append(pickCount>1?"the revealed cards":"it");
- sb.append(" into your ");
- } else if (targetPickedCards == Zone.BATTLEFIELD) {
- sb.append(". ");
- if (optional) {
- sb.append("You may p");
- } else {
- sb.append('P');
- }
- sb.append("ut ").append(filter.getMessage()).append(" from among them onto the ");
- } else {
- sb.append(". Put ");
- if (pickCount > 1) {
- if (upTo) {
- if (pickCount == (cardCount)) {
- sb.append("any number");
- } else {
- sb.append("up to ").append(CardUtil.numberToText(pickCount));
- }
- } else {
- sb.append(CardUtil.numberToText(pickCount));
- }
- } else {
- sb.append("one");
- }
-
- sb.append(" of them into your ");
- }
- sb.append(targetPickedCards.toString().toLowerCase(Locale.ENGLISH));
-
- if (targetZoneLookedCards == Zone.LIBRARY) {
- sb.append(revealPickedCards?". Put ":" and ");
- sb.append(cardCount-pickCount==1?"the other ":"the rest ");
- if (putOnTop) {
- sb.append("back on top");
- } else {
- sb.append("on the bottom");
- }
- sb.append(" of your library");
- if (cardCount-pickCount>1) {
- sb.append(" in ");
- if (anyOrder && !backInRandomOrder) {
- sb.append("any");
- } else {
- sb.append("a random");
- }
- sb.append(" order");
- }
- } else if (targetZoneLookedCards == Zone.GRAVEYARD) {
- sb.append(" and the");
- if (numberOfCards instanceof StaticValue && numberToPick instanceof StaticValue
- && ((StaticValue) numberToPick).getValue() + 1 == ((StaticValue) numberOfCards).getValue()) {
- sb.append(" other");
- } else {
- sb.append(" rest");
- }
- sb.append(" into your graveyard");
- }
+ StringBuilder sb = new StringBuilder(". ");
+ if (optional) {
+ sb.append(revealPickedCards ? "You may reveal " : "You may put ");
+ } else {
+ sb.append(revealPickedCards ? "Reveal " : "Put ");
}
+ boolean havePredicates = filter.hasPredicates();
+ boolean plural = numberToPick > 1;
+ if (havePredicates && !plural && !upTo) {
+ sb.append(CardUtil.addArticle(filter.getMessage()));
+ } else if (numberToPick == Integer.MAX_VALUE) {
+ sb.append("any number of ");
+ if (havePredicates) {
+ sb.append(filter.getMessage());
+ }
+ } else {
+ if (upTo) {
+ sb.append("up to ");
+ }
+ sb.append(CardUtil.numberToText(numberToPick));
+ sb.append(" ");
+ sb.append(havePredicates ? filter.getMessage() : "of ");
+ }
+ if (havePredicates) {
+ sb.append(" from among ");
+ }
+ sb.append("them ");
+ if (revealPickedCards) {
+ sb.append("and put ");
+ sb.append(plural ? "them " : "it ");
+ }
+ sb.append(putPickedCards.getMessage(plural));
+
+ plural = optional
+ || upTo
+ || !(numberOfCards instanceof StaticValue)
+ || numberOfCards.calculate(null, null, this) - numberToPick != 1;
+
+ // if remaining text would be "put the other on top of your library", omit it
+ if (!plural && putLookedCards == PutCards.TOP_ANY) {
+ return setText(mode, sb.toString());
+ }
+ sb.append(havePredicates && (optional || upTo) ? ". Put" : " and");
+ sb.append(" the ");
+ sb.append(plural ? "rest " : "other ");
+ if (putPickedCards == PutCards.GRAVEYARD && putLookedCards == PutCards.TOP_ANY) {
+ sb.append("back ");
+ }
+ sb.append(putLookedCards.getMessage(plural));
+
// get text frame from super class and inject action text
return setText(mode, sb.toString());
}
-
}
diff --git a/Mage/src/main/java/mage/abilities/effects/common/LookLibraryControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/LookLibraryControllerEffect.java
index 020f3f16731..45361da3071 100644
--- a/Mage/src/main/java/mage/abilities/effects/common/LookLibraryControllerEffect.java
+++ b/Mage/src/main/java/mage/abilities/effects/common/LookLibraryControllerEffect.java
@@ -1,4 +1,3 @@
-
package mage.abilities.effects.common;
import mage.abilities.Ability;
@@ -17,61 +16,81 @@ import mage.util.CardUtil;
/**
*
- * @author LevelX
+ * @author LevelX, awjackson
*/
public class LookLibraryControllerEffect extends OneShotEffect {
+ public enum PutCards {
+ HAND(Outcome.DrawCard, Zone.HAND, "into your hand"),
+ GRAVEYARD(Outcome.Discard, Zone.GRAVEYARD, "into your graveyard"),
+ BATTLEFIELD(Outcome.PutCardInPlay, Zone.BATTLEFIELD, "onto the battlefield"),
+ BATTLEFIELD_TAPPED(Outcome.PutCardInPlay, Zone.BATTLEFIELD, "onto the battlefield tapped"),
+ TOP_ANY(Outcome.Benefit, Zone.LIBRARY, "on top of your library", " in any order"),
+ BOTTOM_ANY(Outcome.Benefit, Zone.LIBRARY, "on the bottom of your library", " in any order"),
+ BOTTOM_RANDOM(Outcome.Benefit, Zone.LIBRARY, "on the bottom of your library", " in a random order");
+
+ private final Outcome outcome;
+ private final Zone zone;
+ private final String message;
+ private final String order;
+
+ PutCards(Outcome outcome, Zone zone, String message) {
+ this(outcome, zone, message, "");
+ }
+
+ PutCards(Outcome outcome, Zone zone, String message, String order) {
+ this.outcome = outcome;
+ this.zone = zone;
+ this.message = message;
+ this.order = order;
+ }
+
+ public Outcome getOutcome() {
+ return outcome;
+ }
+
+ public Zone getZone() {
+ return zone;
+ }
+
+ public String getMessage(boolean withOrder) {
+ return withOrder ? message + order : message;
+ }
+ }
+
protected DynamicValue numberOfCards;
- protected boolean mayShuffleAfter = false;
- protected boolean putOnTop = true; // if false on put rest back on bottom of library
- protected Zone targetZoneLookedCards; // GRAVEYARD, LIBRARY
- protected boolean backInRandomOrder = false;
+ protected PutCards putLookedCards;
+ protected boolean revealCards;
public LookLibraryControllerEffect() {
this(1);
}
public LookLibraryControllerEffect(int numberOfCards) {
- this(numberOfCards, false, true);
+ this(StaticValue.get(numberOfCards));
}
public LookLibraryControllerEffect(DynamicValue numberOfCards) {
- this(numberOfCards, false, true);
+ this(Outcome.Benefit, numberOfCards, PutCards.TOP_ANY);
}
- public LookLibraryControllerEffect(int numberOfCards, boolean mayShuffleAfter) {
- this(numberOfCards, mayShuffleAfter, true);
- }
-
- public LookLibraryControllerEffect(int numberOfCards, boolean mayShuffleAfter, boolean putOnTop) {
- this(StaticValue.get(numberOfCards), mayShuffleAfter, putOnTop);
- }
-
- public LookLibraryControllerEffect(DynamicValue numberOfCards, boolean mayShuffleAfter, boolean putOnTop) {
- this(Outcome.Benefit, numberOfCards, mayShuffleAfter, Zone.LIBRARY, putOnTop);
- }
-
- public LookLibraryControllerEffect(Outcome outcome, DynamicValue numberOfCards, boolean mayShuffleAfter, Zone targetZoneLookedCards, boolean putOnTop) {
+ public LookLibraryControllerEffect(Outcome outcome, DynamicValue numberOfCards, PutCards putLookedCards) {
super(outcome);
this.numberOfCards = numberOfCards;
- this.mayShuffleAfter = mayShuffleAfter;
- this.targetZoneLookedCards = targetZoneLookedCards;
- this.putOnTop = putOnTop;
+ this.putLookedCards = putLookedCards;
+ this.revealCards = false;
}
public LookLibraryControllerEffect(final LookLibraryControllerEffect effect) {
super(effect);
this.numberOfCards = effect.numberOfCards.copy();
- this.mayShuffleAfter = effect.mayShuffleAfter;
- this.targetZoneLookedCards = effect.targetZoneLookedCards;
- this.putOnTop = effect.putOnTop;
- this.backInRandomOrder = effect.backInRandomOrder;
+ this.putLookedCards = effect.putLookedCards;
+ this.revealCards = effect.revealCards;
}
@Override
public LookLibraryControllerEffect copy() {
return new LookLibraryControllerEffect(this);
-
}
@Override
@@ -84,68 +103,37 @@ public class LookLibraryControllerEffect extends OneShotEffect {
// take cards from library and look at them
boolean topCardRevealed = controller.isTopCardRevealed();
controller.setTopCardRevealed(false);
- Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, this.numberOfCards.calculate(game, source, this)));
+ Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, numberOfCards.calculate(game, source, this)));
- controller.lookAtCards(source, null, cards, game);
+ if (revealCards) {
+ controller.revealCards(source, cards, game);
+ } else {
+ controller.lookAtCards(source, null, cards, game);
+ }
- this.actionWithSelectedCards(cards, game, source);
-
- this.putCardsBack(source, controller, cards, game);
+ boolean result = actionWithLookedCards(game, source, controller, cards);
controller.setTopCardRevealed(topCardRevealed);
- this.mayShuffle(controller, source, game);
-
- return true;
+ return result;
}
- public boolean isBackInRandomOrder() {
- return backInRandomOrder;
+ protected boolean actionWithLookedCards(Game game, Ability source, Player player, Cards cards) {
+ return moveCards(game, source, player, cards, putLookedCards);
}
- public Effect setBackInRandomOrder(boolean backInRandomOrder) {
- this.backInRandomOrder = backInRandomOrder;
- return this;
- }
-
- protected void actionWithSelectedCards(Cards cards, Game game, Ability source) {
- }
-
- /**
- * Put the rest of the cards back to defined zone
- *
- * @param source
- * @param player
- * @param cards
- * @param game
- */
- protected void putCardsBack(Ability source, Player player, Cards cards, Game game) {
- switch (targetZoneLookedCards) {
- case LIBRARY:
- if (putOnTop) {
- player.putCardsOnTopOfLibrary(cards, game, source, !backInRandomOrder);
- } else {
- player.putCardsOnBottomOfLibrary(cards, game, source, !backInRandomOrder);
- }
- break;
- case GRAVEYARD:
- player.moveCards(cards, Zone.GRAVEYARD, source, game);
- break;
+ protected static boolean moveCards(Game game, Ability source, Player player, Cards cards, PutCards putCards) {
+ switch (putCards) {
+ case TOP_ANY:
+ return player.putCardsOnTopOfLibrary(cards, game, source, true);
+ case BOTTOM_ANY:
+ return player.putCardsOnBottomOfLibrary(cards, game, source, true);
+ case BOTTOM_RANDOM:
+ return player.putCardsOnBottomOfLibrary(cards, game, source, false);
+ case BATTLEFIELD_TAPPED:
+ return player.moveCards(cards.getCards(game), Zone.BATTLEFIELD, source, game, true, false, false, null);
default:
- // not supported yet
- }
- }
-
- /**
- * Check to shuffle library if allowed
- *
- * @param player
- * @param source
- * @param game
- */
- protected void mayShuffle(Player player, Ability source, Game game) {
- if (this.mayShuffleAfter && player.chooseUse(Outcome.Benefit, "Shuffle your library?", source, game)) {
- player.shuffleLibrary(source, game);
+ return player.moveCards(cards, putCards.getZone(), source, game);
}
}
@@ -158,46 +146,29 @@ public class LookLibraryControllerEffect extends OneShotEffect {
if (staticText != null && !staticText.isEmpty()) {
return staticText;
}
- int numberLook;
- try {
- numberLook = Integer.parseInt(numberOfCards.toString());
- } catch (NumberFormatException e) {
- numberLook = 0;
+ String numberString = numberOfCards.toString();
+ boolean dynamic = !numberOfCards.getMessage().isEmpty();
+ boolean oneCard = !dynamic && numberString.equals("1");
+ StringBuilder sb = new StringBuilder(revealCards ? "reveal " : "look at ");
+ if (oneCard) {
+ sb.append("the top card");
+ } else if (dynamic) {
+ sb.append("the top X cards");
+ } else if (numberString.equals("that many")) {
+ sb.append("that many cards from the top");
+ } else {
+ sb.append("the top ").append(CardUtil.numberToText(numberString)).append(" cards");
}
- StringBuilder sb = new StringBuilder("look at the top ");
- switch (numberLook) {
- case 0:
- sb.append(" X ");
- break;
- case 1:
- sb.append("card ");
- break;
- default:
- sb.append(CardUtil.numberToText(numberLook));
- break;
+ sb.append(" of your library");
+ if (dynamic) {
+ sb.append(", where X is ").append(numberOfCards.getMessage());
}
- if (numberLook != 1) {
- sb.append(" cards ");
- }
-
- sb.append("of your library");
- if (numberLook == 0) {
- sb.append(", where {X} is the number of cards ").append(numberOfCards.getMessage());
- }
-
if (!middleText.isEmpty()) {
sb.append(middleText);
- } else if (numberLook > 1) {
- if (backInRandomOrder) {
- sb.append(". Put the rest on the bottom of your library in a random order");
- } else {
- sb.append(", then put them back in any order");
- }
+ } else if (!oneCard) {
+ sb.append(", then put them ");
+ sb.append(putLookedCards == PutCards.TOP_ANY ? "back in any order" : putLookedCards.getMessage(true));
}
- if (this.mayShuffleAfter) {
- sb.append(". You may shuffle");
- }
-
return sb.toString();
}
}
diff --git a/Mage/src/main/java/mage/abilities/effects/common/LookLibraryMayPutToBottomEffect.java b/Mage/src/main/java/mage/abilities/effects/common/LookLibraryMayPutToBottomEffect.java
deleted file mode 100644
index a505bd034b6..00000000000
--- a/Mage/src/main/java/mage/abilities/effects/common/LookLibraryMayPutToBottomEffect.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package mage.abilities.effects.common;
-
-import mage.MageObject;
-import mage.abilities.Ability;
-import mage.abilities.effects.OneShotEffect;
-import mage.cards.Card;
-import mage.cards.CardsImpl;
-import mage.constants.Outcome;
-import mage.constants.Zone;
-import mage.game.Game;
-import mage.players.Player;
-
-/**
- *
- * @author LevelX2
- */
-
-public class LookLibraryMayPutToBottomEffect extends OneShotEffect {
-
- public LookLibraryMayPutToBottomEffect() {
- super(Outcome.DrawCard);
- this.staticText = "Look at the top card of your library. You may put that card on the bottom of your library.";
- }
-
- public LookLibraryMayPutToBottomEffect(final LookLibraryMayPutToBottomEffect effect) {
- super(effect);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player controller = game.getPlayer(source.getControllerId());
- MageObject sourceObject = game.getObject(source);
- if (sourceObject == null || controller == null) {
- return false;
- }
- if (controller.getLibrary().hasCards()) {
- Card card = controller.getLibrary().getFromTop(game);
- if (card == null) {
- return false;
- }
- controller.lookAtCards(sourceObject.getName(), new CardsImpl(card), game);
- boolean toBottom = controller.chooseUse(outcome, "Put card on the bottom of your library?", source, game);
- return controller.moveCardToLibraryWithInfo(card, source, game, Zone.LIBRARY, !toBottom, false);
- }
- return true;
- }
-
- @Override
- public LookLibraryMayPutToBottomEffect copy() {
- return new LookLibraryMayPutToBottomEffect(this);
- }
-
-}
diff --git a/Mage/src/main/java/mage/abilities/effects/common/RevealLibraryPickControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/RevealLibraryPickControllerEffect.java
new file mode 100644
index 00000000000..e6df716914e
--- /dev/null
+++ b/Mage/src/main/java/mage/abilities/effects/common/RevealLibraryPickControllerEffect.java
@@ -0,0 +1,30 @@
+package mage.abilities.effects.common;
+
+import mage.filter.FilterCard;
+
+/**
+ * @author awjackson
+ */
+public class RevealLibraryPickControllerEffect extends LookLibraryAndPickControllerEffect {
+
+ public RevealLibraryPickControllerEffect(int numberOfCards, int numberToPick, FilterCard filter,
+ PutCards putPickedCards, PutCards putLookedCards) {
+ this(numberOfCards, numberToPick, filter, putPickedCards, putLookedCards, true);
+ }
+
+ public RevealLibraryPickControllerEffect(int numberOfCards, int numberToPick, FilterCard filter,
+ PutCards putPickedCards, PutCards putLookedCards, boolean optional) {
+ super(numberOfCards, numberToPick, filter, putPickedCards, putLookedCards, optional);
+ this.revealCards = true;
+ this.revealPickedCards = false;
+ }
+
+ public RevealLibraryPickControllerEffect(final LookLibraryAndPickControllerEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public RevealLibraryPickControllerEffect copy() {
+ return new RevealLibraryPickControllerEffect(this);
+ }
+}
diff --git a/Mage/src/main/java/mage/abilities/effects/common/ShuffleLibrarySourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ShuffleLibrarySourceEffect.java
index a803bd268f2..8d035262a24 100644
--- a/Mage/src/main/java/mage/abilities/effects/common/ShuffleLibrarySourceEffect.java
+++ b/Mage/src/main/java/mage/abilities/effects/common/ShuffleLibrarySourceEffect.java
@@ -1,5 +1,3 @@
-
-
package mage.abilities.effects.common;
import mage.abilities.Ability;
@@ -14,13 +12,21 @@ import mage.players.Player;
*/
public class ShuffleLibrarySourceEffect extends OneShotEffect {
+ private boolean optional;
+
public ShuffleLibrarySourceEffect() {
+ this(false);
+ }
+
+ public ShuffleLibrarySourceEffect(boolean optional) {
super(Outcome.Neutral);
- this.staticText = "Shuffle your library";
+ this.optional = optional;
+ this.staticText = optional ? "you may shuffle" : "shuffle your library";
}
public ShuffleLibrarySourceEffect(final ShuffleLibrarySourceEffect effect) {
super(effect);
+ this.optional = effect.optional;
}
@Override
@@ -32,7 +38,9 @@ public class ShuffleLibrarySourceEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
- player.shuffleLibrary(source, game);
+ if (!optional || player.chooseUse(Outcome.Benefit, "Shuffle your library?", source, game)) {
+ player.shuffleLibrary(source, game);
+ }
return true;
}
return false;
diff --git a/Mage/src/main/java/mage/filter/StaticFilters.java b/Mage/src/main/java/mage/filter/StaticFilters.java
index c6e9354a033..0ad8c90125b 100644
--- a/Mage/src/main/java/mage/filter/StaticFilters.java
+++ b/Mage/src/main/java/mage/filter/StaticFilters.java
@@ -64,6 +64,12 @@ public final class StaticFilters {
FILTER_CARD_ARTIFACT.setLockedFilter(true);
}
+ public static final FilterArtifactCard FILTER_CARD_ARTIFACTS = new FilterArtifactCard("artifact cards");
+
+ static {
+ FILTER_CARD_ARTIFACTS.setLockedFilter(true);
+ }
+
public static final FilterArtifactCard FILTER_CARD_ARTIFACT_AN = new FilterArtifactCard("an artifact card");
static {
@@ -939,6 +945,16 @@ public final class StaticFilters {
FILTER_CARD_ARTIFACT_OR_CREATURE.setLockedFilter(true);
}
+ public static final FilterCard FILTER_CARD_CREATURE_OR_LAND = new FilterCard("creature or land card");
+
+ static {
+ FILTER_CARD_CREATURE_OR_LAND.add(Predicates.or(
+ CardType.CREATURE.getPredicate(),
+ CardType.LAND.getPredicate()
+ ));
+ FILTER_CARD_CREATURE_OR_LAND.setLockedFilter(true);
+ }
+
public static final FilterPlayer FILTER_PLAYER_CONTROLLER = new FilterPlayer("you");
static {