forked from External/mage
* Fixed a lot of cards where hand or graveyard cards were moved to library without firing zone change events.
This commit is contained in:
parent
27d4e9fc37
commit
3afd378c2d
21 changed files with 126 additions and 74 deletions
|
|
@ -35,6 +35,7 @@ import mage.cards.CardImpl;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
|
@ -48,8 +49,6 @@ public class DiminishingReturns extends CardImpl {
|
|||
super(ownerId, 39, "Diminishing Returns", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{U}{U}");
|
||||
this.expansionSetCode = "ALL";
|
||||
|
||||
this.color.setBlue(true);
|
||||
|
||||
// Each player shuffles his or her hand and graveyard into his or her library. You exile the top ten cards of your library. Then each player draws up to seven cards.
|
||||
this.getSpellAbility().addEffect(new DiminishingReturnsEffect());
|
||||
}
|
||||
|
|
@ -77,27 +76,26 @@ class DiminishingReturnsEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player sourcePlayer = game.getPlayer(source.getControllerId());
|
||||
if (sourcePlayer != null) {
|
||||
for (UUID playerId : sourcePlayer.getInRange()) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
for (UUID playerId : controller.getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.getLibrary().addAll(player.getHand().getCards(game), game);
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
for (Card card: player.getHand().getCards(game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
player.getHand().clear();
|
||||
player.getGraveyard().clear();
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
Card card = sourcePlayer.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
card.moveToExile(null, null, source.getSourceId(), game);
|
||||
}
|
||||
for (Card card: controller.getLibrary().getTopCards(game, 10)) {
|
||||
controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY, true);
|
||||
}
|
||||
|
||||
for (UUID playerId : sourcePlayer.getInRange()) {
|
||||
for (UUID playerId : controller.getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
int cardsToDrawCount = player.getAmount(0, 7, "How many cards to draw (up to 7)?", game);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -88,11 +89,13 @@ class SwayOfTheStarsEffect extends OneShotEffect {
|
|||
for (UUID playerId: sourcePlayer.getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.getLibrary().addAll(player.getHand().getCards(game), game);
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
for (Card card: player.getHand().getCards(game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
player.getHand().clear();
|
||||
player.getGraveyard().clear();
|
||||
player.drawCards(7, game);
|
||||
player.setLife(7, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,8 +35,10 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
|
@ -50,8 +52,6 @@ public class ArchangelsLight extends CardImpl {
|
|||
super(ownerId, 1, "Archangel's Light", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{7}{W}");
|
||||
this.expansionSetCode = "DKA";
|
||||
|
||||
this.color.setWhite(true);
|
||||
|
||||
// You gain 2 life for each card in your graveyard, then shuffle your graveyard into your library.
|
||||
this.getSpellAbility().addEffect(new ArchangelsLightEffect());
|
||||
|
||||
|
|
@ -80,13 +80,14 @@ class ArchangelsLightEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
DynamicValue value = new CardsInControllerGraveyardCount();
|
||||
if (player != null) {
|
||||
player.gainLife(value.calculate(game, source, this) * 2, game);
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
player.getGraveyard().clear();
|
||||
player.shuffleLibrary(game);
|
||||
if (controller != null) {
|
||||
controller.gainLife(value.calculate(game, source, this) * 2, game);
|
||||
for (Card card: controller.getGraveyard().getCards(game)) {
|
||||
controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
|
||||
}
|
||||
controller.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -31,10 +31,12 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
|
@ -87,8 +89,9 @@ class LearnFromThePastEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (player != null) {
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
player.getGraveyard().clear();
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,10 +34,12 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.common.GainLifeTargetEffect;
|
||||
import mage.abilities.effects.common.PutOnLibraryTargetEffect;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
|
|
@ -120,8 +122,9 @@ class PrimalCommandShuffleGraveyardEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player != null) {
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
player.getGraveyard().clear();
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import mage.abilities.common.SimpleActivatedAbility;
|
|||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -88,8 +89,9 @@ class ElixerOfImmortalityEffect extends OneShotEffect {
|
|||
if (permanent != null) {
|
||||
player.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, true, true);
|
||||
}
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
player.getGraveyard().clear();
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,9 @@ class MassPolymorphEffect extends OneShotEffect {
|
|||
for (Card creatureCard: creatureCards.getCards(game)) {
|
||||
creatureCard.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId());
|
||||
}
|
||||
player.getLibrary().addAll(nonCreatureCards.getCards(game), game);
|
||||
for (Card card: nonCreatureCards.getCards(game)) {
|
||||
player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,9 @@ import mage.constants.Rarity;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileSpellEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
|
@ -80,11 +82,13 @@ class TimeReversalEffect extends OneShotEffect {
|
|||
for (UUID playerId: sourcePlayer.getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.getLibrary().addAll(player.getHand().getCards(game), game);
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
for (Card card: player.getHand().getCards(game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
player.getHand().clear();
|
||||
player.getGraveyard().clear();
|
||||
player.drawCards(7, game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -116,11 +117,13 @@ class JaceTheLivingGuildpactEffect extends OneShotEffect {
|
|||
for (UUID playerId: controller.getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.getLibrary().addAll(player.getHand().getCards(game), game);
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
for (Card card: player.getHand().getCards(game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
player.getHand().clear();
|
||||
player.getGraveyard().clear();
|
||||
}
|
||||
}
|
||||
controller.drawCards(7, game);
|
||||
|
|
|
|||
|
|
@ -30,10 +30,12 @@ package mage.sets.onslaught;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
|
@ -83,8 +85,9 @@ class ReminisceEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (player != null) {
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
player.getGraveyard().clear();
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,7 +117,9 @@ class RiptideShapeshifterEffect extends OneShotEffect {
|
|||
revealedCards.add(card);
|
||||
}
|
||||
player.revealCards("Riptide Shapeshifter", revealedCards, game);
|
||||
player.getLibrary().addAll(revealedCards.getCards(game), game);
|
||||
for (Card card: revealedCards.getCards(game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,10 +30,12 @@ package mage.sets.ravnica;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
|
@ -78,9 +80,10 @@ class MnemonicNexusEffect extends OneShotEffect {
|
|||
for (UUID playerId: sourcePlayer.getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
player.getGraveyard().clear();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -83,8 +83,9 @@ class PsychicSpiralEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
int cardsInGraveyard = player.getGraveyard().size();
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
player.getGraveyard().clear();
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
|
||||
if (cardsInGraveyard > 0) {
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.keyword.AnnihilatorAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.ProtectionAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.Predicates;
|
||||
|
|
@ -142,8 +143,9 @@ class EmrakulTheAeonsTornEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
player.getGraveyard().clear();
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import mage.abilities.common.PutIntoGraveFromAnywhereSourceTriggeredAbility;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.keyword.AnnihilatorAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
|
@ -60,8 +61,14 @@ public class KozilekButcherOfTruth extends CardImpl {
|
|||
this.subtype.add("Eldrazi");
|
||||
this.power = new MageInt(12);
|
||||
this.toughness = new MageInt(12);
|
||||
|
||||
// When you cast Kozilek, Butcher of Truth, draw four cards.
|
||||
this.addAbility(new KozilekButcherOfTruthOnCastAbility());
|
||||
|
||||
// Annihilator 4 (Whenever this creature attacks, defending player sacrifices four permanents.)
|
||||
this.addAbility(new AnnihilatorAbility(4));
|
||||
|
||||
// When Kozilek is put into a graveyard from anywhere, its owner shuffles his or her graveyard into his or her library.
|
||||
this.addAbility(new PutIntoGraveFromAnywhereSourceTriggeredAbility(new KozilekButcherOfTruthEffect(), false));
|
||||
}
|
||||
|
||||
|
|
@ -88,15 +95,15 @@ class KozilekButcherOfTruthOnCastAbility extends TriggeredAbilityImpl {
|
|||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.SPELL_CAST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
|
||||
Spell spell = (Spell) game.getObject(event.getTargetId());
|
||||
if (this.getSourceId().equals(spell.getSourceId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
Spell spell = (Spell) game.getObject(event.getTargetId());
|
||||
return this.getSourceId().equals(spell.getSourceId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -122,11 +129,12 @@ class KozilekButcherOfTruthEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
player.getGraveyard().clear();
|
||||
player.shuffleLibrary(game);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
for (Card card: controller.getGraveyard().getCards(game)) {
|
||||
controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
|
||||
}
|
||||
controller.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -144,8 +144,9 @@ class UlamogTheInfiniteGyreEnterGraveyardEffect extends OneShotEffect {
|
|||
}
|
||||
Player player = game.getPlayer(ownerId);
|
||||
if (player != null) {
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
player.getGraveyard().clear();
|
||||
for (Card cardToMove: player.getGraveyard().getCards(game)) {
|
||||
cardToMove.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,9 @@ public class ShapeAnew extends CardImpl {
|
|||
if (artifactCard != null) {
|
||||
artifactCard.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId());
|
||||
}
|
||||
player.getLibrary().addAll(nonArtifactCards.getCards(game), game);
|
||||
for (Card cardToMove: nonArtifactCards.getCards(game)) {
|
||||
cardToMove.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,6 +185,9 @@ class GaeasBlessingGraveToLibraryEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
game.informPlayers(new StringBuilder(controller.getName()).append(" shuffle his or her graveyard into his or her library").toString());
|
||||
for (Card card: controller.getGraveyard().getCards(game)) {
|
||||
controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
|
||||
}
|
||||
controller.getLibrary().addAll(controller.getGraveyard().getCards(game), game);
|
||||
controller.getGraveyard().clear();
|
||||
controller.shuffleLibrary(game);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import mage.abilities.costs.common.ExileSourceCost;
|
|||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -91,8 +92,9 @@ class ThranFoundryEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (player != null) {
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
player.getGraveyard().clear();
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,9 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileSpellEffect;
|
||||
import mage.abilities.effects.common.UntapLandsEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
|
@ -83,11 +85,13 @@ class TimeSpiralEffect extends OneShotEffect {
|
|||
for (UUID playerId: sourcePlayer.getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.getLibrary().addAll(player.getHand().getCards(game), game);
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
for (Card card: player.getHand().getCards(game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
player.getHand().clear();
|
||||
player.getGraveyard().clear();
|
||||
player.drawCards(7, game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import mage.abilities.costs.common.RemoveCountersSourceCost;
|
|||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -101,8 +102,9 @@ class QuestForAncientSecretsEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player != null) {
|
||||
player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
|
||||
player.getGraveyard().clear();
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue