fixed various instances of getting source name (fixes #8531, fixes #8528)

This commit is contained in:
Evan Kranzler 2021-12-24 19:30:31 -05:00
parent 8791f30b4a
commit a6fcaab698
29 changed files with 54 additions and 94 deletions

View file

@ -1,7 +1,6 @@
package mage.cards.b;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -111,12 +110,11 @@ class BaneAlleyBrokerDrawExileEffect extends OneShotEffect {
TargetCard target = new TargetCardInHand().withChooseHint("to exile");
controller.chooseTarget(outcome, controller.getHand(), target, source, game);
Card card = game.getCard(target.getFirstTarget());
MageObject sourceObject = source.getSourcePermanentOrLKI(game);
if (card == null || sourceObject == null) {
if (card == null) {
return false;
}
if (!controller.moveCardsToExile(
card, source, game, false, CardUtil.getExileZoneId(game, source), sourceObject.getIdName()
card, source, game, false, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source)
)) {
return false;
}

View file

@ -1,6 +1,5 @@
package mage.cards.b;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
@ -67,15 +66,14 @@ class BottledCloisterExileEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller == null || sourceObject == null) {
if (controller == null) {
return false;
}
Cards cards = new CardsImpl(controller.getHand());
if (cards.isEmpty()) {
return false;
}
controller.moveCardsToExile(cards.getCards(game), source, game, false, CardUtil.getExileZoneId(game, source), sourceObject.getIdName());
controller.moveCardsToExile(cards.getCards(game), source, game, false, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source));
cards.getCards(game)
.stream()
.filter(c -> game.getState().getZone(c.getId()) == Zone.EXILED)

View file

@ -27,11 +27,11 @@ import mage.target.common.TargetAnyTarget;
import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetpointer.FixedTargets;
import mage.util.CardUtil;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.util.CardUtil;
/**
* @author htrajan
@ -117,8 +117,7 @@ class ChandraHeartOfFireUltimateEffect extends OneShotEffect {
}
// exile cards all at once and set the exile name to the source card
Card sourceCard = game.getCard(source.getSourceId());
controller.moveCardsToExile(exiledCards, source, game, true, CardUtil.getExileZoneId(game, source), sourceCard.getName());
controller.moveCardsToExile(exiledCards, source, game, true, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source));
controller.shuffleLibrary(source, game);
exiledCards.removeIf(card -> !Zone.EXILED.equals(game.getState().getZone(card.getId())));

View file

@ -154,7 +154,7 @@ class CurseOfHospitalityEffect extends OneShotEffect {
enchanted.moveCardsToExile(
card, source, game, true,
CardUtil.getExileZoneId(game, source),
CardUtil.getSourceLogName(game, source)
CardUtil.getSourceName(game, source)
);
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
if (player == null) {

View file

@ -83,12 +83,8 @@ class DarkImpostorExileTargetEffect extends OneShotEffect {
if (player == null || permanent == null) {
return false;
}
Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game);
if (sourcePermanent == null) {
return player.moveCards(permanent, Zone.EXILED, source, game);
}
return player.moveCardsToExile(
permanent, source, game, true, CardUtil.getExileZoneId(game, source), sourcePermanent.getIdName()
permanent, source, game, true, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source)
);
}
}

View file

@ -8,7 +8,6 @@ import mage.cards.*;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.common.TargetCardInExile;
@ -68,8 +67,7 @@ class EndlessHorizonsEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = source.getSourcePermanentOrLKI(game);
if (permanent == null || player == null) {
if (player == null) {
return false;
}
TargetCardInLibrary target = new TargetCardInLibrary(0, Integer.MAX_VALUE, filter);
@ -80,7 +78,7 @@ class EndlessHorizonsEffect extends OneShotEffect {
.map(uuid -> player.getLibrary().getCard(uuid, game))
.filter(Objects::nonNull)
.forEach(cards::add);
player.moveCardsToExile(cards.getCards(game), source, game, true, CardUtil.getExileZoneId(game, source), permanent.getIdName());
player.moveCardsToExile(cards.getCards(game), source, game, true, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source));
player.shuffleLibrary(source, game);
return true;
}

View file

@ -1,7 +1,6 @@
package mage.cards.f;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
@ -77,8 +76,7 @@ class FiendOfTheShadowsEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(targetPointer.getFirst(game, source));
MageObject sourceObject = source.getSourceObject(game);
if (player == null || sourceObject == null || player.getHand().isEmpty()) {
if (player == null || player.getHand().isEmpty()) {
return false;
}
TargetCard targetCard = new TargetDiscard(player.getId());
@ -88,7 +86,7 @@ class FiendOfTheShadowsEffect extends OneShotEffect {
return false;
}
player.moveCardToExileWithInfo(
card, CardUtil.getExileZoneId(game, source), sourceObject.getName(),
card, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source),
source, game, Zone.HAND, true
);
CardUtil.makeCardPlayable(game, source, card, Duration.Custom, false);

View file

@ -16,7 +16,6 @@ import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.util.CardUtil;
@ -69,15 +68,14 @@ class FreeForAllExileAllEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = source.getSourcePermanentOrLKI(game);
if (player == null || sourcePermanent == null) {
if (player == null) {
return false;
}
Cards cards = new CardsImpl();
game.getBattlefield().getActivePermanents(
StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game
).stream().forEach(cards::add);
player.moveCardsToExile(cards.getCards(game), source, game, false, CardUtil.getExileZoneId(game, source), sourcePermanent.getIdName());
player.moveCardsToExile(cards.getCards(game), source, game, false, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source));
cards.getCards(game)
.stream()
.filter(card -> game.getState().getZone(card.getId()) == Zone.EXILED)

View file

@ -89,7 +89,7 @@ class GisaGloriousResurrectorExileEffect extends ReplacementEffectImpl {
+ game.getState().getZoneChangeCounter(source.getSourceId()), source);
return player.moveCardsToExile(
zEvent.getTarget(), source, game, false,
CardUtil.getExileZoneId(game, source), "Gisa, Glorious Resurrector"
CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source)
);
}

View file

@ -1,6 +1,5 @@
package mage.cards.h;
import mage.MageObject;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -72,16 +71,14 @@ class HedonistsTroveExileEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Player targetPlayer = game.getPlayer(source.getFirstTarget());
MageObject sourceObject = source.getSourceObject(game);
UUID exileId = CardUtil.getExileZoneId(game, source);
// save the exileId associated with this specific source
game.getState().setValue(source.getSourceId().toString(), exileId);
return controller != null
&& targetPlayer != null
&& sourceObject != null
&& controller.moveCardsToExile(
targetPlayer.getGraveyard().getCards(game), source, game, true,
exileId, sourceObject.getIdName()
exileId, CardUtil.getSourceName(game, source)
);
}
}

View file

@ -16,7 +16,6 @@ import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetOpponent;
import mage.util.CardUtil;
@ -77,13 +76,12 @@ class HypnoxExileEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Player player = game.getPlayer(source.getFirstTarget());
Permanent permanent = source.getSourcePermanentOrLKI(game);
if (controller == null || player == null || permanent == null) {
if (controller == null || player == null) {
return false;
}
return controller.moveCardsToExile(
player.getHand().getCards(game), source, game, true,
CardUtil.getExileZoneId(game, source), permanent.getIdName()
CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source)
);
}

View file

@ -1,6 +1,5 @@
package mage.cards.i;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
@ -63,12 +62,11 @@ class IgnorantBlissEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller == null || sourceObject == null) {
if (controller == null) {
return false;
}
Cards hand = new CardsImpl(controller.getHand());
controller.moveCardsToExile(hand.getCards(game), source, game, false, CardUtil.getExileZoneId(game, source), sourceObject.getIdName());
controller.moveCardsToExile(hand.getCards(game), source, game, false, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source));
hand.getCards(game)
.stream()
.filter(Objects::nonNull)

View file

@ -1,6 +1,5 @@
package mage.cards.i;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility;
@ -66,8 +65,7 @@ class InducedAmnesiaExileEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
MageObject sourceObject = source.getSourceObject(game);
if (targetPlayer == null || sourceObject == null) {
if (targetPlayer == null) {
return false;
}
int numberOfCards = targetPlayer.getHand().size();
@ -77,7 +75,7 @@ class InducedAmnesiaExileEffect extends OneShotEffect {
Cards cards = new CardsImpl(targetPlayer.getHand());
targetPlayer.moveCardsToExile(
cards.getCards(game), source, game, false,
CardUtil.getExileZoneId(game, source), sourceObject.getIdName()
CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source)
);
cards.getCards(game)
.stream()

View file

@ -1,6 +1,5 @@
package mage.cards.l;
import mage.MageObject;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -97,8 +96,7 @@ class LegionsInitiativeExileEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (player == null || sourceObject == null) {
if (player == null) {
return false;
}
Cards cards = new CardsImpl();
@ -108,7 +106,7 @@ class LegionsInitiativeExileEffect extends OneShotEffect {
).stream().filter(Objects::nonNull).forEach(cards::add);
return player.moveCardsToExile(
cards.getCards(game), source, game, true,
CardUtil.getExileZoneId(game, source), sourceObject.getIdName()
CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source)
);
}

View file

@ -103,7 +103,7 @@ class MindFlayerTheShadowExileEffect extends OneShotEffect {
controller.moveCardsToExile(
cards.getCards(game), source, game, false,
CardUtil.getExileZoneId(game, source),
CardUtil.getSourceLogName(game, source)
CardUtil.getSourceName(game, source)
);
cards.getCards(game).stream().forEach(card -> card.setFaceDown(true, game));
for (Card card : cards.getCards(game)) {

View file

@ -1,7 +1,6 @@
package mage.cards.m;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
@ -112,14 +111,13 @@ class MindreaverExileEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Player player = game.getPlayer(source.getFirstTarget());
MageObject mageObject = source.getSourceObject(game);
if (controller == null || player == null || mageObject == null) {
if (controller == null || player == null) {
return false;
}
Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 3));
return controller.moveCardsToExile(
cards.getCards(game), source, game, true,
CardUtil.getExileZoneId(game, source), mageObject.getIdName()
CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source)
);
}
}

View file

@ -85,7 +85,7 @@ class MnemonicBetrayalExileEffect extends OneShotEffect {
.forEach(cards::addAll);
controller.moveCardsToExile(
cards.getCards(game), source, game, true,
source.getSourceId(), CardUtil.getSourceLogName(game, source)
source.getSourceId(), CardUtil.getSourceName(game, source)
);
for (Card card : cards.getCards(game)) {
if (card.isLand(game)) {

View file

@ -79,7 +79,7 @@ class ProwlingGeistcatcherExileEffect extends OneShotEffect {
player.moveCardsToExile(
card, source, game, true,
CardUtil.getExileZoneId(game, source),
CardUtil.getSourceLogName(game, source)
CardUtil.getSourceName(game, source)
);
}
Permanent exiled = (Permanent) getValue("sacrificedPermanent");

View file

@ -1,6 +1,5 @@
package mage.cards.p;
import mage.MageObject;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
@ -71,11 +70,10 @@ class PsychicTheftEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
MageObject sourceObject = game.getObject(source.getSourceId());
if (opponent == null || sourceObject == null) {
if (opponent == null) {
return false;
}
opponent.revealCards(sourceObject.getName(), opponent.getHand(), game);
opponent.revealCards(CardUtil.getSourceName(game, source), opponent.getHand(), game);
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
@ -91,8 +89,7 @@ class PsychicTheftEffect extends OneShotEffect {
if (chosenCard == null) {
return false;
}
UUID exileId = CardUtil.getExileZoneId(game, source);
controller.moveCardToExileWithInfo(chosenCard, exileId, sourceObject.getIdName(), source, game, Zone.HAND, true);
controller.moveCardToExileWithInfo(chosenCard, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source), source, game, Zone.HAND, true);
CardUtil.makeCardPlayable(game, source, chosenCard, Duration.Custom, false);

View file

@ -14,7 +14,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.util.CardUtil;
import mage.watchers.common.AttackedThisTurnWatcher;
@ -120,13 +119,12 @@ class RobberOfTheRichEffect extends OneShotEffect {
if (controller == null || damagedPlayer == null) {
return false;
}
Permanent sourceObject = source.getSourcePermanentIfItStillExists(game);
Card card = damagedPlayer.getLibrary().getFromTop(game);
if (card == null || sourceObject == null) {
if (card == null) {
return false;
}
// move card to exile
controller.moveCardsToExile(card, source, game, true, CardUtil.getExileZoneId(game, source), sourceObject.getIdName());
controller.moveCardsToExile(card, source, game, true, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source));
// Add effects only if the card has a spellAbility (e.g. not for lands).
if (card.getSpellAbility() != null) {
// allow to cast the card

View file

@ -1,6 +1,5 @@
package mage.cards.r;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -103,11 +102,10 @@ class RogueClassExileEffect extends OneShotEffect {
if (card == null) {
return false;
}
MageObject sourceObject = source.getSourcePermanentOrLKI(game);
controller.moveCardsToExile(
card, source, game, false,
CardUtil.getExileZoneId(game, source),
sourceObject != null ? sourceObject.getName() : null
CardUtil.getSourceName(game, source)
);
card.setFaceDown(true, game);
game.addEffect(new RogueClassLookEffect().setTargetPointer(new FixedTarget(card, game)), source);

View file

@ -85,7 +85,7 @@ class WallOfMourningExileEffect extends OneShotEffect {
player.moveCardsToExile(
cards, source, game, false,
CardUtil.getExileZoneId(game, source),
CardUtil.getSourceLogName(game, source)
CardUtil.getSourceName(game, source)
);
for (Card card : cards) {
card.setFaceDown(true, game);

View file

@ -1,7 +1,6 @@
package mage.cards.w;
import mage.ApprovingObject;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.common.SimpleActivatedAbility;
@ -103,8 +102,7 @@ class WizardsSpellbookEffect extends OneShotEffect {
return false;
}
UUID exileId = CardUtil.getExileZoneId(game, source);
MageObject sourceObject = source.getSourcePermanentOrLKI(game);
player.moveCardsToExile(card, source, game, true, exileId, sourceObject != null ? sourceObject.getName() : null);
player.moveCardsToExile(card, source, game, true, exileId, CardUtil.getSourceName(game, source));
if (level < 3) {
Card copiedCard = game.copyCard(card, source, source.getControllerId());
if (!player.chooseUse(

View file

@ -89,11 +89,10 @@ public class ExileFromGraveCost extends CostImpl {
}
Cards cardsToExile = new CardsImpl();
cardsToExile.addAll(exiledCards);
Card sourceCard = game.getCard(source.getSourceId());
controller.moveCardsToExile(
cardsToExile.getCards(game), source, game, true,
CardUtil.getExileZoneId(game, source),
sourceCard.getName()
CardUtil.getSourceName(game, source)
);
if (setTargetPointer) {
source.getEffects().setTargetPointer(new FixedTargets(cardsToExile, game));

View file

@ -1,6 +1,5 @@
package mage.abilities.effects.common;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Cards;
@ -45,8 +44,7 @@ public class ExileAllEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller == null || sourceObject == null) {
if (controller == null) {
return false;
}
Cards cards = new CardsImpl();
@ -54,7 +52,7 @@ public class ExileAllEffect extends OneShotEffect {
filter, source.getControllerId(), source.getSourceId(), game
).stream().forEach(cards::add);
if (forSource) {
return controller.moveCardsToExile(cards.getCards(game), source, game, true, CardUtil.getExileZoneId(game, source), sourceObject.getName());
return controller.moveCardsToExile(cards.getCards(game), source, game, true, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source));
}
return controller.moveCards(cards, Zone.EXILED, source, game);

View file

@ -1,7 +1,6 @@
package mage.abilities.effects.common;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect;
@ -55,7 +54,6 @@ public class ExileFromZoneTargetEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(targetPointer.getFirst(game, source));
MageObject mageObject = source.getSourceObject(game);
if (player == null) {
return false;
}
@ -75,7 +73,7 @@ public class ExileFromZoneTargetEffect extends OneShotEffect {
target.chooseTarget(Outcome.Exile, player.getId(), source, game);
Cards cards = new CardsImpl(target.getTargets());
if (withSource) {
return player.moveCardsToExile(cards.getCards(game), source, game, true, CardUtil.getExileZoneId(game, source), mageObject.getName());
return player.moveCardsToExile(cards.getCards(game), source, game, true, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source));
}
return player.moveCards(cards, Zone.EXILED, source, game);
}

View file

@ -58,8 +58,7 @@ public class ExileTopXMayPlayUntilEndOfTurnEffect extends OneShotEffect {
if (cards.isEmpty()) {
return true;
}
Card sourceCard = game.getCard(source.getSourceId());
controller.moveCardsToExile(cards, source, game, true, CardUtil.getExileZoneId(game, source), sourceCard.getName());
controller.moveCardsToExile(cards, source, game, true, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source));
// remove cards that could not be moved to exile
cards.removeIf(card -> !Zone.EXILED.equals(game.getState().getZone(card.getId())));
if (!cards.isEmpty()) {

View file

@ -1,6 +1,5 @@
package mage.abilities.effects.common;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
@ -29,11 +28,10 @@ public class MistmeadowWitchEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getFirstTarget());
MageObject sourceObject = source.getSourceObject(game);
if (player == null || permanent == null || sourceObject == null) {
if (player == null || permanent == null) {
return false;
}
player.moveCardsToExile(permanent, source, game, true, CardUtil.getExileZoneId(game, source), sourceObject.getName());
player.moveCardsToExile(permanent, source, game, true, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(Zone.BATTLEFIELD, "return the exiled card to the battlefield under its owner's control")), source);
return true;
}

View file

@ -1229,6 +1229,11 @@ public final class CardUtil {
return false;
}
public static String getSourceName(Game game, Ability source) {
MageObject sourceObject = source.getSourceObject(game);
return sourceObject != null ? sourceObject.getName() : "";
}
/**
* Generates source log name to insert into log messages
*