update exile zone for CraftAbility to share between card sides

* updated and added test coverage for previously converted cards Altar of the Wretched and Eye of Ojer Taq
This commit is contained in:
jmlundeen 2025-12-04 09:36:26 -06:00
parent ae97f8944d
commit 99bb467bdc
5 changed files with 216 additions and 42 deletions

View file

@ -9,7 +9,6 @@ import mage.abilities.costs.common.ExileSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.TransformingDoubleFacedCardHalf;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
@ -122,7 +121,8 @@ class CraftCost extends CostImpl {
@Override
public boolean pay(Ability ability, Game game, Ability source, UUID controllerId, boolean noMana, Cost costToPay) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
Card sourceCard = game.getCard(source.getSourceId());
if (player == null || sourceCard == null) {
paid = false;
return paid;
}
@ -143,7 +143,7 @@ class CraftCost extends CostImpl {
.collect(Collectors.toSet());
player.moveCardsToExile(
cards, source, game, true,
CardUtil.getExileZoneId(game, source),
CardUtil.getExileZoneId(game, sourceCard.getMainCard().getId(), sourceCard.getMainCard().getZoneChangeCounter(game)),
CardUtil.getSourceName(game, source)
);
paid = true;