* [C19] Rayami, First of the Fallen - fixed game error on usage with tokens

This commit is contained in:
Oleg Agafonov 2023-03-26 22:54:57 +04:00
parent a648268c4c
commit 2355dfead4
2 changed files with 6 additions and 5 deletions

View file

@ -77,6 +77,7 @@ class DraugrNecromancerReplacementEffect extends ReplacementEffectImpl {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null
|| permanent == null
|| (permanent instanceof PermanentToken)
|| !controller.hasOpponent(permanent.getControllerId(), game)) {
return false;
}

View file

@ -17,6 +17,7 @@ import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken;
import mage.players.Player;
import mage.util.CardUtil;
import java.util.Collection;
import java.util.UUID;
@ -125,13 +126,12 @@ class RayamiFirstOfTheFallenReplacementEffect extends ReplacementEffectImpl {
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
Player controller = game.getPlayer(source.getControllerId());
if (controller == null || permanent == null) {
if (controller == null
|| permanent == null
|| (permanent instanceof PermanentToken)) {
return false;
}
controller.moveCards(permanent, Zone.EXILED, source, game);
Card card = game.getCard(permanent.getId());
card.addCounters(CounterType.BLOOD.createInstance(), source.getControllerId(), source, game);
return true;
return CardUtil.moveCardWithCounter(game, source, controller, permanent, Zone.EXILED, CounterType.BLOOD.createInstance());
}
@Override