[KHM] Fixed Draugr Necromancer being unable to cast Adventures

This commit is contained in:
Daniel Bomar 2021-02-26 16:06:08 -06:00
parent 287aab5564
commit 73f594583f
No known key found for this signature in database
GPG key ID: C86C8658F4023918
2 changed files with 13 additions and 12 deletions

View file

@ -125,15 +125,18 @@ class DraugrNecromancerCastFromExileEffect extends AsThoughEffectImpl {
@Override @Override
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
if (!source.isControlledBy(affectedControllerId) Card card = game.getCard(sourceId);
|| game.getState().getZone(sourceId) != Zone.EXILED) { if (card == null) {
return false; return false;
} }
Card card = game.getCard(sourceId); card = card.getMainCard();
return card != null if (!source.isControlledBy(affectedControllerId)
&& !card.isLand() || game.getState().getZone(card.getId()) != Zone.EXILED) {
return false;
}
return !card.isLand()
&& game.getOpponents(card.getOwnerId()).contains(source.getControllerId()) && game.getOpponents(card.getOwnerId()).contains(source.getControllerId())
&& card.getMainCard().getCounters(game).getCount(CounterType.ICE) > 0; && card.getCounters(game).getCount(CounterType.ICE) > 0;
} }
} }

View file

@ -118,7 +118,6 @@ public class DraugrNecromancerTest extends CardTestPlayerBase {
assertPermanentCount(playerA, pair, 1); assertPermanentCount(playerA, pair, 1);
} }
@Ignore
@Test @Test
public void testCastAdventureSpellFromExile() { public void testCastAdventureSpellFromExile() {
addCard(Zone.BATTLEFIELD, playerA, necromancer); addCard(Zone.BATTLEFIELD, playerA, necromancer);
@ -136,8 +135,8 @@ public class DraugrNecromancerTest extends CardTestPlayerBase {
execute(); execute();
assertAllCommandsUsed(); assertAllCommandsUsed();
assertExileCount(playerB, pair, 0); assertExileCount(playerB, pair, 1);
assertGraveyardCount(playerB, pair, 1); assertGraveyardCount(playerB, pair, 0);
assertPermanentCount(playerA, "Food", 1); assertPermanentCount(playerA, "Food", 1);
} }
@ -162,7 +161,6 @@ public class DraugrNecromancerTest extends CardTestPlayerBase {
assertPermanentCount(playerA, pair, 1); assertPermanentCount(playerA, pair, 1);
} }
@Ignore
@Test @Test
public void testCastAdventureSpellFromExileWithSnow() { public void testCastAdventureSpellFromExileWithSnow() {
addCard(Zone.BATTLEFIELD, playerA, necromancer); addCard(Zone.BATTLEFIELD, playerA, necromancer);
@ -180,8 +178,8 @@ public class DraugrNecromancerTest extends CardTestPlayerBase {
execute(); execute();
assertAllCommandsUsed(); assertAllCommandsUsed();
assertExileCount(playerB, pair, 0); assertExileCount(playerB, pair, 1);
assertGraveyardCount(playerB, pair, 1); assertGraveyardCount(playerB, pair, 0);
assertPermanentCount(playerA, "Food", 1); assertPermanentCount(playerA, "Food", 1);
} }