mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 21:02:08 -08:00
* Some more fixed/reworked card movement handling.
This commit is contained in:
parent
7d7b13d5dd
commit
75c8ee35f6
95 changed files with 969 additions and 2192 deletions
|
|
@ -29,12 +29,15 @@ package mage.cards.a;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||||
import mage.cards.*;
|
import mage.cards.*;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
import mage.target.TargetCard;
|
||||||
|
|
@ -49,7 +52,8 @@ public class AncestralMemories extends CardImpl {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{U}{U}");
|
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.
|
// 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 AncestralMemoriesEffect());
|
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(7), false, new StaticValue(2),
|
||||||
|
StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public AncestralMemories(final AncestralMemories card) {
|
public AncestralMemories(final AncestralMemories card) {
|
||||||
|
|
|
||||||
|
|
@ -28,17 +28,13 @@
|
||||||
package mage.cards.b;
|
package mage.cards.b;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||||
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
|
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
|
||||||
import mage.cards.*;
|
import mage.cards.*;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.players.Player;
|
|
||||||
import mage.target.TargetCard;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -50,7 +46,8 @@ public class BitterRevelation extends CardImpl {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}");
|
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.
|
// 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 BitterRevelationEffect());
|
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(4), false, new StaticValue(2),
|
||||||
|
StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false));
|
||||||
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(2));
|
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -63,40 +60,3 @@ public class BitterRevelation extends CardImpl {
|
||||||
return new BitterRevelation(this);
|
return new BitterRevelation(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class BitterRevelationEffect extends OneShotEffect {
|
|
||||||
|
|
||||||
BitterRevelationEffect() {
|
|
||||||
super(Outcome.Benefit);
|
|
||||||
this.staticText = "Look at the top four cards of your library. Put two of them into your hand and the rest into your graveyard";
|
|
||||||
}
|
|
||||||
|
|
||||||
BitterRevelationEffect(final BitterRevelationEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BitterRevelationEffect copy() {
|
|
||||||
return new BitterRevelationEffect(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));
|
|
||||||
if (!cards.isEmpty()) {
|
|
||||||
controller.lookAtCards(source, null, cards, game);
|
|
||||||
TargetCard target = new TargetCard(Math.min(2, cards.size()), Zone.LIBRARY, new FilterCard("two cards to put in your hand"));
|
|
||||||
if (controller.choose(Outcome.DrawCard, cards, target, game)) {
|
|
||||||
Cards toHand = new CardsImpl(target.getTargets());
|
|
||||||
controller.moveCards(toHand, Zone.HAND, source, game);
|
|
||||||
cards.removeAll(toHand);
|
|
||||||
}
|
|
||||||
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ import mage.abilities.effects.common.continuous.PlayWithTheTopCardRevealedEffect
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.cards.CardsImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
|
@ -138,11 +139,11 @@ class CrownOfConvergenceEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player you = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (you != null) {
|
if (controller != null) {
|
||||||
Card card = you.getLibrary().removeFromTop(game);
|
Card card = controller.getLibrary().getFromTop(game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
controller.putCardsOnBottomOfLibrary(new CardsImpl(card), game, source, true);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,19 +28,15 @@
|
||||||
package mage.cards.f;
|
package mage.cards.f;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||||
|
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||||
import mage.abilities.keyword.FlashbackAbility;
|
import mage.abilities.keyword.FlashbackAbility;
|
||||||
import mage.cards.*;
|
import mage.cards.*;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.TimingRule;
|
import mage.constants.TimingRule;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.players.Player;
|
|
||||||
import mage.target.TargetCard;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -49,11 +45,12 @@ import mage.target.TargetCard;
|
||||||
public class ForbiddenAlchemy extends CardImpl {
|
public class ForbiddenAlchemy extends CardImpl {
|
||||||
|
|
||||||
public ForbiddenAlchemy(UUID ownerId, CardSetInfo setInfo) {
|
public ForbiddenAlchemy(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}");
|
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.
|
// 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 ForbiddenAlchemyEffect());
|
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(4), false, new StaticValue(1),
|
||||||
|
StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false));
|
||||||
|
|
||||||
// Flashback {6}{B}
|
// Flashback {6}{B}
|
||||||
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{6}{B}"), TimingRule.INSTANT));
|
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{6}{B}"), TimingRule.INSTANT));
|
||||||
}
|
}
|
||||||
|
|
@ -67,55 +64,3 @@ public class ForbiddenAlchemy extends CardImpl {
|
||||||
return new ForbiddenAlchemy(this);
|
return new ForbiddenAlchemy(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ForbiddenAlchemyEffect extends OneShotEffect {
|
|
||||||
|
|
||||||
public ForbiddenAlchemyEffect() {
|
|
||||||
super(Outcome.DrawCard);
|
|
||||||
this.staticText = "Look at the top four cards of your library. Put one of them into your hand and the rest into your graveyard";
|
|
||||||
}
|
|
||||||
|
|
||||||
public ForbiddenAlchemyEffect(final ForbiddenAlchemyEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ForbiddenAlchemyEffect copy() {
|
|
||||||
return new ForbiddenAlchemyEffect(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
|
||||||
|
|
||||||
if (player != null) {
|
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
int cardsCount = Math.min(4, player.getLibrary().size());
|
|
||||||
for (int i = 0; i < cardsCount; i++) {
|
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!cards.isEmpty()) {
|
|
||||||
player.lookAtCards("Forbidden Alchemy", cards, game);
|
|
||||||
|
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put in your hand"));
|
|
||||||
if (player.choose(Outcome.Benefit, cards, target, game)) {
|
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
|
||||||
if (card != null) {
|
|
||||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
|
||||||
cards.remove(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Card card : cards.getCards(game)) {
|
|
||||||
card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ import mage.constants.Outcome;
|
||||||
import mage.constants.TargetController;
|
import mage.constants.TargetController;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -47,7 +46,7 @@ import mage.players.Player;
|
||||||
public class ForceMastery extends CardImpl {
|
public class ForceMastery extends CardImpl {
|
||||||
|
|
||||||
public ForceMastery(UUID ownerId, CardSetInfo setInfo) {
|
public ForceMastery(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{G}{U}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}{U}{W}");
|
||||||
|
|
||||||
// At the beggining of your upkeep, reveal the top card of your library and put that card into your hand. You gain life equal to its converted mana cost.
|
// At the beggining of your upkeep, reveal the top card of your library and put that card into your hand. You gain life equal to its converted mana cost.
|
||||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ForceMasteryEffect(), TargetController.YOU, false));
|
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ForceMasteryEffect(), TargetController.YOU, false));
|
||||||
|
|
@ -78,18 +77,14 @@ class ForceMasteryEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
if (controller != null) {
|
||||||
if (controller != null && sourcePermanent != null) {
|
Card card = controller.getLibrary().getFromTop(game);
|
||||||
if (controller.getLibrary().hasCards()) {
|
if (card != null) {
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
controller.revealCards(source, new CardsImpl(card), game);
|
||||||
if (card != null) {
|
controller.moveCards(card, Zone.HAND, source, game);
|
||||||
Cards cards = new CardsImpl(card);
|
controller.gainLife(card.getConvertedManaCost(), game, source);
|
||||||
controller.revealCards(sourcePermanent.getIdName(), cards, game);
|
|
||||||
controller.moveCards(card, Zone.HAND, source, game);
|
|
||||||
controller.gainLife(card.getConvertedManaCost(), game, source);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.*;
|
import mage.cards.*;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.TargetController;
|
import mage.constants.TargetController;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
@ -80,16 +80,14 @@ class GalvanothEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null && controller.getLibrary().hasCards()) {
|
if (controller != null) {
|
||||||
Card card = controller.getLibrary().getFromTop(game);
|
Card card = controller.getLibrary().getFromTop(game);
|
||||||
Cards cards = new CardsImpl(card);
|
if (card != null) {
|
||||||
controller.lookAtCards("Galvanoth", cards, game);
|
controller.lookAtCards(source, null, new CardsImpl(card), game);
|
||||||
|
if (card.isInstant() || card.isSorcery()) {
|
||||||
if (card.isInstant() || card.isSorcery()) {
|
if (controller.chooseUse(Outcome.PlayForFree, "Cast " + card.getName() + " without paying its mana cost?", source, game)) {
|
||||||
StringBuilder message = new StringBuilder("Cast ").append(card.getName()).append(" without paying its mana cost?");
|
controller.cast(card.getSpellAbility(), game, true);
|
||||||
if (controller.chooseUse(Outcome.PlayForFree, message.toString(), source, game)) {
|
}
|
||||||
controller.getLibrary().removeFromTop(game);
|
|
||||||
controller.cast(card.getSpellAbility(), game, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ import mage.constants.Outcome;
|
||||||
import mage.constants.TargetController;
|
import mage.constants.TargetController;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -85,29 +84,29 @@ class DuskmarEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent sourceCard = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (sourceCard == null) {
|
if (controller != null) {
|
||||||
return false;
|
boolean putToPlay = true;
|
||||||
}
|
Cards cards = new CardsImpl();
|
||||||
boolean putToPlay = true;
|
for (Player player : game.getPlayers().values()) {
|
||||||
Cards cards = new CardsImpl();
|
if (player.getLibrary().hasCards()) {
|
||||||
for (Player player : game.getPlayers().values()) {
|
Card card = player.getLibrary().removeFromTop(game);
|
||||||
if (player.getLibrary().hasCards()) {
|
if (card != null) {
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
cards.add(card);
|
||||||
if (card != null) {
|
if (!card.isCreature()) {
|
||||||
cards.add(card);
|
putToPlay = false;
|
||||||
if (!card.isCreature()) {
|
}
|
||||||
putToPlay = false;
|
player.revealCards(source, "- Revealed by " + player.getName(), cards, game);
|
||||||
}
|
}
|
||||||
player.revealCards(sourceCard.getName() + ": Revealed by " + player.getName(), cards, game);
|
} else {
|
||||||
|
putToPlay = false;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
putToPlay = false;
|
|
||||||
}
|
}
|
||||||
|
if (putToPlay) {
|
||||||
|
controller.moveCards(cards.getCards(game), Zone.BATTLEFIELD, source, game, false, false, true, null);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
if (putToPlay) {
|
return false;
|
||||||
game.getPlayers().values().iterator().next().moveCards(cards.getCards(game), Zone.BATTLEFIELD, source, game, false, false, true, null);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,9 @@ import mage.abilities.effects.common.CastSourceTriggeredAbility;
|
||||||
import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect;
|
import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect;
|
||||||
import mage.cards.*;
|
import mage.cards.*;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.ComparisonType;
|
import mage.constants.ComparisonType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
|
|
@ -58,7 +58,7 @@ import mage.target.TargetCard;
|
||||||
public class GenesisHydra extends CardImpl {
|
public class GenesisHydra extends CardImpl {
|
||||||
|
|
||||||
public GenesisHydra(UUID ownerId, CardSetInfo setInfo) {
|
public GenesisHydra(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{X}{G}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{X}{G}{G}");
|
||||||
this.subtype.add(SubType.PLANT);
|
this.subtype.add(SubType.PLANT);
|
||||||
this.subtype.add(SubType.HYDRA);
|
this.subtype.add(SubType.HYDRA);
|
||||||
|
|
||||||
|
|
@ -96,49 +96,39 @@ class GenesisHydraPutOntoBattlefieldEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
|
|
||||||
Object obj = getValue(CastSourceTriggeredAbility.SOURCE_CAST_SPELL_ABILITY);
|
Object obj = getValue(CastSourceTriggeredAbility.SOURCE_CAST_SPELL_ABILITY);
|
||||||
int count = 0;
|
if (controller != null && obj != null && obj instanceof SpellAbility) {
|
||||||
if (obj != null && obj instanceof SpellAbility) {
|
int count = ((SpellAbility) obj).getManaCostsToPay().getX();
|
||||||
count = ((SpellAbility) obj).getManaCostsToPay().getX();
|
if (count > 0) {
|
||||||
// using other var because of tooltip
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, count));
|
||||||
int size = Math.min(controller.getLibrary().size(), count);
|
controller.revealCards(source, cards, game);
|
||||||
for (int i = 0; i < size; i++) {
|
FilterCard filter = new FilterPermanentCard("a nonland permanent card with converted mana cost " + count + " or less to put onto the battlefield");
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
|
||||||
cards.add(card);
|
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, count + 1));
|
||||||
}
|
TargetCard target1 = new TargetCard(Zone.LIBRARY, filter);
|
||||||
}
|
target1.setRequired(false);
|
||||||
|
if (cards.count(filter, controller.getId(), source.getSourceId(), game) > 0) {
|
||||||
if (!cards.isEmpty()) {
|
if (controller.choose(Outcome.PutCardInPlay, cards, target1, game)) {
|
||||||
controller.revealCards("Genesis Hydra", cards, game);
|
Card card = cards.get(target1.getFirstTarget(), game);
|
||||||
}
|
if (card != null) {
|
||||||
|
cards.remove(card);
|
||||||
FilterCard filter = new FilterPermanentCard("a nonland permanent card with converted mana cost " + count + " or less to put onto the battlefield");
|
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||||
filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
|
}
|
||||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, count + 1));
|
target1.clearChosen();
|
||||||
TargetCard target1 = new TargetCard(Zone.LIBRARY, filter);
|
} else {
|
||||||
target1.setRequired(false);
|
game.informPlayers(controller.getLogName() + " didn't choose anything");
|
||||||
if (cards.count(filter, controller.getId(), source.getSourceId(), game) > 0) {
|
}
|
||||||
if (controller.choose(Outcome.PutCardInPlay, cards, target1, game)) {
|
} else {
|
||||||
Card card = cards.get(target1.getFirstTarget(), game);
|
game.informPlayers("No nonland permanent card with converted mana cost " + count + " or less to choose.");
|
||||||
if (card != null) {
|
}
|
||||||
cards.remove(card);
|
if (!cards.isEmpty()) {
|
||||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
controller.moveCards(cards, Zone.LIBRARY, source, game);
|
||||||
|
controller.shuffleLibrary(source, game);
|
||||||
}
|
}
|
||||||
target1.clearChosen();
|
|
||||||
} else {
|
|
||||||
game.informPlayers(controller.getLogName() + " didn't choose anything");
|
|
||||||
}
|
}
|
||||||
} else {
|
return true;
|
||||||
game.informPlayers("No nonland permanent card with converted mana cost " + count + " or less to choose.");
|
|
||||||
}
|
}
|
||||||
controller.moveCards(cards, Zone.LIBRARY, source, game);
|
return false;
|
||||||
controller.shuffleLibrary(source, game);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -25,14 +25,10 @@
|
||||||
* authors and should not be interpreted as representing official policies, either expressed
|
* authors and should not be interpreted as representing official policies, either expressed
|
||||||
* or implied, of BetaSteward_at_googlemail.com.
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.*;
|
import mage.cards.*;
|
||||||
|
|
@ -86,35 +82,21 @@ class GenesisWaveEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
if (controller == null) {
|
||||||
if (controller == null || sourceObject == null) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
int xValue = source.getManaCostsToPay().getX();
|
int xValue = source.getManaCostsToPay().getX();
|
||||||
int numberCards = Math.min(controller.getLibrary().size(), xValue);
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, xValue));
|
||||||
for (int i = 0; i < numberCards; i++) {
|
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
controller.revealCards(source, cards, game);
|
||||||
FilterCard filter = new FilterPermanentCard("cards with converted mana cost " + xValue + " or less to put onto the battlefield");
|
FilterCard filter = new FilterPermanentCard("cards with converted mana cost " + xValue + " or less to put onto the battlefield");
|
||||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
||||||
|
|
||||||
TargetCard target1 = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, filter);
|
TargetCard target1 = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, filter);
|
||||||
target1.setRequired(false);
|
target1.setNotTarget(true);
|
||||||
|
|
||||||
controller.choose(Outcome.PutCardInPlay, cards, target1, game);
|
controller.choose(Outcome.PutCardInPlay, cards, target1, game);
|
||||||
Set<Card> toBattlefield = new LinkedHashSet<>();
|
Cards toBattlefield = new CardsImpl(target1.getTargets());
|
||||||
for (UUID cardId : target1.getTargets()) {
|
cards.removeAll(toBattlefield);
|
||||||
Card card = cards.get(cardId, game);
|
controller.moveCards(toBattlefield.getCards(game), Zone.BATTLEFIELD, source, game, false, false, false, null);
|
||||||
if (card != null) {
|
|
||||||
cards.remove(card);
|
|
||||||
toBattlefield.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, false, false, false, null);
|
|
||||||
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
|
@ -49,9 +48,9 @@ import mage.players.Player;
|
||||||
public class GhoulcallersBell extends CardImpl {
|
public class GhoulcallersBell extends CardImpl {
|
||||||
|
|
||||||
public GhoulcallersBell(UUID ownerId, CardSetInfo setInfo) {
|
public GhoulcallersBell(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
|
||||||
|
|
||||||
// {tap}: Each player puts the top card of their library into their graveyard.
|
// {T}: Each player puts the top card of their library into their graveyard.
|
||||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GhoulcallersBellEffect(), new TapSourceCost()));
|
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GhoulcallersBellEffect(), new TapSourceCost()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -83,10 +82,10 @@ class GhoulcallersBellEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Collection<Player> players = game.getPlayers().values();
|
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||||
for (Player player : players) {
|
Player player = game.getPlayer(playerId);
|
||||||
if (player.getLibrary().hasCards()) {
|
if (player != null) {
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
Card card = player.getLibrary().getFromTop(game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
player.moveCards(card, Zone.GRAVEYARD, source, game);
|
player.moveCards(card, Zone.GRAVEYARD, source, game);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,7 @@ import mage.target.TargetCard;
|
||||||
public class GiftOfTheGargantuan extends CardImpl {
|
public class GiftOfTheGargantuan extends CardImpl {
|
||||||
|
|
||||||
public GiftOfTheGargantuan(UUID ownerId, CardSetInfo setInfo) {
|
public GiftOfTheGargantuan(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}");
|
||||||
|
|
||||||
|
|
||||||
// Look at the top four cards of your library. You may reveal a creature card and/or a land card from among them and put the revealed cards into your hand. Put the rest on the bottom of your library in any order.
|
// Look at the top four cards of your library. You may reveal a creature card and/or a land card 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 GiftOfTheGargantuanEffect());
|
this.getSpellAbility().addEffect(new GiftOfTheGargantuanEffect());
|
||||||
|
|
@ -86,52 +85,32 @@ class GiftOfTheGargantuanEffect extends OneShotEffect {
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 4));
|
||||||
Cards cards = new CardsImpl();
|
player.lookAtCards(source, null, cards, game);
|
||||||
boolean creatureCardFound = false;
|
Cards revealedCards = new CardsImpl();
|
||||||
boolean landCardFound = false;
|
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCreatureCard("creature card to reveal and put into your hand"));
|
||||||
int count = Math.min(player.getLibrary().size(), 4);
|
if (target.canChoose(source.getControllerId(), game)
|
||||||
for (int i = 0; i < count; i++) {
|
&& player.choose(Outcome.DrawCard, cards, target, game)) {
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
Card card = cards.get(target.getFirstTarget(), game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
cards.add(card);
|
cards.remove(card);
|
||||||
if (card.isCreature()) {
|
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||||
creatureCardFound = true;
|
revealedCards.add(card);
|
||||||
}
|
|
||||||
if (card.isLand()) {
|
|
||||||
landCardFound = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.lookAtCards("Gift of the Gargantuan", cards, game);
|
target = new TargetCard(Zone.LIBRARY, new FilterLandCard("land card to reveal and put into your hand"));
|
||||||
|
if (target.canChoose(source.getControllerId(), game)
|
||||||
if ((creatureCardFound || landCardFound) && player.chooseUse(Outcome.DrawCard, "Do you wish to reveal a creature card and/or a land card and put them into your hand?", source, game)) {
|
&& player.choose(Outcome.DrawCard, cards, target, game)) {
|
||||||
Cards revealedCards = new CardsImpl();
|
Card card = cards.get(target.getFirstTarget(), game);
|
||||||
|
if (card != null) {
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCreatureCard("creature card to reveal and put into your hand"));
|
cards.remove(card);
|
||||||
if (creatureCardFound && player.choose(Outcome.DrawCard, cards, target, game)) {
|
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
revealedCards.add(card);
|
||||||
if (card != null) {
|
|
||||||
cards.remove(card);
|
|
||||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
|
||||||
revealedCards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
target = new TargetCard(Zone.LIBRARY, new FilterLandCard("land card to reveal and put into your hand"));
|
|
||||||
if (landCardFound && 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.getSourceId(), game, false);
|
|
||||||
revealedCards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!revealedCards.isEmpty()) {
|
|
||||||
player.revealCards("Gift of the Gargantuan", revealedCards, game);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!revealedCards.isEmpty()) {
|
||||||
|
player.revealCards(source, revealedCards, game);
|
||||||
|
}
|
||||||
player.putCardsOnBottomOfLibrary(cards, game, source, true);
|
player.putCardsOnBottomOfLibrary(cards, game, source, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,18 +27,14 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.keyword.TrampleAbility;
|
import mage.abilities.keyword.TrampleAbility;
|
||||||
import mage.abilities.keyword.VigilanceAbility;
|
import mage.abilities.keyword.VigilanceAbility;
|
||||||
import mage.abilities.keyword.HasteAbility;
|
import mage.abilities.keyword.HasteAbility;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
import mage.cards.Cards;
|
||||||
|
|
@ -94,12 +90,6 @@ public class GishathSunsAvatar extends CardImpl {
|
||||||
|
|
||||||
class GishathSunsAvatarEffect extends OneShotEffect {
|
class GishathSunsAvatarEffect extends OneShotEffect {
|
||||||
|
|
||||||
private static final FilterCreatureCard filter = new FilterCreatureCard("Dinosaur creature cards");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new SubtypePredicate(SubType.DINOSAUR));
|
|
||||||
}
|
|
||||||
|
|
||||||
GishathSunsAvatarEffect() {
|
GishathSunsAvatarEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "reveal that many cards from the top of your library. Put any number of Dinosaur creature cards from among them onto the battlefield and the rest on the bottom of your library in a random order";
|
this.staticText = "reveal that many cards from the top of your library. Put any number of Dinosaur creature cards from among them onto the battlefield and the rest on the bottom of your library in a random order";
|
||||||
|
|
@ -117,31 +107,21 @@ class GishathSunsAvatarEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
if (controller == null) {
|
||||||
if (controller == null || sourceObject == null) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
int xValue = (Integer) getValue("damage");
|
int xValue = (Integer) getValue("damage");
|
||||||
int numberCards = Math.min(controller.getLibrary().size(), xValue);
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, xValue));
|
||||||
for (int i = 0; i < numberCards; i++) {
|
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
controller.revealCards(source, cards, game);
|
||||||
|
FilterCreatureCard filter = new FilterCreatureCard("Dinosaur creature cards");
|
||||||
|
filter.add(new SubtypePredicate(SubType.DINOSAUR));
|
||||||
TargetCard target1 = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, filter);
|
TargetCard target1 = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, filter);
|
||||||
target1.setRequired(false);
|
target1.setNotTarget(true);
|
||||||
controller.choose(Outcome.PutCardInPlay, cards, target1, game);
|
controller.choose(Outcome.PutCardInPlay, cards, target1, game);
|
||||||
Set<Card> toBattlefield = new LinkedHashSet<>();
|
Cards toBattlefield = new CardsImpl(target1.getTargets());
|
||||||
for (UUID cardId : target1.getTargets()) {
|
cards.removeAll(toBattlefield);
|
||||||
Card card = cards.get(cardId, game);
|
controller.moveCards(toBattlefield.getCards(game), Zone.BATTLEFIELD, source, game, false, false, false, null);
|
||||||
if (card != null) {
|
|
||||||
cards.remove(card);
|
|
||||||
toBattlefield.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, false, false, false, null);
|
|
||||||
controller.putCardsOnBottomOfLibrary(cards, game, source, false);
|
controller.putCardsOnBottomOfLibrary(cards, game, source, false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -28,16 +28,12 @@
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||||
import mage.cards.*;
|
import mage.cards.*;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.players.Player;
|
|
||||||
import mage.target.TargetCard;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -46,11 +42,11 @@ import mage.target.TargetCard;
|
||||||
public class GlimpseTheFuture extends CardImpl {
|
public class GlimpseTheFuture extends CardImpl {
|
||||||
|
|
||||||
public GlimpseTheFuture(UUID ownerId, CardSetInfo setInfo) {
|
public GlimpseTheFuture(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{U}");
|
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.
|
||||||
// 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(new StaticValue(3), false, new StaticValue(1),
|
||||||
this.getSpellAbility().addEffect(new GlimpseTheFutureEffect());
|
StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -63,51 +59,3 @@ public class GlimpseTheFuture extends CardImpl {
|
||||||
return new GlimpseTheFuture(this);
|
return new GlimpseTheFuture(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
class GlimpseTheFutureEffect extends OneShotEffect {
|
|
||||||
|
|
||||||
public GlimpseTheFutureEffect() {
|
|
||||||
super(Outcome.DrawCard);
|
|
||||||
this.staticText = "Look at the top three cards of your library. Put one of them into your hand and the rest into your graveyard";
|
|
||||||
}
|
|
||||||
|
|
||||||
public GlimpseTheFutureEffect(final GlimpseTheFutureEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public GlimpseTheFutureEffect copy() {
|
|
||||||
return new GlimpseTheFutureEffect(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
|
||||||
|
|
||||||
if (controller != null) {
|
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
int cardsCount = Math.min(3, controller.getLibrary().size());
|
|
||||||
for (int i = 0; i < cardsCount; i++) {
|
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!cards.isEmpty()) {
|
|
||||||
controller.lookAtCards("Glimpse the Future", cards, game);
|
|
||||||
|
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put in your hand"));
|
|
||||||
if (controller.choose(Outcome.Benefit, cards, target, game)) {
|
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
|
||||||
if (card != null) {
|
|
||||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
|
||||||
cards.remove(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -29,22 +29,20 @@ package mage.cards.g;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.CardsImpl;
|
import mage.cards.CardsImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Library;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -93,27 +91,20 @@ class GoblinMachinistEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
if (controller != null) {
|
||||||
if (controller != null && sourceObject != null) {
|
CardsImpl cards = new CardsImpl();
|
||||||
if (controller.getLibrary().hasCards()) {
|
for (Card card : controller.getLibrary().getCards(game)) {
|
||||||
|
|
||||||
CardsImpl cards = new CardsImpl();
|
|
||||||
Library library = controller.getLibrary();
|
|
||||||
Card card = null;
|
|
||||||
do {
|
|
||||||
card = library.removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
} while (library.hasCards() && card != null && card.isLand());
|
|
||||||
if (!cards.isEmpty()) {
|
|
||||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
|
||||||
}
|
|
||||||
boolean retVal = false;
|
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
retVal = new BoostSourceEffect(card.getConvertedManaCost(), 0, Duration.EndOfTurn).apply(game, source);
|
cards.add(card);
|
||||||
|
if (!card.isLand()) {
|
||||||
|
if (card.getConvertedManaCost() > 0) {
|
||||||
|
game.addEffect(new BoostSourceEffect(card.getConvertedManaCost(), 0, Duration.EndOfTurn), source);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return controller.putCardsOnBottomOfLibrary(cards, game, source, true) && retVal;
|
controller.revealCards(source, cards, game);
|
||||||
|
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ import mage.target.TargetPlayer;
|
||||||
public class Grindstone extends CardImpl {
|
public class Grindstone extends CardImpl {
|
||||||
|
|
||||||
public Grindstone(UUID ownerId, CardSetInfo setInfo) {
|
public Grindstone(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
|
||||||
|
|
||||||
// {3}, {T}: Target player puts the top two cards of their library into their graveyard. If both cards share a color, repeat this process.
|
// {3}, {T}: Target player puts the top two cards of their library into their graveyard. If both cards share a color, repeat this process.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GrindstoneEffect(), new ManaCostsImpl("{3}"));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GrindstoneEffect(), new ManaCostsImpl("{3}"));
|
||||||
|
|
@ -87,10 +87,11 @@ class GrindstoneEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||||
boolean colorShared;
|
|
||||||
if (targetPlayer != null) {
|
if (targetPlayer != null) {
|
||||||
int possibleIterations = targetPlayer.getLibrary().size() / 2;
|
int possibleIterations = targetPlayer.getLibrary().size() / 2;
|
||||||
int iteration = 0;
|
int iteration = 0;
|
||||||
|
boolean colorShared;
|
||||||
do {
|
do {
|
||||||
iteration++;
|
iteration++;
|
||||||
if (iteration > possibleIterations + 20) {
|
if (iteration > possibleIterations + 20) {
|
||||||
|
|
@ -102,16 +103,19 @@ class GrindstoneEffect extends OneShotEffect {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
colorShared = false;
|
colorShared = false;
|
||||||
Cards cards = new CardsImpl();
|
Card card1 = null;
|
||||||
cards.addAll(targetPlayer.getLibrary().getTopCards(game, 2));
|
Cards toGraveyard = new CardsImpl();
|
||||||
if (!cards.isEmpty()) {
|
for (Card card : targetPlayer.getLibrary().getCards(game)) {
|
||||||
Card card1 = targetPlayer.getLibrary().removeFromTop(game);
|
toGraveyard.add(card);
|
||||||
if (targetPlayer.getLibrary().hasCards()) {
|
if (card1 == null) {
|
||||||
colorShared = card1.getColor(game).shares(targetPlayer.getLibrary().removeFromTop(game).getColor(game));
|
card1 = card;
|
||||||
|
} else {
|
||||||
|
colorShared = card1.getColor(game).shares(card.getColor(game));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
targetPlayer.moveCards(cards, Zone.GRAVEYARD, source, game);
|
targetPlayer.moveCards(toGraveyard, Zone.GRAVEYARD, source, game);
|
||||||
} while (colorShared && targetPlayer.canRespond());
|
} while (colorShared);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.*;
|
import mage.cards.*;
|
||||||
|
|
@ -49,7 +48,7 @@ import mage.target.TargetCard;
|
||||||
public class GrislySalvage extends CardImpl {
|
public class GrislySalvage extends CardImpl {
|
||||||
|
|
||||||
public GrislySalvage(UUID ownerId, CardSetInfo setInfo) {
|
public GrislySalvage(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}{G}");
|
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.
|
// 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());
|
this.getSpellAbility().addEffect(new GrislySalvageEffect());
|
||||||
|
|
@ -68,6 +67,7 @@ public class GrislySalvage extends CardImpl {
|
||||||
class GrislySalvageEffect extends OneShotEffect {
|
class GrislySalvageEffect extends OneShotEffect {
|
||||||
|
|
||||||
private static final FilterCard filterPutInHand = new FilterCard("creature or land card to put in hand");
|
private static final FilterCard filterPutInHand = new FilterCard("creature or land card to put in hand");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filterPutInHand.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND)));
|
filterPutInHand.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND)));
|
||||||
}
|
}
|
||||||
|
|
@ -89,22 +89,14 @@ class GrislySalvageEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
if (controller != null) {
|
||||||
if (sourceObject != null && controller != null) {
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 5));
|
||||||
Cards cards = new CardsImpl();
|
boolean properCardFound = cards.count(filterPutInHand, game) > 0;
|
||||||
cards.addAll(controller.getLibrary().getTopCards(game, 5));
|
|
||||||
boolean properCardFound = false;
|
|
||||||
for (Card card: cards.getCards(game)) {
|
|
||||||
if (filterPutInHand.match(card, source.getSourceId(), source.getControllerId(), game)) {
|
|
||||||
properCardFound = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
controller.revealCards(sourceObject.getName(), cards, game);
|
controller.revealCards(source, cards, game);
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, filterPutInHand);
|
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) &&
|
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)) {
|
&& controller.choose(Outcome.DrawCard, cards, target, game)) {
|
||||||
Card card = game.getCard(target.getFirstTarget());
|
Card card = game.getCard(target.getFirstTarget());
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
controller.moveCards(card, Zone.HAND, source, game);
|
controller.moveCards(card, Zone.HAND, source, game);
|
||||||
|
|
|
||||||
|
|
@ -29,20 +29,15 @@ package mage.cards.g;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.common.ExploitCreatureTriggeredAbility;
|
import mage.abilities.common.ExploitCreatureTriggeredAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||||
|
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||||
import mage.abilities.keyword.ExploitAbility;
|
import mage.abilities.keyword.ExploitAbility;
|
||||||
import mage.cards.*;
|
import mage.cards.*;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.players.Player;
|
|
||||||
import mage.target.TargetCard;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -51,7 +46,7 @@ import mage.target.TargetCard;
|
||||||
public class GurmagDrowner extends CardImpl {
|
public class GurmagDrowner extends CardImpl {
|
||||||
|
|
||||||
public GurmagDrowner(UUID ownerId, CardSetInfo setInfo) {
|
public GurmagDrowner(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
|
||||||
this.subtype.add(SubType.NAGA);
|
this.subtype.add(SubType.NAGA);
|
||||||
this.subtype.add(SubType.WIZARD);
|
this.subtype.add(SubType.WIZARD);
|
||||||
this.power = new MageInt(2);
|
this.power = new MageInt(2);
|
||||||
|
|
@ -59,9 +54,10 @@ public class GurmagDrowner extends CardImpl {
|
||||||
|
|
||||||
// Exploit
|
// Exploit
|
||||||
this.addAbility(new ExploitAbility());
|
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.
|
// 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 GurmagDrownerEffect(), false));
|
this.addAbility(new ExploitCreatureTriggeredAbility(new LookLibraryAndPickControllerEffect(new StaticValue(4), false, new StaticValue(1),
|
||||||
|
StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false), false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public GurmagDrowner(final GurmagDrowner card) {
|
public GurmagDrowner(final GurmagDrowner card) {
|
||||||
|
|
@ -73,44 +69,3 @@ public class GurmagDrowner extends CardImpl {
|
||||||
return new GurmagDrowner(this);
|
return new GurmagDrowner(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class GurmagDrownerEffect extends OneShotEffect {
|
|
||||||
|
|
||||||
public GurmagDrownerEffect() {
|
|
||||||
super(Outcome.DrawCard);
|
|
||||||
this.staticText = "look at the top four cards of your library. Put one of them into your hand and the rest into your graveyard";
|
|
||||||
}
|
|
||||||
|
|
||||||
public GurmagDrownerEffect(final GurmagDrownerEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public GurmagDrownerEffect copy() {
|
|
||||||
return new GurmagDrownerEffect(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
|
||||||
if (controller != null && sourceObject != null) {
|
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
cards.addAll(controller.getLibrary().getTopCards(game, 4));
|
|
||||||
if (!cards.isEmpty()) {
|
|
||||||
controller.lookAtCards(sourceObject.getName(), cards, game);
|
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put in your hand"));
|
|
||||||
if (controller.choose(Outcome.Benefit, cards, target, game)) {
|
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
|
||||||
if (card != null) {
|
|
||||||
controller.moveCards(card, Zone.HAND, source, game);
|
|
||||||
cards.remove(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,8 @@ import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
@ -47,10 +47,9 @@ import mage.players.Player;
|
||||||
public class HeedTheMists extends CardImpl {
|
public class HeedTheMists extends CardImpl {
|
||||||
|
|
||||||
public HeedTheMists(UUID ownerId, CardSetInfo setInfo) {
|
public HeedTheMists(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}{U}");
|
||||||
this.subtype.add(SubType.ARCANE);
|
this.subtype.add(SubType.ARCANE);
|
||||||
|
|
||||||
|
|
||||||
// Put the top card of your library into your graveyard, then draw cards equal to that card's converted mana cost.
|
// Put the top card of your library into your graveyard, then draw cards equal to that card's converted mana cost.
|
||||||
this.getSpellAbility().addEffect(new HeedTheMistsEffect());
|
this.getSpellAbility().addEffect(new HeedTheMistsEffect());
|
||||||
}
|
}
|
||||||
|
|
@ -80,7 +79,7 @@ public class HeedTheMists extends CardImpl {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
Card card = controller.getLibrary().getFromTop(game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
int cmc = card.getConvertedManaCost();
|
int cmc = card.getConvertedManaCost();
|
||||||
controller.moveCards(card, Zone.GRAVEYARD, source, game);
|
controller.moveCards(card, Zone.GRAVEYARD, source, game);
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ import mage.target.common.TargetOpponent;
|
||||||
public class HelmOfObedience extends CardImpl {
|
public class HelmOfObedience extends CardImpl {
|
||||||
|
|
||||||
public HelmOfObedience(UUID ownerId, CardSetInfo setInfo) {
|
public HelmOfObedience(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
|
||||||
|
|
||||||
// {X}, {T}: Target opponent puts cards from the top of their library into their graveyard until a creature card or X cards are put into that graveyard this way, whichever comes first. If a creature card is put into that graveyard this way, sacrifice Helm of Obedience and put that card onto the battlefield under your control. X can't be 0.
|
// {X}, {T}: Target opponent puts cards from the top of their library into their graveyard until a creature card or X cards are put into that graveyard this way, whichever comes first. If a creature card is put into that graveyard this way, sacrifice Helm of Obedience and put that card onto the battlefield under your control. X can't be 0.
|
||||||
VariableManaCost xCosts = new VariableManaCost();
|
VariableManaCost xCosts = new VariableManaCost();
|
||||||
|
|
@ -73,22 +73,19 @@ public class HelmOfObedience extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class HelmOfObedienceEffect extends OneShotEffect {
|
class HelmOfObedienceEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
|
||||||
private static final ManacostVariableValue amount = new ManacostVariableValue();
|
private static final ManacostVariableValue amount = new ManacostVariableValue();
|
||||||
|
|
||||||
public HelmOfObedienceEffect() {
|
public HelmOfObedienceEffect() {
|
||||||
super(Outcome.Detriment);
|
super(Outcome.Detriment);
|
||||||
staticText = "Target opponent puts cards from the top of their library into their graveyard until a creature card or X cards are put into that graveyard this way, whichever comes first. If a creature card is put into that graveyard this way, sacrifice Helm of Obedience and put that card onto the battlefield under your control. X can't be 0";
|
staticText = "Target opponent puts cards from the top of their library into their graveyard until a creature card or X cards are put into that graveyard this way, whichever comes first. If a creature card is put into that graveyard this way, sacrifice {this} and put that card onto the battlefield under your control. X can't be 0";
|
||||||
}
|
}
|
||||||
|
|
||||||
public HelmOfObedienceEffect(final HelmOfObedienceEffect effect) {
|
public HelmOfObedienceEffect(final HelmOfObedienceEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HelmOfObedienceEffect copy() {
|
public HelmOfObedienceEffect copy() {
|
||||||
return new HelmOfObedienceEffect(this);
|
return new HelmOfObedienceEffect(this);
|
||||||
|
|
@ -96,36 +93,29 @@ class HelmOfObedienceEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Player targetOpponent = game.getPlayer(targetPointer.getFirst(game, source));
|
Player targetOpponent = game.getPlayer(targetPointer.getFirst(game, source));
|
||||||
if (targetOpponent != null) {
|
int max = amount.calculate(game, source, this);
|
||||||
int max = amount.calculate(game, source, this);
|
if (targetOpponent != null && controller != null && max > 0) {
|
||||||
if(max != 0){
|
int numberOfCard = 0;
|
||||||
int numberOfCard = 0;
|
for (Card card : targetOpponent.getLibrary().getCards(game)) {
|
||||||
|
if (card != null) {
|
||||||
while(targetOpponent.getLibrary().hasCards()) {
|
if (targetOpponent.moveCards(card, Zone.GRAVEYARD, source, game)) {
|
||||||
Card card = targetOpponent.getLibrary().removeFromTop(game);
|
if (card.isCreature()) {
|
||||||
if (card != null){
|
// If a creature card is put into that graveyard this way, sacrifice Helm of Obedience
|
||||||
if (targetOpponent.moveCards(card, Zone.GRAVEYARD, source, game)) {
|
// and put that card onto the battlefield under your control.
|
||||||
if(card.isCreature()){
|
Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game);
|
||||||
// If a creature card is put into that graveyard this way, sacrifice Helm of Obedience
|
if (sourcePermanent != null) {
|
||||||
// and put that card onto the battlefield under your control.
|
sourcePermanent.sacrifice(source.getSourceId(), game);
|
||||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
}
|
||||||
if (sourcePermanent != null) {
|
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||||
sourcePermanent.sacrifice(source.getSourceId(), game);
|
break;
|
||||||
}
|
} else {
|
||||||
if (game.getState().getZone(card.getId()) == Zone.GRAVEYARD) {
|
numberOfCard++;
|
||||||
card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
|
if (numberOfCard >= max) {
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
} else{
|
|
||||||
numberOfCard++;
|
|
||||||
if(numberOfCard >= max){
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else{
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.i;
|
package mage.cards.i;
|
||||||
|
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
import mage.abilities.SpellAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
|
@ -104,8 +103,7 @@ class IndomitableCreativityEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
if (controller != null) {
|
||||||
if (controller != null && sourceObject != null) {
|
|
||||||
List<Permanent> destroyedPermanents = new ArrayList<>();
|
List<Permanent> destroyedPermanents = new ArrayList<>();
|
||||||
for (UUID targetId : getTargetPointer().getTargets(game, source)) {
|
for (UUID targetId : getTargetPointer().getTargets(game, source)) {
|
||||||
Permanent target = game.getPermanent(targetId);
|
Permanent target = game.getPermanent(targetId);
|
||||||
|
|
@ -115,47 +113,25 @@ class IndomitableCreativityEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Map<Player, Cards> cardsToReveal = new HashMap<>();
|
|
||||||
|
|
||||||
for (Permanent permanent : destroyedPermanents) {
|
for (Permanent permanent : destroyedPermanents) {
|
||||||
Player controllerOfDestroyedCreature = game.getPlayer(permanent.getControllerId());
|
Player controllerOfDestroyedCreature = game.getPlayer(permanent.getControllerId());
|
||||||
if (controllerOfDestroyedCreature != null) {
|
if (controllerOfDestroyedCreature != null) {
|
||||||
Library library = controllerOfDestroyedCreature.getLibrary();
|
Library library = controllerOfDestroyedCreature.getLibrary();
|
||||||
if (library.hasCards()) {
|
if (library.hasCards()) {
|
||||||
Cards cards = new CardsImpl();
|
Cards cardsToReaveal = new CardsImpl();
|
||||||
Cards revealCards;
|
for (Card card : library.getCards(game)) {
|
||||||
if (cardsToReveal.containsKey(controllerOfDestroyedCreature)) {
|
cardsToReaveal.add(card);
|
||||||
revealCards = cardsToReveal.get(controllerOfDestroyedCreature);
|
|
||||||
} else {
|
|
||||||
revealCards = new CardsImpl();
|
|
||||||
cardsToReveal.put(controllerOfDestroyedCreature, revealCards);
|
|
||||||
}
|
|
||||||
Card card = library.removeFromTop(game);
|
|
||||||
cards.add(card);
|
|
||||||
while (!card.isCreature() && !card.isArtifact() && library.hasCards()) {
|
|
||||||
card = library.removeFromTop(game);
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!cards.isEmpty()) {
|
|
||||||
revealCards.addAll(cards);
|
|
||||||
if (card.isCreature() || card.isArtifact()) {
|
if (card.isCreature() || card.isArtifact()) {
|
||||||
controllerOfDestroyedCreature.moveCards(card, Zone.EXILED, source, game);
|
controllerOfDestroyedCreature.moveCards(card, Zone.EXILED, source, game);
|
||||||
controllerOfDestroyedCreature.moveCards(card, Zone.BATTLEFIELD, source, game);
|
controllerOfDestroyedCreature.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
Set<Card> cardsToShuffle = cards.getCards(game);
|
|
||||||
cardsToShuffle.remove(card);
|
|
||||||
library.addAll(cardsToShuffle, game);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
controllerOfDestroyedCreature.revealCards(source, " for destroyed " + permanent.getIdName(), cardsToReaveal, game);
|
||||||
controllerOfDestroyedCreature.shuffleLibrary(source, game);
|
controllerOfDestroyedCreature.shuffleLibrary(source, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// reveal cards at the end (because a player can have x permanents to be destroyed
|
|
||||||
for (Player player : cardsToReveal.keySet()) {
|
|
||||||
player.revealCards(sourceObject.getIdName(), cardsToReveal.get(player), game);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
package mage.cards.j;
|
package mage.cards.j;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
|
@ -72,7 +71,7 @@ import mage.util.CardUtil;
|
||||||
public class JaceArchitectOfThought extends CardImpl {
|
public class JaceArchitectOfThought extends CardImpl {
|
||||||
|
|
||||||
public JaceArchitectOfThought(UUID ownerId, CardSetInfo setInfo) {
|
public JaceArchitectOfThought(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.PLANESWALKER},"{2}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{U}{U}");
|
||||||
this.addSuperType(SuperType.LEGENDARY);
|
this.addSuperType(SuperType.LEGENDARY);
|
||||||
this.subtype.add(SubType.JACE);
|
this.subtype.add(SubType.JACE);
|
||||||
|
|
||||||
|
|
@ -192,16 +191,8 @@ class JaceArchitectOfThoughtEffect2 extends OneShotEffect {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cards cards = new CardsImpl();
|
Cards allCards = new CardsImpl(player.getLibrary().getTopCards(game, 3));
|
||||||
int count = Math.min(player.getLibrary().size(), 3);
|
player.revealCards(source, allCards, game);
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
player.revealCards("Jace, Architect of Thought", cards, game);
|
|
||||||
|
|
||||||
Set<UUID> opponents = game.getOpponents(source.getControllerId());
|
Set<UUID> opponents = game.getOpponents(source.getControllerId());
|
||||||
if (!opponents.isEmpty()) {
|
if (!opponents.isEmpty()) {
|
||||||
Player opponent = null;
|
Player opponent = null;
|
||||||
|
|
@ -215,50 +206,24 @@ class JaceArchitectOfThoughtEffect2 extends OneShotEffect {
|
||||||
opponent = game.getPlayer(opponents.iterator().next());
|
opponent = game.getPlayer(opponents.iterator().next());
|
||||||
}
|
}
|
||||||
|
|
||||||
TargetCard target = new TargetCard(0, cards.size(), Zone.LIBRARY, new FilterCard("cards to put in the first pile"));
|
TargetCard target = new TargetCard(0, allCards.size(), Zone.LIBRARY, new FilterCard("cards to put in the first pile"));
|
||||||
target.setRequired(false);
|
target.setNotTarget(true);
|
||||||
Cards pile1 = new CardsImpl();
|
opponent.choose(Outcome.Neutral, allCards, target, game);
|
||||||
if (opponent.choose(Outcome.Neutral, cards, target, game)) {
|
Cards pile1 = new CardsImpl(target.getTargets());
|
||||||
for (UUID targetId : (List<UUID>) target.getTargets()) {
|
Cards pile2 = new CardsImpl(allCards);
|
||||||
Card card = cards.get(targetId, game);
|
pile2.removeAll(pile1);
|
||||||
if (card != null) {
|
player.revealCards(source, "Pile 1", pile1, game);
|
||||||
pile1.add(card);
|
player.revealCards(source, "Pile 2", pile2, game);
|
||||||
cards.remove(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
player.revealCards("Pile 1 (Jace, Architect of Thought)", pile1, game);
|
|
||||||
player.revealCards("Pile 2 (Jace, Architect of Thought)", cards, game);
|
|
||||||
|
|
||||||
postPileToLog("Pile 1", pile1.getCards(game), game);
|
postPileToLog("Pile 1", pile1.getCards(game), game);
|
||||||
postPileToLog("Pile 2", cards.getCards(game), game);
|
postPileToLog("Pile 2", pile2.getCards(game), game);
|
||||||
|
|
||||||
Cards cardsToHand = cards;
|
boolean pileChoice = player.choosePile(Outcome.Neutral, "Choose a pile to to put into your hand.",
|
||||||
Cards cardsToLibrary = pile1;
|
new ArrayList<>(pile1.getCards(game)),
|
||||||
List<Card> cardPile1 = new ArrayList<>();
|
new ArrayList<>(allCards.getCards(game)), game);
|
||||||
List<Card> cardPile2 = new ArrayList<>();
|
|
||||||
for (UUID cardId : pile1) {
|
|
||||||
cardPile1.add(game.getCard(cardId));
|
|
||||||
}
|
|
||||||
for (UUID cardId : cards) {
|
|
||||||
cardPile2.add(game.getCard(cardId));
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean pileChoice = player.choosePile(Outcome.Neutral, "Choose a pile to to put into your hand.", cardPile1, cardPile2, game);
|
|
||||||
if (pileChoice) {
|
|
||||||
cardsToHand = pile1;
|
|
||||||
cardsToLibrary = cards;
|
|
||||||
}
|
|
||||||
game.informPlayers(player.getLogName() + " chose pile" + (pileChoice ? "1" : "2"));
|
game.informPlayers(player.getLogName() + " chose pile" + (pileChoice ? "1" : "2"));
|
||||||
|
player.moveCards(pileChoice ? pile1 : pile2, Zone.HAND, source, game);
|
||||||
for (UUID cardUuid : cardsToHand) {
|
player.putCardsOnBottomOfLibrary(pileChoice ? pile2 : pile1, game, source, true);
|
||||||
Card card = cardsToHand.get(cardUuid, game);
|
|
||||||
if (card != null) {
|
|
||||||
player.moveCards(card, Zone.HAND, source, game);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
player.putCardsOnBottomOfLibrary(cardsToLibrary, game, source, true);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,8 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
import mage.cards.Cards;
|
||||||
import mage.cards.CardsImpl;
|
import mage.cards.CardsImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.SuperType;
|
import mage.constants.SuperType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
@ -55,7 +55,7 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
public class JaceTheMindSculptor extends CardImpl {
|
public class JaceTheMindSculptor extends CardImpl {
|
||||||
|
|
||||||
public JaceTheMindSculptor(UUID ownerId, CardSetInfo setInfo) {
|
public JaceTheMindSculptor(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.PLANESWALKER},"{2}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{U}{U}");
|
||||||
this.addSuperType(SuperType.LEGENDARY);
|
this.addSuperType(SuperType.LEGENDARY);
|
||||||
this.subtype.add(SubType.JACE);
|
this.subtype.add(SubType.JACE);
|
||||||
|
|
||||||
|
|
@ -150,21 +150,12 @@ class JaceTheMindSculptorEffect2 extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getFirstTarget());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (player != null) {
|
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||||
while (true) {
|
if (controller != null && targetPlayer != null) {
|
||||||
if (player.getLibrary().getFromTop(game) == null) {
|
controller.moveCards(targetPlayer.getLibrary().getTopCards(game, targetPlayer.getLibrary().size()), Zone.EXILED, source, game);
|
||||||
break;
|
targetPlayer.moveCards(targetPlayer.getHand(), Zone.LIBRARY, source, game);
|
||||||
}
|
targetPlayer.shuffleLibrary(source, game);
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
card.moveToExile(null, "", source.getSourceId(), game);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Card card : player.getHand().getCards(game)) {
|
|
||||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
|
||||||
}
|
|
||||||
player.shuffleLibrary(source, game);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
import mage.cards.Cards;
|
||||||
|
|
@ -62,7 +61,7 @@ import mage.target.TargetCard;
|
||||||
public class JarOfEyeballs extends CardImpl {
|
public class JarOfEyeballs extends CardImpl {
|
||||||
|
|
||||||
public JarOfEyeballs(UUID ownerId, CardSetInfo setInfo) {
|
public JarOfEyeballs(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||||
|
|
||||||
// Whenever a creature you control dies, put two eyeball counters on Jar of Eyeballs.
|
// Whenever a creature you control dies, put two eyeball counters on Jar of Eyeballs.
|
||||||
this.addAbility(new JarOfEyeballsTriggeredAbility());
|
this.addAbility(new JarOfEyeballsTriggeredAbility());
|
||||||
|
|
@ -184,37 +183,25 @@ class JarOfEyeballsEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
if (controller == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
int countersRemoved = 0;
|
int countersRemoved = 0;
|
||||||
for (Cost cost : source.getCosts()) {
|
for (Cost cost : source.getCosts()) {
|
||||||
if (cost instanceof JarOfEyeballsCost) {
|
if (cost instanceof JarOfEyeballsCost) {
|
||||||
countersRemoved = ((JarOfEyeballsCost) cost).getRemovedCounters();
|
countersRemoved = ((JarOfEyeballsCost) cost).getRemovedCounters();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, countersRemoved));
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
controller.lookAtCards(source, null, cards, game);
|
||||||
if (player == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
int count = Math.min(player.getLibrary().size(), countersRemoved);
|
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
player.lookAtCards("Jar of Eyeballs", cards, game);
|
|
||||||
|
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand"));
|
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand"));
|
||||||
if (player.choose(Outcome.DrawCard, cards, target, game)) {
|
if (controller.choose(Outcome.DrawCard, cards, target, game)) {
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
Cards targetCards = new CardsImpl(target.getTargets());
|
||||||
if (card != null) {
|
controller.moveCards(targetCards, Zone.HAND, source, game);
|
||||||
cards.remove(card);
|
cards.removeAll(targetCards);
|
||||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
player.putCardsOnBottomOfLibrary(cards, game, source, true);
|
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,7 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.j;
|
package mage.cards.j;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.HashSet;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObjectReference;
|
import mage.MageObjectReference;
|
||||||
|
|
@ -51,13 +47,13 @@ import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.TargetController;
|
import mage.constants.TargetController;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import mage.game.ExileZone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -67,7 +63,7 @@ import mage.players.Player;
|
||||||
public class JeskaiInfiltrator extends CardImpl {
|
public class JeskaiInfiltrator extends CardImpl {
|
||||||
|
|
||||||
public JeskaiInfiltrator(UUID ownerId, CardSetInfo setInfo) {
|
public JeskaiInfiltrator(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
|
||||||
this.subtype.add(SubType.HUMAN);
|
this.subtype.add(SubType.HUMAN);
|
||||||
this.subtype.add(SubType.MONK);
|
this.subtype.add(SubType.MONK);
|
||||||
this.power = new MageInt(2);
|
this.power = new MageInt(2);
|
||||||
|
|
@ -112,23 +108,21 @@ class JeskaiInfiltratorEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
List<Card> cardsToManifest = new ArrayList<>(2);
|
HashSet<Card> cardsToManifest = new HashSet<>();
|
||||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
cardsToManifest.add(source.getSourcePermanentIfItStillExists(game));
|
||||||
Card sourceCard = game.getCard(source.getSourceId());
|
cardsToManifest.add(controller.getLibrary().getFromTop(game));
|
||||||
if (sourcePermanent != null && sourceCard != null) {
|
UUID exileId = UUID.randomUUID();
|
||||||
controller.moveCardToExileWithInfo(sourcePermanent, sourcePermanent.getId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
|
controller.moveCardsToExile(cardsToManifest, source, game, false, exileId, "");
|
||||||
cardsToManifest.add(sourceCard);
|
ExileZone exileZone = game.getExile().getExileZone(exileId);
|
||||||
|
for (Card card : exileZone.getCards(game)) {
|
||||||
|
card.setFaceDown(true, game);
|
||||||
}
|
}
|
||||||
if (sourcePermanent != null && controller.getLibrary().hasCards()) {
|
|
||||||
Card cardFromLibrary = controller.getLibrary().removeFromTop(game);
|
|
||||||
controller.moveCardToExileWithInfo(cardFromLibrary, sourcePermanent.getId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
|
|
||||||
cardsToManifest.add(cardFromLibrary);
|
|
||||||
}
|
|
||||||
Collections.shuffle(cardsToManifest);
|
|
||||||
game.fireUpdatePlayersEvent(); // removes Jeskai from Battlefield, so he returns as a fresh permanent to the battlefield with new position
|
game.fireUpdatePlayersEvent(); // removes Jeskai from Battlefield, so he returns as a fresh permanent to the battlefield with new position
|
||||||
|
|
||||||
Ability newSource = source.copy();
|
Ability newSource = source.copy();
|
||||||
newSource.setWorksFaceDown(true);
|
newSource.setWorksFaceDown(true);
|
||||||
for (Card card : cardsToManifest) {
|
while (!exileZone.isEmpty()) {
|
||||||
|
Card card = exileZone.getRandom(game);
|
||||||
ManaCosts manaCosts = null;
|
ManaCosts manaCosts = null;
|
||||||
if (card.isCreature()) {
|
if (card.isCreature()) {
|
||||||
manaCosts = card.getSpellAbility().getManaCosts();
|
manaCosts = card.getSpellAbility().getManaCosts();
|
||||||
|
|
@ -139,9 +133,7 @@ class JeskaiInfiltratorEffect extends OneShotEffect {
|
||||||
MageObjectReference objectReference = new MageObjectReference(card.getId(), card.getZoneChangeCounter(game) + 1, game);
|
MageObjectReference objectReference = new MageObjectReference(card.getId(), card.getZoneChangeCounter(game) + 1, game);
|
||||||
game.addEffect(new BecomesFaceDownCreatureEffect(manaCosts, objectReference, Duration.Custom, FaceDownType.MANIFESTED), newSource);
|
game.addEffect(new BecomesFaceDownCreatureEffect(manaCosts, objectReference, Duration.Custom, FaceDownType.MANIFESTED), newSource);
|
||||||
}
|
}
|
||||||
Set<Card> toBattlefield = new LinkedHashSet();
|
controller.moveCards(exileZone.getCards(game), Zone.BATTLEFIELD, source, game, false, true, false, null);
|
||||||
toBattlefield.addAll(cardsToManifest);
|
|
||||||
controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, false, true, false, null);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,9 @@
|
||||||
package mage.cards.k;
|
package mage.cards.k;
|
||||||
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.LegendarySpellAbility;
|
import mage.abilities.common.LegendarySpellAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
import mage.cards.Cards;
|
||||||
|
|
@ -29,8 +24,7 @@ import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
import mage.target.TargetCard;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author JRHerlehy
|
* @author JRHerlehy Created on 4/8/18.
|
||||||
* Created on 4/8/18.
|
|
||||||
*/
|
*/
|
||||||
public class KamahlsDruidicVow extends CardImpl {
|
public class KamahlsDruidicVow extends CardImpl {
|
||||||
|
|
||||||
|
|
@ -72,18 +66,12 @@ class KamahlsDruidicVowEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
if (controller == null) {
|
||||||
if (controller == null || sourceObject == null) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
int xValue = source.getManaCostsToPay().getX();
|
int xValue = source.getManaCostsToPay().getX();
|
||||||
int numCards = Math.min(controller.getLibrary().size(), xValue);
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, xValue));
|
||||||
for (int i = 0; i < numCards; i++) {
|
controller.lookAtCards(source, null, cards, game);
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
FilterCard filter = new FilterPermanentCard("land and/or legendary permanent cards with converted mana cost " + xValue + " or less to put onto the battlefield");
|
FilterCard filter = new FilterPermanentCard("land and/or legendary permanent cards with converted mana cost " + xValue + " or less to put onto the battlefield");
|
||||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
||||||
|
|
@ -93,18 +81,11 @@ class KamahlsDruidicVowEffect extends OneShotEffect {
|
||||||
new SupertypePredicate(SuperType.LEGENDARY)
|
new SupertypePredicate(SuperType.LEGENDARY)
|
||||||
));
|
));
|
||||||
TargetCard target1 = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, filter);
|
TargetCard target1 = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, filter);
|
||||||
target1.setRequired(false);
|
target1.setNotTarget(true);
|
||||||
|
|
||||||
controller.choose(Outcome.PutCardInPlay, cards, target1, game);
|
controller.choose(Outcome.PutCardInPlay, cards, target1, game);
|
||||||
Set<Card> toBattlefield = new LinkedHashSet<>();
|
Cards toBattlefield = new CardsImpl(target1.getTargets());
|
||||||
for (UUID cardId : target1.getTargets()) {
|
cards.removeAll(toBattlefield);
|
||||||
Card card = cards.get(cardId, game);
|
controller.moveCards(toBattlefield.getCards(game), Zone.BATTLEFIELD, source, game, false, false, false, null);
|
||||||
if (card != null) {
|
|
||||||
cards.remove(card);
|
|
||||||
toBattlefield.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, false, false, false, null);
|
|
||||||
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ package mage.cards.k;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
|
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
|
||||||
|
|
@ -96,8 +95,7 @@ class KindredSummonsEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
if (controller != null) {
|
||||||
if (controller != null && sourceObject != null) {
|
|
||||||
SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game);
|
SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(source.getSourceId(), game);
|
||||||
if (subType == null) {
|
if (subType == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -110,19 +108,23 @@ class KindredSummonsEffect extends OneShotEffect {
|
||||||
Cards otherCards = new CardsImpl();
|
Cards otherCards = new CardsImpl();
|
||||||
FilterCreatureCard filterCard = new FilterCreatureCard("creature card of the chosen type");
|
FilterCreatureCard filterCard = new FilterCreatureCard("creature card of the chosen type");
|
||||||
filterCard.add(new SubtypePredicate(subType));
|
filterCard.add(new SubtypePredicate(subType));
|
||||||
while (chosenSubtypeCreatureCards.size() < numberOfCards && controller.getLibrary().hasCards()) {
|
for (Card card : controller.getLibrary().getCards(game)) {
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
|
||||||
revealed.add(card);
|
revealed.add(card);
|
||||||
if (card != null && filterCard.match(card, game)) {
|
if (card != null && filterCard.match(card, game)) {
|
||||||
chosenSubtypeCreatureCards.add(card);
|
chosenSubtypeCreatureCards.add(card);
|
||||||
|
if (chosenSubtypeCreatureCards.size() == numberOfCards) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
otherCards.add(card);
|
otherCards.add(card);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
controller.revealCards(sourceObject.getIdName(), revealed, game);
|
controller.revealCards(source, revealed, game);
|
||||||
controller.moveCards(chosenSubtypeCreatureCards, Zone.BATTLEFIELD, source, game);
|
controller.moveCards(chosenSubtypeCreatureCards, Zone.BATTLEFIELD, source, game);
|
||||||
controller.putCardsOnTopOfLibrary(otherCards, game, source, false);
|
if (!otherCards.isEmpty()) {
|
||||||
controller.shuffleLibrary(source, game);
|
controller.putCardsOnTopOfLibrary(otherCards, game, source, false);
|
||||||
|
controller.shuffleLibrary(source, game);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -30,18 +30,14 @@ package mage.cards.l;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
import mage.cards.Cards;
|
||||||
import mage.cards.CardsImpl;
|
import mage.cards.CardsImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.FilterCard;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -50,8 +46,7 @@ import mage.target.TargetCard;
|
||||||
public class LimDulsVault extends CardImpl {
|
public class LimDulsVault extends CardImpl {
|
||||||
|
|
||||||
public LimDulsVault(UUID ownerId, CardSetInfo setInfo) {
|
public LimDulsVault(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}{B}");
|
||||||
|
|
||||||
|
|
||||||
// Look at the top five cards of your library. As many times as you choose, you may pay 1 life, put those cards on the bottom of your library in any order, then look at the top five cards of your library. Then shuffle your library and put the last cards you looked at this way on top of it in any order.
|
// Look at the top five cards of your library. As many times as you choose, you may pay 1 life, put those cards on the bottom of your library in any order, then look at the top five cards of your library. Then shuffle your library and put the last cards you looked at this way on top of it in any order.
|
||||||
this.getSpellAbility().addEffect(new LimDulsVaultEffect());
|
this.getSpellAbility().addEffect(new LimDulsVaultEffect());
|
||||||
|
|
@ -68,12 +63,12 @@ public class LimDulsVault extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
class LimDulsVaultEffect extends OneShotEffect {
|
class LimDulsVaultEffect extends OneShotEffect {
|
||||||
static final private String textTop = "card to put on your library (last chosen will be on top)";
|
|
||||||
static final private String textBottom = "card to put on bottom of your library (last chosen will be on bottom)";
|
|
||||||
|
|
||||||
public LimDulsVaultEffect() {
|
public LimDulsVaultEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "Look at the top five cards of your library. As many times as you choose, you may pay 1 life, put those cards on the bottom of your library in any order, then look at the top five cards of your library. Then shuffle your library and put the last cards you looked at this way on top of it in any order";
|
this.staticText = "Look at the top five cards of your library. As many times as you choose, "
|
||||||
|
+ "you may pay 1 life, put those cards on the bottom of your library in any order, then look at the top five cards of your library. "
|
||||||
|
+ "Then shuffle your library and put the last cards you looked at this way on top of it in any order";
|
||||||
}
|
}
|
||||||
|
|
||||||
public LimDulsVaultEffect(final LimDulsVaultEffect effect) {
|
public LimDulsVaultEffect(final LimDulsVaultEffect effect) {
|
||||||
|
|
@ -93,38 +88,17 @@ class LimDulsVaultEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean doAgain;
|
boolean doAgain;
|
||||||
do {
|
do {
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 5));
|
||||||
int count = Math.min(player.getLibrary().size(), 5);
|
player.lookAtCards(source, null, cards, game);
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
player.lookAtCards("Lim-Dul's Vault", cards, game);
|
|
||||||
doAgain = player.chooseUse(outcome, "Pay 1 life and look at the next 5 cards?", source, game);
|
doAgain = player.chooseUse(outcome, "Pay 1 life and look at the next 5 cards?", source, game);
|
||||||
if (doAgain) {
|
if (doAgain) {
|
||||||
player.loseLife(1, game, false);
|
player.loseLife(1, game, false);
|
||||||
|
player.putCardsOnBottomOfLibrary(cards, game, source, true);
|
||||||
} else {
|
} else {
|
||||||
player.shuffleLibrary(source, game);
|
player.shuffleLibrary(source, game);
|
||||||
|
player.putCardsOnTopOfLibrary(cards, game, source, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard(doAgain ? textBottom : textTop));
|
|
||||||
while (player.canRespond() && 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.getSourceId(), game, !doAgain);
|
|
||||||
}
|
|
||||||
target.clearChosen();
|
|
||||||
}
|
|
||||||
if (cards.size() == 1) {
|
|
||||||
Card card = cards.get(cards.iterator().next(), game);
|
|
||||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, !doAgain);
|
|
||||||
}
|
|
||||||
|
|
||||||
} while (doAgain);
|
} while (doAgain);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -33,13 +33,11 @@ import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.CardsImpl;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
import mage.target.TargetCard;
|
||||||
|
|
@ -52,7 +50,7 @@ import mage.target.TargetPlayer;
|
||||||
public class LostHours extends CardImpl {
|
public class LostHours extends CardImpl {
|
||||||
|
|
||||||
public LostHours(UUID ownerId, CardSetInfo setInfo) {
|
public LostHours(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}");
|
||||||
|
|
||||||
// Target player reveals their hand. You choose a nonland card from it. That player puts that card into their library third from the top.
|
// Target player reveals their hand. You choose a nonland card from it. That player puts that card into their library third from the top.
|
||||||
this.getSpellAbility().addEffect(new LostHoursEffect());
|
this.getSpellAbility().addEffect(new LostHoursEffect());
|
||||||
|
|
@ -71,17 +69,11 @@ public class LostHours extends CardImpl {
|
||||||
|
|
||||||
class LostHoursEffect extends OneShotEffect {
|
class LostHoursEffect extends OneShotEffect {
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("nonland card");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
|
|
||||||
}
|
|
||||||
|
|
||||||
public LostHoursEffect() {
|
public LostHoursEffect() {
|
||||||
super(Outcome.Discard);
|
super(Outcome.Discard);
|
||||||
this.staticText = "Target player reveals their hand. You choose a nonland card from it. That player puts that card into their library third from the top.";
|
this.staticText = "Target player reveals their hand. You choose a nonland card from it. That player puts that card into their library third from the top";
|
||||||
}
|
}
|
||||||
|
|
||||||
public LostHoursEffect(final LostHoursEffect effect) {
|
public LostHoursEffect(final LostHoursEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
@ -90,38 +82,19 @@ class LostHoursEffect extends OneShotEffect {
|
||||||
public LostHoursEffect copy() {
|
public LostHoursEffect copy() {
|
||||||
return new LostHoursEffect(this);
|
return new LostHoursEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (player != null && controller != null) {
|
if (targetPlayer != null && controller != null) {
|
||||||
player.revealCards("Lost Hours", player.getHand(), game);
|
targetPlayer.revealCards(source, targetPlayer.getHand(), game);
|
||||||
|
if (targetPlayer.getHand().size() > 0) {
|
||||||
if (player.getHand().size() > 0) {
|
TargetCard target = new TargetCard(Zone.HAND, new FilterCard(StaticFilters.FILTER_CARD_A_NON_LAND));
|
||||||
TargetCard target = new TargetCard(Zone.HAND, new FilterCard(filter));
|
if (controller.choose(Outcome.Discard, targetPlayer.getHand(), target, game)) {
|
||||||
if (controller.choose(Outcome.Discard, player.getHand(), target, game)) {
|
|
||||||
Card card = game.getCard(target.getFirstTarget());
|
Card card = game.getCard(target.getFirstTarget());
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
// Move card to third position
|
targetPlayer.putCardOnTopXOfLibrary(card, game, source, 3);
|
||||||
CardsImpl cards = new CardsImpl();
|
|
||||||
cards.add(card);
|
|
||||||
Card cardTop = null;
|
|
||||||
Card cardSecond = null;
|
|
||||||
if (player.getLibrary().hasCards()) {
|
|
||||||
cardTop = player.getLibrary().removeFromTop(game);
|
|
||||||
}
|
|
||||||
if (player.getLibrary().hasCards()) {
|
|
||||||
cardSecond = player.getLibrary().removeFromTop(game);
|
|
||||||
}
|
|
||||||
player.putCardsOnTopOfLibrary(cards, game, source, true);
|
|
||||||
if (cardSecond != null) {
|
|
||||||
player.getLibrary().putOnTop(cardSecond, game);
|
|
||||||
}
|
|
||||||
if (cardTop != null) {
|
|
||||||
player.getLibrary().putOnTop(cardTop, game);
|
|
||||||
}
|
|
||||||
game.informPlayers(card.getLogName() + " is put into " + player.getLogName() +"'s library " + (cardTop != null ? (cardSecond != null ? "third" : "second") : "first") + " from the top");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -129,5 +102,5 @@ class LostHoursEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
|
|
@ -39,7 +38,6 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Library;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -84,31 +82,25 @@ class MadcapExperimentEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
if (controller != null) {
|
||||||
if (controller != null && controller.getLibrary().hasCards()) {
|
CardsImpl toReveal = new CardsImpl();
|
||||||
CardsImpl cards = new CardsImpl();
|
Card toBattlefield = null;
|
||||||
Library library = controller.getLibrary();
|
for (Card card : controller.getLibrary().getCards(game)) {
|
||||||
Card card = null;
|
toReveal.add(card);
|
||||||
do {
|
game.fireUpdatePlayersEvent();
|
||||||
card = library.removeFromTop(game);
|
if (card.isArtifact()) {
|
||||||
if (card != null) {
|
toBattlefield = card;
|
||||||
cards.add(card);
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} while (library.hasCards() && card != null && !card.isArtifact());
|
|
||||||
// reveal cards
|
|
||||||
if (!cards.isEmpty()) {
|
|
||||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
|
||||||
}
|
}
|
||||||
int revealed = cards.size();
|
controller.revealCards(source, toReveal, game);
|
||||||
if (card != null && card.isArtifact()) {
|
controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game);
|
||||||
// put artifact card to battlefield
|
int damage = toReveal.size();
|
||||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
toReveal.remove(toBattlefield);
|
||||||
// remove it from revealed card list
|
controller.putCardsOnBottomOfLibrary(toReveal, game, source, false);
|
||||||
cards.remove(card);
|
controller.damage(damage, source.getSourceId(), game, false, true);
|
||||||
}
|
|
||||||
// Put the rest on the bottom of your library in a random order
|
|
||||||
controller.putCardsOnBottomOfLibrary(cards, game, source, false);
|
|
||||||
controller.damage(revealed, source.getSourceId(), game, false, true);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,8 @@ package mage.cards.m;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
|
|
@ -45,7 +43,6 @@ import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -86,31 +83,25 @@ class MassPolymorphEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
if (controller != null) {
|
||||||
if (controller != null && sourceObject != null) {
|
|
||||||
int count;
|
|
||||||
// Cards creatures = new CardsImpl();
|
// Cards creatures = new CardsImpl();
|
||||||
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game);
|
Set<Card> creaturesToExile = new HashSet<>(game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game));
|
||||||
Set<Card> creaturesToExile = new HashSet<>();
|
int count = creaturesToExile.size();
|
||||||
creaturesToExile.addAll(creatures);
|
|
||||||
count = creatures.size();
|
|
||||||
controller.moveCards(creaturesToExile, Zone.EXILED, source, game);
|
controller.moveCards(creaturesToExile, Zone.EXILED, source, game);
|
||||||
|
|
||||||
Cards revealed = new CardsImpl();
|
Cards revealed = new CardsImpl();
|
||||||
Set<Card> creatureCards = new LinkedHashSet<>();
|
Set<Card> creatureCards = new LinkedHashSet<>();
|
||||||
Cards nonCreatureCards = new CardsImpl();
|
for (Card card : controller.getLibrary().getCards(game)) {
|
||||||
while (creatureCards.size() < count && controller.getLibrary().hasCards()) {
|
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
|
||||||
revealed.add(card);
|
revealed.add(card);
|
||||||
if (card.isCreature()) {
|
if (card.isCreature()) {
|
||||||
creatureCards.add(card);
|
creatureCards.add(card);
|
||||||
} else {
|
if (creatureCards.size() == count) {
|
||||||
nonCreatureCards.add(card);
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
controller.revealCards(sourceObject.getIdName(), revealed, game);
|
controller.revealCards(source, revealed, game);
|
||||||
controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game, false, false, true, null);
|
controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game, false, false, true, null);
|
||||||
controller.putCardsOnTopOfLibrary(nonCreatureCards, game, source, false);
|
|
||||||
controller.shuffleLibrary(source, game);
|
controller.shuffleLibrary(source, game);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,15 +49,12 @@ import mage.target.common.TargetOpponent;
|
||||||
public class MindFuneral extends CardImpl {
|
public class MindFuneral extends CardImpl {
|
||||||
|
|
||||||
public MindFuneral(UUID ownerId, CardSetInfo setInfo) {
|
public MindFuneral(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{U}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}{B}");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Target opponent reveals cards from the top of their library until four land cards are revealed. That player puts all cards revealed this way into their graveyard.
|
// Target opponent reveals cards from the top of their library until four land cards are revealed. That player puts all cards revealed this way into their graveyard.
|
||||||
this.getSpellAbility().addEffect(new MindFuneralEffect());
|
this.getSpellAbility().addEffect(new MindFuneralEffect());
|
||||||
this.getSpellAbility().addTarget(new TargetOpponent());
|
this.getSpellAbility().addTarget(new TargetOpponent());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MindFuneral(final MindFuneral card) {
|
public MindFuneral(final MindFuneral card) {
|
||||||
|
|
@ -92,17 +89,13 @@ class MindFuneralEffect extends OneShotEffect {
|
||||||
if (opponent != null) {
|
if (opponent != null) {
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl();
|
||||||
int landsFound = 0;
|
int landsFound = 0;
|
||||||
while (landsFound < 4 && opponent.getLibrary().hasCards()) {
|
for (Card card : opponent.getLibrary().getCards(game)) {
|
||||||
Card card = opponent.getLibrary().removeFromTop(game);
|
cards.add(card);
|
||||||
if (card == null) {
|
if (card.isLand() && ++landsFound == 4) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (card.isLand()) {
|
|
||||||
landsFound++;
|
|
||||||
}
|
|
||||||
cards.add(card);
|
|
||||||
}
|
}
|
||||||
opponent.revealCards("Mind Funeral", cards, game);
|
opponent.revealCards(source, cards, game);
|
||||||
opponent.moveCards(cards, Zone.GRAVEYARD, source, game);
|
opponent.moveCards(cards, Zone.GRAVEYARD, source, game);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,18 +50,17 @@ import mage.players.Player;
|
||||||
public class MindGrind extends CardImpl {
|
public class MindGrind extends CardImpl {
|
||||||
|
|
||||||
public MindGrind(UUID ownerId, CardSetInfo setInfo) {
|
public MindGrind(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{U}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{U}{B}");
|
||||||
|
|
||||||
|
|
||||||
// Each opponent reveals cards from the top of their library until he or she reveals X land cards, then puts all cards revealed this way into their graveyard. X can't be 0.
|
// Each opponent reveals cards from the top of their library until he or she reveals X land cards, then puts all cards revealed this way into their graveyard. X can't be 0.
|
||||||
this.getSpellAbility().addEffect(new MindGrindEffect());
|
this.getSpellAbility().addEffect(new MindGrindEffect());
|
||||||
for (VariableCost cost: this.getSpellAbility().getManaCosts().getVariableCosts()) {
|
for (VariableCost cost : this.getSpellAbility().getManaCosts().getVariableCosts()) {
|
||||||
if (cost instanceof VariableManaCost) {
|
if (cost instanceof VariableManaCost) {
|
||||||
((VariableManaCost) cost).setMinX(1);
|
((VariableManaCost) cost).setMinX(1);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public MindGrind(final MindGrind card) {
|
public MindGrind(final MindGrind card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
|
@ -92,8 +91,7 @@ class MindGrindEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
int xValue = source.getManaCostsToPay().getX();
|
int xValue = source.getManaCostsToPay().getX();
|
||||||
Card sourceCard = game.getCard(source.getSourceId());
|
if (xValue < 1) {
|
||||||
if (xValue < 1 || sourceCard == null) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
|
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
|
||||||
|
|
@ -103,19 +101,13 @@ class MindGrindEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
int landsToReveal = xValue;
|
int landsToReveal = xValue;
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl();
|
||||||
while(player.getLibrary().hasCards()){
|
for (Card card : player.getLibrary().getCards(game)) {
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
cards.add(card);
|
||||||
if (card != null) {
|
if (card.isLand() && --landsToReveal == 0) {
|
||||||
cards.add(card);
|
break;
|
||||||
if(card.isLand()){
|
|
||||||
--landsToReveal;
|
|
||||||
if (landsToReveal < 1) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.revealCards("by " + sourceCard.getName() + " from " + player.getName(), cards, game);
|
player.revealCards(source, "from " + player.getName(), cards, game);
|
||||||
player.moveCards(cards, Zone.GRAVEYARD, source, game);
|
player.moveCards(cards, Zone.GRAVEYARD, source, game);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.AsThoughEffectImpl;
|
import mage.abilities.effects.AsThoughEffectImpl;
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
import mage.abilities.effects.ContinuousEffect;
|
||||||
|
|
@ -41,10 +40,10 @@ import mage.constants.AsThoughEffectType;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTargets;
|
||||||
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -91,17 +90,15 @@ class MindsDesireEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
if (controller != null) {
|
||||||
if (controller != null && sourceObject != null) {
|
|
||||||
controller.shuffleLibrary(source, game);
|
controller.shuffleLibrary(source, game);
|
||||||
if (controller.getLibrary().hasCards()) {
|
Card card = controller.getLibrary().getFromTop(game);
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
if (card != null) {
|
||||||
if (card != null) {
|
UUID exileId = UUID.randomUUID();
|
||||||
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
|
controller.moveCardsToExile(card, source, game, true, exileId, CardUtil.createObjectRealtedWindowTitle(source, game, null));
|
||||||
ContinuousEffect effect = new MindsDesireCastFromExileEffect();
|
ContinuousEffect effect = new MindsDesireCastFromExileEffect();
|
||||||
effect.setTargetPointer(new FixedTarget(card.getId()));
|
effect.setTargetPointer(new FixedTargets(game.getExile().getExileZone(exileId).getCards(game), game));
|
||||||
game.addEffect(effect, source);
|
game.addEffect(effect, source);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -132,19 +129,15 @@ class MindsDesireCastFromExileEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
if (objectId != null && objectId.equals(getTargetPointer().getFirst(game, source))) {
|
if (affectedControllerId.equals(source.getControllerId()) && getTargetPointer().getTargets(game, source).contains(objectId)) {
|
||||||
if (affectedControllerId.equals(source.getControllerId())) {
|
Card card = game.getCard(objectId);
|
||||||
Card card = game.getCard(objectId);
|
if (card != null && !card.isLand() && card.getSpellAbility().getCosts() != null) {
|
||||||
if (card != null && game.getState().getZone(objectId) == Zone.EXILED) {
|
Player player = game.getPlayer(affectedControllerId);
|
||||||
if (!card.isLand() && card.getSpellAbility().getCosts() != null) {
|
if (player != null) {
|
||||||
Player player = game.getPlayer(affectedControllerId);
|
player.setCastSourceIdWithAlternateMana(objectId, null, card.getSpellAbility().getCosts());
|
||||||
if (player != null) {
|
|
||||||
player.setCastSourceIdWithAlternateMana(objectId, null, card.getSpellAbility().getCosts());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,9 @@ import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
@ -54,7 +54,7 @@ import mage.target.TargetPlayer;
|
||||||
public class Mindshrieker extends CardImpl {
|
public class Mindshrieker extends CardImpl {
|
||||||
|
|
||||||
public Mindshrieker(UUID ownerId, CardSetInfo setInfo) {
|
public Mindshrieker(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
|
||||||
this.subtype.add(SubType.SPIRIT);
|
this.subtype.add(SubType.SPIRIT);
|
||||||
this.subtype.add(SubType.BIRD);
|
this.subtype.add(SubType.BIRD);
|
||||||
|
|
||||||
|
|
@ -95,7 +95,7 @@ class MindshriekerEffect extends OneShotEffect {
|
||||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||||
if (targetPlayer != null) {
|
if (targetPlayer != null) {
|
||||||
if (targetPlayer.getLibrary().hasCards()) {
|
if (targetPlayer.getLibrary().hasCards()) {
|
||||||
Card card = targetPlayer.getLibrary().removeFromTop(game);
|
Card card = targetPlayer.getLibrary().getFromTop(game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
targetPlayer.moveCards(card, Zone.GRAVEYARD, source, game);
|
targetPlayer.moveCards(card, Zone.GRAVEYARD, source, game);
|
||||||
int amount = card.getConvertedManaCost();
|
int amount = card.getConvertedManaCost();
|
||||||
|
|
@ -114,4 +114,4 @@ class MindshriekerEffect extends OneShotEffect {
|
||||||
return new MindshriekerEffect(this);
|
return new MindshriekerEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,20 +25,18 @@
|
||||||
* authors and should not be interpreted as representing official policies, either expressed
|
* authors and should not be interpreted as representing official policies, either expressed
|
||||||
* or implied, of BetaSteward_at_googlemail.com.
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.cards.*;
|
import mage.cards.*;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.SuperType;
|
import mage.constants.SuperType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
@ -48,16 +46,13 @@ import mage.players.Player;
|
||||||
*
|
*
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
public class MirkoVoskMindDrinker extends CardImpl {
|
public class MirkoVoskMindDrinker extends CardImpl {
|
||||||
|
|
||||||
public MirkoVoskMindDrinker (UUID ownerId, CardSetInfo setInfo) {
|
public MirkoVoskMindDrinker(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{B}");
|
||||||
this.subtype.add(SubType.VAMPIRE);
|
this.subtype.add(SubType.VAMPIRE);
|
||||||
addSuperType(SuperType.LEGENDARY);
|
addSuperType(SuperType.LEGENDARY);
|
||||||
|
|
||||||
|
|
||||||
this.power = new MageInt(2);
|
this.power = new MageInt(2);
|
||||||
this.toughness = new MageInt(4);
|
this.toughness = new MageInt(4);
|
||||||
|
|
||||||
|
|
@ -67,7 +62,7 @@ public class MirkoVoskMindDrinker extends CardImpl {
|
||||||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new MirkoVoskMindDrinkerEffect(), false, true));
|
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new MirkoVoskMindDrinkerEffect(), false, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
public MirkoVoskMindDrinker (final MirkoVoskMindDrinker card) {
|
public MirkoVoskMindDrinker(final MirkoVoskMindDrinker card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -97,25 +92,20 @@ class MirkoVoskMindDrinkerEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
if (player == null) {
|
||||||
if (player == null || sourceObject == null) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int landsToReveal = 4;
|
int landsToReveal = 4;
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl();
|
||||||
while(player.getLibrary().hasCards()){
|
for (Card card : player.getLibrary().getCards(game)) {
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
cards.add(card);
|
cards.add(card);
|
||||||
if(card.isLand()){
|
if (card.isLand() && --landsToReveal < 1) {
|
||||||
--landsToReveal;
|
break;
|
||||||
if (landsToReveal < 1) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.revealCards("by " + sourceObject.getName() + " from " + player.getName(), cards, game);
|
player.revealCards(source, "from " + player.getName(), cards, game);
|
||||||
player.moveCards(cards, Zone.GRAVEYARD, source, game);
|
player.moveCards(cards, Zone.GRAVEYARD, source, game);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,32 +89,34 @@ class MirrorMadPhantasmEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent perm = game.getPermanent(source.getSourceId());
|
Permanent perm = source.getSourcePermanentIfItStillExists(game);
|
||||||
if (perm != null) {
|
if (perm != null) {
|
||||||
Player player = game.getPlayer(perm.getOwnerId());
|
Player owner = game.getPlayer(perm.getOwnerId());
|
||||||
if (player != null) {
|
if (owner == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (owner.moveCards(perm, Zone.LIBRARY, source, game)) {
|
||||||
|
owner.shuffleLibrary(source, game);
|
||||||
perm.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
perm.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||||
player.shuffleLibrary(source, game);
|
owner.shuffleLibrary(source, game);
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl();
|
||||||
while (player.getLibrary().hasCards()) {
|
Card phantasmCard = null;
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
for (Card card : owner.getLibrary().getCards(game)) {
|
||||||
if (card == null) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (card.getName().equals("Mirror-Mad Phantasm")) {
|
|
||||||
player.moveCards(card, Zone.BATTLEFIELD, source, game);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
cards.add(card);
|
cards.add(card);
|
||||||
|
if (card.getName().equals("Mirror-Mad Phantasm")) {
|
||||||
|
phantasmCard = card;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!cards.isEmpty()) {
|
owner.revealCards(source, cards, game);
|
||||||
player.revealCards("Mirror-Mad Phantasm", cards, game);
|
if (phantasmCard != null) {
|
||||||
player.moveCards(cards, Zone.GRAVEYARD, source, game);
|
owner.moveCards(phantasmCard, Zone.BATTLEFIELD, source, game);
|
||||||
|
cards.remove(phantasmCard);
|
||||||
}
|
}
|
||||||
return true;
|
owner.moveCards(cards, Zone.GRAVEYARD, source, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.*;
|
import mage.cards.*;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.SuperType;
|
import mage.constants.SuperType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterArtifactCard;
|
import mage.filter.common.FilterArtifactCard;
|
||||||
|
|
@ -55,7 +55,7 @@ import mage.target.TargetCard;
|
||||||
public class MuzzioVisionaryArchitect extends CardImpl {
|
public class MuzzioVisionaryArchitect extends CardImpl {
|
||||||
|
|
||||||
public MuzzioVisionaryArchitect(UUID ownerId, CardSetInfo setInfo) {
|
public MuzzioVisionaryArchitect(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{U}");
|
||||||
addSuperType(SuperType.LEGENDARY);
|
addSuperType(SuperType.LEGENDARY);
|
||||||
this.subtype.add(SubType.HUMAN);
|
this.subtype.add(SubType.HUMAN);
|
||||||
this.subtype.add(SubType.ARTIFICER);
|
this.subtype.add(SubType.ARTIFICER);
|
||||||
|
|
@ -97,8 +97,7 @@ class MuzzioVisionaryArchitectEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
if (controller == null) {
|
||||||
if (controller == null || sourcePermanent == null) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -113,28 +112,19 @@ class MuzzioVisionaryArchitectEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, highCMC));
|
||||||
|
controller.lookAtCards(source, null, cards, game);
|
||||||
for (int i = 0; i < highCMC; i++) {
|
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
controller.lookAtCards(sourcePermanent.getIdName(), cards, game);
|
|
||||||
|
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterArtifactCard("artifact card to put onto the battlefield"));
|
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterArtifactCard("artifact card to put onto the battlefield"));
|
||||||
if (target.canChoose(source.getSourceId(), controller.getId(), game) && controller.choose(Outcome.Benefit, cards, target, game)) {
|
if (target.canChoose(source.getSourceId(), controller.getId(), game) && controller.choose(Outcome.Benefit, cards, target, game)) {
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
Card card = cards.get(target.getFirstTarget(), game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
controller.revealCards(sourcePermanent.getIdName(), new CardsImpl(card), game);
|
controller.revealCards(source, new CardsImpl(card), game);
|
||||||
cards.remove(card);
|
cards.remove(card);
|
||||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
|
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,30 +30,25 @@ package mage.cards.n;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
import mage.cards.Cards;
|
||||||
import mage.cards.CardsImpl;
|
import mage.cards.CardsImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.FilterCard;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author KholdFuzion
|
* @author KholdFuzion
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public class NaturalSelection extends CardImpl {
|
public class NaturalSelection extends CardImpl {
|
||||||
|
|
||||||
public NaturalSelection(UUID ownerId, CardSetInfo setInfo) {
|
public NaturalSelection(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}");
|
||||||
|
|
||||||
|
|
||||||
// Look at the top three cards of target player's library, then put them back in any order. You may have that player shuffle their library.
|
// Look at the top three cards of target player's library, then put them back in any order. You may have that player shuffle their library.
|
||||||
this.getSpellAbility().addEffect(new NaturalSelectionEffect());
|
this.getSpellAbility().addEffect(new NaturalSelectionEffect());
|
||||||
|
|
@ -70,57 +65,35 @@ public class NaturalSelection extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class NaturalSelectionEffect extends OneShotEffect {
|
class NaturalSelectionEffect extends OneShotEffect {
|
||||||
|
|
||||||
public NaturalSelectionEffect() {
|
public NaturalSelectionEffect() {
|
||||||
super(Outcome.DrawCard);
|
super(Outcome.DrawCard);
|
||||||
this.staticText = "look at the top three cards of target player's library, then put them back in any order. You may have that player shuffle their library.";
|
this.staticText = "look at the top three cards of target player's library, then put them back in any order. You may have that player shuffle their library.";
|
||||||
}
|
}
|
||||||
|
|
||||||
public NaturalSelectionEffect(final NaturalSelectionEffect effect) {
|
public NaturalSelectionEffect(final NaturalSelectionEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NaturalSelectionEffect copy() {
|
public NaturalSelectionEffect copy() {
|
||||||
return new NaturalSelectionEffect(this);
|
return new NaturalSelectionEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player you = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Player player = game.getPlayer(source.getFirstTarget());
|
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||||
if (player == null || you == null) {
|
if (targetPlayer == null || controller == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl(targetPlayer.getLibrary().getTopCards(game, 3));
|
||||||
int count = Math.min(player.getLibrary().size(), 3);
|
controller.lookAtCards(source, null, cards, game);
|
||||||
for (int i = 0; i < count; i++) {
|
controller.putCardsOnTopOfLibrary(cards, game, source, true);
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
if (controller.chooseUse(Outcome.Neutral, "You may have that player shuffle their library", source, game)) {
|
||||||
if (card != null) {
|
targetPlayer.shuffleLibrary(source, game);
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
you.lookAtCards("Natural Selection", cards, game);
|
|
||||||
|
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put on the top of target player's library"));
|
|
||||||
while (player.canRespond() && cards.size() > 1) {
|
|
||||||
you.choose(Outcome.Neutral, cards, target, game);
|
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.remove(card);
|
|
||||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
|
||||||
}
|
|
||||||
target.clearChosen();
|
|
||||||
}
|
|
||||||
if (cards.size() == 1) {
|
|
||||||
Card card = cards.get(cards.iterator().next(), game);
|
|
||||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
|
||||||
}
|
|
||||||
if (you.chooseUse(Outcome.Neutral, "You may have that player shuffle their library", source, game)){
|
|
||||||
player.shuffleLibrary(source, game);
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ import mage.game.events.GameEvent;
|
||||||
import mage.game.events.GameEvent.EventType;
|
import mage.game.events.GameEvent.EventType;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -59,7 +60,7 @@ import mage.target.targetpointer.FixedTarget;
|
||||||
public class Necropotence extends CardImpl {
|
public class Necropotence extends CardImpl {
|
||||||
|
|
||||||
public Necropotence(UUID ownerId, CardSetInfo setInfo) {
|
public Necropotence(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{B}{B}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}{B}");
|
||||||
|
|
||||||
// Skip your draw step.
|
// Skip your draw step.
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipDrawStepEffect()));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipDrawStepEffect()));
|
||||||
|
|
@ -137,17 +138,16 @@ class NecropotenceEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
if (controller.getLibrary().hasCards()) {
|
Card card = controller.getLibrary().getFromTop(game);
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
if (card != null && controller.moveCardsToExile(card, source, game, false,
|
||||||
if (controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY, false)) {
|
CardUtil.getCardExileZoneId(game, source),
|
||||||
card.setFaceDown(true, game);
|
CardUtil.createObjectRealtedWindowTitle(source, game, null))) {
|
||||||
Effect returnToHandEffect = new ReturnToHandTargetEffect();
|
card.setFaceDown(true, game);
|
||||||
returnToHandEffect.setText("put that face down card into your hand");
|
Effect returnToHandEffect = new ReturnToHandTargetEffect();
|
||||||
returnToHandEffect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
|
returnToHandEffect.setText("put that face down card into your hand");
|
||||||
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(returnToHandEffect, TargetController.YOU), source);
|
returnToHandEffect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
|
||||||
return true;
|
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(returnToHandEffect, TargetController.YOU), source);
|
||||||
}
|
return true;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,9 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.n;
|
package mage.cards.n;
|
||||||
|
|
||||||
import mage.MageObject;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.LoyaltyAbility;
|
import mage.abilities.LoyaltyAbility;
|
||||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||||
|
|
@ -46,15 +48,11 @@ import mage.game.Game;
|
||||||
import mage.players.Library;
|
import mage.players.Library;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.common.TargetCardInHand;
|
|
||||||
import mage.target.common.TargetAnyTarget;
|
import mage.target.common.TargetAnyTarget;
|
||||||
|
import mage.target.common.TargetCardInHand;
|
||||||
import mage.target.common.TargetOpponent;
|
import mage.target.common.TargetOpponent;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Will
|
* @author Will
|
||||||
|
|
@ -172,22 +170,21 @@ class NicolBolasGodPharaohPlusTwoEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
|
Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
if (opponent != null) {
|
||||||
if (opponent != null && opponent.getLibrary().hasCards() && sourceObject != null) {
|
|
||||||
Library library = opponent.getLibrary();
|
Library library = opponent.getLibrary();
|
||||||
Card card;
|
Card card;
|
||||||
do {
|
do {
|
||||||
card = library.removeFromTop(game);
|
card = library.getFromTop(game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
opponent.moveCards(card, Zone.EXILED, source, game);
|
opponent.moveCards(card, Zone.EXILED, source, game);
|
||||||
|
if (!card.isLand()) {
|
||||||
|
ContinuousEffect effect = new NicolBolasGodPharaohFromExileEffect();
|
||||||
|
effect.setTargetPointer(new FixedTarget(card.getId(), game.getState().getZoneChangeCounter(card.getId())));
|
||||||
|
game.addEffect(effect, source);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} while (library.hasCards() && card != null && card.isLand());
|
} while (library.hasCards() && card != null);
|
||||||
|
|
||||||
if (card != null) {
|
|
||||||
ContinuousEffect effect = new NicolBolasGodPharaohFromExileEffect();
|
|
||||||
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
|
|
||||||
game.addEffect(effect, source);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ package mage.cards.n;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
|
@ -108,10 +107,9 @@ class NightveilSpecterExileEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
Card card = player.getLibrary().getFromTop(game);
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
if (card != null) {
|
||||||
if (card != null && sourceObject != null) {
|
player.moveCardsToExile(card, source, game, true, CardUtil.getCardExileZoneId(game, source), CardUtil.createObjectRealtedWindowTitle(source, game, null));
|
||||||
player.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -147,10 +145,9 @@ class NightveilSpecterEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
Card card = game.getCard(objectId);
|
if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId) == Zone.EXILED) {
|
||||||
if (affectedControllerId.equals(source.getControllerId()) && card != null && game.getState().getZone(card.getId()) == Zone.EXILED) {
|
|
||||||
ExileZone zone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
|
ExileZone zone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
|
||||||
return zone != null && zone.contains(card.getId());
|
return zone != null && zone.contains(objectId);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ import mage.game.Game;
|
||||||
import mage.players.Library;
|
import mage.players.Library;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -56,11 +57,11 @@ import mage.target.targetpointer.FixedTarget;
|
||||||
public class NivixAerieOfTheFiremind extends CardImpl {
|
public class NivixAerieOfTheFiremind extends CardImpl {
|
||||||
|
|
||||||
public NivixAerieOfTheFiremind(UUID ownerId, CardSetInfo setInfo) {
|
public NivixAerieOfTheFiremind(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
|
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||||
|
|
||||||
// {tap}: Add {C}.
|
// {tap}: Add {C}.
|
||||||
this.addAbility(new ColorlessManaAbility());
|
this.addAbility(new ColorlessManaAbility());
|
||||||
|
|
||||||
// {2}{U}{R}, {tap}: Exile the top card of your library. Until your next turn, you may cast that card if it's an instant or sorcery card.
|
// {2}{U}{R}, {tap}: Exile the top card of your library. Until your next turn, you may cast that card if it's an instant or sorcery card.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new NivixAerieOfTheFiremindEffect(), new ManaCostsImpl<>("{2}{U}{R}"));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new NivixAerieOfTheFiremindEffect(), new ManaCostsImpl<>("{2}{U}{R}"));
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
|
|
@ -78,30 +79,30 @@ public class NivixAerieOfTheFiremind extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
class NivixAerieOfTheFiremindEffect extends OneShotEffect {
|
class NivixAerieOfTheFiremindEffect extends OneShotEffect {
|
||||||
|
|
||||||
NivixAerieOfTheFiremindEffect() {
|
NivixAerieOfTheFiremindEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "Exile the top card of your library. Until your next turn, you may cast that card if it's an instant or sorcery card";
|
this.staticText = "Exile the top card of your library. Until your next turn, you may cast that card if it's an instant or sorcery card";
|
||||||
}
|
}
|
||||||
|
|
||||||
NivixAerieOfTheFiremindEffect(final NivixAerieOfTheFiremindEffect effect) {
|
NivixAerieOfTheFiremindEffect(final NivixAerieOfTheFiremindEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NivixAerieOfTheFiremindEffect copy() {
|
public NivixAerieOfTheFiremindEffect copy() {
|
||||||
return new NivixAerieOfTheFiremindEffect(this);
|
return new NivixAerieOfTheFiremindEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
Library library = controller.getLibrary();
|
Library library = controller.getLibrary();
|
||||||
if (library.hasCards()) {
|
if (library.hasCards()) {
|
||||||
Card card = library.removeFromTop(game);
|
Card card = library.getFromTop(game);
|
||||||
if (card != null
|
if (card != null
|
||||||
&& controller.moveCardsToExile(card, source, game, true, source.getSourceId(), "Nivix, Aerie of the Firemind")
|
&& controller.moveCardsToExile(card, source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, null))
|
||||||
&& (card.isInstant() || card.isSorcery())) {
|
&& (card.isInstant() || card.isSorcery())) {
|
||||||
ContinuousEffect effect = new NivixAerieOfTheFiremindCanCastEffect();
|
ContinuousEffect effect = new NivixAerieOfTheFiremindCanCastEffect();
|
||||||
effect.setTargetPointer(new FixedTarget(card.getId()));
|
effect.setTargetPointer(new FixedTarget(card.getId()));
|
||||||
|
|
@ -136,10 +137,8 @@ class NivixAerieOfTheFiremindCanCastEffect extends AsThoughEffectImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
return this.getTargetPointer().getFirst(game, source) != null
|
return source.getControllerId().equals(affectedControllerId)
|
||||||
&& this.getTargetPointer().getFirst(game, source).equals(sourceId)
|
&& objectId.equals(this.getTargetPointer().getFirst(game, source));
|
||||||
&& source.getControllerId().equals(affectedControllerId)
|
|
||||||
&& game.getState().getZone(sourceId) == Zone.EXILED;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -120,9 +120,9 @@ class OmenMachineEffect2 extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
Card card = player.getLibrary().getFromTop(game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
player.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY, true);
|
player.moveCards(card, Zone.EXILED, source, game);
|
||||||
if (card.isLand()) {
|
if (card.isLand()) {
|
||||||
player.moveCards(card, Zone.BATTLEFIELD, source, game);
|
player.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ import mage.counters.CounterType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Library;
|
import mage.players.Library;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -77,7 +78,7 @@ public class OraclesVault extends CardImpl {
|
||||||
this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
||||||
new OraclesVaultFreeEffect(), new TapSourceCost(), new SourceHasCounterCondition(CounterType.BRICK, 3, Integer.MAX_VALUE),
|
new OraclesVaultFreeEffect(), new TapSourceCost(), new SourceHasCounterCondition(CounterType.BRICK, 3, Integer.MAX_VALUE),
|
||||||
"{T}: Exile the top card of your library. Until end of turn, you may play that card without paying its mana cost. "
|
"{T}: Exile the top card of your library. Until end of turn, you may play that card without paying its mana cost. "
|
||||||
+ "Activate this ability only if there are three or more brick counters on {this}"));
|
+ "Activate this ability only if there are three or more brick counters on {this}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public OraclesVault(final OraclesVault card) {
|
public OraclesVault(final OraclesVault card) {
|
||||||
|
|
@ -108,12 +109,11 @@ class OraclesVaultEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
if (controller != null) {
|
||||||
if (controller != null && sourceObject != null && controller.getLibrary().hasCards()) {
|
Card card = controller.getLibrary().getFromTop(game);
|
||||||
Library library = controller.getLibrary();
|
|
||||||
Card card = library.removeFromTop(game);
|
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName() + " <this card may be played the turn it was exiled>", source.getSourceId(), game, Zone.LIBRARY, true);
|
controller.moveCardsToExile(card, source, game, true, source.getSourceId(),
|
||||||
|
CardUtil.createObjectRealtedWindowTitle(source, game, "<this card may be played the turn it was exiled>"));
|
||||||
game.addEffect(new OraclesVaultPlayEffect(new MageObjectReference(card, game)), source);
|
game.addEffect(new OraclesVaultPlayEffect(new MageObjectReference(card, game)), source);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -121,6 +121,7 @@ class OraclesVaultEffect extends OneShotEffect {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class OraclesVaultFreeEffect extends OneShotEffect {
|
class OraclesVaultFreeEffect extends OneShotEffect {
|
||||||
|
|
||||||
public OraclesVaultFreeEffect() {
|
public OraclesVaultFreeEffect() {
|
||||||
|
|
@ -142,9 +143,10 @@ class OraclesVaultFreeEffect extends OneShotEffect {
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
if (controller != null && sourceObject != null && controller.getLibrary().hasCards()) {
|
if (controller != null && sourceObject != null && controller.getLibrary().hasCards()) {
|
||||||
Library library = controller.getLibrary();
|
Library library = controller.getLibrary();
|
||||||
Card card = library.removeFromTop(game);
|
Card card = library.getFromTop(game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName() + " <this card may be played the turn it was exiled>", source.getSourceId(), game, Zone.LIBRARY, true);
|
controller.moveCardsToExile(card, source, game, true, source.getSourceId(),
|
||||||
|
CardUtil.createObjectRealtedWindowTitle(source, game, " <this card may be played the turn it was exiled>"));
|
||||||
game.addEffect(new OraclesVaultPlayForFreeEffect(new MageObjectReference(card, game)), source);
|
game.addEffect(new OraclesVaultPlayForFreeEffect(new MageObjectReference(card, game)), source);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -191,6 +193,7 @@ class OraclesVaultPlayEffect extends AsThoughEffectImpl {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class OraclesVaultPlayForFreeEffect extends AsThoughEffectImpl {
|
class OraclesVaultPlayForFreeEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
private final MageObjectReference objectReference;
|
private final MageObjectReference objectReference;
|
||||||
|
|
@ -229,4 +232,4 @@ class OraclesVaultPlayForFreeEffect extends AsThoughEffectImpl {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,10 +45,8 @@ import mage.constants.ColoredManaSymbol;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -83,7 +81,7 @@ class OrcishLibrarianEffect extends OneShotEffect {
|
||||||
|
|
||||||
public OrcishLibrarianEffect() {
|
public OrcishLibrarianEffect() {
|
||||||
super(Outcome.Neutral);
|
super(Outcome.Neutral);
|
||||||
this.staticText = "Look at the top eight cards of your library. Exile four of them at random, then put the rest on top of your library in any order.";
|
this.staticText = "Look at the top eight cards of your library. Exile four of them at random, then put the rest on top of your library in any order";
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrcishLibrarianEffect(final OrcishLibrarianEffect effect) {
|
public OrcishLibrarianEffect(final OrcishLibrarianEffect effect) {
|
||||||
|
|
@ -100,34 +98,21 @@ class OrcishLibrarianEffect extends OneShotEffect {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
if (controller != null && sourceObject != null) {
|
if (controller != null && sourceObject != null) {
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 8));
|
||||||
int cardsCount = Math.min(8, controller.getLibrary().size());
|
|
||||||
for (int i = 0; i < cardsCount; i++) {
|
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
|
Cards randomExit = new CardsImpl();
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
Card card = cards.getRandom(game);
|
Card card = cards.getRandom(game);
|
||||||
controller.moveCardToExileWithInfo(card, null, null, source.getId(), game, Zone.LIBRARY, true);
|
if (card != null) {
|
||||||
cards.remove(card);
|
randomExit.add(card);
|
||||||
|
cards.remove(card);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
controller.lookAtCards(sourceObject.getIdName(), cards, game);
|
controller.moveCards(randomExit, Zone.EXILED, source, game);
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put on the top of target player's library"));
|
controller.lookAtCards(source, null, cards, game);
|
||||||
while (controller.canRespond() && !cards.isEmpty()) {
|
controller.putCardsOnTopOfLibrary(cards, game, source, true);
|
||||||
controller.choose(Outcome.Neutral, cards, target, game);
|
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.remove(card);
|
|
||||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
|
||||||
}
|
|
||||||
target.clearChosen();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,12 +30,10 @@ package mage.cards.o;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
@ -48,8 +46,7 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
public class Oust extends CardImpl {
|
public class Oust extends CardImpl {
|
||||||
|
|
||||||
public Oust(UUID ownerId, CardSetInfo setInfo) {
|
public Oust(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}");
|
||||||
|
|
||||||
|
|
||||||
// Put target creature into its owner's library second from the top. Its controller gains 3 life.
|
// Put target creature into its owner's library second from the top. Its controller gains 3 life.
|
||||||
this.getSpellAbility().addEffect(new OustEffect());
|
this.getSpellAbility().addEffect(new OustEffect());
|
||||||
|
|
@ -84,27 +81,16 @@ class OustEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
Player owner = game.getPlayer(permanent.getOwnerId());
|
Player owner = game.getPlayer(permanent.getOwnerId());
|
||||||
Player controller = game.getPlayer(permanent.getControllerId());
|
Player controller = game.getPlayer(permanent.getControllerId());
|
||||||
if (owner == null || controller == null) {
|
if (owner == null || controller == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
owner.getLibrary().putCardToTopXPos(permanent, 2, game);
|
||||||
Card card = null;
|
|
||||||
if (owner.getLibrary().hasCards()) {
|
|
||||||
card = owner.getLibrary().removeFromTop(game);
|
|
||||||
}
|
|
||||||
|
|
||||||
permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
|
||||||
if (card != null) {
|
|
||||||
owner.getLibrary().putOnTop(card, game);
|
|
||||||
}
|
|
||||||
controller.gainLife(3, game, source);
|
controller.gainLife(3, game, source);
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ package mage.cards.p;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
|
|
@ -45,6 +44,7 @@ import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -89,11 +89,9 @@ class PetraSphinxEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||||
if (controller != null && sourceObject != null && player != null) {
|
if (controller != null && player != null) {
|
||||||
|
|
||||||
if (player.getLibrary().hasCards()) {
|
if (player.getLibrary().hasCards()) {
|
||||||
Choice cardChoice = new ChoiceImpl();
|
Choice cardChoice = new ChoiceImpl();
|
||||||
cardChoice.setChoices(CardRepository.instance.getNames());
|
cardChoice.setChoices(CardRepository.instance.getNames());
|
||||||
|
|
@ -102,11 +100,11 @@ class PetraSphinxEffect extends OneShotEffect {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String cardName = cardChoice.getChoice();
|
String cardName = cardChoice.getChoice();
|
||||||
game.informPlayers(sourceObject.getLogName() + ", player: " + player.getLogName() + ", named: [" + cardName + ']');
|
game.informPlayers(CardUtil.createObjectRealtedWindowTitle(source, game, null) + ", player: " + player.getLogName() + ", named: [" + cardName + ']');
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
Card card = player.getLibrary().getFromTop(game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
Cards cards = new CardsImpl(card);
|
Cards cards = new CardsImpl(card);
|
||||||
player.revealCards(sourceObject.getIdName(), cards, game);
|
player.revealCards(source, cards, game);
|
||||||
if (card.getName().equals(cardName)) {
|
if (card.getName().equals(cardName)) {
|
||||||
player.moveCards(cards, Zone.HAND, source, game);
|
player.moveCards(cards, Zone.HAND, source, game);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -58,10 +58,9 @@ import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
public class PlungeIntoDarkness extends CardImpl {
|
public class PlungeIntoDarkness extends CardImpl {
|
||||||
|
|
||||||
public PlungeIntoDarkness(UUID ownerId, CardSetInfo setInfo) {
|
public PlungeIntoDarkness(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}");
|
||||||
|
|
||||||
|
// Choose one -
|
||||||
// Choose one -
|
|
||||||
this.getSpellAbility().getModes().setMinModes(1);
|
this.getSpellAbility().getModes().setMinModes(1);
|
||||||
this.getSpellAbility().getModes().setMaxModes(1);
|
this.getSpellAbility().getModes().setMaxModes(1);
|
||||||
// Sacrifice any number of creatures, then you gain 3 life for each sacrificed creature;
|
// Sacrifice any number of creatures, then you gain 3 life for each sacrificed creature;
|
||||||
|
|
@ -70,7 +69,7 @@ public class PlungeIntoDarkness extends CardImpl {
|
||||||
Mode mode = new Mode();
|
Mode mode = new Mode();
|
||||||
mode.getEffects().add(new PlungeIntoDarknessSearchEffect());
|
mode.getEffects().add(new PlungeIntoDarknessSearchEffect());
|
||||||
this.getSpellAbility().getModes().addMode(mode);
|
this.getSpellAbility().getModes().addMode(mode);
|
||||||
|
|
||||||
// Entwine {B}
|
// Entwine {B}
|
||||||
this.addAbility(new EntwineAbility("{B}"));
|
this.addAbility(new EntwineAbility("{B}"));
|
||||||
}
|
}
|
||||||
|
|
@ -86,21 +85,21 @@ public class PlungeIntoDarkness extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
class PlungeIntoDarknessLifeEffect extends OneShotEffect {
|
class PlungeIntoDarknessLifeEffect extends OneShotEffect {
|
||||||
|
|
||||||
PlungeIntoDarknessLifeEffect() {
|
PlungeIntoDarknessLifeEffect() {
|
||||||
super(Outcome.GainLife);
|
super(Outcome.GainLife);
|
||||||
this.staticText = "Sacrifice any number of creatures, then you gain 3 life for each sacrificed creature";
|
this.staticText = "Sacrifice any number of creatures, then you gain 3 life for each sacrificed creature";
|
||||||
}
|
}
|
||||||
|
|
||||||
PlungeIntoDarknessLifeEffect(final PlungeIntoDarknessLifeEffect effect) {
|
PlungeIntoDarknessLifeEffect(final PlungeIntoDarknessLifeEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PlungeIntoDarknessLifeEffect copy() {
|
public PlungeIntoDarknessLifeEffect copy() {
|
||||||
return new PlungeIntoDarknessLifeEffect(this);
|
return new PlungeIntoDarknessLifeEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player player = game.getPlayer(source.getControllerId());
|
||||||
|
|
@ -126,52 +125,40 @@ class PlungeIntoDarknessLifeEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
class PlungeIntoDarknessSearchEffect extends OneShotEffect {
|
class PlungeIntoDarknessSearchEffect extends OneShotEffect {
|
||||||
|
|
||||||
PlungeIntoDarknessSearchEffect() {
|
PlungeIntoDarknessSearchEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "pay X life, then look at the top X cards of your library, put one of those cards into your hand, and exile the rest.";
|
this.staticText = "pay X life, then look at the top X cards of your library, put one of those cards into your hand, and exile the rest.";
|
||||||
}
|
}
|
||||||
|
|
||||||
PlungeIntoDarknessSearchEffect(final PlungeIntoDarknessSearchEffect effect) {
|
PlungeIntoDarknessSearchEffect(final PlungeIntoDarknessSearchEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PlungeIntoDarknessSearchEffect copy() {
|
public PlungeIntoDarknessSearchEffect copy() {
|
||||||
return new PlungeIntoDarknessSearchEffect(this);
|
return new PlungeIntoDarknessSearchEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (player != null) {
|
if (controller != null) {
|
||||||
VariableCost cost = new PayVariableLifeCost();
|
VariableCost cost = new PayVariableLifeCost();
|
||||||
int xValue = cost.announceXValue(source, game);
|
int xValue = cost.announceXValue(source, game);
|
||||||
cost.getFixedCostsFromAnnouncedValue(xValue).pay(source, game, source.getSourceId(), source.getControllerId(), false, null);
|
cost.getFixedCostsFromAnnouncedValue(xValue).pay(source, game, source.getSourceId(), source.getControllerId(), false, null);
|
||||||
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, xValue));
|
||||||
Cards cards = new CardsImpl();
|
controller.lookAtCards(source, null, cards, game);
|
||||||
int count = Math.min(player.getLibrary().size(), xValue);
|
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
player.lookAtCards("Plunge into Darkness", cards, game);
|
|
||||||
|
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand"));
|
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand"));
|
||||||
if (player.choose(Outcome.DrawCard, cards, target, game)) {
|
if (controller.choose(Outcome.DrawCard, cards, target, game)) {
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
Card card = cards.get(target.getFirstTarget(), game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
cards.remove(card);
|
cards.remove(card);
|
||||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
controller.moveCards(card, Zone.HAND, source, game);
|
||||||
game.informPlayers("Plunge into Darkness: " + player.getLogName() + " puts a card into their hand");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (UUID cardId : cards) {
|
controller.moveCards(cards, Zone.EXILED, source, game);
|
||||||
Card card = game.getCard(cardId);
|
|
||||||
card.moveToExile(null, "", source.getSourceId(), game);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.p;
|
package mage.cards.p;
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
|
@ -53,7 +52,7 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
public class Polymorph extends CardImpl {
|
public class Polymorph extends CardImpl {
|
||||||
|
|
||||||
public Polymorph(UUID ownerId, CardSetInfo setInfo) {
|
public Polymorph(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}");
|
||||||
|
|
||||||
// Destroy target creature. It can't be regenerated.
|
// Destroy target creature. It can't be regenerated.
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
|
|
@ -98,22 +97,21 @@ class PolymorphEffect extends OneShotEffect {
|
||||||
Library library = player.getLibrary();
|
Library library = player.getLibrary();
|
||||||
if (library.hasCards()) {
|
if (library.hasCards()) {
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl();
|
||||||
Card card = library.removeFromTop(game);
|
Card toBattlefield = null;
|
||||||
cards.add(card);
|
for (Card card : library.getCards(game)) {
|
||||||
while (!card.isCreature() && library.hasCards()) {
|
|
||||||
card = library.removeFromTop(game);
|
|
||||||
cards.add(card);
|
cards.add(card);
|
||||||
|
if (card.isCreature()) {
|
||||||
|
toBattlefield = card;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (toBattlefield != null) {
|
||||||
if (card.isCreature()) {
|
player.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game);
|
||||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId());
|
|
||||||
}
|
}
|
||||||
|
player.revealCards(source, cards, game);
|
||||||
|
cards.remove(toBattlefield);
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
player.revealCards("Polymorph", cards, game);
|
player.shuffleLibrary(source, game);
|
||||||
Set<Card> cardsToShuffle = cards.getCards(game);
|
|
||||||
cardsToShuffle.remove(card);
|
|
||||||
library.addAll(cardsToShuffle, game);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -33,18 +33,14 @@ import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbili
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
import mage.cards.Cards;
|
||||||
import mage.cards.CardsImpl;
|
import mage.cards.CardsImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.FilterCard;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -54,7 +50,7 @@ import mage.target.TargetPlayer;
|
||||||
public class Portent extends CardImpl {
|
public class Portent extends CardImpl {
|
||||||
|
|
||||||
public Portent(UUID ownerId, CardSetInfo setInfo) {
|
public Portent(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{U}");
|
||||||
|
|
||||||
// Look at the top three cards of target player's library, then put them back in any order. You may have that player shuffle their library.
|
// Look at the top three cards of target player's library, then put them back in any order. You may have that player shuffle their library.
|
||||||
this.getSpellAbility().addEffect(new PortentEffect());
|
this.getSpellAbility().addEffect(new PortentEffect());
|
||||||
|
|
@ -73,57 +69,35 @@ public class Portent extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PortentEffect extends OneShotEffect {
|
class PortentEffect extends OneShotEffect {
|
||||||
|
|
||||||
public PortentEffect() {
|
public PortentEffect() {
|
||||||
super(Outcome.DrawCard);
|
super(Outcome.DrawCard);
|
||||||
this.staticText = "look at the top three cards of target player's library, then put them back in any order. You may have that player shuffle their library.";
|
this.staticText = "look at the top three cards of target player's library, then put them back in any order. You may have that player shuffle their library.";
|
||||||
}
|
}
|
||||||
|
|
||||||
public PortentEffect(final PortentEffect effect) {
|
public PortentEffect(final PortentEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PortentEffect copy() {
|
public PortentEffect copy() {
|
||||||
return new PortentEffect(this);
|
return new PortentEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player you = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Player player = game.getPlayer(source.getFirstTarget());
|
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||||
if (player == null || you == null) {
|
if (player == null || controller == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 3));
|
||||||
int count = Math.min(player.getLibrary().size(), 3);
|
controller.lookAtCards(source, null, cards, game);
|
||||||
for (int i = 0; i < count; i++) {
|
controller.putCardsOnTopOfLibrary(cards, game, source, true);
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
if (controller.chooseUse(Outcome.Neutral, "You may have that player shuffle their library", source, game)) {
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
you.lookAtCards("Portent", cards, game);
|
|
||||||
|
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put on the top of target player's library"));
|
|
||||||
while (player.canRespond() && cards.size() > 1) {
|
|
||||||
you.choose(Outcome.Neutral, cards, target, game);
|
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.remove(card);
|
|
||||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
|
||||||
}
|
|
||||||
target.clearChosen();
|
|
||||||
}
|
|
||||||
if (cards.size() == 1) {
|
|
||||||
Card card = cards.get(cards.iterator().next(), game);
|
|
||||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
|
||||||
}
|
|
||||||
if (you.chooseUse(Outcome.Neutral, "You may have that player shuffle their library", source, game)){
|
|
||||||
player.shuffleLibrary(source, game);
|
player.shuffleLibrary(source, game);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -47,8 +46,7 @@ import mage.players.Player;
|
||||||
public class PrimalSurge extends CardImpl {
|
public class PrimalSurge extends CardImpl {
|
||||||
|
|
||||||
public PrimalSurge(UUID ownerId, CardSetInfo setInfo) {
|
public PrimalSurge(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{8}{G}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{8}{G}{G}");
|
||||||
|
|
||||||
|
|
||||||
// Exile the top card of your library. If it's a permanent card, you may put it onto the battlefield. If you do, repeat this process.
|
// Exile the top card of your library. If it's a permanent card, you may put it onto the battlefield. If you do, repeat this process.
|
||||||
this.getSpellAbility().addEffect(new PrimalSurgeEffect());
|
this.getSpellAbility().addEffect(new PrimalSurgeEffect());
|
||||||
|
|
@ -82,33 +80,24 @@ class PrimalSurgeEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (player == null) {
|
if (controller == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean repeat;
|
boolean repeat;
|
||||||
do {
|
do {
|
||||||
repeat = false;
|
repeat = false;
|
||||||
if (player.getLibrary().hasCards()) {
|
Card card = controller.getLibrary().getFromTop(game);
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
if (card != null) {
|
||||||
if (card != null) {
|
controller.moveCards(card, Zone.EXILED, source, game);
|
||||||
card.moveToExile(null, "", source.getSourceId(), game);
|
if (card.isPermanent()
|
||||||
if (card.isPermanent()
|
&& controller.chooseUse(Outcome.PutCardInPlay, "Put " + card.getName() + " onto the battlefield?", source, game)) {
|
||||||
&& player.chooseUse(Outcome.PutCardInPlay, "Put " + card.getName() + " onto the battlefield?", source, game)) {
|
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||||
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
|
repeat = true;
|
||||||
|
|
||||||
Permanent permanent = game.getPermanent(card.getId());
|
|
||||||
if (permanent == null) {
|
|
||||||
permanent = (Permanent) game.getLastKnownInformation(card.getId(), Zone.BATTLEFIELD);
|
|
||||||
}
|
|
||||||
if (permanent != null) {
|
|
||||||
repeat = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (player.canRespond() && repeat);
|
} while (controller.canRespond() && repeat);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,15 +41,13 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.AsThoughEffectType;
|
import mage.constants.AsThoughEffectType;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.SubType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.players.Library;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -102,16 +100,15 @@ class PropheticFlamespeakerExileEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
if (controller != null) {
|
||||||
if (sourcePermanent != null && controller != null && controller.getLibrary().hasCards()) {
|
Card card = controller.getLibrary().getFromTop(game);
|
||||||
Library library = controller.getLibrary();
|
|
||||||
Card card = library.removeFromTop(game);
|
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
String exileName = new StringBuilder(sourcePermanent.getIdName()).append(" <this card may be played the turn it was exiled>").toString();
|
if (controller.moveCardsToExile(card, source, game, true, source.getSourceId(),
|
||||||
controller.moveCardToExileWithInfo(card, source.getSourceId(), exileName, source.getSourceId(), game, Zone.LIBRARY, true);
|
CardUtil.createObjectRealtedWindowTitle(source, game, "<this card may be played the turn it was exiled>"))) {
|
||||||
ContinuousEffect effect = new PropheticFlamespeakerCastFromExileEffect();
|
ContinuousEffect effect = new PropheticFlamespeakerCastFromExileEffect();
|
||||||
effect.setTargetPointer(new FixedTarget(card.getId()));
|
effect.setTargetPointer(new FixedTarget(card.getId()));
|
||||||
game.addEffect(effect, source);
|
game.addEffect(effect, source);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,9 +53,10 @@ import mage.target.TargetCard;
|
||||||
public class PsychicSurgery extends CardImpl {
|
public class PsychicSurgery extends CardImpl {
|
||||||
|
|
||||||
public PsychicSurgery(UUID ownerId, CardSetInfo setInfo) {
|
public PsychicSurgery(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}");
|
||||||
|
|
||||||
|
|
||||||
|
// Whenever an opponent shuffles his or her library, you may look at the top two cards of that library.
|
||||||
|
// You may exile one of those cards. Then put the rest on top of that library in any order.
|
||||||
this.addAbility(new PsychicSurgeryTriggeredAbility());
|
this.addAbility(new PsychicSurgeryTriggeredAbility());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -100,7 +101,7 @@ class PsychicSurgeryTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
return "Whenever an opponent shuffles their library, you may look at the top two cards of that library. You may exile one of those cards. Then put the rest on top of that library in any order.";
|
return "Whenever an opponent shuffles their library, " + super.getRule();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -108,7 +109,7 @@ class PsychicSurgeryEffect extends OneShotEffect {
|
||||||
|
|
||||||
public PsychicSurgeryEffect() {
|
public PsychicSurgeryEffect() {
|
||||||
super(Outcome.Exile);
|
super(Outcome.Exile);
|
||||||
this.staticText = "look at the top two cards of that library. You may exile one of those cards. Then put the rest on top of that library in any order";
|
this.staticText = "you may look at the top two cards of that library. You may exile one of those cards. Then put the rest on top of that library in any order";
|
||||||
}
|
}
|
||||||
|
|
||||||
public PsychicSurgeryEffect(final PsychicSurgeryEffect effect) {
|
public PsychicSurgeryEffect(final PsychicSurgeryEffect effect) {
|
||||||
|
|
@ -123,31 +124,23 @@ class PsychicSurgeryEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
UUID opponentId = (UUID) this.getValue("PsychicSurgeryOpponent");
|
UUID opponentId = (UUID) this.getValue("PsychicSurgeryOpponent");
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Player opponent = game.getPlayer(opponentId);
|
Player opponent = game.getPlayer(opponentId);
|
||||||
|
|
||||||
if (player != null && opponent != null) {
|
if (controller != null && opponent != null) {
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl(opponent.getLibrary().getTopCards(game, 2));
|
||||||
int count = Math.min(player.getLibrary().size(), 2);
|
controller.lookAtCards(source, null, cards, game);
|
||||||
for (int i = 0; i < count; i++) {
|
if (!cards.isEmpty() && controller.chooseUse(Outcome.Exile, "Do you wish to exile a card?", source, game)) {
|
||||||
Card card = opponent.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
player.lookAtCards("Psychic Surgery", cards, game);
|
|
||||||
|
|
||||||
if (!cards.isEmpty() && player.chooseUse(Outcome.Exile, "Do you wish to exile a card?", source, game)) {
|
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to exile"));
|
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to exile"));
|
||||||
if (player.choose(Outcome.Exile, cards, target, game)) {
|
if (controller.choose(Outcome.Exile, cards, target, game)) {
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
Card card = cards.get(target.getFirstTarget(), game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
|
controller.moveCards(card, Zone.EXILED, source, game);
|
||||||
cards.remove(card);
|
cards.remove(card);
|
||||||
card.moveToZone(Zone.EXILED, source.getSourceId(), game, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.putCardsOnBottomOfLibrary(cards, game, source, true);
|
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -27,22 +27,16 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.q;
|
package mage.cards.q;
|
||||||
|
|
||||||
import java.util.Deque;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
|
||||||
import mage.cards.CardsImpl;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
|
@ -56,7 +50,7 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
public class QuarryColossus extends CardImpl {
|
public class QuarryColossus extends CardImpl {
|
||||||
|
|
||||||
public QuarryColossus(UUID ownerId, CardSetInfo setInfo) {
|
public QuarryColossus(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{W}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{W}{W}");
|
||||||
this.subtype.add(SubType.GIANT);
|
this.subtype.add(SubType.GIANT);
|
||||||
|
|
||||||
this.power = new MageInt(5);
|
this.power = new MageInt(5);
|
||||||
|
|
@ -102,27 +96,7 @@ class QuarryColossusReturnLibraryEffect extends OneShotEffect {
|
||||||
Player owner = game.getPlayer(permanent.getOwnerId());
|
Player owner = game.getPlayer(permanent.getOwnerId());
|
||||||
if (owner != null) {
|
if (owner != null) {
|
||||||
int plains = game.getBattlefield().countAll(new FilterPermanent(SubType.PLAINS, "Plains you control"), source.getControllerId(), game);
|
int plains = game.getBattlefield().countAll(new FilterPermanent(SubType.PLAINS, "Plains you control"), source.getControllerId(), game);
|
||||||
int xValue = Math.min(plains, owner.getLibrary().size());
|
controller.putCardOnTopXOfLibrary(permanent, game, source, plains);
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
Deque<UUID> cardIds = new LinkedList<>();
|
|
||||||
for (int i = 0; i < xValue; i++) {
|
|
||||||
Card card = owner.getLibrary().removeFromTop(game);
|
|
||||||
cards.add(card);
|
|
||||||
cardIds.push(card.getId());
|
|
||||||
}
|
|
||||||
// return cards back to library
|
|
||||||
permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
|
||||||
game.informPlayers(new StringBuilder(controller.getLogName())
|
|
||||||
.append(" puts ").append(permanent.getName())
|
|
||||||
.append(" beneath the top ").append(xValue)
|
|
||||||
.append(" cards of ").append(owner.getLogName()).append("'s library").toString());
|
|
||||||
while(!cardIds.isEmpty()) {
|
|
||||||
UUID cardId = cardIds.poll();
|
|
||||||
Card card = cards.get(cardId, game);
|
|
||||||
if (card != null) {
|
|
||||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,22 +29,16 @@ package mage.cards.r;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
|
||||||
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||||
import mage.abilities.keyword.EchoAbility;
|
import mage.abilities.keyword.EchoAbility;
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.cards.*;
|
import mage.cards.*;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.players.Player;
|
|
||||||
import mage.target.TargetCard;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -53,7 +47,7 @@ import mage.target.TargetCard;
|
||||||
public class RavenFamiliar extends CardImpl {
|
public class RavenFamiliar extends CardImpl {
|
||||||
|
|
||||||
public RavenFamiliar(UUID ownerId, CardSetInfo setInfo) {
|
public RavenFamiliar(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
|
||||||
this.subtype.add(SubType.BIRD);
|
this.subtype.add(SubType.BIRD);
|
||||||
|
|
||||||
this.power = new MageInt(1);
|
this.power = new MageInt(1);
|
||||||
|
|
@ -65,7 +59,7 @@ public class RavenFamiliar extends CardImpl {
|
||||||
this.addAbility(new EchoAbility("{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(
|
this.addAbility(new EntersBattlefieldTriggeredAbility(
|
||||||
new LookLibraryAndPickControllerEffect(new StaticValue(3), false, new StaticValue(1), new FilterCard(), Zone.LIBRARY, false, false),
|
new LookLibraryAndPickControllerEffect(new StaticValue(3), false, new StaticValue(1), StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false),
|
||||||
false));
|
false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -77,47 +71,4 @@ public class RavenFamiliar extends CardImpl {
|
||||||
public RavenFamiliar copy() {
|
public RavenFamiliar copy() {
|
||||||
return new RavenFamiliar(this);
|
return new RavenFamiliar(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static class RavenFamiliarEffect extends OneShotEffect {
|
|
||||||
|
|
||||||
public RavenFamiliarEffect() {
|
|
||||||
super(Outcome.DrawCard);
|
|
||||||
this.staticText = "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";
|
|
||||||
}
|
|
||||||
|
|
||||||
public RavenFamiliarEffect(final RavenFamiliarEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RavenFamiliarEffect copy() {
|
|
||||||
return new RavenFamiliarEffect(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
player.lookAtCards("Raven Familiar", cards, game);
|
|
||||||
|
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to 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.getSourceId(), game, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
player.putCardsOnBottomOfLibrary(cards, game, source, true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.r;
|
package mage.cards.r;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
|
@ -44,8 +45,6 @@ import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
|
|
@ -53,7 +52,7 @@ import java.util.UUID;
|
||||||
public class Reweave extends CardImpl {
|
public class Reweave extends CardImpl {
|
||||||
|
|
||||||
public Reweave(UUID ownerId, CardSetInfo setInfo) {
|
public Reweave(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{5}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{5}{U}");
|
||||||
this.subtype.add(SubType.ARCANE);
|
this.subtype.add(SubType.ARCANE);
|
||||||
|
|
||||||
// Target permanent's controller sacrifices it. If he or she does, that player reveals cards from the top of their library until he or she reveals a permanent card that shares a card type with the sacrificed permanent, puts that card onto the battlefield, then shuffles their library.
|
// Target permanent's controller sacrifices it. If he or she does, that player reveals cards from the top of their library until he or she reveals a permanent card that shares a card type with the sacrificed permanent, puts that card onto the battlefield, then shuffles their library.
|
||||||
|
|
@ -104,33 +103,24 @@ class ReweaveEffect extends OneShotEffect {
|
||||||
Library library = permanentController.getLibrary();
|
Library library = permanentController.getLibrary();
|
||||||
if (library.hasCards()) {
|
if (library.hasCards()) {
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl();
|
||||||
Card card = null;
|
Card permanentCard = null;
|
||||||
boolean cardFound = false;
|
for (Card card : permanentController.getLibrary().getCards(game)) {
|
||||||
if (library.hasCards()) {
|
cards.add(card);
|
||||||
do {
|
if (card.isPermanent()) {
|
||||||
card = library.removeFromTop(game);
|
for (CardType cardType : permanent.getCardType()) {
|
||||||
cards.add(card);
|
if (card.getCardType().contains(cardType)) {
|
||||||
if (filter.match(card, game)) {
|
permanentCard = card;
|
||||||
for (CardType cardType : permanent.getCardType()) {
|
break;
|
||||||
if (card.getCardType().contains(cardType)) {
|
|
||||||
// a permanent card
|
|
||||||
cardFound = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (!cardFound && library.hasCards());
|
|
||||||
permanentController.moveCards(card, Zone.BATTLEFIELD, source, game);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!cards.isEmpty()) {
|
|
||||||
permanentController.revealCards(sourceObject.getIdName(), cards, game);
|
|
||||||
if (cardFound && card != null) {
|
|
||||||
cards.remove(card);
|
|
||||||
}
|
}
|
||||||
library.addAll(cards.getCards(game), game);
|
|
||||||
permanentController.shuffleLibrary(source, game);
|
|
||||||
}
|
}
|
||||||
|
permanentController.revealCards(source, cards, game);
|
||||||
|
if (permanentCard != null) {
|
||||||
|
permanentController.moveCards(permanentCard, Zone.BATTLEFIELD, source, game);
|
||||||
|
}
|
||||||
|
permanentController.shuffleLibrary(source, game);
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@ import mage.constants.Outcome;
|
||||||
import mage.constants.TargetController;
|
import mage.constants.TargetController;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.watchers.common.PlayerAttackedWatcher;
|
import mage.watchers.common.PlayerAttackedWatcher;
|
||||||
|
|
||||||
|
|
@ -97,16 +96,14 @@ class RuinRaiderEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
if (controller != null) {
|
||||||
if (controller != null && sourcePermanent != null) {
|
|
||||||
if (controller.getLibrary().hasCards()) {
|
if (controller.getLibrary().hasCards()) {
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
Card card = controller.getLibrary().getFromTop(game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
Cards cards = new CardsImpl(card);
|
Cards cards = new CardsImpl(card);
|
||||||
controller.revealCards(sourcePermanent.getIdName(), cards, game);
|
controller.revealCards(source, cards, game);
|
||||||
controller.moveCards(card, Zone.HAND, source, game);
|
controller.moveCards(card, Zone.HAND, source, game);
|
||||||
controller.loseLife(card.getConvertedManaCost(), game, false);
|
controller.loseLife(card.getConvertedManaCost(), game, false);
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.ReplacementEffectImpl;
|
import mage.abilities.effects.ReplacementEffectImpl;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
import mage.cards.Cards;
|
||||||
|
|
@ -42,12 +41,10 @@ import mage.constants.SubType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -56,7 +53,7 @@ import mage.target.TargetCard;
|
||||||
public class SagesOfTheAnima extends CardImpl {
|
public class SagesOfTheAnima extends CardImpl {
|
||||||
|
|
||||||
public SagesOfTheAnima(UUID ownerId, CardSetInfo setInfo) {
|
public SagesOfTheAnima(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{U}");
|
||||||
this.subtype.add(SubType.ELF);
|
this.subtype.add(SubType.ELF);
|
||||||
this.subtype.add(SubType.WIZARD);
|
this.subtype.add(SubType.WIZARD);
|
||||||
|
|
||||||
|
|
@ -101,47 +98,24 @@ class SagesOfTheAnimaReplacementEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||||
FilterCard filter = new FilterCard();
|
|
||||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
|
||||||
Player player = game.getPlayer(event.getPlayerId());
|
Player player = game.getPlayer(event.getPlayerId());
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
for (int i = 0; i < 3; i++) {
|
Cards revealedCards = new CardsImpl(player.getLibrary().getTopCards(game, 3));
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
player.revealCards(source, revealedCards, game);
|
||||||
if (card != null) {
|
Cards creatures = new CardsImpl(revealedCards.getCards(StaticFilters.FILTER_CARD_CREATURE, game));
|
||||||
cards.add(card);
|
player.moveCards(creatures, Zone.BATTLEFIELD, source, game);
|
||||||
}
|
revealedCards.removeAll(creatures);
|
||||||
}
|
player.putCardsOnBottomOfLibrary(revealedCards, game, source, true);
|
||||||
player.revealCards("Top three cards of library revealed", cards, game);
|
return true;
|
||||||
for (Card revealedCard : cards.getCards(game)) {
|
|
||||||
if (revealedCard.isCreature()) {
|
|
||||||
revealedCard.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
|
||||||
cards.remove(revealedCard);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard());
|
|
||||||
while (player.canRespond() && 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.getSourceId(), game, false);
|
|
||||||
}
|
|
||||||
target.clearChosen();
|
|
||||||
}
|
|
||||||
if (cards.size() == 1) {
|
|
||||||
Card card = cards.get(cards.iterator().next(), game);
|
|
||||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DRAW_CARD;
|
return event.getType() == GameEvent.EventType.DRAW_CARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
return event.getPlayerId().equals(source.getControllerId());
|
return event.getPlayerId().equals(source.getControllerId());
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ import mage.constants.SubType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@ import mage.players.Player;
|
||||||
public class SaprazzanBreaker extends CardImpl {
|
public class SaprazzanBreaker extends CardImpl {
|
||||||
|
|
||||||
public SaprazzanBreaker(UUID ownerId, CardSetInfo setInfo) {
|
public SaprazzanBreaker(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}");
|
||||||
this.subtype.add(SubType.BEAST);
|
this.subtype.add(SubType.BEAST);
|
||||||
this.power = new MageInt(3);
|
this.power = new MageInt(3);
|
||||||
this.toughness = new MageInt(3);
|
this.toughness = new MageInt(3);
|
||||||
|
|
@ -92,11 +92,11 @@ class SaprazzanBreakerEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player player = game.getPlayer(source.getControllerId());
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
Card card = player.getLibrary().getFromTop(game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
player.moveCards(card, Zone.GRAVEYARD, source, game);
|
player.moveCards(card, Zone.GRAVEYARD, source, game);
|
||||||
if (card.isLand()) {
|
if (card.isLand()) {
|
||||||
game.addEffect(new CantBeBlockedByAllSourceEffect(new FilterCreaturePermanent(), Duration.EndOfCombat), source);
|
game.addEffect(new CantBeBlockedByAllSourceEffect(StaticFilters.FILTER_PERMANENT_CREATURES, Duration.EndOfTurn), source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
|
@ -38,9 +38,12 @@ import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.cards.Cards;
|
||||||
|
import mage.cards.CardsImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
|
|
@ -51,7 +54,7 @@ import mage.players.Player;
|
||||||
public class Scalpelexis extends CardImpl {
|
public class Scalpelexis extends CardImpl {
|
||||||
|
|
||||||
public Scalpelexis(UUID ownerId, CardSetInfo setInfo) {
|
public Scalpelexis(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}");
|
||||||
this.subtype.add(SubType.BEAST);
|
this.subtype.add(SubType.BEAST);
|
||||||
|
|
||||||
this.power = new MageInt(1);
|
this.power = new MageInt(1);
|
||||||
|
|
@ -92,38 +95,26 @@ class ScalpelexisEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||||
List<String> namesFiltered = new ArrayList<>();
|
if (targetPlayer == null) {
|
||||||
boolean doneOnce = false;
|
return false;
|
||||||
|
}
|
||||||
while (checkDuplicatedNames(namesFiltered) || !doneOnce) {
|
Set<String> cardNames = new HashSet<>();
|
||||||
doneOnce = true;
|
boolean doubleName;
|
||||||
namesFiltered.clear();
|
do {
|
||||||
int count = Math.min(player.getLibrary().size(), 4);
|
doubleName = false;
|
||||||
for (int i = 0; i < count; i++) {
|
Cards toExile = new CardsImpl(targetPlayer.getLibrary().getTopCards(game, 4));
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
cardNames.clear();
|
||||||
if (card != null) {
|
for (Card card : toExile.getCards(game)) {
|
||||||
namesFiltered.add(card.getName());
|
if (cardNames.contains(card.getName())) {
|
||||||
card.moveToExile(id, "Moved these cards to exile", source.getSourceId(), game);
|
doubleName = true;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
cardNames.add(card.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
targetPlayer.moveCards(toExile, Zone.EXILED, source, game);
|
||||||
|
} while (doubleName);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public boolean checkDuplicatedNames(List<String> string) {
|
|
||||||
for (int i = 0; i < string.size() - 1; i++) {
|
|
||||||
String stringToCheck = string.get(i);
|
|
||||||
if (stringToCheck == null) {
|
|
||||||
continue; //empty ignore
|
|
||||||
}
|
|
||||||
for (int j = i + 1; j < string.size(); j++) {
|
|
||||||
String stringToCompare = string.get(j);
|
|
||||||
if (stringToCheck.equals(stringToCompare)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
|
|
@ -53,11 +52,10 @@ import mage.target.TargetCard;
|
||||||
public class ScoutTheBorders extends CardImpl {
|
public class ScoutTheBorders extends CardImpl {
|
||||||
|
|
||||||
public ScoutTheBorders(UUID ownerId, CardSetInfo setInfo) {
|
public ScoutTheBorders(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}");
|
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.
|
// 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 ScoutTheBordersEffect());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ScoutTheBorders(final ScoutTheBorders card) {
|
public ScoutTheBorders(final ScoutTheBorders card) {
|
||||||
|
|
@ -70,48 +68,36 @@ public class ScoutTheBorders extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ScoutTheBordersEffect extends OneShotEffect {
|
class ScoutTheBordersEffect extends OneShotEffect {
|
||||||
|
|
||||||
private static final FilterCard filterPutInHand = new FilterCard("creature or land card to put in hand");
|
private static final FilterCard filterPutInHand = new FilterCard("creature or land card to put in hand");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filterPutInHand.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND)));
|
filterPutInHand.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ScoutTheBordersEffect() {
|
public ScoutTheBordersEffect() {
|
||||||
super(Outcome.DrawCard);
|
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";
|
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) {
|
public ScoutTheBordersEffect(final ScoutTheBordersEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ScoutTheBordersEffect copy() {
|
public ScoutTheBordersEffect copy() {
|
||||||
return new ScoutTheBordersEffect(this);
|
return new ScoutTheBordersEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
if (controller != null) {
|
||||||
if (controller != null && sourceObject != null) {
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 5));
|
||||||
Cards cards = new CardsImpl();
|
boolean properCardFound = cards.count(filterPutInHand, game) > 0;
|
||||||
|
|
||||||
boolean properCardFound = false;
|
|
||||||
int count = Math.min(controller.getLibrary().size(), 5);
|
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
if (filterPutInHand.match(card, source.getSourceId(), source.getControllerId(), game)) {
|
|
||||||
properCardFound = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
controller.revealCards(sourceObject.getName(), cards, game);
|
controller.revealCards(source, cards, game);
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, filterPutInHand);
|
TargetCard target = new TargetCard(Zone.LIBRARY, filterPutInHand);
|
||||||
if (properCardFound && controller.choose(Outcome.DrawCard, cards, target, game)) {
|
if (properCardFound && controller.choose(Outcome.DrawCard, cards, target, game)) {
|
||||||
Card card = game.getCard(target.getFirstTarget());
|
Card card = game.getCard(target.getFirstTarget());
|
||||||
|
|
|
||||||
|
|
@ -34,18 +34,14 @@ import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.LookLibraryControllerEffect;
|
import mage.abilities.effects.common.LookLibraryControllerEffect;
|
||||||
import mage.abilities.keyword.EntwineAbility;
|
import mage.abilities.keyword.EntwineAbility;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
import mage.cards.Cards;
|
||||||
import mage.cards.CardsImpl;
|
import mage.cards.CardsImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.FilterCard;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
|
||||||
import mage.target.common.TargetOpponent;
|
import mage.target.common.TargetOpponent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -91,7 +87,7 @@ class SecondSightEffect extends OneShotEffect {
|
||||||
|
|
||||||
public SecondSightEffect() {
|
public SecondSightEffect() {
|
||||||
super(Outcome.DrawCard);
|
super(Outcome.DrawCard);
|
||||||
this.staticText = "look at the top five cards of target opponent's library, then put them back in any order.";
|
this.staticText = "look at the top five cards of target opponent's library, then put them back in any order";
|
||||||
}
|
}
|
||||||
|
|
||||||
public SecondSightEffect(final SecondSightEffect effect) {
|
public SecondSightEffect(final SecondSightEffect effect) {
|
||||||
|
|
@ -105,36 +101,14 @@ class SecondSightEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player you = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Player player = game.getPlayer(source.getFirstTarget());
|
Player player = game.getPlayer(source.getFirstTarget());
|
||||||
if (player == null || you == null) {
|
if (player == null || controller == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 5));
|
||||||
int count = Math.min(player.getLibrary().size(), 5);
|
controller.lookAtCards(source, null, cards, game);
|
||||||
for (int i = 0; i < count; i++) {
|
controller.putCardsOnTopOfLibrary(cards, game, source, true);
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
you.lookAtCards("Second Sight", cards, game);
|
|
||||||
|
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put on the top of target player's library"));
|
|
||||||
while (player.canRespond() && cards.size() > 1) {
|
|
||||||
you.choose(Outcome.Neutral, cards, target, game);
|
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.remove(card);
|
|
||||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
|
||||||
}
|
|
||||||
target.clearChosen();
|
|
||||||
}
|
|
||||||
if (cards.size() == 1) {
|
|
||||||
Card card = cards.get(cards.iterator().next(), game);
|
|
||||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,13 +28,11 @@
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.condition.InvertCondition;
|
import mage.abilities.condition.InvertCondition;
|
||||||
import mage.abilities.condition.common.FerociousCondition;
|
import mage.abilities.condition.common.FerociousCondition;
|
||||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
import mage.cards.Cards;
|
||||||
|
|
@ -42,7 +40,7 @@ import mage.cards.CardsImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterCreatureCard;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
import mage.target.TargetCard;
|
||||||
|
|
@ -54,7 +52,7 @@ import mage.target.TargetCard;
|
||||||
public class SeeTheUnwritten extends CardImpl {
|
public class SeeTheUnwritten extends CardImpl {
|
||||||
|
|
||||||
public SeeTheUnwritten(UUID ownerId, CardSetInfo setInfo) {
|
public SeeTheUnwritten(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{G}{G}");
|
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.
|
// 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.
|
||||||
// <i>Ferocious</i> — If you control a creature with power 4 or greater, you may put two creature cards onto the battlefield instead of one.
|
// <i>Ferocious</i> — If you control a creature with power 4 or greater, you may put two creature cards onto the battlefield instead of one.
|
||||||
|
|
@ -78,8 +76,6 @@ public class SeeTheUnwritten extends CardImpl {
|
||||||
|
|
||||||
class SeeTheUnwrittenEffect extends OneShotEffect {
|
class SeeTheUnwrittenEffect extends OneShotEffect {
|
||||||
|
|
||||||
private static final FilterCreatureCard filter = new FilterCreatureCard("creature card");
|
|
||||||
|
|
||||||
private final int numberOfCardsToPutIntoPlay;
|
private final int numberOfCardsToPutIntoPlay;
|
||||||
|
|
||||||
public SeeTheUnwrittenEffect(int numberOfCardsToPutIntoPlay) {
|
public SeeTheUnwrittenEffect(int numberOfCardsToPutIntoPlay) {
|
||||||
|
|
@ -103,36 +99,18 @@ class SeeTheUnwrittenEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
if (controller != null) {
|
||||||
if (controller != null && sourceObject != null) {
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 8));
|
||||||
Cards cards = new CardsImpl();
|
int creatureCardsFound = cards.count(StaticFilters.FILTER_CARD_CREATURE, game);
|
||||||
|
|
||||||
int creatureCardsFound = 0;
|
|
||||||
int count = Math.min(controller.getLibrary().size(), 8);
|
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
if (filter.match(card, source.getSourceId(), source.getControllerId(), game)) {
|
|
||||||
creatureCardsFound++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
controller.revealCards(sourceObject.getName(), cards, game);
|
controller.revealCards(source, cards, game);
|
||||||
if (creatureCardsFound > 0 && controller.chooseUse(outcome, "Put creature(s) into play?", source, game)) {
|
if (creatureCardsFound > 0 && controller.chooseUse(outcome, "Put creature(s) into play?", source, game)) {
|
||||||
int cardsToChoose = Math.min(numberOfCardsToPutIntoPlay, creatureCardsFound);
|
int cardsToChoose = Math.min(numberOfCardsToPutIntoPlay, creatureCardsFound);
|
||||||
TargetCard target = new TargetCard(cardsToChoose, cardsToChoose, Zone.LIBRARY, filter);
|
TargetCard target = new TargetCard(cardsToChoose, cardsToChoose, Zone.LIBRARY, StaticFilters.FILTER_CARD_CREATURE);
|
||||||
if (controller.choose(Outcome.PutCreatureInPlay, cards, target, game)) {
|
if (controller.choose(Outcome.PutCreatureInPlay, cards, target, game)) {
|
||||||
for (UUID creatureId : target.getTargets()) {
|
Cards toBattlefield = new CardsImpl(target.getTargets());
|
||||||
Card card = game.getCard(creatureId);
|
controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game);
|
||||||
if (card != null) {
|
cards.removeAll(toBattlefield);
|
||||||
cards.remove(card);
|
|
||||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@ public class SelvalasStampede extends CardImpl {
|
||||||
|
|
||||||
public SelvalasStampede(UUID ownerId, CardSetInfo setInfo) {
|
public SelvalasStampede(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}{G}");
|
||||||
|
|
||||||
|
|
||||||
// <i>Council's dilemma</i> &mdash Starting with you, each player votes for wild or free. Reveal cards from the top of your library until you reveal a creature card for each wild vote. Put those creature cards onto the battlefield, then shuffle the rest into your library. You may put a permanent card from your hand onto the battlefield for each free vote.
|
// <i>Council's dilemma</i> &mdash Starting with you, each player votes for wild or free. Reveal cards from the top of your library until you reveal a creature card for each wild vote. Put those creature cards onto the battlefield, then shuffle the rest into your library. You may put a permanent card from your hand onto the battlefield for each free vote.
|
||||||
this.getSpellAbility().addEffect(new SelvalasStampedeDilemmaEffect());
|
this.getSpellAbility().addEffect(new SelvalasStampedeDilemmaEffect());
|
||||||
|
|
@ -66,8 +65,9 @@ public class SelvalasStampede extends CardImpl {
|
||||||
class SelvalasStampedeDilemmaEffect extends CouncilsDilemmaVoteEffect {
|
class SelvalasStampedeDilemmaEffect extends CouncilsDilemmaVoteEffect {
|
||||||
|
|
||||||
public SelvalasStampedeDilemmaEffect() {
|
public SelvalasStampedeDilemmaEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.PutCardInPlay);
|
||||||
this.staticText = "<i>Council's dilemma</i> — Starting with you, each player votes for wild or free. Reveal cards from the top of your library until you reveal a creature card for each wild vote. Put those creature cards onto the battlefield, then shuffle the rest into your library. You may put a permanent card from your hand onto the battlefield for each free vote";
|
this.staticText = "<i>Council's dilemma</i> — Starting with you, each player votes for wild or free. Reveal cards from the top of your library until you reveal a creature card for each wild vote. Put those creature cards onto the battlefield, then shuffle the rest into your library. "
|
||||||
|
+ "You may put a permanent card from your hand onto the battlefield for each free vote";
|
||||||
}
|
}
|
||||||
|
|
||||||
public SelvalasStampedeDilemmaEffect(final SelvalasStampedeDilemmaEffect effect) {
|
public SelvalasStampedeDilemmaEffect(final SelvalasStampedeDilemmaEffect effect) {
|
||||||
|
|
@ -79,34 +79,37 @@ class SelvalasStampedeDilemmaEffect extends CouncilsDilemmaVoteEffect {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
|
||||||
//If no controller, exit here and do not vote.
|
//If no controller, exit here and do not vote.
|
||||||
if (controller == null) return false;
|
if (controller == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
this.vote("wild", "free", controller, game, source);
|
this.vote("wild", "free", controller, game, source);
|
||||||
|
|
||||||
//Wild Votes
|
//Wild Votes
|
||||||
if (voteOneCount > 0) {
|
if (voteOneCount > 0) {
|
||||||
Cards revealedCards = new CardsImpl();
|
Cards revealedCards = new CardsImpl();
|
||||||
int cardsToReveal = voteOneCount;
|
Cards toBattlefield = new CardsImpl();
|
||||||
|
for (Card card : controller.getLibrary().getCards(game)) {
|
||||||
while (cardsToReveal > 0 && controller.getLibrary().hasCards()) {
|
revealedCards.add(card);
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
|
||||||
if (card.isCreature()) {
|
if (card.isCreature()) {
|
||||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
toBattlefield.add(card);
|
||||||
cardsToReveal--;
|
if (toBattlefield.size() == voteOneCount) {
|
||||||
} else {
|
break;
|
||||||
revealedCards.add(card);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
controller.revealCards(source, revealedCards, game);
|
||||||
controller.revealCards("Selvala's Stampede", revealedCards, game);
|
controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game);
|
||||||
controller.moveCards(revealedCards, Zone.LIBRARY, source, game);
|
revealedCards.removeAll(toBattlefield);
|
||||||
controller.shuffleLibrary(source, game);
|
if (!revealedCards.isEmpty()) {
|
||||||
|
controller.shuffleLibrary(source, game);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Free Votes
|
//Free Votes
|
||||||
if (voteTwoCount > 0) {
|
if (voteTwoCount > 0) {
|
||||||
TargetCardInHand target = new TargetCardInHand(0, voteTwoCount, new FilterPermanentCard("permanent cards"));
|
TargetCardInHand target = new TargetCardInHand(0, voteTwoCount, new FilterPermanentCard("permanent cards"));
|
||||||
if (controller.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) {
|
if (controller.choose(outcome, target, source.getSourceId(), game)) {
|
||||||
controller.moveCards(new CardsImpl(target.getTargets()), Zone.BATTLEFIELD, source, game);
|
controller.moveCards(new CardsImpl(target.getTargets()), Zone.BATTLEFIELD, source, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,11 @@ package mage.cards.s;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
|
||||||
import mage.cards.*;
|
import mage.cards.*;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
@ -48,21 +46,14 @@ import mage.target.TargetPermanent;
|
||||||
*/
|
*/
|
||||||
public class ShapeAnew extends CardImpl {
|
public class ShapeAnew extends CardImpl {
|
||||||
|
|
||||||
private static final FilterPermanent filter = new FilterPermanent("an artifact");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new CardTypePredicate(CardType.ARTIFACT));
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShapeAnew(UUID ownerId, CardSetInfo setInfo) {
|
public ShapeAnew(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}");
|
||||||
|
|
||||||
// The controller of target artifact sacrifices it, then reveals cards from the top
|
// The controller of target artifact sacrifices it, then reveals cards from the top
|
||||||
// of their library until he or she reveals an artifact card. That player puts
|
// of their library until he or she reveals an artifact card. That player puts
|
||||||
// that card onto the battlefield, then shuffles all other cards revealed this way into their library.
|
// that card onto the battlefield, then shuffles all other cards revealed this way into their library.
|
||||||
this.getSpellAbility().addEffect(new SacrificeTargetEffect("The controller of target artifact sacrifices it"));
|
|
||||||
this.getSpellAbility().addTarget(new TargetPermanent(filter));
|
|
||||||
this.getSpellAbility().addEffect(new ShapeAnewEffect());
|
this.getSpellAbility().addEffect(new ShapeAnewEffect());
|
||||||
|
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_AN));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShapeAnew(final ShapeAnew card) {
|
public ShapeAnew(final ShapeAnew card) {
|
||||||
|
|
@ -78,7 +69,7 @@ public class ShapeAnew extends CardImpl {
|
||||||
|
|
||||||
public ShapeAnewEffect() {
|
public ShapeAnewEffect() {
|
||||||
super(Outcome.PutCardInPlay);
|
super(Outcome.PutCardInPlay);
|
||||||
staticText = ", then reveals cards from the top of their library until he or she reveals an artifact card. That player puts that card onto the battlefield, then shuffles all other cards revealed this way into their library";
|
staticText = "The controller of target artifact sacrifices it, then reveals cards from the top of their library until he or she reveals an artifact card. That player puts that card onto the battlefield, then shuffles all other cards revealed this way into their library";
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShapeAnewEffect(ShapeAnewEffect effect) {
|
public ShapeAnewEffect(ShapeAnewEffect effect) {
|
||||||
|
|
@ -87,32 +78,29 @@ public class ShapeAnew extends CardImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent sourcePermanent = (Permanent) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.BATTLEFIELD);
|
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||||
if (sourcePermanent == null) {
|
if (targetPermanent == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
targetPermanent.sacrifice(source.getSourceId(), game);
|
||||||
if (controller == null) {
|
Player targetController = game.getPlayer(targetPermanent.getControllerId());
|
||||||
|
if (targetController == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Cards revealed = new CardsImpl();
|
Cards revealed = new CardsImpl();
|
||||||
Card artifactCard = null;
|
Card artifactCard = null;
|
||||||
Cards nonArtifactCards = new CardsImpl();
|
for (Card card : targetController.getLibrary().getCards(game)) {
|
||||||
Player targetController = game.getPlayer(sourcePermanent.getControllerId());
|
|
||||||
while (artifactCard == null && targetController.getLibrary().hasCards()) {
|
|
||||||
Card card = targetController.getLibrary().removeFromTop(game);
|
|
||||||
revealed.add(card);
|
revealed.add(card);
|
||||||
if (card.isArtifact()) {
|
if (card.isArtifact()) {
|
||||||
artifactCard = card;
|
artifactCard = card;
|
||||||
} else {
|
break;
|
||||||
nonArtifactCards.add(card);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
targetController.revealCards(sourcePermanent.getIdName(), revealed, game);
|
targetController.revealCards(source, revealed, game);
|
||||||
if (artifactCard != null) {
|
if (artifactCard != null) {
|
||||||
targetController.moveCards(artifactCard, Zone.BATTLEFIELD, source, game);
|
targetController.moveCards(artifactCard, Zone.BATTLEFIELD, source, game);
|
||||||
}
|
}
|
||||||
targetController.putCardsOnTopOfLibrary(nonArtifactCards, game, source, false);
|
// 1/1/2011: If the first card the player reveals is an artifact card, he or she will still have to shuffle his or her library even though no other cards were revealed this way.
|
||||||
targetController.shuffleLibrary(source, game);
|
targetController.shuffleLibrary(source, game);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ public class ShrineOfPiercingVision extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShrineOfPiercingVision(UUID ownerId, CardSetInfo setInfo) {
|
public ShrineOfPiercingVision(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||||
|
|
||||||
// At the beginning of your upkeep or whenever you cast a blue spell, put a charge counter on Shrine of Piercing Vision.
|
// At the beginning of your upkeep or whenever you cast a blue spell, put a charge counter on Shrine of Piercing Vision.
|
||||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), TargetController.YOU, false));
|
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), TargetController.YOU, false));
|
||||||
|
|
@ -113,30 +113,19 @@ class ShrineOfPiercingVisionEffect extends OneShotEffect {
|
||||||
if (player == null || permanent == null) {
|
if (player == null || permanent == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int count = permanent.getCounters(game).getCount(CounterType.CHARGE);
|
Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, permanent.getCounters(game).getCount(CounterType.CHARGE)));
|
||||||
|
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
count = Math.min(player.getLibrary().size(), count);
|
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
player.lookAtCards("Shrine of Piercing Vision", cards, game);
|
|
||||||
|
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
|
player.lookAtCards(source, null, cards, game);
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand"));
|
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand"));
|
||||||
|
|
||||||
if (player.choose(Outcome.DrawCard, cards, target, game)) {
|
if (player.choose(Outcome.DrawCard, cards, target, game)) {
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
Card card = cards.get(target.getFirstTarget(), game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
cards.remove(card);
|
cards.remove(card);
|
||||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
player.moveCards(card, Zone.HAND, source, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
player.putCardsOnBottomOfLibrary(cards, game, source, true);
|
||||||
}
|
}
|
||||||
player.putCardsOnBottomOfLibrary(cards, game, source, true);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
|
@ -37,15 +36,13 @@ import mage.abilities.keyword.MenaceAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
|
||||||
import mage.cards.CardsImpl;
|
import mage.cards.CardsImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.TargetController;
|
import mage.constants.TargetController;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -55,7 +52,7 @@ import mage.players.Player;
|
||||||
public class SinProdder extends CardImpl {
|
public class SinProdder extends CardImpl {
|
||||||
|
|
||||||
public SinProdder(UUID ownerId, CardSetInfo setInfo) {
|
public SinProdder(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||||
this.subtype.add(SubType.DEVIL);
|
this.subtype.add(SubType.DEVIL);
|
||||||
this.power = new MageInt(3);
|
this.power = new MageInt(3);
|
||||||
this.toughness = new MageInt(2);
|
this.toughness = new MageInt(2);
|
||||||
|
|
@ -98,32 +95,31 @@ class SinProdderEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
if (controller != null) {
|
||||||
if (controller != null && sourcePermanent != null) {
|
Card card = controller.getLibrary().getFromTop(game);
|
||||||
if (controller.getLibrary().hasCards()) {
|
if (card != null) {
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
controller.revealCards(source, new CardsImpl(card), game);
|
||||||
if (card != null) {
|
String message = "Put " + card.getName() + " in " + controller.getName() + "'s graveyard?";
|
||||||
Cards cards = new CardsImpl(card);
|
boolean putInGraveyard = false;
|
||||||
controller.revealCards(sourcePermanent.getIdName(), cards, game);
|
for (UUID opponentUuid : game.getOpponents(source.getControllerId())) {
|
||||||
StringBuilder sb = new StringBuilder();
|
Player opponent = game.getPlayer(opponentUuid);
|
||||||
sb.append("Put ").append(card.getName()).append(" in ").append(controller.getLogName()).append("'s graveyard?");
|
if (opponent != null && !putInGraveyard && opponent.chooseUse(Outcome.Damage, message, source, game)) {
|
||||||
boolean putInGraveyard = false;
|
putInGraveyard = true;
|
||||||
Set<UUID> opponents = game.getOpponents(source.getControllerId());
|
opponent.damage(card.getConvertedManaCost(), source.getSourceId(), game, false, true);
|
||||||
for (UUID opponentUuid : opponents) {
|
// 4/8/2016: Each opponent in turn order, starting with the one after you in turn order, may choose to have you put that card into your graveyard.
|
||||||
Player opponent = game.getPlayer(opponentUuid);
|
// Once a player does so, Sin Prodder deals damage equal to that card's converted mana cost to that player immediately
|
||||||
if (opponent != null && !putInGraveyard && opponent.chooseUse(Outcome.Damage, sb.toString(), source, game)) {
|
// and Sin Prodder's trigger has no further action.
|
||||||
putInGraveyard = true;
|
break;
|
||||||
opponent.damage(card.getConvertedManaCost(), source.getSourceId(), game, false, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (putInGraveyard) {
|
}
|
||||||
controller.moveCards(card, Zone.GRAVEYARD, source, game);
|
if (putInGraveyard) {
|
||||||
} else {
|
controller.moveCards(card, Zone.GRAVEYARD, source, game);
|
||||||
controller.moveCards(card, Zone.HAND, source, game);
|
} else {
|
||||||
}
|
controller.moveCards(card, Zone.HAND, source, game);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterInstantOrSorcerySpell;
|
import mage.filter.common.FilterInstantOrSorcerySpell;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.stack.Spell;
|
import mage.game.stack.Spell;
|
||||||
import mage.players.Library;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetSpell;
|
import mage.target.TargetSpell;
|
||||||
|
|
||||||
|
|
@ -91,31 +90,22 @@ class SpellshiftEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(((Spell) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.STACK)).getControllerId());
|
Player spellController = game.getPlayer(((Spell) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.STACK)).getControllerId());
|
||||||
if (player != null) {
|
if (spellController != null) {
|
||||||
Library library = player.getLibrary();
|
Cards cardsToReveal = new CardsImpl();
|
||||||
if (library.hasCards()) {
|
Card toCast = null;
|
||||||
Cards cards = new CardsImpl();
|
for (Card card : spellController.getLibrary().getCards(game)) {
|
||||||
Card card = library.removeFromTop(game);
|
cardsToReveal.add(card);
|
||||||
cards.add(card);
|
|
||||||
while (!(card.isSorcery() || card.isInstant()) && library.hasCards()) {
|
|
||||||
card = library.removeFromTop(game);
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (card.isSorcery() || card.isInstant()) {
|
if (card.isSorcery() || card.isInstant()) {
|
||||||
if (player.chooseUse(outcome, "Cast " + card.getLogName() + " ?", source, game)) {
|
toCast = card;
|
||||||
if (player.cast(card.getSpellAbility(), game, true)) {
|
break;
|
||||||
cards.remove(card.getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!cards.isEmpty()) {
|
|
||||||
library.addAll(cards.getCards(game), game);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.shuffleLibrary(source, game);
|
spellController.revealCards(source, cardsToReveal, game);
|
||||||
|
if (toCast != null && spellController.chooseUse(outcome, "Cast " + toCast.getLogName() + " without paying its mana cost?", source, game)) {
|
||||||
|
spellController.cast(toCast.getSpellAbility(), game, true);
|
||||||
|
}
|
||||||
|
spellController.shuffleLibrary(source, game);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,8 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
import mage.cards.Cards;
|
||||||
import mage.cards.CardsImpl;
|
import mage.cards.CardsImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
@ -58,7 +58,7 @@ import mage.target.TargetCard;
|
||||||
public class SphinxOfUthuun extends CardImpl {
|
public class SphinxOfUthuun extends CardImpl {
|
||||||
|
|
||||||
public SphinxOfUthuun(UUID ownerId, CardSetInfo setInfo) {
|
public SphinxOfUthuun(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}");
|
||||||
this.subtype.add(SubType.SPHINX);
|
this.subtype.add(SubType.SPHINX);
|
||||||
|
|
||||||
this.power = new MageInt(5);
|
this.power = new MageInt(5);
|
||||||
|
|
@ -96,21 +96,13 @@ class SphinxOfUthuunEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
if (player == null || sourceObject == null) {
|
if (controller == null || sourceObject == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 5));
|
||||||
Cards cards = new CardsImpl();
|
controller.revealCards(source, cards, game);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
player.revealCards(sourceObject.getName(), cards, game);
|
|
||||||
|
|
||||||
Set<UUID> opponents = game.getOpponents(source.getControllerId());
|
Set<UUID> opponents = game.getOpponents(source.getControllerId());
|
||||||
if (!opponents.isEmpty()) {
|
if (!opponents.isEmpty()) {
|
||||||
|
|
@ -121,25 +113,15 @@ class SphinxOfUthuunEffect extends OneShotEffect {
|
||||||
List<Card> pile1 = new ArrayList<>();
|
List<Card> pile1 = new ArrayList<>();
|
||||||
Cards pile1CardsIds = new CardsImpl();
|
Cards pile1CardsIds = new CardsImpl();
|
||||||
if (opponent.choose(Outcome.Neutral, cards, target, game)) {
|
if (opponent.choose(Outcome.Neutral, cards, target, game)) {
|
||||||
List<UUID> targets = target.getTargets();
|
pile1CardsIds.addAll(target.getTargets());
|
||||||
for (UUID targetId : targets) {
|
pile1.addAll(pile1CardsIds.getCards(game));
|
||||||
Card card = game.getCard(targetId);
|
|
||||||
if (card != null) {
|
|
||||||
pile1.add(card);
|
|
||||||
pile1CardsIds.add(card.getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
List<Card> pile2 = new ArrayList<>();
|
List<Card> pile2 = new ArrayList<>();
|
||||||
Cards pile2CardsIds = new CardsImpl();
|
Cards pile2CardsIds = new CardsImpl(cards);
|
||||||
for (UUID cardId :cards) {
|
pile2CardsIds.removeAll(pile1CardsIds);
|
||||||
Card card = game.getCard(cardId);
|
pile2.addAll(pile2CardsIds.getCards(game));
|
||||||
if (card != null && !pile1.contains(card)) {
|
|
||||||
pile2.add(card);
|
boolean choice = controller.choosePile(Outcome.DestroyPermanent, "Choose a pile to put into hand.", pile1, pile2, game);
|
||||||
pile2CardsIds.add(card.getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
boolean choice = player.choosePile(Outcome.DestroyPermanent, "Choose a pile to put into hand.", pile1, pile2, game);
|
|
||||||
|
|
||||||
Zone pile1Zone = Zone.GRAVEYARD;
|
Zone pile1Zone = Zone.GRAVEYARD;
|
||||||
Zone pile2Zone = Zone.HAND;
|
Zone pile2Zone = Zone.HAND;
|
||||||
|
|
@ -148,7 +130,7 @@ class SphinxOfUthuunEffect extends OneShotEffect {
|
||||||
pile2Zone = Zone.GRAVEYARD;
|
pile2Zone = Zone.GRAVEYARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder(sourceObject.getLogName()).append(": Pile 1, going to ").append(pile1Zone == Zone.HAND ?"Hand":"Graveyard").append (": ");
|
StringBuilder sb = new StringBuilder(sourceObject.getLogName()).append(": Pile 1, going to ").append(pile1Zone == Zone.HAND ? "Hand" : "Graveyard").append(": ");
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (UUID cardUuid : pile1CardsIds) {
|
for (UUID cardUuid : pile1CardsIds) {
|
||||||
i++;
|
i++;
|
||||||
|
|
@ -158,12 +140,12 @@ class SphinxOfUthuunEffect extends OneShotEffect {
|
||||||
if (i < pile1CardsIds.size()) {
|
if (i < pile1CardsIds.size()) {
|
||||||
sb.append(", ");
|
sb.append(", ");
|
||||||
}
|
}
|
||||||
card.moveToZone(pile1Zone, source.getSourceId(), game, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
controller.moveCards(pile1CardsIds, pile1Zone, source, game);
|
||||||
game.informPlayers(sb.toString());
|
game.informPlayers(sb.toString());
|
||||||
|
|
||||||
sb = new StringBuilder(sourceObject.getLogName()).append(": Pile 2, going to ").append(pile2Zone == Zone.HAND ?"Hand":"Graveyard").append (':');
|
sb = new StringBuilder(sourceObject.getLogName()).append(": Pile 2, going to ").append(pile2Zone == Zone.HAND ? "Hand" : "Graveyard").append(':');
|
||||||
i = 0;
|
i = 0;
|
||||||
for (UUID cardUuid : pile2CardsIds) {
|
for (UUID cardUuid : pile2CardsIds) {
|
||||||
Card card = game.getCard(cardUuid);
|
Card card = game.getCard(cardUuid);
|
||||||
|
|
@ -173,9 +155,9 @@ class SphinxOfUthuunEffect extends OneShotEffect {
|
||||||
if (i < pile2CardsIds.size()) {
|
if (i < pile2CardsIds.size()) {
|
||||||
sb.append(", ");
|
sb.append(", ");
|
||||||
}
|
}
|
||||||
card.moveToZone(pile2Zone, source.getSourceId(), game, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
controller.moveCards(pile2CardsIds, pile2Zone, source, game);
|
||||||
game.informPlayers(sb.toString());
|
game.informPlayers(sb.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ import mage.target.common.TargetOpponent;
|
||||||
public class SphinxsTutelage extends CardImpl {
|
public class SphinxsTutelage extends CardImpl {
|
||||||
|
|
||||||
public SphinxsTutelage(UUID ownerId, CardSetInfo setInfo) {
|
public SphinxsTutelage(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
|
||||||
|
|
||||||
// Whenever you draw a card, target opponent puts the top two cards of their library into their graveyard. If they're both nonland cards that share a color, repeat this process.
|
// Whenever you draw a card, target opponent puts the top two cards of their library into their graveyard. If they're both nonland cards that share a color, repeat this process.
|
||||||
Ability ability = new DrawCardControllerTriggeredAbility(new SphinxsTutelageEffect(), false);
|
Ability ability = new DrawCardControllerTriggeredAbility(new SphinxsTutelageEffect(), false);
|
||||||
|
|
@ -108,19 +108,20 @@ class SphinxsTutelageEffect extends OneShotEffect {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
colorShared = false;
|
colorShared = false;
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl(targetPlayer.getLibrary().getTopCards(game, 2));
|
||||||
cards.addAll(targetPlayer.getLibrary().getTopCards(game, 2));
|
Card card1 = null;
|
||||||
if (!cards.isEmpty()) {
|
for (Card card : cards.getCards(game)) {
|
||||||
Card card1 = targetPlayer.getLibrary().removeFromTop(game);
|
if (card.isLand()) {
|
||||||
if (!card1.isLand() && targetPlayer.getLibrary().hasCards()) {
|
break;
|
||||||
Card card2 = targetPlayer.getLibrary().removeFromTop(game);
|
}
|
||||||
if (!card2.isLand()) {
|
if (card1 == null) {
|
||||||
colorShared = card1.getColor(game).shares(card2.getColor(game));
|
card1 = card;
|
||||||
}
|
} else {
|
||||||
|
colorShared = card1.getColor(game).shares(card.getColor(game));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
targetPlayer.moveCards(cards, Zone.GRAVEYARD, source, game);
|
targetPlayer.moveCards(cards, Zone.GRAVEYARD, source, game);
|
||||||
} while (colorShared && targetPlayer.canRespond());
|
} while (colorShared && targetPlayer.isInGame());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.AsThoughEffectImpl;
|
import mage.abilities.effects.AsThoughEffectImpl;
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
import mage.abilities.effects.ContinuousEffect;
|
||||||
|
|
@ -42,10 +41,10 @@ import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Library;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetOpponent;
|
import mage.target.common.TargetOpponent;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -54,7 +53,7 @@ import mage.target.targetpointer.FixedTarget;
|
||||||
public class StolenGoods extends CardImpl {
|
public class StolenGoods extends CardImpl {
|
||||||
|
|
||||||
public StolenGoods(UUID ownerId, CardSetInfo setInfo) {
|
public StolenGoods(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}");
|
||||||
|
|
||||||
// Target opponent exiles cards from the top of their library until he or she exiles a nonland card. Until end of turn, you may cast that card without paying its mana cost.
|
// Target opponent exiles cards from the top of their library until he or she exiles a nonland card. Until end of turn, you may cast that card without paying its mana cost.
|
||||||
this.getSpellAbility().addEffect(new StolenGoodsEffect());
|
this.getSpellAbility().addEffect(new StolenGoodsEffect());
|
||||||
|
|
@ -90,16 +89,14 @@ class StolenGoodsEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
|
Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
if (opponent != null) {
|
||||||
if (opponent != null && opponent.getLibrary().hasCards() && sourceObject != null) {
|
|
||||||
Library library = opponent.getLibrary();
|
|
||||||
Card card;
|
Card card;
|
||||||
do {
|
do {
|
||||||
card = library.removeFromTop(game);
|
card = opponent.getLibrary().getFromTop(game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
opponent.moveCardsToExile(card, source, game, true, source.getSourceId(), sourceObject.getIdName());
|
opponent.moveCardsToExile(card, source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, null));
|
||||||
}
|
}
|
||||||
} while (library.hasCards() && card != null && card.isLand());
|
} while (card != null && card.isLand());
|
||||||
|
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
ContinuousEffect effect = new StolenGoodsCastFromExileEffect();
|
ContinuousEffect effect = new StolenGoodsCastFromExileEffect();
|
||||||
|
|
|
||||||
|
|
@ -28,20 +28,13 @@
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
|
||||||
import mage.cards.CardsImpl;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.players.Player;
|
|
||||||
import mage.target.TargetCard;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -50,11 +43,11 @@ import mage.target.TargetCard;
|
||||||
public class StrategicPlanning extends CardImpl {
|
public class StrategicPlanning extends CardImpl {
|
||||||
|
|
||||||
public StrategicPlanning(UUID ownerId, CardSetInfo setInfo) {
|
public StrategicPlanning(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{U}");
|
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.
|
// 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 StrategicPlanningEffect());
|
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(3), false, new StaticValue(1),
|
||||||
|
StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public StrategicPlanning(final StrategicPlanning card) {
|
public StrategicPlanning(final StrategicPlanning card) {
|
||||||
|
|
@ -66,44 +59,3 @@ public class StrategicPlanning extends CardImpl {
|
||||||
return new StrategicPlanning(this);
|
return new StrategicPlanning(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class StrategicPlanningEffect extends OneShotEffect {
|
|
||||||
|
|
||||||
public StrategicPlanningEffect() {
|
|
||||||
super(Outcome.DrawCard);
|
|
||||||
this.staticText = "Look at the top three cards of your library. Put one of them into your hand and the rest into your graveyard";
|
|
||||||
}
|
|
||||||
|
|
||||||
public StrategicPlanningEffect(final StrategicPlanningEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public StrategicPlanningEffect copy() {
|
|
||||||
return new StrategicPlanningEffect(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
|
||||||
|
|
||||||
if (controller != null) {
|
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
cards.addAll(controller.getLibrary().getTopCards(game, 3));
|
|
||||||
if (!cards.isEmpty()) {
|
|
||||||
controller.lookAtCards("Strategic Planning", cards, game);
|
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put in your hand"));
|
|
||||||
if (controller.choose(Outcome.Benefit, cards, target, game)) {
|
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
|
||||||
if (card != null) {
|
|
||||||
controller.moveCards(card, Zone.HAND, source, game);
|
|
||||||
cards.remove(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -29,23 +29,15 @@ package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||||
import mage.cards.Card;
|
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
|
||||||
import mage.cards.CardsImpl;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.players.Player;
|
|
||||||
import mage.target.TargetCard;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -54,7 +46,7 @@ import mage.target.TargetCard;
|
||||||
public class SultaiSoothsayer extends CardImpl {
|
public class SultaiSoothsayer extends CardImpl {
|
||||||
|
|
||||||
public SultaiSoothsayer(UUID ownerId, CardSetInfo setInfo) {
|
public SultaiSoothsayer(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{G}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{G}{U}");
|
||||||
this.subtype.add(SubType.NAGA);
|
this.subtype.add(SubType.NAGA);
|
||||||
this.subtype.add(SubType.SHAMAN);
|
this.subtype.add(SubType.SHAMAN);
|
||||||
|
|
||||||
|
|
@ -62,7 +54,8 @@ public class SultaiSoothsayer extends CardImpl {
|
||||||
this.toughness = new MageInt(5);
|
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.
|
// 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 SultaiSoothsayerEffect(), false));
|
this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(new StaticValue(4), false, new StaticValue(1),
|
||||||
|
StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false), false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public SultaiSoothsayer(final SultaiSoothsayer card) {
|
public SultaiSoothsayer(final SultaiSoothsayer card) {
|
||||||
|
|
@ -74,44 +67,3 @@ public class SultaiSoothsayer extends CardImpl {
|
||||||
return new SultaiSoothsayer(this);
|
return new SultaiSoothsayer(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class SultaiSoothsayerEffect extends OneShotEffect {
|
|
||||||
|
|
||||||
public SultaiSoothsayerEffect() {
|
|
||||||
super(Outcome.DrawCard);
|
|
||||||
this.staticText = "look at the top four cards of your library. Put one of them into your hand and the rest into your graveyard";
|
|
||||||
}
|
|
||||||
|
|
||||||
public SultaiSoothsayerEffect(final SultaiSoothsayerEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SultaiSoothsayerEffect copy() {
|
|
||||||
return new SultaiSoothsayerEffect(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
|
||||||
if (controller != null && sourceObject != null) {
|
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
cards.addAll(controller.getLibrary().getTopCards(game, 4));
|
|
||||||
if (!cards.isEmpty()) {
|
|
||||||
controller.lookAtCards(sourceObject.getName(), cards, game);
|
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put in your hand"));
|
|
||||||
if (controller.choose(Outcome.Benefit, cards, target, game)) {
|
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
|
||||||
if (card != null) {
|
|
||||||
controller.moveCards(card, Zone.HAND, source, game);
|
|
||||||
cards.remove(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.StaticFilters;
|
||||||
import mage.target.TargetSpell;
|
import mage.target.TargetSpell;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -55,7 +55,7 @@ public class SupremeWill extends CardImpl {
|
||||||
|
|
||||||
// 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.
|
// 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();
|
Mode mode = new Mode();
|
||||||
mode.getEffects().add(new LookLibraryAndPickControllerEffect(new StaticValue(4), false, new StaticValue(1), new FilterCard(), Zone.LIBRARY, false, false));
|
mode.getEffects().add(new LookLibraryAndPickControllerEffect(new StaticValue(4), false, new StaticValue(1), StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false));
|
||||||
this.getSpellAbility().addMode(mode);
|
this.getSpellAbility().addMode(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ import java.util.HashSet;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
|
@ -126,23 +125,20 @@ class SyntheticDestinyDelayedEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
if (controller != null) {
|
||||||
if (controller != null && sourceObject != null) {
|
|
||||||
Cards revealed = new CardsImpl();
|
Cards revealed = new CardsImpl();
|
||||||
Set<Card> creatureCards = new LinkedHashSet<>();
|
Set<Card> creatureCards = new LinkedHashSet<>();
|
||||||
Cards nonCreatureCards = new CardsImpl();
|
for (Card card : controller.getLibrary().getCards(game)) {
|
||||||
while (creatureCards.size() < numberOfCards && controller.getLibrary().hasCards()) {
|
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
|
||||||
revealed.add(card);
|
revealed.add(card);
|
||||||
if (card.isCreature()) {
|
if (card.isCreature()) {
|
||||||
creatureCards.add(card);
|
creatureCards.add(card);
|
||||||
} else {
|
}
|
||||||
nonCreatureCards.add(card);
|
if (creatureCards.size() >= numberOfCards) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
controller.revealCards(sourceObject.getIdName(), revealed, game);
|
controller.revealCards(source, revealed, game);
|
||||||
controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game, false, false, true, null);
|
controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game);
|
||||||
controller.putCardsOnTopOfLibrary(nonCreatureCards, game, source, false);
|
|
||||||
controller.shuffleLibrary(source, game);
|
controller.shuffleLibrary(source, game);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,27 +37,26 @@ import mage.abilities.costs.Cost;
|
||||||
import mage.abilities.costs.common.ExileFromGraveCost;
|
import mage.abilities.costs.common.ExileFromGraveCost;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
|
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
import mage.abilities.effects.ContinuousEffect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||||
import mage.abilities.effects.common.SkipDrawStepEffect;
|
import mage.abilities.effects.common.SkipDrawStepEffect;
|
||||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
|
||||||
import mage.cards.CardsImpl;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.SuperType;
|
import mage.constants.SuperType;
|
||||||
import mage.constants.TargetController;
|
import mage.constants.TargetController;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
@ -81,7 +80,8 @@ public class TaigamSidisisHand extends CardImpl {
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipDrawStepEffect()));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, 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.
|
// 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 TaigamSidisisHandDrawEffect(), TargetController.YOU, false));
|
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new LookLibraryAndPickControllerEffect(new StaticValue(4), false, new StaticValue(1),
|
||||||
|
StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false), TargetController.YOU, false));
|
||||||
|
|
||||||
// {B}, {T}, Exile X cards from your graveyard: Target creature gets -X/-X until end of turn.
|
// {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(Zone.BATTLEFIELD, new TaigamSidisisHandEffect(), new ManaCostsImpl("{B}"));
|
||||||
|
|
@ -138,44 +138,3 @@ class TaigamSidisisHandEffect extends OneShotEffect {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TaigamSidisisHandDrawEffect extends OneShotEffect {
|
|
||||||
|
|
||||||
public TaigamSidisisHandDrawEffect() {
|
|
||||||
super(Outcome.DrawCard);
|
|
||||||
this.staticText = "Look at the top three cards of your library. Put one of them into your hand and the rest into your graveyard";
|
|
||||||
}
|
|
||||||
|
|
||||||
public TaigamSidisisHandDrawEffect(final TaigamSidisisHandDrawEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TaigamSidisisHandDrawEffect copy() {
|
|
||||||
return new TaigamSidisisHandDrawEffect(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
|
||||||
|
|
||||||
if (controller != null) {
|
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
cards.addAll(controller.getLibrary().getTopCards(game, 3));
|
|
||||||
if (!cards.isEmpty()) {
|
|
||||||
controller.lookAtCards("Taigam, Sidisi's Hand", cards, game);
|
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put in your hand"));
|
|
||||||
if (controller.choose(Outcome.Benefit, cards, target, game)) {
|
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
|
||||||
if (card != null) {
|
|
||||||
controller.moveCards(card, Zone.HAND, source, game);
|
|
||||||
cards.remove(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
package mage.cards.t;
|
package mage.cards.t;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
|
|
@ -86,31 +85,25 @@ class TeleminPerformanceEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
if (controller != null) {
|
||||||
if (controller != null && sourceObject != null) {
|
|
||||||
Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source));
|
Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||||
if (opponent != null) {
|
if (opponent != null) {
|
||||||
Card creature = null;
|
Card creature = null;
|
||||||
CardsImpl cards = new CardsImpl();
|
CardsImpl nonCreatures = new CardsImpl();
|
||||||
boolean creatureFound = false;
|
CardsImpl reveal = new CardsImpl();
|
||||||
while (opponent.getLibrary().hasCards() && !creatureFound) {
|
for (Card card : opponent.getLibrary().getCards(game)) {
|
||||||
Card card = opponent.getLibrary().removeFromTop(game);
|
reveal.add(card);
|
||||||
if (card != null) {
|
if (card.isCreature()) {
|
||||||
if (card.isCreature()) {
|
creature = card;
|
||||||
creature = card;
|
break;
|
||||||
creatureFound = true;
|
} else {
|
||||||
}
|
nonCreatures.add(card);
|
||||||
if (!creatureFound) {
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!cards.isEmpty()) {
|
opponent.revealCards(source, reveal, game);
|
||||||
opponent.revealCards(sourceObject.getIdName(), cards, game);
|
opponent.moveCards(nonCreatures, Zone.GRAVEYARD, source, game);
|
||||||
opponent.moveCards(cards, Zone.GRAVEYARD, source, game);
|
|
||||||
}
|
|
||||||
game.applyEffects();
|
|
||||||
if (creature != null) {
|
if (creature != null) {
|
||||||
|
game.applyEffects();
|
||||||
controller.moveCards(creature, Zone.BATTLEFIELD, source, game);
|
controller.moveCards(creature, Zone.BATTLEFIELD, source, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.StaticFilters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -45,14 +45,14 @@ import mage.filter.FilterCard;
|
||||||
public class ThievesFortune extends CardImpl {
|
public class ThievesFortune extends CardImpl {
|
||||||
|
|
||||||
public ThievesFortune(UUID ownerId, CardSetInfo setInfo) {
|
public ThievesFortune(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.TRIBAL,CardType.INSTANT},"{2}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.TRIBAL, CardType.INSTANT}, "{2}{U}");
|
||||||
this.subtype.add(SubType.ROGUE);
|
this.subtype.add(SubType.ROGUE);
|
||||||
|
|
||||||
|
|
||||||
// Prowl {U}
|
// Prowl {U}
|
||||||
this.addAbility(new ProwlAbility(this, "{U}"));
|
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.
|
// 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(new StaticValue(4), false, new StaticValue(1), new FilterCard(), Zone.LIBRARY, false, false));
|
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(4), false, new StaticValue(1), StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ThievesFortune(final ThievesFortune card) {
|
public ThievesFortune(final ThievesFortune card) {
|
||||||
|
|
|
||||||
|
|
@ -27,19 +27,13 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.t;
|
package mage.cards.t;
|
||||||
|
|
||||||
import java.util.Deque;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
|
||||||
import mage.cards.CardsImpl;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.FilterPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||||
|
|
@ -102,33 +96,14 @@ class TimeOutEffect extends OneShotEffect {
|
||||||
Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
Player owner = game.getPlayer(permanent.getOwnerId());
|
Player owner = game.getPlayer(permanent.getOwnerId());
|
||||||
if (owner != null) {
|
if (owner == null) {
|
||||||
int amount = controller.rollDice(game, 6);
|
return false;
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
Deque<UUID> cardIds = new LinkedList<>();
|
|
||||||
for (int i = 0; i < amount; i++) {
|
|
||||||
Card card = owner.getLibrary().removeFromTop(game);
|
|
||||||
cards.add(card);
|
|
||||||
cardIds.push(card.getId());
|
|
||||||
}
|
|
||||||
// return cards back to library
|
|
||||||
game.informPlayers(new StringBuilder(controller.getLogName())
|
|
||||||
.append(" puts ").append(permanent.getName())
|
|
||||||
.append(" beneath the top ").append(amount)
|
|
||||||
.append(" cards of ").append(owner.getLogName()).append("'s library").toString());
|
|
||||||
permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
|
||||||
while (!cardIds.isEmpty()) {
|
|
||||||
UUID cardId = cardIds.poll();
|
|
||||||
Card card = cards.get(cardId, game);
|
|
||||||
if (card != null) {
|
|
||||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
int amount = controller.rollDice(game, 6);
|
||||||
|
controller.putCardOnTopXOfLibrary(permanent, game, source, amount);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.TimingRule;
|
import mage.constants.TimingRule;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterCreatureCard;
|
import mage.filter.common.FilterCreatureCard;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
@ -53,8 +54,7 @@ import mage.target.TargetCard;
|
||||||
public class TrackersInstincts extends CardImpl {
|
public class TrackersInstincts extends CardImpl {
|
||||||
|
|
||||||
public TrackersInstincts(UUID ownerId, CardSetInfo setInfo) {
|
public TrackersInstincts(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{G}");
|
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.
|
// 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 TrackersInstinctsEffect());
|
||||||
|
|
@ -92,30 +92,17 @@ class TrackersInstinctsEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 4));
|
||||||
|
boolean creaturesFound = cards.count(StaticFilters.FILTER_CARD_CREATURE, game) > 0;
|
||||||
boolean creaturesFound = false;
|
|
||||||
int count = Math.min(controller.getLibrary().size(), 4);
|
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
if (card.isCreature()) {
|
|
||||||
creaturesFound = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
controller.revealCards("Tracker's Instincts", cards, game);
|
controller.revealCards(source, cards, game);
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCreatureCard("creature card to put in hand"));
|
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCreatureCard("creature card to put in hand"));
|
||||||
if (creaturesFound && controller.choose(Outcome.DrawCard, cards, target, game)) {
|
if (creaturesFound && controller.choose(Outcome.DrawCard, cards, target, game)) {
|
||||||
Card card = game.getCard(target.getFirstTarget());
|
Card card = game.getCard(target.getFirstTarget());
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
|
controller.moveCards(card, Zone.HAND, source, game);
|
||||||
cards.remove(card);
|
cards.remove(card);
|
||||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Library;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -48,8 +47,7 @@ import mage.players.Player;
|
||||||
public class TreasureHunt extends CardImpl {
|
public class TreasureHunt extends CardImpl {
|
||||||
|
|
||||||
public TreasureHunt(UUID ownerId, CardSetInfo setInfo) {
|
public TreasureHunt(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}");
|
||||||
|
|
||||||
|
|
||||||
// Reveal cards from the top of your library until you reveal a nonland card, then put all cards revealed this way into your hand.
|
// Reveal cards from the top of your library until you reveal a nonland card, then put all cards revealed this way into your hand.
|
||||||
this.getSpellAbility().addEffect(new TreasureHuntEffect());
|
this.getSpellAbility().addEffect(new TreasureHuntEffect());
|
||||||
|
|
@ -83,22 +81,17 @@ class TreasureHuntEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (player != null && player.getLibrary().hasCards()) {
|
if (controller != null && controller.getLibrary().hasCards()) {
|
||||||
CardsImpl cards = new CardsImpl();
|
CardsImpl cards = new CardsImpl();
|
||||||
Library library = player.getLibrary();
|
for (Card card : controller.getLibrary().getCards(game)) {
|
||||||
Card card = null;
|
cards.add(card);
|
||||||
do {
|
if (!card.isLand()) {
|
||||||
card = library.removeFromTop(game);
|
break;
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
|
||||||
}
|
}
|
||||||
} while (library.hasCards() && card != null && card.isLand());
|
|
||||||
|
|
||||||
if (!cards.isEmpty()) {
|
|
||||||
player.revealCards("Treasure Hunt", cards, game);
|
|
||||||
}
|
}
|
||||||
|
controller.revealCards(source, cards, game);
|
||||||
|
controller.moveCards(cards, Zone.HAND, source, game);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ package mage.cards.t;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.DiesTriggeredAbility;
|
import mage.abilities.common.DiesTriggeredAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
|
@ -38,8 +37,8 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.CardsImpl;
|
import mage.cards.CardsImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
|
|
@ -85,22 +84,18 @@ class TreasureKeeperEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
CardsImpl toReveal = new CardsImpl();
|
|
||||||
Card nonLandCard = null;
|
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
if (controller != null) {
|
||||||
if (controller != null && sourceObject != null) {
|
CardsImpl toReveal = new CardsImpl();
|
||||||
while (nonLandCard == null && controller.getLibrary().hasCards()) {
|
Card nonLandCard = null;
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
for (Card card : controller.getLibrary().getCards(game)) {
|
||||||
toReveal.add(card);
|
toReveal.add(card);
|
||||||
if (!card.isLand() && card.getConvertedManaCost() < 4) {
|
if (!card.isLand() && card.getConvertedManaCost() < 4) {
|
||||||
nonLandCard = card;
|
nonLandCard = card;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// reveal cards
|
controller.revealCards(source, toReveal, game);
|
||||||
if (!toReveal.isEmpty()) {
|
|
||||||
controller.revealCards(sourceObject.getIdName(), toReveal, game);
|
|
||||||
}
|
|
||||||
if (nonLandCard != null && controller.chooseUse(outcome, "Cast " + nonLandCard.getLogName() + "without paying its mana cost?", source, game)) {
|
if (nonLandCard != null && controller.chooseUse(outcome, "Cast " + nonLandCard.getLogName() + "without paying its mana cost?", source, game)) {
|
||||||
controller.cast(nonLandCard.getSpellAbility(), game, true);
|
controller.cast(nonLandCard.getSpellAbility(), game, true);
|
||||||
toReveal.remove(nonLandCard);
|
toReveal.remove(nonLandCard);
|
||||||
|
|
|
||||||
|
|
@ -29,26 +29,25 @@ package mage.cards.t;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.Mode;
|
|
||||||
import mage.abilities.common.AttacksAttachedTriggeredAbility;
|
import mage.abilities.common.AttacksAttachedTriggeredAbility;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
import mage.abilities.effects.ContinuousEffect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||||
import mage.abilities.keyword.EquipAbility;
|
import mage.abilities.keyword.EquipAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.CardsImpl;
|
import mage.cards.CardsImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Layer;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubLayer;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -57,14 +56,13 @@ import mage.players.Player;
|
||||||
public class TrepanationBlade extends CardImpl {
|
public class TrepanationBlade extends CardImpl {
|
||||||
|
|
||||||
public TrepanationBlade(UUID ownerId, CardSetInfo setInfo) {
|
public TrepanationBlade(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||||
this.subtype.add(SubType.EQUIPMENT);
|
this.subtype.add(SubType.EQUIPMENT);
|
||||||
|
|
||||||
// Whenever equipped creature attacks, defending player reveals cards from the top of their library until he or she reveals a land card.
|
// Whenever equipped creature attacks, defending player reveals cards from the top of their library until he or she reveals a land card.
|
||||||
// The creature gets +1/+0 until end of turn for each card revealed this way. That player puts the revealed cards into their graveyard.
|
// The creature gets +1/+0 until end of turn for each card revealed this way. That player puts the revealed cards into their graveyard.
|
||||||
Ability ability = new AttacksAttachedTriggeredAbility(new TrepanationBladeDiscardEffect());
|
this.addAbility(new AttacksAttachedTriggeredAbility(new TrepanationBladeDiscardEffect()));
|
||||||
ability.addEffect(new TrepanationBladeBoostEffect());
|
|
||||||
this.addAbility(ability);
|
|
||||||
// Equip {2}
|
// Equip {2}
|
||||||
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(2)));
|
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(2)));
|
||||||
}
|
}
|
||||||
|
|
@ -104,69 +102,26 @@ class TrepanationBladeDiscardEffect extends OneShotEffect {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
UUID defenderId = game.getCombat().getDefenderId(creature.getId());
|
UUID defenderId = game.getCombat().getDefenderId(creature.getId());
|
||||||
Player player = game.getPlayer(defenderId);
|
Player defendingPlayer = game.getPlayer(defenderId);
|
||||||
if (player == null) {
|
if (defendingPlayer == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CardsImpl cards = new CardsImpl();
|
CardsImpl cards = new CardsImpl();
|
||||||
boolean landFound = false;
|
for (Card card : defendingPlayer.getLibrary().getCards(game)) {
|
||||||
while (player.getLibrary().hasCards() && !landFound) {
|
cards.add(card);
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
if (card.isLand()) {
|
||||||
if (card != null) {
|
break;
|
||||||
cards.add(card);
|
|
||||||
if (card.isLand()) {
|
|
||||||
landFound = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.moveCards(cards, Zone.GRAVEYARD, source, game);
|
defendingPlayer.revealCards(equipment.getName(), cards, game);
|
||||||
|
defendingPlayer.moveCards(cards, Zone.GRAVEYARD, source, game);
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
player.revealCards(equipment.getName(), cards, game);
|
ContinuousEffect effect = new BoostTargetEffect(cards.size(), 0, Duration.EndOfTurn);
|
||||||
game.getState().setValue(source.getSourceId().toString() + "_TrepanationBlade", cards.size());
|
effect.setTargetPointer(new FixedTarget(creature, game));
|
||||||
return true;
|
game.addEffect(effect, source);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
game.getState().setValue(source.getSourceId().toString() + "_TrepanationBlade", null);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getText(Mode mode) {
|
|
||||||
return super.getText(mode); //To change body of overridden methods use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class TrepanationBladeBoostEffect extends ContinuousEffectImpl {
|
|
||||||
|
|
||||||
public TrepanationBladeBoostEffect() {
|
|
||||||
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
|
|
||||||
staticText = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TrepanationBladeBoostEffect(final TrepanationBladeBoostEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TrepanationBladeBoostEffect copy() {
|
|
||||||
return new TrepanationBladeBoostEffect(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Integer amount = (Integer) game.getState().getValue(source.getSourceId().toString() + "_TrepanationBlade");
|
|
||||||
|
|
||||||
Permanent equipment = game.getPermanent(source.getSourceId());
|
|
||||||
if (amount != null && amount > 0 && equipment != null && equipment.getAttachedTo() != null) {
|
|
||||||
Permanent creature = game.getPermanent(equipment.getAttachedTo());
|
|
||||||
if (creature != null) {
|
|
||||||
creature.addPower(amount);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,7 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.t;
|
package mage.cards.t;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.NameACardEffect;
|
import mage.abilities.effects.common.NameACardEffect;
|
||||||
|
|
@ -91,41 +88,29 @@ class TunnelVisionEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
|
||||||
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
|
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
|
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
|
||||||
if (sourceObject == null || targetPlayer == null || cardName == null || cardName.isEmpty()) {
|
if (targetPlayer == null || cardName == null || cardName.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cards cardsToReveal = new CardsImpl();
|
Cards cardsToReveal = new CardsImpl();
|
||||||
Set<Card> cardsToBury = new HashSet<>();
|
|
||||||
Card namedCard = null;
|
Card namedCard = null;
|
||||||
|
|
||||||
// reveal until named card found
|
for (Card card : targetPlayer.getLibrary().getCards(game)) {
|
||||||
// if named card found, put all revealed cards in grave and put named card on top of library
|
cardsToReveal.add(card);
|
||||||
// if named card not found, shuffle library
|
if (card.getName().equals(cardName)) {
|
||||||
boolean namedCardFound = false;
|
namedCard = card;
|
||||||
while (targetPlayer.getLibrary().hasCards()) {
|
break;
|
||||||
Card card = targetPlayer.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cardsToReveal.add(card);
|
|
||||||
if (card.getName().equals(cardName)) {
|
|
||||||
namedCardFound = true;
|
|
||||||
namedCard = card;
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
cardsToBury.add(card);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
targetPlayer.revealCards(sourceObject.getIdName(), cardsToReveal, game);
|
targetPlayer.revealCards(source, cardsToReveal, game);
|
||||||
if (namedCardFound) {
|
if (namedCard != null) {
|
||||||
targetPlayer.moveCards(cardsToBury, Zone.GRAVEYARD, source, game);
|
cardsToReveal.remove(namedCard);
|
||||||
targetPlayer.moveCards(namedCard, Zone.LIBRARY, source, game);
|
targetPlayer.moveCards(cardsToReveal, Zone.GRAVEYARD, source, game);
|
||||||
|
targetPlayer.putCardsOnTopOfLibrary(new CardsImpl(namedCard), game, source, true);
|
||||||
} else {
|
} else {
|
||||||
targetPlayer.getLibrary().addAll(cardsToBury, game);
|
|
||||||
targetPlayer.shuffleLibrary(source, game);
|
targetPlayer.shuffleLibrary(source, game);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.ExileTargetEffect;
|
import mage.abilities.effects.common.ExileTargetEffect;
|
||||||
import mage.abilities.keyword.IndestructibleAbility;
|
import mage.abilities.keyword.IndestructibleAbility;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
|
@ -60,7 +59,7 @@ import mage.target.targetpointer.FixedTarget;
|
||||||
public class UlamogTheCeaselessHunger extends CardImpl {
|
public class UlamogTheCeaselessHunger extends CardImpl {
|
||||||
|
|
||||||
public UlamogTheCeaselessHunger(UUID ownerId, CardSetInfo setInfo) {
|
public UlamogTheCeaselessHunger(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{10}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{10}");
|
||||||
addSuperType(SuperType.LEGENDARY);
|
addSuperType(SuperType.LEGENDARY);
|
||||||
this.subtype.add(SubType.ELDRAZI);
|
this.subtype.add(SubType.ELDRAZI);
|
||||||
this.power = new MageInt(10);
|
this.power = new MageInt(10);
|
||||||
|
|
@ -156,7 +155,7 @@ class UlamogAttackTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
return new StringBuilder("Whenever {this} attacks, ").append(super.getRule()).toString();
|
return "Whenever {this} attacks, " + super.getRule();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -180,13 +179,7 @@ class UlamogExileLibraryEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player defender = game.getPlayer(targetPointer.getFirst(game, source));
|
Player defender = game.getPlayer(targetPointer.getFirst(game, source));
|
||||||
if (defender != null) {
|
if (defender != null) {
|
||||||
int count = Math.min(defender.getLibrary().size(), 20);
|
defender.moveCards(defender.getLibrary().getTopCards(game, 20), Zone.EXILED, source, game);
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
Card card = defender.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
card.moveToExile(null, null, source.getSourceId(), game);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -104,18 +104,14 @@ class UndercityInformerEffect extends OneShotEffect {
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl();
|
||||||
while (player.getLibrary().hasCards()) {
|
for (Card card : player.getLibrary().getCards(game)) {
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
cards.add(card);
|
||||||
if (card != null) {
|
if (card.isLand()) {
|
||||||
cards.add(card);
|
break;
|
||||||
if (card.isLand()) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.revealCards("Undercity Informer", cards, game);
|
player.revealCards(source, cards, game);
|
||||||
player.moveCards(cards, Zone.GRAVEYARD, source, game);
|
player.moveCards(cards, Zone.GRAVEYARD, source, game);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ package mage.cards.u;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.DamageTargetEffect;
|
||||||
import mage.abilities.effects.common.EpicEffect;
|
import mage.abilities.effects.common.EpicEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
|
@ -38,7 +39,6 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetAnyTarget;
|
import mage.target.common.TargetAnyTarget;
|
||||||
|
|
||||||
|
|
@ -50,8 +50,7 @@ import mage.target.common.TargetAnyTarget;
|
||||||
public class UndyingFlames extends CardImpl {
|
public class UndyingFlames extends CardImpl {
|
||||||
|
|
||||||
public UndyingFlames(UUID ownerId, CardSetInfo setInfo) {
|
public UndyingFlames(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{R}{R}");
|
||||||
|
|
||||||
|
|
||||||
// Exile cards from the top of your library until you exile a nonland card. Undying Flames deals damage to any target equal to that card's converted mana cost.
|
// Exile cards from the top of your library until you exile a nonland card. Undying Flames deals damage to any target equal to that card's converted mana cost.
|
||||||
this.getSpellAbility().addEffect(new UndyingFlamesEffect());
|
this.getSpellAbility().addEffect(new UndyingFlamesEffect());
|
||||||
|
|
@ -85,36 +84,22 @@ class UndyingFlamesEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
boolean applied = false;
|
|
||||||
Player you = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Card sourceCard = game.getCard(source.getSourceId());
|
if (controller != null) {
|
||||||
while (you != null && sourceCard != null
|
while (controller.getLibrary().hasCards() && controller.isInGame()) {
|
||||||
&& you.getLibrary().hasCards() && you.canRespond()) {
|
Card card = controller.getLibrary().getFromTop(game);
|
||||||
Card card = you.getLibrary().removeFromTop(game);
|
if (card != null) {
|
||||||
if (card != null) {
|
controller.moveCards(card, Zone.LIBRARY, source, game);
|
||||||
you.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.LIBRARY, true);
|
if (!card.isLand()) {
|
||||||
if (!card.isLand()) {
|
new DamageTargetEffect(card.getConvertedManaCost()).apply(game, source);
|
||||||
int damage = card.getConvertedManaCost();
|
break;
|
||||||
if (damage > 0) {
|
|
||||||
Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
|
||||||
if (creature != null) {
|
|
||||||
creature.damage(damage, source.getSourceId(), game, false, true);
|
|
||||||
game.informPlayers(new StringBuilder(sourceCard.getName()).append(" deals ").append(damage).append(" damage to ").append(creature.getName()).toString());
|
|
||||||
applied = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
|
||||||
if (player != null) {
|
|
||||||
player.damage(card.getConvertedManaCost(), source.getSourceId(), game, false, true);
|
|
||||||
game.informPlayers(new StringBuilder(sourceCard.getName()).append(" deals ").append(damage).append(" damage to ").append(player.getLogName()).toString());
|
|
||||||
applied = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return applied;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -27,22 +27,14 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.u;
|
package mage.cards.u;
|
||||||
|
|
||||||
import java.util.Deque;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.Cards;
|
|
||||||
import mage.cards.CardsImpl;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.FilterPermanent;
|
|
||||||
import mage.filter.predicate.Predicates;
|
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
@ -54,18 +46,12 @@ import mage.target.TargetPermanent;
|
||||||
*/
|
*/
|
||||||
public class UnexpectedlyAbsent extends CardImpl {
|
public class UnexpectedlyAbsent extends CardImpl {
|
||||||
|
|
||||||
private static final FilterPermanent filter = new FilterPermanent("nonland permanent");
|
|
||||||
static {
|
|
||||||
filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnexpectedlyAbsent(UUID ownerId, CardSetInfo setInfo) {
|
public UnexpectedlyAbsent(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{W}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{W}{W}");
|
||||||
|
|
||||||
|
|
||||||
// Put target nonland permanent into its owner's library just beneath the top X cards of that library.
|
// Put target nonland permanent into its owner's library just beneath the top X cards of that library.
|
||||||
this.getSpellAbility().addEffect(new UnexpectedlyAbsentEffect());
|
this.getSpellAbility().addEffect(new UnexpectedlyAbsentEffect());
|
||||||
this.getSpellAbility().addTarget(new TargetPermanent(filter));
|
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_NON_LAND));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -101,31 +87,8 @@ class UnexpectedlyAbsentEffect extends OneShotEffect {
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
Player owner = game.getPlayer(permanent.getOwnerId());
|
controller.putCardOnTopXOfLibrary(permanent, game, source, source.getManaCostsToPay().getX());
|
||||||
if (owner != null) {
|
return true;
|
||||||
int xValue = Math.min(source.getManaCostsToPay().getX(), owner.getLibrary().size());
|
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
Deque<UUID> cardIds = new LinkedList<>();
|
|
||||||
for (int i = 0; i < xValue; i++) {
|
|
||||||
Card card = owner.getLibrary().removeFromTop(game);
|
|
||||||
cards.add(card);
|
|
||||||
cardIds.push(card.getId());
|
|
||||||
}
|
|
||||||
// return cards back to library
|
|
||||||
game.informPlayers(new StringBuilder(controller.getLogName())
|
|
||||||
.append(" puts ").append(permanent.getName())
|
|
||||||
.append(" beneath the top ").append(xValue)
|
|
||||||
.append(" cards of ").append(owner.getLogName()).append("'s library").toString());
|
|
||||||
permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
|
||||||
while(!cardIds.isEmpty()) {
|
|
||||||
UUID cardId = cardIds.poll();
|
|
||||||
Card card = cards.get(cardId, game);
|
|
||||||
if (card != null) {
|
|
||||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,29 +86,25 @@ class VexingArcanixEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
|
||||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||||
if (controller != null && sourceObject != null && player != null) {
|
if (sourceObject != null && player != null) {
|
||||||
|
Choice cardChoice = new ChoiceImpl();
|
||||||
if (player.getLibrary().hasCards()) {
|
cardChoice.setChoices(CardRepository.instance.getNames());
|
||||||
Choice cardChoice = new ChoiceImpl();
|
cardChoice.setMessage("Name a card");
|
||||||
cardChoice.setChoices(CardRepository.instance.getNames());
|
if (!player.choose(Outcome.DrawCard, cardChoice, game)) {
|
||||||
cardChoice.setMessage("Name a card");
|
return false;
|
||||||
if (!player.choose(Outcome.DrawCard, cardChoice, game)) {
|
}
|
||||||
return false;
|
String cardName = cardChoice.getChoice();
|
||||||
}
|
game.informPlayers(sourceObject.getLogName() + ", player: " + player.getLogName() + ", named: [" + cardName + ']');
|
||||||
String cardName = cardChoice.getChoice();
|
Card card = player.getLibrary().getFromTop(game);
|
||||||
game.informPlayers(sourceObject.getLogName() + ", player: " + player.getLogName() + ", named: [" + cardName + ']');
|
if (card != null) {
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
Cards cards = new CardsImpl(card);
|
||||||
if (card != null) {
|
player.revealCards(sourceObject.getIdName(), cards, game);
|
||||||
Cards cards = new CardsImpl(card);
|
if (card.getName().equals(cardName)) {
|
||||||
player.revealCards(sourceObject.getIdName(), cards, game);
|
player.moveCards(cards, Zone.HAND, source, game);
|
||||||
if (card.getName().equals(cardName)) {
|
} else {
|
||||||
player.moveCards(cards, Zone.HAND, source, game);
|
player.moveCards(cards, Zone.GRAVEYARD, source, game);
|
||||||
} else {
|
player.damage(2, source.getSourceId(), game, false, true);
|
||||||
player.moveCards(cards, Zone.GRAVEYARD, source, game);
|
|
||||||
player.damage(2, source.getSourceId(), game, false, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,7 @@ import mage.target.TargetCard;
|
||||||
public class WorldlyCounsel extends CardImpl {
|
public class WorldlyCounsel extends CardImpl {
|
||||||
|
|
||||||
public WorldlyCounsel(UUID ownerId, CardSetInfo setInfo) {
|
public WorldlyCounsel(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
|
||||||
|
|
||||||
|
|
||||||
// Domain - Look at the top X cards of your library, where X is the number of basic land types among lands you control. Put one of those cards into your hand and the rest on the bottom of your library in any order.
|
// Domain - Look at the top X cards of your library, where X is the number of basic land types among lands 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(new WorldlyCounselEffect());
|
this.getSpellAbility().addEffect(new WorldlyCounselEffect());
|
||||||
|
|
@ -86,40 +85,30 @@ class WorldlyCounselEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (player == null) {
|
if (controller == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, (new DomainValue()).calculate(game, source, this)));
|
||||||
int count = (new DomainValue()).calculate(game, source, this);
|
controller.lookAtCards(source, null, cards, game);
|
||||||
count = Math.min(player.getLibrary().size(), count);
|
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
player.lookAtCards("Worldly Counsel", cards, game);
|
|
||||||
|
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
if (cards.size() == 1) {
|
if (cards.size() == 1) {
|
||||||
Card card = cards.getRandom(game);
|
controller.moveCards(cards, Zone.HAND, source, game);
|
||||||
cards.remove(card);
|
|
||||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
|
||||||
return true;
|
|
||||||
} else {
|
} else {
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand"));
|
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand"));
|
||||||
if (player.choose(Outcome.DrawCard, cards, target, game)) {
|
if (controller.choose(Outcome.DrawCard, cards, target, game)) {
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
Card card = cards.get(target.getFirstTarget(), game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
cards.remove(card);
|
cards.remove(card);
|
||||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
controller.moveCards(card, Zone.HAND, source, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.putCardsOnBottomOfLibrary(cards, game, source, true);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ import mage.target.TargetCard;
|
||||||
public class WriteIntoBeing extends CardImpl {
|
public class WriteIntoBeing extends CardImpl {
|
||||||
|
|
||||||
public WriteIntoBeing(UUID ownerId, CardSetInfo setInfo) {
|
public WriteIntoBeing(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}");
|
||||||
|
|
||||||
// Look at the top two cards of your library. Manifest one of those cards, then put the other on the top or bottom of your library.
|
// Look at the top two cards of your library. Manifest one of those cards, then put the other on the top or bottom of your library.
|
||||||
this.getSpellAbility().addEffect(new WriteIntoBeingEffect());
|
this.getSpellAbility().addEffect(new WriteIntoBeingEffect());
|
||||||
|
|
@ -72,7 +72,8 @@ class WriteIntoBeingEffect extends OneShotEffect {
|
||||||
|
|
||||||
public WriteIntoBeingEffect() {
|
public WriteIntoBeingEffect() {
|
||||||
super(Outcome.PutCreatureInPlay);
|
super(Outcome.PutCreatureInPlay);
|
||||||
this.staticText = "Look at the top two cards of your library. Manifest one of those cards, then put the other on the top or bottom of your library. <i>(To manifest a card, put it onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)</i>";
|
this.staticText = "Look at the top two cards of your library. Manifest one of those cards, then put the other on the top or bottom of your library. "
|
||||||
|
+ "<i>(To manifest a card, put it onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)</i>";
|
||||||
}
|
}
|
||||||
|
|
||||||
public WriteIntoBeingEffect(final WriteIntoBeingEffect effect) {
|
public WriteIntoBeingEffect(final WriteIntoBeingEffect effect) {
|
||||||
|
|
@ -89,9 +90,8 @@ class WriteIntoBeingEffect extends OneShotEffect {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||||
if (sourceObject != null && controller != null) {
|
if (sourceObject != null && controller != null) {
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 2));
|
||||||
cards.addAll(controller.getLibrary().getTopCards(game, 2));
|
controller.lookAtCards(source, null, cards, game);
|
||||||
controller.lookAtCards(sourceObject.getName(), cards, game);
|
|
||||||
Card cardToManifest = null;
|
Card cardToManifest = null;
|
||||||
if (cards.size() > 1) {
|
if (cards.size() > 1) {
|
||||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to manifest"));
|
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to manifest"));
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ import mage.abilities.Ability;
|
||||||
import mage.abilities.Mode;
|
import mage.abilities.Mode;
|
||||||
import mage.abilities.dynamicvalue.DynamicValue;
|
import mage.abilities.dynamicvalue.DynamicValue;
|
||||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.Cards;
|
import mage.cards.Cards;
|
||||||
import mage.cards.CardsImpl;
|
import mage.cards.CardsImpl;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
|
@ -150,6 +149,7 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
|
||||||
FilterCard pickFilter, Zone targetZoneLookedCards, boolean putOnTop,
|
FilterCard pickFilter, Zone targetZoneLookedCards, boolean putOnTop,
|
||||||
boolean reveal, boolean upTo, Zone targetZonePickedCards,
|
boolean reveal, boolean upTo, Zone targetZonePickedCards,
|
||||||
boolean optional) {
|
boolean optional) {
|
||||||
|
|
||||||
this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter,
|
this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter,
|
||||||
targetZoneLookedCards, putOnTop, reveal, upTo,
|
targetZoneLookedCards, putOnTop, reveal, upTo,
|
||||||
targetZonePickedCards, optional, true, true);
|
targetZonePickedCards, optional, true, true);
|
||||||
|
|
@ -207,16 +207,10 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void cardLooked(Card card, Game game, Ability source) {
|
protected void actionWithSelectedCards(Cards cards, Game game, Ability source) {
|
||||||
if (numberToPick.calculate(game, source, this) > 0 && filter.match(card, game)) {
|
|
||||||
++foundCardsToPick;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void actionWithSelectedCards(Cards cards, Game game, Ability source, String windowName) {
|
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player player = game.getPlayer(source.getControllerId());
|
||||||
if (player != null && foundCardsToPick > 0) {
|
if (player != null && numberToPick.calculate(game, source, this) > 0
|
||||||
|
&& cards.count(filter, source.getSourceId(), source.getControllerId(), game) > 0) {
|
||||||
if (!optional || player.chooseUse(Outcome.DrawCard, getMayText(), source, game)) {
|
if (!optional || player.chooseUse(Outcome.DrawCard, getMayText(), source, game)) {
|
||||||
FilterCard pickFilter = filter.copy();
|
FilterCard pickFilter = filter.copy();
|
||||||
pickFilter.setMessage(getPickText());
|
pickFilter.setMessage(getPickText());
|
||||||
|
|
@ -231,7 +225,7 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
|
||||||
player.moveCards(pickedCards.getCards(game), targetPickedCards, source, game);
|
player.moveCards(pickedCards.getCards(game), targetPickedCards, source, game);
|
||||||
}
|
}
|
||||||
if (revealPickedCards) {
|
if (revealPickedCards) {
|
||||||
player.revealCards(windowName, pickedCards, game);
|
player.revealCards(source, pickedCards, game);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -346,7 +340,14 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
|
||||||
}
|
}
|
||||||
sb.append(" order");
|
sb.append(" order");
|
||||||
} else if (targetZoneLookedCards == Zone.GRAVEYARD) {
|
} else if (targetZoneLookedCards == Zone.GRAVEYARD) {
|
||||||
sb.append(" and the other into your 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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// get text frame from super class and inject action text
|
// get text frame from super class and inject action text
|
||||||
|
|
|
||||||
|
|
@ -29,18 +29,15 @@ package mage.abilities.effects.common;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.Mode;
|
import mage.abilities.Mode;
|
||||||
import mage.abilities.SpellAbility;
|
|
||||||
import mage.abilities.dynamicvalue.DynamicValue;
|
import mage.abilities.dynamicvalue.DynamicValue;
|
||||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.Cards;
|
import mage.cards.Cards;
|
||||||
import mage.cards.CardsImpl;
|
import mage.cards.CardsImpl;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
|
@ -105,46 +102,25 @@ public class LookLibraryControllerEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
String windowName = "Reveal";
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
if (controller == null) {
|
||||||
if (source instanceof SpellAbility) {
|
|
||||||
Card sourceCard = game.getCard(source.getSourceId());
|
|
||||||
if (sourceCard != null) {
|
|
||||||
windowName = sourceCard.getIdName();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
|
||||||
if (sourcePermanent != null) {
|
|
||||||
windowName = sourcePermanent.getIdName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
|
||||||
if (player == null) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// take cards from library and look at them
|
// take cards from library and look at them
|
||||||
boolean topCardRevealed = player.isTopCardRevealed();
|
boolean topCardRevealed = controller.isTopCardRevealed();
|
||||||
player.setTopCardRevealed(false);
|
controller.setTopCardRevealed(false);
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, this.numberOfCards.calculate(game, source, this)));
|
||||||
int count = Math.min(player.getLibrary().size(), this.numberOfCards.calculate(game, source, this));
|
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cards.add(card);
|
|
||||||
this.cardLooked(card, game, source);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
player.lookAtCards(windowName, cards, game);
|
|
||||||
|
|
||||||
this.actionWithSelectedCards(cards, game, source, windowName);
|
controller.lookAtCards(source, null, cards, game);
|
||||||
|
|
||||||
this.putCardsBack(source, player, cards, game);
|
this.actionWithSelectedCards(cards, game, source);
|
||||||
|
|
||||||
player.setTopCardRevealed(topCardRevealed);
|
this.putCardsBack(source, controller, cards, game);
|
||||||
|
|
||||||
this.mayShuffle(player, source, game);
|
controller.setTopCardRevealed(topCardRevealed);
|
||||||
|
|
||||||
|
this.mayShuffle(controller, source, game);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -158,10 +134,7 @@ public class LookLibraryControllerEffect extends OneShotEffect {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void cardLooked(Card card, Game game, Ability source) {
|
protected void actionWithSelectedCards(Cards cards, Game game, Ability source) {
|
||||||
}
|
|
||||||
|
|
||||||
protected void actionWithSelectedCards(Cards cards, Game game, Ability source, String windowName) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ public class CantBeBlockedByAllSourceEffect extends RestrictionEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||||
return source.getSourceId().equals(permanent.getId());
|
return permanent.equals(source.getSourcePermanentIfItStillExists(game));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,13 @@ public final class StaticFilters {
|
||||||
static {
|
static {
|
||||||
FILTER_PERMANENT.setLockedFilter(true);
|
FILTER_PERMANENT.setLockedFilter(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final FilterPermanent FILTER_PERMANENT_ARTIFACT_AN = new FilterArtifactPermanent("an artifact");
|
||||||
|
|
||||||
|
static {
|
||||||
|
FILTER_PERMANENT_ARTIFACT_AN.setLockedFilter(true);
|
||||||
|
}
|
||||||
|
|
||||||
public static final FilterArtifactOrEnchantmentPermanent FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT = new FilterArtifactOrEnchantmentPermanent();
|
public static final FilterArtifactOrEnchantmentPermanent FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT = new FilterArtifactOrEnchantmentPermanent();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue