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() {
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) {