diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/RotFarmSkeleton.java b/Mage.Sets/src/mage/sets/dragonsmaze/RotFarmSkeleton.java index c53b2ecbae..7d10546df5 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/RotFarmSkeleton.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/RotFarmSkeleton.java @@ -53,13 +53,13 @@ public class RotFarmSkeleton extends CardImpl { this.expansionSetCode = "DGM"; this.subtype.add("Plant"); this.subtype.add("Skeleton"); - this.color.setBlack(true); - this.color.setGreen(true); + this.power = new MageInt(4); this.toughness = new MageInt(1); // Rot Farm Skeleton can't block. this.addAbility(new CantBlockAbility()); + // 2{B}{G}, Put the top four cards of your library into your graveyard: Return Rot Farm Skeleton from your graveyard to the battlefield. Activate this ability only any time you could cast a sorcery. Ability ability = new ActivateAsSorceryActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), new ManaCostsImpl("{2}{B}{G}")); ability.addCost(new PutTopCardOfYourLibraryToGraveyardCost(4)); diff --git a/Mage.Sets/src/mage/sets/innistrad/DerangedAssistant.java b/Mage.Sets/src/mage/sets/innistrad/DerangedAssistant.java index 7cb3cc89a7..39db94f380 100644 --- a/Mage.Sets/src/mage/sets/innistrad/DerangedAssistant.java +++ b/Mage.Sets/src/mage/sets/innistrad/DerangedAssistant.java @@ -47,13 +47,13 @@ public class DerangedAssistant extends CardImpl { this.subtype.add("Human"); this.subtype.add("Wizard"); - this.color.setBlue(true); this.power = new MageInt(1); this.toughness = new MageInt(1); - // {tap}, Put the top card of your library into your graveyard: Add {1} to your mana pool. + // {T}, Put the top card of your library into your graveyard: Add {1} to your mana pool. ColorlessManaAbility ability = new ColorlessManaAbility(); ability.addCost(new PutTopCardOfYourLibraryToGraveyardCost()); + ability.setUndoPossible(false); this.addAbility(ability); } diff --git a/Mage/src/mage/abilities/costs/common/PutTopCardOfYourLibraryToGraveyardCost.java b/Mage/src/mage/abilities/costs/common/PutTopCardOfYourLibraryToGraveyardCost.java index 8ae3d2d845..8923b3079e 100644 --- a/Mage/src/mage/abilities/costs/common/PutTopCardOfYourLibraryToGraveyardCost.java +++ b/Mage/src/mage/abilities/costs/common/PutTopCardOfYourLibraryToGraveyardCost.java @@ -33,6 +33,8 @@ import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.costs.CostImpl; import mage.cards.Card; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.game.Game; import mage.players.Player; import mage.util.CardUtil; @@ -65,16 +67,10 @@ public class PutTopCardOfYourLibraryToGraveyardCost extends CostImpl { public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { Player player = game.getPlayer(controllerId); if (player != null && player.getLibrary().size() >= numberOfCards) { - int i = 0; paid = true; - while (player.isInGame() && i < numberOfCards) { - Card card = player.getLibrary().removeFromTop(game); - if (card != null) { - // all cards must reach the graveyard to pay the costs - paid &= card.moveToZone(Zone.GRAVEYARD, sourceId, game, true); - } - ++i; - } + Cards cards = new CardsImpl(); + cards.addAll(player.getLibrary().getTopCards(game, numberOfCards)); + player.moveCardsToGraveyardWithInfo(cards, ability, game, Zone.LIBRARY); } return paid; } @@ -82,10 +78,7 @@ public class PutTopCardOfYourLibraryToGraveyardCost extends CostImpl { @Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { Player player = game.getPlayer(controllerId); - if (player != null && player.getLibrary().size() >= numberOfCards) { - return true; - } - return false; + return player != null && player.getLibrary().size() >= numberOfCards; } @Override diff --git a/Mage/src/mage/abilities/mana/ManaAbility.java b/Mage/src/mage/abilities/mana/ManaAbility.java index 15affee8ef..135593a770 100644 --- a/Mage/src/mage/abilities/mana/ManaAbility.java +++ b/Mage/src/mage/abilities/mana/ManaAbility.java @@ -34,6 +34,7 @@ import java.util.UUID; import mage.Mana; import mage.abilities.ActivatedAbilityImpl; import mage.abilities.costs.Cost; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.ManaEffect; import mage.constants.AbilityType; import mage.constants.Zone; @@ -46,10 +47,12 @@ import mage.game.Game; public abstract class ManaAbility extends ActivatedAbilityImpl { protected List netMana = new ArrayList<>(); - + protected boolean undoPossible; + public ManaAbility(Zone zone, ManaEffect effect, Cost cost) { super(AbilityType.MANA, zone); this.usesStack = false; + this.undoPossible = true; if (effect != null) { this.addEffect(effect); } @@ -92,4 +95,13 @@ public abstract class ManaAbility extends ActivatedAbilityImpl { public boolean definesMana() { return netMana.size() > 0; } + + public boolean isUndoPossible() { + return undoPossible; + } + + public void setUndoPossible(boolean undoPossible) { + this.undoPossible = undoPossible; + } + } diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 8b88325759..2d344cc591 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -1016,7 +1016,7 @@ public abstract class PlayerImpl implements Player, Serializable { int bookmark = game.bookmarkState(); if (ability.activate(game, false)) { if (ability.resolve(game)) { - if (storedBookmark == -1 || storedBookmark > bookmark) { // e.g. usefull for undo Nykthos, Shrine to Nyx + if (ability.isUndoPossible() && storedBookmark == -1 || storedBookmark > bookmark) { // e.g. usefull for undo Nykthos, Shrine to Nyx setStoredBookmark(bookmark); } return true;