From fd719ad287484a50c97378a293ece5aa93c1d7e2 Mon Sep 17 00:00:00 2001 From: jeffwadsworth Date: Thu, 19 Aug 2021 12:03:31 -0500 Subject: [PATCH] - Fixed #8141 --- .../src/mage/cards/d/DauthiVoidwalker.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Mage.Sets/src/mage/cards/d/DauthiVoidwalker.java b/Mage.Sets/src/mage/cards/d/DauthiVoidwalker.java index 5aee07ac04..45e6a97c65 100644 --- a/Mage.Sets/src/mage/cards/d/DauthiVoidwalker.java +++ b/Mage.Sets/src/mage/cards/d/DauthiVoidwalker.java @@ -64,8 +64,8 @@ class DauthiVoidwalkerReplacementEffect extends ReplacementEffectImpl { DauthiVoidwalkerReplacementEffect() { super(Duration.WhileOnBattlefield, Outcome.Exile); - staticText = "if a card would be put into an opponent's graveyard from anywhere, " + - "instead exile it with a void counter on it"; + staticText = "if a card would be put into an opponent's graveyard from anywhere, " + + "instead exile it with a void counter on it"; } private DauthiVoidwalkerReplacementEffect(final DauthiVoidwalkerReplacementEffect effect) { @@ -79,17 +79,22 @@ class DauthiVoidwalkerReplacementEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Player player = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); Card card = ((ZoneChangeEvent) event).getTarget(); if (card == null) { card = game.getCard(event.getTargetId()); } - if (player == null || card == null) { + if (controller == null + || card == null) { return false; } - player.moveCards(card, Zone.EXILED, source, game); - card.addCounters(CounterType.VOID.createInstance(), source.getControllerId(), source, game); - return true; + controller.moveCards(card, Zone.EXILED, source, game); + // okay, not sure why this needs to be done to work correctly with creature permanents + Card cardFromObject = (Card) game.getObject(card.getId()); + if (cardFromObject != null) { + return cardFromObject.addCounters(CounterType.VOID.createInstance(), source.getControllerId(), source, game); + } + return false; } @Override @@ -116,8 +121,8 @@ class DauthiVoidwalkerPlayEffect extends OneShotEffect { DauthiVoidwalkerPlayEffect() { super(Outcome.Benefit); - staticText = "choose an exiled card an opponent owns with a void counter on it. " + - "You may play it this turn without paying its mana cost"; + staticText = "choose an exiled card an opponent owns with a void counter on it. " + + "You may play it this turn without paying its mana cost"; } private DauthiVoidwalkerPlayEffect(final DauthiVoidwalkerPlayEffect effect) {