Added object identifier to the exile windows header line .

This commit is contained in:
LevelX2 2015-05-28 00:06:33 +02:00
parent 9dd5f66c64
commit a31794bb7e
58 changed files with 114 additions and 71 deletions

View file

@ -111,7 +111,7 @@ class RestorationAngelEffect extends OneShotEffect {
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent != null && sourcePermanent != null) {
controller.moveCardToExileWithInfo(permanent, source.getSourceId(), sourcePermanent.getName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
controller.moveCardToExileWithInfo(permanent, source.getSourceId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
Card card = game.getCard(targetPointer.getFirst(game, source));
if (card != null) {
Zone currentZone = game.getState().getZone(card.getId());

View file

@ -40,6 +40,7 @@ import mage.players.Player;
import mage.target.common.TargetOpponent;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.effects.ContinuousEffect;
import mage.target.targetpointer.FixedTarget;
@ -88,13 +89,14 @@ class StolenGoodsEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
if (opponent != null && opponent.getLibrary().size() > 0) {
MageObject sourceObject = source.getSourceObject(game);
if (opponent != null && opponent.getLibrary().size() > 0 && sourceObject != null) {
Library library = opponent.getLibrary();
Card card;
do {
card = library.removeFromTop(game);
if (card != null) {
opponent.moveCardToExileWithInfo(card, source.getSourceId(), "Stolen Goods", source.getSourceId(), game, Zone.LIBRARY, true);
opponent.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
}
} while (library.size() > 0 && card != null && card.getCardType().contains(CardType.LAND));

View file

@ -121,7 +121,7 @@ class RoonOfTheHiddenRealmEffect extends OneShotEffect {
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (permanent != null) {
UUID exileId = UUID.randomUUID();
if (controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) {
if (controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) {
if (card != null) {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());

View file

@ -29,6 +29,7 @@ package mage.sets.darkascension;
import java.util.List;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
@ -87,11 +88,12 @@ class SuddenDisappearanceEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
List<Permanent> perms = game.getBattlefield().getAllActivePermanents(filter, source.getFirstTarget(), game);
if (perms.size() > 0) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getFirstTarget(), game)) {
controller.moveCardToExileWithInfo(permanent, source.getSourceId(), "Sudden Disappearance", source.getSourceId(), game, Zone.BATTLEFIELD, true);
controller.moveCardToExileWithInfo(permanent, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
}
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());

View file

@ -137,19 +137,19 @@ class PossibilityStormEffect extends OneShotEffect {
if (sourceObject != null && spell != null) {
Player spellController = game.getPlayer(spell.getControllerId());
if (spellController != null &&
spellController.moveCardToExileWithInfo(spell, source.getSourceId(), sourceObject.getName(), source.getSourceId(), game, Zone.STACK, true)) {
spellController.moveCardToExileWithInfo(spell, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.STACK, true)) {
if (spellController.getLibrary().size() > 0) {
Library library = spellController.getLibrary();
Card card;
do {
card = library.removeFromTop(game);
if (card != null) {
spellController.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getName(), source.getSourceId(), game, Zone.LIBRARY, true);
spellController.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
}
} while (library.size() > 0 && card != null && !sharesType(card, spell.getCardType()));
if (card != null && sharesType(card, spell.getCardType())) {
if (spellController.chooseUse(Outcome.PlayForFree, new StringBuilder("Cast ").append(card.getName()).append(" without paying cost?").toString(), game)) {
if (spellController.chooseUse(Outcome.PlayForFree, "Cast " + card.getLogName() + " without paying cost?", game)) {
spellController.cast(card.getSpellAbility(), game, true);
}
}

View file

@ -97,7 +97,7 @@ class CommuneWithLavaEffect extends OneShotEffect {
List<Card> cards = controller.getLibrary().getTopCards(game, amount);
for (Card card : cards) {
if (card != null) {
controller.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourceCard.getName(), source.getSourceId(), game, Zone.LIBRARY, true);
controller.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourceCard.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
ContinuousEffect effect = new CommuneWithLavaMayPlayEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));
game.addEffect(effect, source);

View file

@ -106,7 +106,7 @@ class HedonistsTroveExileEffect extends OneShotEffect {
for (UUID cardId : graveyard) {
Card card = game.getCard(cardId);
if (card != null) {
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.GRAVEYARD, true);
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.GRAVEYARD, true);
}
}
return true;

View file

@ -110,7 +110,7 @@ class IreShamanExileEffect extends OneShotEffect {
Library library = controller.getLibrary();
Card card = library.removeFromTop(game);
if (card != null) {
String exileName = new StringBuilder(sourcePermanent.getName()).append(" <this card may be played the turn it was exiled>").toString();
String exileName = new StringBuilder(sourcePermanent.getIdName()).append(" <this card may be played the turn it was exiled>").toString();
controller.moveCardToExileWithInfo(card, source.getSourceId(), exileName, source.getSourceId(), game, Zone.LIBRARY, true);
ContinuousEffect effect = new IreShamanCastFromExileEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));

View file

@ -113,7 +113,7 @@ class LivingLoreExileEffect extends OneShotEffect {
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
Card card = controller.getGraveyard().get(target.getFirstTarget(), game);
if (card != null) {
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.GRAVEYARD, true);
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.GRAVEYARD, true);
}
}
return true;

View file

@ -103,7 +103,7 @@ class FlickerwispEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (controller != null && permanent != null && sourcePermanent != null) {
if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), sourcePermanent.getName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) {
if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) {
//create delayed triggered ability
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, false));
delayedAbility.setSourceId(source.getSourceId());

View file

@ -113,12 +113,12 @@ class JeskaiInfiltratorEffect extends OneShotEffect {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
Card sourceCard = game.getCard(source.getSourceId());
if (sourcePermanent != null && sourceCard != null) {
player.moveCardToExileWithInfo(sourcePermanent, sourcePermanent.getId(), sourcePermanent.getName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
player.moveCardToExileWithInfo(sourcePermanent, sourcePermanent.getId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
cardsToManifest.add(sourceCard);
}
if (sourcePermanent!= null && player.getLibrary().size() > 0) {
Card cardFromLibrary = player.getLibrary().removeFromTop(game);
player.moveCardToExileWithInfo(cardFromLibrary, sourcePermanent.getId(), sourcePermanent.getName(), source.getSourceId(), game, Zone.LIBRARY, true);
player.moveCardToExileWithInfo(cardFromLibrary, sourcePermanent.getId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
cardsToManifest.add(cardFromLibrary);
}
Collections.shuffle(cardsToManifest);

View file

@ -97,7 +97,7 @@ class SummonersEggImprintEffect extends OneShotEffect {
&& controller.choose(Outcome.Benefit, controller.getHand(), target, game)) {
Card card = controller.getHand().get(target.getFirstTarget(), game);
if (card != null) {
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourcePermanent.getName() +" (Imprint)", source.getSourceId(), game, Zone.HAND, true);
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourcePermanent.getIdName() +" (Imprint)", source.getSourceId(), game, Zone.HAND, true);
card.setFaceDown(true, game);
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {

View file

@ -111,7 +111,7 @@ class NightveilSpecterExileEffect extends OneShotEffect {
Card card = player.getLibrary().removeFromTop(game);
MageObject sourceObject = game.getObject(source.getSourceId());
if (card != null && sourceObject != null) {
player.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourceObject.getName(), source.getSourceId(), game, Zone.LIBRARY, true);
player.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
return true;
}
}

View file

@ -134,7 +134,7 @@ class GhostCouncilOfOrzhovaRemovingEffect extends OneShotEffect {
if (controller != null) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), permanent.getName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) {
if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), permanent.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) {
//create delayed triggered ability
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));

View file

@ -98,7 +98,7 @@ class GhostwayEffect extends OneShotEffect {
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
if (creature != null) {
controller.moveCardToExileWithInfo(creature, exileId,sourceObject.getName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
controller.moveCardToExileWithInfo(creature, exileId,sourceObject.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
numberCreatures++;
}
}

View file

@ -118,7 +118,7 @@ class BrainMaggotExileEffect extends OneShotEffect {
Card card = opponent.getHand().get(target.getFirstTarget(), game);
// If source permanent leaves the battlefield before its triggered ability resolves, the target card won't be exiled.
if (card != null && game.getState().getZone(source.getSourceId()) == Zone.BATTLEFIELD) {
controller.moveCardToExileWithInfo(card, CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), sourcePermanent.getName(), source.getSourceId(), game, Zone.HAND, true);
controller.moveCardToExileWithInfo(card, CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.HAND, true);
}
}
}

View file

@ -190,7 +190,7 @@ class GodsendExileEffect extends OneShotEffect {
if (creature != null && controller != null && sourcePermanent != null) {
UUID exileId = CardUtil.getCardExileZoneId(game, source);
controller.moveCardToExileWithInfo(creature, exileId,
new StringBuilder(sourcePermanent.getName()).append(" (").append(sourcePermanent.getZoneChangeCounter(game)).append(")").toString()
sourcePermanent.getIdName() + " (" + sourcePermanent.getZoneChangeCounter(game) + ")"
, source.getSourceId(), game, Zone.BATTLEFIELD, true);
}

View file

@ -107,7 +107,7 @@ class PropheticFlamespeakerExileEffect extends OneShotEffect {
Library library = controller.getLibrary();
Card card = library.removeFromTop(game);
if (card != null) {
String exileName = new StringBuilder(sourcePermanent.getName()).append(" <this card may be played the turn it was exiled>").toString();
String exileName = new StringBuilder(sourcePermanent.getIdName()).append(" <this card may be played the turn it was exiled>").toString();
controller.moveCardToExileWithInfo(card, source.getSourceId(), exileName, source.getSourceId(), game, Zone.LIBRARY, true);
ContinuousEffect effect = new PropheticFlamespeakerCastFromExileEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));

View file

@ -114,7 +114,7 @@ class WorldgorgerDragonEntersEffect extends OneShotEffect {
if (exileId != null) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
if (!permanent.getId().equals(source.getSourceId())) { // Another
controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
}
}
return true;

View file

@ -134,7 +134,7 @@ class WormfangDrakeExileCost extends CostImpl {
if (permanent == null) {
return false;
}
paid |= controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getName() + " exiled permanents", sourceId, game, Zone.BATTLEFIELD, true);
paid |= controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getIdName() + " exiled permanents", sourceId, game, Zone.BATTLEFIELD, true);
}
}
}

View file

@ -105,7 +105,7 @@ class NarsetEnlightenedMasterExileEffect extends OneShotEffect {
if (player.getLibrary().size() > 0) {
Card card = player.getLibrary().getFromTop(game);
if (card != null) {
player.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourceObject.getName(), source.getSourceId(), game, Zone.LIBRARY, true);
player.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
if (!card.getCardType().contains(CardType.CREATURE) && !card.getCardType().contains(CardType.LAND)) {
ContinuousEffect effect = new NarsetEnlightenedMasterCastFromExileEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));

View file

@ -107,7 +107,7 @@ class VillainousWealthEffect extends OneShotEffect {
for (int i = 0; i < cardsCount; i++) {
Card card = player.getLibrary().getFromTop(game);
if (card != null) {
controller.moveCardToExileWithInfo(card, exileId, "Cards exiled by " + mageObject.getLogName(), source.getSourceId(), game, Zone.LIBRARY, true);
controller.moveCardToExileWithInfo(card, exileId, mageObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
}
}
}

View file

@ -30,6 +30,7 @@ package mage.sets.magic2011;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -101,13 +102,14 @@ class HoardingDragonEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
TargetCardInLibrary target = new TargetCardInLibrary(new FilterArtifactCard());
if (controller.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
Card card = controller.getLibrary().getCard(target.getFirstTarget(), game);
if (card != null) {
controller.moveCardToExileWithInfo(card, exileId, "Hoarding Dragon", source.getSourceId(), game, Zone.LIBRARY, true);
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
}
}
}

View file

@ -36,7 +36,6 @@ import mage.abilities.LoyaltyAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.combat.CantBlockTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
@ -210,11 +209,12 @@ class ChandraPyromasterEffect2 extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && controller.getLibrary().size() > 0) {
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null && controller.getLibrary().size() > 0) {
Library library = controller.getLibrary();
Card card = library.removeFromTop(game);
if (card != null) {
controller.moveCardToExileWithInfo(card, source.getSourceId(), "Chandra Pyromaster <this card may be played the turn it was exiled>", source.getSourceId(), game, Zone.LIBRARY, true);
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName() + " <this card may be played the turn it was exiled>", source.getSourceId(), game, Zone.LIBRARY, true);
ContinuousEffect effect = new ChandraPyromasterCastFromExileEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));
game.addEffect(effect, source);

View file

@ -109,7 +109,7 @@ class IsochronScepterImprintEffect extends OneShotEffect {
&& controller.choose(Outcome.Benefit, controller.getHand(), target, game)) {
Card card = controller.getHand().get(target.getFirstTarget(), game);
if (card != null) {
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourcePermanent.getName() +" (Imprint)", source.getSourceId(), game, Zone.HAND, true);
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourcePermanent.getIdName() +" (Imprint)", source.getSourceId(), game, Zone.HAND, true);
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
permanent.imprint(card.getId(), game);

View file

@ -130,7 +130,7 @@ class SoulFoundryImprintEffect extends OneShotEffect {
&& controller.choose(Outcome.Benefit, controller.getHand(), target, game)) {
Card card = controller.getHand().get(target.getFirstTarget(), game);
if (card != null) {
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourcePermanent.getName() + " (Imprint)", source.getSourceId(), game, Zone.HAND, true);
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourcePermanent.getIdName() + " (Imprint)", source.getSourceId(), game, Zone.HAND, true);
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
permanent.imprint(card.getId(), game);

View file

@ -95,7 +95,7 @@ class ExclusionRitualImprintEffect extends OneShotEffect {
Permanent targetPermanent = game.getPermanent(targetPointer.getFirst(game, source));
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && sourcePermanent != null && targetPermanent != null) {
controller.moveCardToExileWithInfo(targetPermanent, getId(), sourcePermanent.getName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
controller.moveCardToExileWithInfo(targetPermanent, getId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
sourcePermanent.imprint(targetPermanent.getId(), game);
}
return true;

View file

@ -30,6 +30,7 @@ package mage.sets.newphyrexia;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.LoyaltyAbility;
@ -114,6 +115,10 @@ class KarnLiberatedEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
MageObject sourceObject = source.getSourceObject(game);
if (sourceObject == null) {
return false;
}
List<Card> cards = new ArrayList<>();
for (ExileZone zone: game.getExile().getExileZones()) {
if (zone.getId().equals(exileId)) {
@ -143,7 +148,7 @@ class KarnLiberatedEffect extends OneShotEffect {
}
for (Card card: cards) {
if ( CardUtil.isPermanentCard(card) && !card.getSubtype().contains("Aura") ) {
game.getExile().add(exileId, "Karn Liberated", card);
game.getExile().add(exileId, sourceObject.getIdName(), card);
}
}
DelayedTriggeredAbility delayedAbility = new KarnLiberatedDelayedTriggeredAbility(exileId);

View file

@ -36,6 +36,7 @@ import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -108,11 +109,12 @@ class PhyrexianIngesterImprintEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
Permanent targetPermanent = game.getPermanent(source.getFirstTarget());
if (targetPermanent != null) {
controller.moveCardToExileWithInfo(targetPermanent, getId(), "Phyrexian Ingester (Imprint)", source.getSourceId(), game, Zone.BATTLEFIELD, true);
controller.moveCardToExileWithInfo(targetPermanent, getId(), sourceObject.getIdName() + " (Imprint)", source.getSourceId(), game, Zone.BATTLEFIELD, true);
sourcePermanent.imprint(targetPermanent.getId(), game);
return true;
}

View file

@ -91,7 +91,7 @@ class AstralSlideEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
UUID exileId = UUID.randomUUID();
if (controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) {
if (controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) {
//create delayed triggered ability
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD, false));
delayedAbility.setSourceId(source.getSourceId());

View file

@ -104,7 +104,7 @@ class IntetTheDreamerExileEffect extends OneShotEffect {
MageObject sourceObject = source.getSourceObject(game);
if (card != null && sourceObject != null) {
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
player.moveCardToExileWithInfo(card, exileZoneId, sourceObject.getName(), source.getSourceId(), game, Zone.LIBRARY, false);
player.moveCardToExileWithInfo(card, exileZoneId, sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, false);
card.setFaceDown(true, game);
return true;
}

View file

@ -98,7 +98,7 @@ class SkyshipWeatherlightEffect extends SearchEffect {
for (UUID cardID : target.getTargets()) {
Card card = controller.getLibrary().getCard(cardID, game);
if (card != null) {
controller.moveCardToExileWithInfo(card, exileZone, sourceObject.getName(), source.getSourceId(), game, Zone.LIBRARY, true);
controller.moveCardToExileWithInfo(card, exileZone, sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
}
}
}

View file

@ -112,12 +112,12 @@ class DetentionSphereEntersEffect extends OneShotEffect {
if (sourceObject != null && exileId != null && targetPermanent != null && controller != null) {
if (targetPermanent.getName().isEmpty()) { // face down creature
controller.moveCardToExileWithInfo(targetPermanent, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
controller.moveCardToExileWithInfo(targetPermanent, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
} else {
String name = targetPermanent.getName();
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
if (permanent != null && permanent.getName().equals(name)) {
controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
}
}
}

View file

@ -101,7 +101,7 @@ class EpicExperimentEffect extends OneShotEffect {
for (int i = 0; i < source.getManaCostsToPay().getX(); i++) {
if (controller.getLibrary().size() > 0) {
Card topCard = controller.getLibrary().getFromTop(game);
controller.moveCardToExileWithInfo(topCard, source.getSourceId(), "Cards exiled by " + sourceObject.getName(), source.getSourceId(), game, Zone.LIBRARY, true);
controller.moveCardToExileWithInfo(topCard, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
}
}
// cast the possible cards without paying the mana

View file

@ -308,7 +308,7 @@ class JaceArchitectOfThoughtEffect3 extends OneShotEffect {
UUID targetId = target.getFirstTarget();
Card card = player.getLibrary().remove(targetId, game);
if (card != null) {
controller.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourcePermanent.getName(), source.getSourceId(), game, Zone.LIBRARY, true);
controller.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
}
}
player.shuffleLibrary(game);

View file

@ -122,7 +122,7 @@ class KahoMinamoHistorianEffect extends SearchEffect {
for (UUID cardId : target.getTargets()) {
Card card = controller.getLibrary().getCard(cardId, game);
if (card != null) {
controller.moveCardToExileWithInfo(card, exileZone, sourceObject.getName(), source.getSourceId(), game, Zone.LIBRARY, true);
controller.moveCardToExileWithInfo(card, exileZone, sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
}
}
}

View file

@ -29,6 +29,7 @@ package mage.sets.shadowmoor;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.UntapSourceCost;
@ -96,14 +97,15 @@ class PuresightMerrowEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
Card card = controller.getLibrary().getFromTop(game);
if (card != null) {
Cards cards = new CardsImpl();
cards.add(card);
controller.lookAtCards("Puresight Merrow", cards, game);
if (controller.chooseUse(Outcome.Removal, "Do you wish to exile the card from the top of your library?", game)) {
controller.moveCardToExileWithInfo(card, source.getSourceId(), "Puresight Merrow", source.getSourceId(), game, Zone.LIBRARY, true);
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
} else {
game.informPlayers(controller.getLogName() + " puts the card back on top of their library.");
}

View file

@ -115,7 +115,7 @@ class TidehollowScullerExileEffect extends OneShotEffect {
if (controller.choose(Outcome.Exile, opponent.getHand(), target, game)) {
Card card = opponent.getHand().get(target.getFirstTarget(), game);
if (card != null) {
controller.moveCardToExileWithInfo(card, CardUtil.getObjectExileZoneId(game, sourcePermanent), sourcePermanent.getName(), source.getSourceId(), game, Zone.HAND, true);
controller.moveCardToExileWithInfo(card, CardUtil.getObjectExileZoneId(game, sourcePermanent), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.HAND, true);
}
}

View file

@ -93,7 +93,7 @@ class LivingDeathEffect extends OneShotEffect {
Player player = game.getPlayer(playerId);
if (player != null) {
for (Card card :player.getGraveyard().getCards(new FilterCreatureCard(), game)) {
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getName(), source.getSourceId(), game, Zone.GRAVEYARD, true);
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.GRAVEYARD, true);
}
}
}

View file

@ -126,7 +126,7 @@ class AshiokNightmareWeaverExileEffect extends OneShotEffect {
for (int i = 0; i < 3; i++) {
Card card = opponent.getLibrary().getFromTop(game);
if (card != null) {
controller.moveCardToExileWithInfo(card, exileZone, sourceObject.getName(), source.getSourceId(), game, Zone.LIBRARY, true);
controller.moveCardToExileWithInfo(card, exileZone, sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
}
}
return true;
@ -275,7 +275,7 @@ class AshiokNightmareWeaverExileAllEffect extends OneShotEffect {
for (UUID cardId : cards) {
Card card = game.getCard(cardId);
if (card != null) {
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.HAND, true);
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.HAND, true);
}
}
cards.clear();
@ -283,7 +283,7 @@ class AshiokNightmareWeaverExileAllEffect extends OneShotEffect {
for (UUID cardId :cards) {
Card card = game.getCard(cardId);
if (card != null) {
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.GRAVEYARD, true);
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.GRAVEYARD, true);
}
}
}

View file

@ -119,7 +119,7 @@ class DaxosOfMeletisEffect extends OneShotEffect {
Card card = damagedPlayer.getLibrary().getFromTop(game);
if (card != null) {
// move card to exile
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.LIBRARY, true);
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
// player gains life
int cmc = card.getManaCost().convertedManaCost();
if (cmc > 0) {

View file

@ -135,7 +135,7 @@ class PsychicIntrusionExileEffect extends OneShotEffect {
if (card != null) {
// move card to exile
UUID exileId = CardUtil.getCardExileZoneId(game, source);
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getName(), source.getSourceId(), game, fromHand ? Zone.HAND:Zone.GRAVEYARD, true);
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, fromHand ? Zone.HAND:Zone.GRAVEYARD, true);
// allow to cast the card
ContinuousEffect effect = new PsychicIntrusionCastFromExileEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));

View file

@ -122,7 +122,7 @@ class PyxisOfPandemoniumExileEffect extends OneShotEffect {
exileIds.put(exileKey, exileId);
}
player.moveCardToExileWithInfo(card, exileId,
new StringBuilder(sourceObject.getName() +" (").append(player.getLogName()).append(")").toString(),
new StringBuilder(sourceObject.getIdName() +" (").append(player.getLogName()).append(")").toString(),
source.getSourceId(), game, Zone.LIBRARY, true);
card.setFaceDown(true, game);
}

View file

@ -117,7 +117,7 @@ class GrinningTotemSearchAndExileEffect extends OneShotEffect {
if (you.searchLibrary(targetCard, game, targetOpponent.getId())) {
Card card = targetOpponent.getLibrary().remove(targetCard.getFirstTarget(), game);
if (card != null) {
you.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourcObject != null ? sourcObject.getName() : "", source.getSourceId(), game, Zone.LIBRARY, true);
you.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourcObject != null ? sourcObject.getIdName() : "", source.getSourceId(), game, Zone.LIBRARY, true);
ContinuousEffect effect = new GrinningTotemMayPlayEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));
game.addEffect(effect, source);

View file

@ -102,7 +102,7 @@ class LivingEndEffect extends OneShotEffect {
Player player = game.getPlayer(playerId);
if (player != null) {
for (Card card :player.getGraveyard().getCards(new FilterCreatureCard(), game)) {
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getName(), source.getSourceId(), game, Zone.GRAVEYARD, true);
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.GRAVEYARD, true);
}
}
}

View file

@ -125,7 +125,7 @@ class NorinTheWaryRemovingEffect extends OneShotEffect {
if (controller != null) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), permanent.getName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) {
if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), permanent.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) {
//create delayed triggered ability
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));

View file

@ -111,7 +111,7 @@ class MesmericFiendExileEffect extends OneShotEffect {
if (controller.choose(Outcome.Exile, opponent.getHand(), target, game)) {
Card card = opponent.getHand().get(target.getFirstTarget(), game);
if (card != null) {
controller.moveCardToExileWithInfo(card, CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), sourcePermanent.getName(), source.getSourceId(), game, Zone.HAND, true);
controller.moveCardToExileWithInfo(card, CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.HAND, true);
}
}

View file

@ -114,7 +114,7 @@ class GalepowderMageEffect extends OneShotEffect {
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (permanent != null) {
UUID exileId = UUID.randomUUID();
if (controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) {
if (controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) {
if (card != null) {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());

View file

@ -28,6 +28,7 @@
package mage.sets.vintagemasters;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.ContinuousEffect;
@ -91,13 +92,14 @@ class MindsDesireEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
player.shuffleLibrary(game);
if (player.getLibrary().size() > 0) {
Card card = player.getLibrary().removeFromTop(game);
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
controller.shuffleLibrary(game);
if (controller.getLibrary().size() > 0) {
Card card = controller.getLibrary().removeFromTop(game);
if (card != null) {
player.moveCardToExileWithInfo(card, source.getSourceId(), "Mind's Desire", source.getSourceId(), game, Zone.LIBRARY, true);
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
ContinuousEffect effect = new MindsDesireCastFromExileEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));
game.addEffect(effect, source);

View file

@ -107,7 +107,7 @@ class ThadaAdelAcquisitorEffect extends OneShotEffect {
if (target.getTargets().size() > 0) {
Card card = damagedPlayer.getLibrary().remove(target.getFirstTarget(), game);
if (card != null) {
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getName(), source.getSourceId(), game, Zone.LIBRARY, true);
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
ContinuousEffect effect = new ThadaAdelPlayFromExileEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));
game.addEffect(effect, source);

View file

@ -13,6 +13,7 @@ import mage.game.Game;
public interface MageObject extends MageItem, Serializable {
String getName();
String getIdName();
String getLogName();
String getImageName();
void setName(String name);

View file

@ -97,6 +97,11 @@ public abstract class MageObjectImpl implements MageObject {
return name;
}
@Override
public String getIdName() {
return getName() + " ["+getId().toString().substring(0,3) +"]";
}
@Override
public String getLogName() {
return GameLog.getColoredObjectName(this);

View file

@ -71,11 +71,11 @@ public class ExileTargetForSourceEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
if (permanent != null) {
return controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
return controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
} else {
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (card != null) {
return controller.moveCardToExileWithInfo(card, exileId, sourceObject.getName(), source.getSourceId(), game, game.getState().getZone(card.getId()), true);
return controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, game.getState().getZone(card.getId()), true);
}
}
}

View file

@ -161,7 +161,7 @@ class ChampionExileCost extends CostImpl {
if (permanent == null) {
return false;
}
paid |= controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getLogName() + " championed permanents", sourceId, game, Zone.BATTLEFIELD, true);
paid |= controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getIdName() + " championed permanents", sourceId, game, Zone.BATTLEFIELD, true);
}
}
}

View file

@ -99,6 +99,11 @@ public class Commander implements CommandObject{
return card.getName();
}
@Override
public String getIdName() {
return card.getName() + " ["+card.getId().toString().substring(0,3) +"]";
}
@Override
public String getLogName() {
return GameLog.getColoredObjectName(this);

View file

@ -99,6 +99,11 @@ public class Emblem implements CommandObject {
return name;
}
@Override
public String getIdName() {
return getName() + " ["+getId().toString().substring(0,3) +"]";
}
@Override
public String getLogName() {
return GameLog.getColoredObjectName(this);

View file

@ -552,6 +552,11 @@ public class Spell implements StackObject, Card {
return card.getName();
}
@Override
public String getIdName() {
return getName() + " ["+getId().toString().substring(0,3) +"]";
}
@Override
public String getLogName() {
return GameLog.getColoredObjectName(card);

View file

@ -130,6 +130,11 @@ public class StackAbility implements StackObject, Ability {
return name;
}
@Override
public String getIdName() {
return getName() + " ["+getId().toString().substring(0,3) +"]";
}
@Override
public String getLogName() {
return GameLog.getColoredObjectName(this);