1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-10 01:01:05 -09:00
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
Mage.Sets/src/mage/cards/w
Mage/src/main/java/mage/abilities

View file

@ -19,6 +19,7 @@ import mage.players.Player;
import mage.util.CardUtil; import mage.util.CardUtil;
import java.util.UUID; import java.util.UUID;
import mage.game.permanent.Permanent;
/** /**
* @author TheElk801 * @author TheElk801
@ -72,11 +73,15 @@ class WatcherForTomorrowEffect extends OneShotEffect {
if (player == null) { if (player == null) {
return false; 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) { if (zone == null) {
return false; return false;
} }
Cards cards = new CardsImpl(zone.getCards(game)); Cards cards = new CardsImpl(zone.getCards(game));
return player.moveCards(cards, Zone.HAND, source, game); return player.moveCards(cards, Zone.HAND, source, game);
} }
} }

View file

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

View file

@ -9,6 +9,7 @@ import mage.cards.Card;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.game.ExileZone; 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;
import mage.util.CardUtil; import mage.util.CardUtil;
@ -34,8 +35,14 @@ public class HideawayPlayEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
ExileZone zone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)); ExileZone zone = null;
if (zone == null || zone.isEmpty()) { 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; return true;
} }
Card card = zone.getCards(game).iterator().next(); Card card = zone.getCards(game).iterator().next();

View file

@ -1,4 +1,3 @@
package mage.abilities.keyword; package mage.abilities.keyword;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -105,7 +104,8 @@ class HideawayExileEffect extends OneShotEffect {
Card card = cards.get(target1.getFirstTarget(), game); Card card = cards.get(target1.getFirstTarget(), game);
if (card != null) { if (card != null) {
cards.remove(card); 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); "Hideaway (" + hideawaySource.getIdName() + ')', source.getSourceId(), game, Zone.LIBRARY, false);
card.setFaceDown(true, game); card.setFaceDown(true, game);
} }