This commit is contained in:
jeffwadsworth 2021-08-19 12:03:31 -05:00
parent 5111438750
commit fd719ad287

View file

@ -64,8 +64,8 @@ class DauthiVoidwalkerReplacementEffect extends ReplacementEffectImpl {
DauthiVoidwalkerReplacementEffect() { DauthiVoidwalkerReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.Exile); super(Duration.WhileOnBattlefield, Outcome.Exile);
staticText = "if a card would be put into an opponent's graveyard from anywhere, " + staticText = "if a card would be put into an opponent's graveyard from anywhere, "
"instead exile it with a void counter on it"; + "instead exile it with a void counter on it";
} }
private DauthiVoidwalkerReplacementEffect(final DauthiVoidwalkerReplacementEffect effect) { private DauthiVoidwalkerReplacementEffect(final DauthiVoidwalkerReplacementEffect effect) {
@ -79,17 +79,22 @@ class DauthiVoidwalkerReplacementEffect extends ReplacementEffectImpl {
@Override @Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) { 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(); Card card = ((ZoneChangeEvent) event).getTarget();
if (card == null) { if (card == null) {
card = game.getCard(event.getTargetId()); card = game.getCard(event.getTargetId());
} }
if (player == null || card == null) { if (controller == null
|| card == null) {
return false; return false;
} }
player.moveCards(card, Zone.EXILED, source, game); controller.moveCards(card, Zone.EXILED, source, game);
card.addCounters(CounterType.VOID.createInstance(), source.getControllerId(), source, game); // okay, not sure why this needs to be done to work correctly with creature permanents
return true; Card cardFromObject = (Card) game.getObject(card.getId());
if (cardFromObject != null) {
return cardFromObject.addCounters(CounterType.VOID.createInstance(), source.getControllerId(), source, game);
}
return false;
} }
@Override @Override
@ -116,8 +121,8 @@ class DauthiVoidwalkerPlayEffect extends OneShotEffect {
DauthiVoidwalkerPlayEffect() { DauthiVoidwalkerPlayEffect() {
super(Outcome.Benefit); super(Outcome.Benefit);
staticText = "choose an exiled card an opponent owns with a void counter on it. " + 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"; + "You may play it this turn without paying its mana cost";
} }
private DauthiVoidwalkerPlayEffect(final DauthiVoidwalkerPlayEffect effect) { private DauthiVoidwalkerPlayEffect(final DauthiVoidwalkerPlayEffect effect) {