mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
- Fixed #5854
This commit is contained in:
parent
9c6d0f6d59
commit
792af6d331
4 changed files with 18 additions and 7 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.effects.Effect;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue