This commit is contained in:
jeffwadsworth 2019-11-27 23:56:22 -06:00
parent 9c6d0f6d59
commit 792af6d331
4 changed files with 18 additions and 7 deletions

View file

@ -19,6 +19,7 @@ import mage.players.Player;
import mage.util.CardUtil;
import java.util.UUID;
import mage.game.permanent.Permanent;
/**
* @author TheElk801
@ -72,11 +73,15 @@ class WatcherForTomorrowEffect extends OneShotEffect {
if (player == null) {
return false;
}
ExileZone zone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source.getSourceId(), true));
Permanent permanentLeftBattlefield = (Permanent) getValue("permanentLeftBattlefield");
if (permanentLeftBattlefield == null) {
return false;
}
ExileZone zone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), permanentLeftBattlefield.getZoneChangeCounter(game)));
if (zone == null) {
return false;
}
Cards cards = new CardsImpl(zone.getCards(game));
return player.moveCards(cards, Zone.HAND, source, game);
}
}
}

View file

@ -1,4 +1,3 @@
package mage.abilities.common;
import mage.abilities.effects.Effect;

View file

@ -9,6 +9,7 @@ import mage.cards.Card;
import mage.constants.Outcome;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.util.CardUtil;
@ -34,8 +35,14 @@ public class HideawayPlayEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
ExileZone zone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
if (zone == null || zone.isEmpty()) {
ExileZone zone = null;
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (permanent != null) {
zone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), permanent.getZoneChangeCounter(game)));
}
if (zone == null
|| zone.isEmpty()) {
return true;
}
Card card = zone.getCards(game).iterator().next();

View file

@ -1,4 +1,3 @@
package mage.abilities.keyword;
import mage.abilities.Ability;
@ -105,7 +104,8 @@ class HideawayExileEffect extends OneShotEffect {
Card card = cards.get(target1.getFirstTarget(), game);
if (card != null) {
cards.remove(card);
controller.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source),
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
controller.moveCardToExileWithInfo(card, exileId,
"Hideaway (" + hideawaySource.getIdName() + ')', source.getSourceId(), game, Zone.LIBRARY, false);
card.setFaceDown(true, game);
}