mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Chenged cards using LookLibraryAndPickControllerEffect.
This commit is contained in:
parent
e313b130fe
commit
02fa9e6c81
8 changed files with 30 additions and 270 deletions
|
@ -146,8 +146,6 @@ class OpalEyeKondasYojimboRedirectionEffect extends ReplacementEffectImpl<OpalEy
|
|||
}
|
||||
}
|
||||
game.informPlayers(message.toString());
|
||||
// remember redirection effect (614.5)
|
||||
event.getAppliedEffects().add(getId());
|
||||
// redirect damage
|
||||
this.used = true;
|
||||
sourcePermanent.damage(damageEvent.getAmount(), damageEvent.getSourceId(), game, damageEvent.isPreventable(), damageEvent.isCombatDamage(), event.getAppliedEffects());
|
||||
|
|
|
@ -43,7 +43,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
|
|||
*/
|
||||
public class CommuneWithNature extends CardImpl<CommuneWithNature> {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("creature card");
|
||||
private static final FilterCard filter = new FilterCard("a creature card");
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
|
|||
*/
|
||||
public class PeerThroughDepths extends CardImpl<PeerThroughDepths> {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("instant or sorcery card");
|
||||
private static final FilterCard filter = new FilterCard("an instant or sorcery card");
|
||||
static {
|
||||
filter.add(Predicates.or(
|
||||
new CardTypePredicate(CardType.SORCERY),
|
||||
|
|
|
@ -46,7 +46,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
|
|||
*/
|
||||
public class FaerieMechanist extends CardImpl<FaerieMechanist> {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("artifact card");
|
||||
private static final FilterCard filter = new FilterCard("an artifact card");
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.ARTIFACT));
|
||||
}
|
||||
|
|
|
@ -28,23 +28,15 @@
|
|||
package mage.sets.magic2013;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -52,6 +44,11 @@ import mage.target.TargetCard;
|
|||
*/
|
||||
public class AugurOfBolas extends CardImpl<AugurOfBolas> {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("an instant or sorcery card");
|
||||
static {
|
||||
filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY)));
|
||||
}
|
||||
|
||||
public AugurOfBolas(UUID ownerId) {
|
||||
super(ownerId, 43, "Augur of Bolas", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}");
|
||||
this.expansionSetCode = "M13";
|
||||
|
@ -63,7 +60,7 @@ public class AugurOfBolas extends CardImpl<AugurOfBolas> {
|
|||
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()));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(3, 1, filter, false)));
|
||||
}
|
||||
|
||||
public AugurOfBolas(final AugurOfBolas card) {
|
||||
|
@ -75,84 +72,3 @@ public class AugurOfBolas extends CardImpl<AugurOfBolas> {
|
|||
return new AugurOfBolas(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AugurOfBolasEffect extends OneShotEffect<AugurOfBolasEffect> {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("Instant or Sorcery card");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(
|
||||
new CardTypePredicate(CardType.INSTANT),
|
||||
new CardTypePredicate(CardType.SORCERY)));
|
||||
}
|
||||
|
||||
public AugurOfBolasEffect() {
|
||||
super(Constants.Outcome.DrawCard);
|
||||
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 player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Cards cards = new CardsImpl(Constants.Zone.PICK);
|
||||
boolean spellFound = false;
|
||||
int count = Math.min(player.getLibrary().size(), 3);
|
||||
for (int i = 0; i < count; i++) {
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
game.setZone(card.getId(), Constants.Zone.PICK);
|
||||
if (card.getCardType().contains(CardType.INSTANT) || card.getCardType().contains(CardType.SORCERY)) {
|
||||
spellFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
player.lookAtCards("Augur of Bolas", cards, game);
|
||||
|
||||
if (spellFound && player.chooseUse(Constants.Outcome.DrawCard, "Do you wish to reveal an instant or sorcery card and put it into your hand?", game)) {
|
||||
TargetCard target = new TargetCard(Constants.Zone.PICK, filter);
|
||||
if (player.choose(Constants.Outcome.DrawCard, cards, target, game)) {
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Constants.Zone.HAND, source.getId(), game, false);
|
||||
|
||||
Cards reveal = new CardsImpl(Constants.Zone.OUTSIDE);
|
||||
reveal.add(card);
|
||||
player.revealCards("Augur of Bolas", reveal, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TargetCard target = new TargetCard(Constants.Zone.PICK, new FilterCard("card to put on the bottom of your library"));
|
||||
target.setRequired(true);
|
||||
while (cards.size() > 1) {
|
||||
player.choose(Constants.Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Constants.Zone.LIBRARY, source.getId(), game, false);
|
||||
}
|
||||
target.clearChosen();
|
||||
}
|
||||
if (cards.size() == 1) {
|
||||
Card card = cards.get(cards.iterator().next(), game);
|
||||
card.moveToZone(Constants.Zone.LIBRARY, source.getId(), game, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,23 +27,13 @@
|
|||
*/
|
||||
package mage.sets.mirrodinbesieged;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -51,13 +41,18 @@ import mage.target.TargetCard;
|
|||
*/
|
||||
public class LeadTheStampede extends CardImpl<LeadTheStampede> {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("any number of creature cards");
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
}
|
||||
|
||||
public LeadTheStampede(UUID ownerId) {
|
||||
super(ownerId, 82, "Lead the Stampede", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{G}");
|
||||
this.expansionSetCode = "MBS";
|
||||
|
||||
this.color.setGreen(true);
|
||||
|
||||
this.getSpellAbility().addEffect(new LeadTheStampedeEffect());
|
||||
// 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));
|
||||
}
|
||||
|
||||
public LeadTheStampede(final LeadTheStampede card) {
|
||||
|
@ -69,81 +64,3 @@ public class LeadTheStampede extends CardImpl<LeadTheStampede> {
|
|||
return new LeadTheStampede(this);
|
||||
}
|
||||
}
|
||||
|
||||
class LeadTheStampedeEffect extends OneShotEffect<LeadTheStampedeEffect> {
|
||||
|
||||
public LeadTheStampedeEffect() {
|
||||
super(Outcome.DrawCard);
|
||||
this.staticText = "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";
|
||||
}
|
||||
|
||||
public LeadTheStampedeEffect(final LeadTheStampedeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LeadTheStampedeEffect copy() {
|
||||
return new LeadTheStampedeEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Cards cards = new CardsImpl(Zone.PICK);
|
||||
int creatureCardsFound = 0;
|
||||
int count = Math.min(player.getLibrary().size(), 5);
|
||||
for (int i = 0; i < count; i++) {
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
game.setZone(card.getId(), Zone.PICK);
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
creatureCardsFound++;
|
||||
}
|
||||
}
|
||||
}
|
||||
player.lookAtCards("Lead the Stampede", cards, game);
|
||||
|
||||
if (creatureCardsFound > 0 && player.chooseUse(Outcome.DrawCard, "Do you wish to reveal creature cards and put them into your hand?", game)) {
|
||||
Cards revealedCards = new CardsImpl();
|
||||
TargetCard target = new TargetCard(0, creatureCardsFound, Zone.PICK, new FilterCreatureCard("creature cards to reveal and put into your hand"));
|
||||
|
||||
if (player.choose(Outcome.DrawCard, cards, target, game)) {
|
||||
List<UUID> targets = target.getTargets();
|
||||
for (UUID targetId : targets) {
|
||||
Card card = cards.get(targetId, game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
revealedCards.add(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!revealedCards.isEmpty()) {
|
||||
player.revealCards("Lead the Stampede", revealedCards, game);
|
||||
}
|
||||
}
|
||||
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
|
||||
target.setRequired(true);
|
||||
while (cards.size() > 1) {
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
}
|
||||
target.clearChosen();
|
||||
}
|
||||
if (cards.size() == 1) {
|
||||
Card card = cards.get(cards.iterator().next(), game);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@ import mage.Constants.CardType;
|
|||
import mage.Constants.Duration;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
|
@ -40,21 +39,17 @@ import mage.abilities.common.EntersBattlefieldAbility;
|
|||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||
import mage.abilities.effects.common.continious.BecomesCreatureTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterArtifactCard;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetArtifactPermanent;
|
||||
|
||||
|
@ -64,6 +59,11 @@ import mage.target.common.TargetArtifactPermanent;
|
|||
*/
|
||||
public class TezzeretAgentOfBolas extends CardImpl<TezzeretAgentOfBolas> {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("an artifact card");
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.ARTIFACT));
|
||||
}
|
||||
|
||||
public TezzeretAgentOfBolas(UUID ownerId) {
|
||||
super(ownerId, 97, "Tezzeret, Agent of Bolas", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{U}{B}");
|
||||
this.expansionSetCode = "MBS";
|
||||
|
@ -72,12 +72,15 @@ public class TezzeretAgentOfBolas extends CardImpl<TezzeretAgentOfBolas> {
|
|||
this.color.setBlack(true);
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
|
||||
|
||||
this.addAbility(new LoyaltyAbility(new TezzeretAgentOfBolasEffect1(), 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, filter, true), 1));
|
||||
|
||||
// -1: Target artifact becomes a 5/5 artifact creature.
|
||||
LoyaltyAbility ability1 = new LoyaltyAbility(new BecomesCreatureTargetEffect(new ArtifactCreatureToken(), "", Duration.EndOfGame), -1);
|
||||
ability1.addTarget(new TargetArtifactPermanent());
|
||||
this.addAbility(ability1);
|
||||
|
||||
// -4: Target player loses X life and you gain X life, where X is twice the number of artifacts you control.
|
||||
LoyaltyAbility ability2 = new LoyaltyAbility(new TezzeretAgentOfBolasEffect2(), -4);
|
||||
ability2.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability2);
|
||||
|
@ -95,79 +98,6 @@ public class TezzeretAgentOfBolas extends CardImpl<TezzeretAgentOfBolas> {
|
|||
|
||||
}
|
||||
|
||||
class TezzeretAgentOfBolasEffect1 extends OneShotEffect<TezzeretAgentOfBolasEffect1> {
|
||||
|
||||
public TezzeretAgentOfBolasEffect1() {
|
||||
super(Outcome.DrawCard);
|
||||
staticText = "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";
|
||||
}
|
||||
|
||||
public TezzeretAgentOfBolasEffect1(final TezzeretAgentOfBolasEffect1 effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TezzeretAgentOfBolasEffect1 copy() {
|
||||
return new TezzeretAgentOfBolasEffect1(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Cards cards = new CardsImpl(Zone.PICK);
|
||||
boolean artifactFound = false;
|
||||
int count = Math.min(player.getLibrary().size(), 5);
|
||||
for (int i = 0; i < count; i++) {
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
game.setZone(card.getId(), Zone.PICK);
|
||||
if (card.getCardType().contains(CardType.ARTIFACT)) {
|
||||
artifactFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
player.lookAtCards("Tezzeret, Agent of Bolas", cards, game);
|
||||
|
||||
if (artifactFound && player.chooseUse(Outcome.DrawCard, "Do you wish to reveal an artifact card and put it into your hand?", game)) {
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterArtifactCard("artifact card to reveal and put into your hand"));
|
||||
if (player.choose(Outcome.DrawCard, cards, target, game)) {
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
|
||||
Cards reveal = new CardsImpl(Zone.OUTSIDE);
|
||||
reveal.add(card);
|
||||
player.revealCards("Tezzeret, Agent of Bolas", reveal, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
|
||||
target.setRequired(true);
|
||||
while (cards.size() > 1) {
|
||||
player.choose(Outcome.Neutral, cards, target, game);
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
}
|
||||
target.clearChosen();
|
||||
}
|
||||
if (cards.size() == 1) {
|
||||
Card card = cards.get(cards.iterator().next(), game);
|
||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class ArtifactCreatureToken extends Token {
|
||||
|
||||
public ArtifactCreatureToken() {
|
||||
|
|
|
@ -43,7 +43,7 @@ import java.util.UUID;
|
|||
*/
|
||||
public class AncientStirrings extends CardImpl<AncientStirrings> {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("colorless card");
|
||||
private static final FilterCard filter = new FilterCard("a colorless card");
|
||||
|
||||
static {
|
||||
filter.add(new ColorlessPredicate());
|
||||
|
@ -70,4 +70,3 @@ public class AncientStirrings extends CardImpl<AncientStirrings> {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue