* Fossil Find - Fixed card movement handling.

This commit is contained in:
LevelX2 2016-01-06 22:11:09 +01:00
parent e367fe40b1
commit e9f58d20a5
12 changed files with 410 additions and 24 deletions

View file

@ -113,7 +113,7 @@ class AugurOfBolasEffect extends OneShotEffect {
int number = topCards.count(new FilterInstantOrSorceryCard(), source.getSourceId(), source.getControllerId(), game);
if (number > 0) {
if (controller.chooseUse(outcome, "Reveal an instant or sorcery card from the looked at cards and put it into your hand?", source, game)) {
Card card = null;
Card card;
if (number == 1) {
card = topCards.getCards(new FilterInstantOrSorceryCard(), source.getSourceId(), source.getControllerId(), game).iterator().next();
} else {
@ -122,7 +122,7 @@ class AugurOfBolasEffect extends OneShotEffect {
card = topCards.get(target.getFirstTarget(), game);
}
if (card != null) {
controller.moveCards(card, null, Zone.HAND, source, game);
controller.moveCards(card, Zone.HAND, source, game);
controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);
topCards.remove(card);
}

View file

@ -28,14 +28,14 @@
package mage.sets.shadowmoor;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.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;
@ -49,7 +49,6 @@ public class FossilFind extends CardImpl {
super(ownerId, 206, "Fossil Find", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{R/G}");
this.expansionSetCode = "SHM";
// Return a card at random from your graveyard to your hand, then reorder your graveyard as you choose.
this.getSpellAbility().addEffect(new FossilFindEffect());
}
@ -82,14 +81,14 @@ class FossilFindEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null && !player.getGraveyard().isEmpty()) {
Card card = player.getGraveyard().getRandom(game);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && !controller.getGraveyard().isEmpty()) {
Card card = controller.getGraveyard().getRandom(game);
if (card != null) {
card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
game.informPlayers(card.getName() + "returned to the hand of" + player.getLogName());
controller.moveCards(card, Zone.HAND, source, game);
return true;
}
controller.moveCards(controller.getGraveyard(), Zone.GRAVEYARD, source, game);
}
return false;
}