From e747b12659f9fa866025d8f3d46c61e4d4617487 Mon Sep 17 00:00:00 2001 From: "Jozsef.Kerekes" Date: Wed, 27 Jan 2021 11:15:36 +0200 Subject: [PATCH] Allow 'Gonti, Lord of Luxury', 'Nightveil Specter' and 'Thief of Sanity' to cast adventures from exile --- Mage.Sets/src/mage/cards/g/GontiLordOfLuxury.java | 8 +++++++- Mage.Sets/src/mage/cards/n/NightveilSpecter.java | 6 ++++++ Mage.Sets/src/mage/cards/t/ThiefOfSanity.java | 6 ++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/g/GontiLordOfLuxury.java b/Mage.Sets/src/mage/cards/g/GontiLordOfLuxury.java index 47c54e24de..0aac4c651f 100644 --- a/Mage.Sets/src/mage/cards/g/GontiLordOfLuxury.java +++ b/Mage.Sets/src/mage/cards/g/GontiLordOfLuxury.java @@ -147,6 +147,12 @@ class GontiLordOfLuxuryCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + Card theCard = game.getCard(objectId); + if (theCard == null) { + return false; + } + objectId = theCard.getMainCard().getId(); // for split cards + UUID targetId = getTargetPointer().getFirst(game, source); if (targetId == null) { this.discard(); @@ -194,7 +200,7 @@ class GontiLordOfLuxurySpendAnyManaEffect extends AsThoughEffectImpl implements // if the card moved from exile to spell the zone change counter is increased by 1 (effect must applies before and on stack, use isCheckPlayableMode?) return source.isControlledBy(affectedControllerId); } else if (((FixedTarget) getTargetPointer()).getTarget().equals(objectId)) { - // object has moved zone so effect can be discarted + // object has moved zone so effect can be discarded this.discard(); } return false; diff --git a/Mage.Sets/src/mage/cards/n/NightveilSpecter.java b/Mage.Sets/src/mage/cards/n/NightveilSpecter.java index 6296c1f07b..a5be28a218 100644 --- a/Mage.Sets/src/mage/cards/n/NightveilSpecter.java +++ b/Mage.Sets/src/mage/cards/n/NightveilSpecter.java @@ -119,6 +119,12 @@ class NightveilSpecterEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + Card theCard = game.getCard(objectId); + if (theCard == null) { + return false; + } + objectId = theCard.getMainCard().getId();// for split cards + if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId) == Zone.EXILED) { ExileZone zone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)); return zone != null && zone.contains(objectId); diff --git a/Mage.Sets/src/mage/cards/t/ThiefOfSanity.java b/Mage.Sets/src/mage/cards/t/ThiefOfSanity.java index 64c5954eeb..4d4ec269df 100644 --- a/Mage.Sets/src/mage/cards/t/ThiefOfSanity.java +++ b/Mage.Sets/src/mage/cards/t/ThiefOfSanity.java @@ -147,6 +147,12 @@ class ThiefOfSanityCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + Card theCard = game.getCard(objectId); + if (theCard == null) { + return false; + } + objectId = theCard.getMainCard().getId();// for split cards + UUID cardId = getTargetPointer().getFirst(game, source); if (cardId == null) { this.discard(); // card is no longer in the origin zone, effect can be discarded