From 3bbbd4c02b76cb61dc6788e0dcab4f27037466f6 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 13 Aug 2014 14:22:32 +0200 Subject: [PATCH] Replaced use of source.getId() by source.getSourceId() for Mage Framework. --- .../common/delayed/PactDelayedTriggeredAbility.java | 2 +- .../common/ControlsBiggestOrTiedCreatureCondition.java | 4 ++-- .../common/EnchantedCreatureColorCondition.java | 10 +++++----- .../mage/abilities/effects/common/CipherEffect.java | 2 +- .../common/DamageAllControlledTargetEffect.java | 2 +- .../mage/abilities/effects/common/DamageAllEffect.java | 2 +- .../effects/common/DamageControllerEffect.java | 2 +- .../abilities/effects/common/DamageSelfEffect.java | 2 +- .../common/DestroyAllControlledTargetEffect.java | 2 +- .../common/DestroyAllNamedPermanentsEffect.java | 5 +++-- .../effects/common/DestroyMultiTargetEffect.java | 2 +- .../abilities/effects/common/DestroySourceEffect.java | 2 +- .../effects/common/LookLibraryControllerEffect.java | 6 +++--- .../common/PutLibraryIntoGraveTargetEffect.java | 2 +- .../PutTopCardOfLibraryIntoGraveEachPlayerEffect.java | 2 +- .../effects/common/ReturnFromExileForSourceEffect.java | 2 +- .../common/ReturnSourceFromGraveyardToHandEffect.java | 2 +- ...rnToBattlefieldUnderOwnerControlAttachedEffect.java | 2 +- ...turnToBattlefieldUnderOwnerControlTargetEffect.java | 2 +- ...urnToBattlefieldUnderYourControlAttachedEffect.java | 2 +- ...eturnToBattlefieldUnderYourControlSourceEffect.java | 2 +- .../effects/common/ReturnToHandAttachedEffect.java | 2 +- .../effects/common/ReturnToHandSpellEffect.java | 2 +- .../effects/common/RevealLibraryPutIntoHandEffect.java | 6 +++--- Mage/src/mage/abilities/keyword/BuybackAbility.java | 2 +- .../abilities/keyword/CumulativeUpkeepAbility.java | 4 ++-- Mage/src/mage/abilities/keyword/EchoAbility.java | 2 +- .../mage/abilities/keyword/LivingWeaponAbility.java | 2 +- Mage/src/mage/abilities/keyword/NinjutsuAbility.java | 2 +- Mage/src/mage/abilities/keyword/TransmuteAbility.java | 2 +- Mage/src/mage/players/ManaPool.java | 2 +- Mage/src/mage/target/TargetImpl.java | 6 +++--- .../common/TargetActivatedOrTriggeredAbility.java | 1 + 33 files changed, 47 insertions(+), 45 deletions(-) diff --git a/Mage/src/mage/abilities/common/delayed/PactDelayedTriggeredAbility.java b/Mage/src/mage/abilities/common/delayed/PactDelayedTriggeredAbility.java index 7df8960faf2..e2dfba9beb7 100644 --- a/Mage/src/mage/abilities/common/delayed/PactDelayedTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/delayed/PactDelayedTriggeredAbility.java @@ -96,7 +96,7 @@ class PactEffect extends OneShotEffect { if (player != null) { if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + "?", game)) { cost.clearPaid(); - if (cost.pay(source, game, source.getId(), source.getControllerId(), false)){ + if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)){ return true; } } diff --git a/Mage/src/mage/abilities/condition/common/ControlsBiggestOrTiedCreatureCondition.java b/Mage/src/mage/abilities/condition/common/ControlsBiggestOrTiedCreatureCondition.java index 7663b4e0b10..eaed22f3d5b 100644 --- a/Mage/src/mage/abilities/condition/common/ControlsBiggestOrTiedCreatureCondition.java +++ b/Mage/src/mage/abilities/condition/common/ControlsBiggestOrTiedCreatureCondition.java @@ -56,10 +56,10 @@ public class ControlsBiggestOrTiedCreatureCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - Set controllers = new HashSet(); + Set controllers = new HashSet<>(); Integer maxPower = null; - List permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getId(), game); + List permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game); for (Permanent permanent : permanents) { if (permanent == null) { continue; diff --git a/Mage/src/mage/abilities/condition/common/EnchantedCreatureColorCondition.java b/Mage/src/mage/abilities/condition/common/EnchantedCreatureColorCondition.java index 4f6049ee8e7..95a9fb51da1 100644 --- a/Mage/src/mage/abilities/condition/common/EnchantedCreatureColorCondition.java +++ b/Mage/src/mage/abilities/condition/common/EnchantedCreatureColorCondition.java @@ -45,7 +45,7 @@ import mage.game.permanent.Permanent; public class EnchantedCreatureColorCondition implements Condition { - private FilterPermanent filter = new FilterCreaturePermanent(); + private final FilterPermanent filter = new FilterCreaturePermanent(); public EnchantedCreatureColorCondition(ObjectColor color){ filter.add(new ColorPredicate(color)); @@ -53,11 +53,11 @@ public class EnchantedCreatureColorCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - Permanent enchantement = game.getPermanent(source.getSourceId()); - if (enchantement != null) { - Permanent creature = game.getPermanent(enchantement.getAttachedTo()); + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); if (creature != null) { - if(filter.match(creature, source.getId(), enchantement.getControllerId(), game)){ + if(filter.match(creature, source.getSourceId(), enchantment.getControllerId(), game)){ return true; } } diff --git a/Mage/src/mage/abilities/effects/common/CipherEffect.java b/Mage/src/mage/abilities/effects/common/CipherEffect.java index 09003c6225b..cc1dd395389 100644 --- a/Mage/src/mage/abilities/effects/common/CipherEffect.java +++ b/Mage/src/mage/abilities/effects/common/CipherEffect.java @@ -100,7 +100,7 @@ public class CipherEffect extends OneShotEffect { effect.setTargetPointer(new FixedTarget(target.getFirstTarget())); game.addEffect(effect, source); game.informPlayers(new StringBuilder(sourceCard.getLogName()).append(": Spell ciphered to ").append(targetCreature.getLogName()).toString()); - return sourceCard.moveToExile(null, "", source.getId(), game); + return sourceCard.moveToExile(null, "", source.getSourceId(), game); } else { return false; } diff --git a/Mage/src/mage/abilities/effects/common/DamageAllControlledTargetEffect.java b/Mage/src/mage/abilities/effects/common/DamageAllControlledTargetEffect.java index 164b13a83b8..5a4622b6e2c 100644 --- a/Mage/src/mage/abilities/effects/common/DamageAllControlledTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageAllControlledTargetEffect.java @@ -65,7 +65,7 @@ public class DamageAllControlledTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getFirstTarget(), game)) { - permanent.damage(amount, source.getId(), game, false, true); + permanent.damage(amount, source.getSourceId(), game, false, true); } return true; } diff --git a/Mage/src/mage/abilities/effects/common/DamageAllEffect.java b/Mage/src/mage/abilities/effects/common/DamageAllEffect.java index a9fa7dfaa56..750fce07458 100644 --- a/Mage/src/mage/abilities/effects/common/DamageAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageAllEffect.java @@ -70,7 +70,7 @@ public class DamageAllEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - List permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getId(), game); + List permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game); for (Permanent permanent: permanents) { permanent.damage(amount.calculate(game, source), source.getSourceId(), game, false, true); } diff --git a/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java b/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java index 4cdfbde08a0..ce160da7a9d 100644 --- a/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageControllerEffect.java @@ -85,7 +85,7 @@ public class DamageControllerEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - player.damage(amount.calculate(game, source), source.getId(), game, false, preventable); + player.damage(amount.calculate(game, source), source.getSourceId(), game, false, preventable); return true; } return false; diff --git a/Mage/src/mage/abilities/effects/common/DamageSelfEffect.java b/Mage/src/mage/abilities/effects/common/DamageSelfEffect.java index 860af343cbd..b159786f404 100644 --- a/Mage/src/mage/abilities/effects/common/DamageSelfEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageSelfEffect.java @@ -61,7 +61,7 @@ public class DamageSelfEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - permanent.damage(amount, source.getId(), game, false, true); + permanent.damage(amount, source.getSourceId(), game, false, true); return true; } return false; diff --git a/Mage/src/mage/abilities/effects/common/DestroyAllControlledTargetEffect.java b/Mage/src/mage/abilities/effects/common/DestroyAllControlledTargetEffect.java index 0da7f5c210d..67e29399ba5 100644 --- a/Mage/src/mage/abilities/effects/common/DestroyAllControlledTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroyAllControlledTargetEffect.java @@ -62,7 +62,7 @@ public class DestroyAllControlledTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getFirstTarget(), game)) { - permanent.destroy(source.getId(), game, false); + permanent.destroy(source.getSourceId(), game, false); } return true; } diff --git a/Mage/src/mage/abilities/effects/common/DestroyAllNamedPermanentsEffect.java b/Mage/src/mage/abilities/effects/common/DestroyAllNamedPermanentsEffect.java index 55fe9af13f5..78369fcb027 100644 --- a/Mage/src/mage/abilities/effects/common/DestroyAllNamedPermanentsEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroyAllNamedPermanentsEffect.java @@ -61,8 +61,9 @@ public class DestroyAllNamedPermanentsEffect extends OneShotEffect { permanent.destroy(source.getSourceId(), game, false); for (Permanent perm: game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { - if (perm.getName().equals(name)) - perm.destroy(source.getId(), game, false); + if (perm.getName().equals(name)) { + perm.destroy(source.getSourceId(), game, false); + } } return true; diff --git a/Mage/src/mage/abilities/effects/common/DestroyMultiTargetEffect.java b/Mage/src/mage/abilities/effects/common/DestroyMultiTargetEffect.java index 328c9bff960..6be73a2eb9d 100644 --- a/Mage/src/mage/abilities/effects/common/DestroyMultiTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroyMultiTargetEffect.java @@ -70,7 +70,7 @@ public class DestroyMultiTargetEffect extends OneShotEffect { for (UUID permanentId: target.getTargets()) { Permanent permanent = game.getPermanent(permanentId); if (permanent != null) { - permanent.destroy(source.getId(), game, noRegen); + permanent.destroy(source.getSourceId(), game, noRegen); affectedTargets++; } } diff --git a/Mage/src/mage/abilities/effects/common/DestroySourceEffect.java b/Mage/src/mage/abilities/effects/common/DestroySourceEffect.java index 91899c7aad8..d7b661302a6 100644 --- a/Mage/src/mage/abilities/effects/common/DestroySourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroySourceEffect.java @@ -66,7 +66,7 @@ public class DestroySourceEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - permanent.destroy(source.getId(), game, noRegen); + permanent.destroy(source.getSourceId(), game, noRegen); return true; } return false; diff --git a/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java b/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java index a87e52b605c..e44aae7ab3b 100644 --- a/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java @@ -173,20 +173,20 @@ public class LookLibraryControllerEffect extends OneShotEffect { Card card = cards.get(target.getFirstTarget(), game); if (card != null) { cards.remove(card); - card.moveToZone(targetZoneLookedCards, source.getId(), game, putOnTop); + card.moveToZone(targetZoneLookedCards, source.getSourceId(), game, putOnTop); game.informPlayers(player.getName() + " moves a card to " + targetZoneLookedCards.toString()); } target.clearChosen(); } if (cards.size() == 1) { Card card = cards.get(cards.iterator().next(), game); - card.moveToZone(targetZoneLookedCards, source.getId(), game, putOnTop); + card.moveToZone(targetZoneLookedCards, source.getSourceId(), game, putOnTop); game.informPlayers(player.getName() + " moves a card to " + targetZoneLookedCards.toString()); } break; case GRAVEYARD: for (Card card : cards.getCards(game)) { - card.moveToZone(Zone.GRAVEYARD, source.getId(), game, true); + card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, true); } break; default: diff --git a/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java b/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java index a10d9c37b7b..9c92e1efeda 100644 --- a/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java @@ -80,7 +80,7 @@ public class PutLibraryIntoGraveTargetEffect extends OneShotEffect { for (int i = 0; i < cardsCount; i++) { Card card = player.getLibrary().getFromTop(game); if (card != null) { - player.moveCardToGraveyardWithInfo(card, source.getId(), game, Zone.LIBRARY); + player.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.LIBRARY); } else { break; diff --git a/Mage/src/mage/abilities/effects/common/PutTopCardOfLibraryIntoGraveEachPlayerEffect.java b/Mage/src/mage/abilities/effects/common/PutTopCardOfLibraryIntoGraveEachPlayerEffect.java index 7386caf5c9f..961d0980daa 100644 --- a/Mage/src/mage/abilities/effects/common/PutTopCardOfLibraryIntoGraveEachPlayerEffect.java +++ b/Mage/src/mage/abilities/effects/common/PutTopCardOfLibraryIntoGraveEachPlayerEffect.java @@ -104,7 +104,7 @@ public class PutTopCardOfLibraryIntoGraveEachPlayerEffect extends OneShotEffect for (int i = 0; i < cardsCount; i++) { Card card = player.getLibrary().removeFromTop(game); if (card != null) { - card.moveToZone(Zone.GRAVEYARD, source.getId(), game, true); + card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, true); } } } diff --git a/Mage/src/mage/abilities/effects/common/ReturnFromExileForSourceEffect.java b/Mage/src/mage/abilities/effects/common/ReturnFromExileForSourceEffect.java index 99bd5380ed8..430c84b3846 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnFromExileForSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnFromExileForSourceEffect.java @@ -87,7 +87,7 @@ public class ReturnFromExileForSourceEffect extends OneShotEffect { return false; } game.informPlayers(controller.getName() + " moves " + card.getLogName() + " to " + zone.toString().toLowerCase()); - card.moveToZone(zone, source.getId(), game, tapped); + card.moveToZone(zone, source.getSourceId(), game, tapped); } exile.clear(); } diff --git a/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToHandEffect.java b/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToHandEffect.java index 289b6dfc3bd..f3ab060987f 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToHandEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToHandEffect.java @@ -62,7 +62,7 @@ public class ReturnSourceFromGraveyardToHandEffect extends OneShotEffect { Card card = player.getGraveyard().get(source.getSourceId(), game); if (card != null) { player.removeFromGraveyard(card, game); - card.moveToZone(Zone.HAND, source.getId(), game, false); + card.moveToZone(Zone.HAND, source.getSourceId(), game, false); return true; } return false; diff --git a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlAttachedEffect.java b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlAttachedEffect.java index 0ac3d5feffc..18c5bad257a 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlAttachedEffect.java @@ -64,7 +64,7 @@ public class ReturnToBattlefieldUnderOwnerControlAttachedEffect extends OneShotE Card card = game.getCard(((Permanent) object).getId()); if (card != null) { Zone currentZone = game.getState().getZone(card.getId()); - if (card.putOntoBattlefield(game, currentZone, source.getId(), card.getOwnerId())) { + if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), card.getOwnerId())) { return true; } } diff --git a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlTargetEffect.java b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlTargetEffect.java index b573c4a5ebc..5d868a5bdcc 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderOwnerControlTargetEffect.java @@ -60,7 +60,7 @@ public class ReturnToBattlefieldUnderOwnerControlTargetEffect extends OneShotEff Card card = game.getCard(targetPointer.getFirst(game, source)); if (card != null) { Zone currentZone = game.getState().getZone(card.getId()); - if (card.putOntoBattlefield(game, currentZone, source.getId(), card.getOwnerId())) { + if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), card.getOwnerId())) { return true; } } diff --git a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlAttachedEffect.java b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlAttachedEffect.java index 3cc7bd5d663..98b637ef328 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlAttachedEffect.java @@ -63,7 +63,7 @@ public class ReturnToBattlefieldUnderYourControlAttachedEffect extends OneShotEf Card card = game.getCard(((Permanent)object).getId()); if (card != null) { Zone currentZone = game.getState().getZone(card.getId()); - if (card.putOntoBattlefield(game, currentZone, source.getId(), source.getControllerId())) { + if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId())) { return true; } } diff --git a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlSourceEffect.java b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlSourceEffect.java index 9c407ff0178..c635f66c61b 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlSourceEffect.java @@ -60,7 +60,7 @@ public class ReturnToBattlefieldUnderYourControlSourceEffect extends OneShotEffe Card card = game.getCard(source.getSourceId()); if (card != null) { Zone currentZone = game.getState().getZone(card.getId()); - if (card.putOntoBattlefield(game, currentZone, source.getId(), source.getControllerId())) { + if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId())) { return true; } } diff --git a/Mage/src/mage/abilities/effects/common/ReturnToHandAttachedEffect.java b/Mage/src/mage/abilities/effects/common/ReturnToHandAttachedEffect.java index 5945c55decc..6edfd0e1441 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnToHandAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnToHandAttachedEffect.java @@ -62,7 +62,7 @@ public class ReturnToHandAttachedEffect extends OneShotEffect { if (object != null && object instanceof Permanent) { Card card = game.getCard(((Permanent)object).getId()); if (card != null) { - if (card.moveToZone(Zone.HAND, source.getId(), game, false)) { + if (card.moveToZone(Zone.HAND, source.getSourceId(), game, false)) { return true; } } diff --git a/Mage/src/mage/abilities/effects/common/ReturnToHandSpellEffect.java b/Mage/src/mage/abilities/effects/common/ReturnToHandSpellEffect.java index dd7b4cc6112..c436a41c6c6 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnToHandSpellEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnToHandSpellEffect.java @@ -41,7 +41,7 @@ public class ReturnToHandSpellEffect extends PostResolveEffect implements MageSi @Override public void postResolve(Card card, Ability source, UUID controllerId, Game game) { - card.moveToZone(Zone.HAND, source.getId(), game, false); + card.moveToZone(Zone.HAND, source.getSourceId(), game, false); } } diff --git a/Mage/src/mage/abilities/effects/common/RevealLibraryPutIntoHandEffect.java b/Mage/src/mage/abilities/effects/common/RevealLibraryPutIntoHandEffect.java index 25afd10073b..894654cb055 100644 --- a/Mage/src/mage/abilities/effects/common/RevealLibraryPutIntoHandEffect.java +++ b/Mage/src/mage/abilities/effects/common/RevealLibraryPutIntoHandEffect.java @@ -93,7 +93,7 @@ public class RevealLibraryPutIntoHandEffect extends OneShotEffect { Set cardsList = cards.getCards(game); for (Card card : cardsList) { if (filter.match(card, game)) { - card.moveToZone(Zone.HAND, source.getId(), game, true); + card.moveToZone(Zone.HAND, source.getSourceId(), game, true); cards.remove(card); } } @@ -109,13 +109,13 @@ public class RevealLibraryPutIntoHandEffect extends OneShotEffect { } if (card != null) { cards.remove(card); - card.moveToZone(Zone.LIBRARY, source.getId(), game, false); + card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false); } } if (cards.size() == 1) { Card card = cards.get(cards.iterator().next(), game); - card.moveToZone(Zone.LIBRARY, source.getId(), game, false); + card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false); } return true; diff --git a/Mage/src/mage/abilities/keyword/BuybackAbility.java b/Mage/src/mage/abilities/keyword/BuybackAbility.java index 0a0b67f349e..b1d96dccc3b 100644 --- a/Mage/src/mage/abilities/keyword/BuybackAbility.java +++ b/Mage/src/mage/abilities/keyword/BuybackAbility.java @@ -199,7 +199,7 @@ class BuybackEffect extends ReplacementEffectImpl { Card card = game.getCard(source.getSourceId()); if (card != null && source instanceof BuybackAbility) { if (((BuybackAbility) source).isActivated()) { - return card.moveToZone(Zone.HAND, source.getId(), game, true, event.getAppliedEffects()); + return card.moveToZone(Zone.HAND, source.getSourceId(), game, true, event.getAppliedEffects()); } } return false; diff --git a/Mage/src/mage/abilities/keyword/CumulativeUpkeepAbility.java b/Mage/src/mage/abilities/keyword/CumulativeUpkeepAbility.java index e6493fbffc8..1b111f5538c 100644 --- a/Mage/src/mage/abilities/keyword/CumulativeUpkeepAbility.java +++ b/Mage/src/mage/abilities/keyword/CumulativeUpkeepAbility.java @@ -112,7 +112,7 @@ class CumulativeUpkeepEffect extends OneShotEffect { } if (player.chooseUse(Outcome.Benefit, "Pay " + totalCost.getText() + "?", game)) { totalCost.clearPaid(); - if (totalCost.payOrRollback(source, game, source.getId(), source.getControllerId())){ + if (totalCost.payOrRollback(source, game, source.getSourceId(), source.getControllerId())){ return true; } } @@ -127,7 +127,7 @@ class CumulativeUpkeepEffect extends OneShotEffect { if (player.chooseUse(Outcome.Benefit, totalCost.getText() + "?", game)) { totalCost.clearPaid(); int bookmark = game.bookmarkState(); - if (totalCost.pay(source, game, source.getId(), source.getControllerId(), false)){ + if (totalCost.pay(source, game, source.getSourceId(), source.getControllerId(), false)){ return true; } else{ diff --git a/Mage/src/mage/abilities/keyword/EchoAbility.java b/Mage/src/mage/abilities/keyword/EchoAbility.java index 398f3710f9a..0fab89f4901 100644 --- a/Mage/src/mage/abilities/keyword/EchoAbility.java +++ b/Mage/src/mage/abilities/keyword/EchoAbility.java @@ -144,7 +144,7 @@ class EchoEffect extends OneShotEffect { if (player != null && permanent != null) { if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() /* + " or sacrifice " + permanent.getName() */ + "?", game)) { cost.clearPaid(); - if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) { + if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { return true; } } diff --git a/Mage/src/mage/abilities/keyword/LivingWeaponAbility.java b/Mage/src/mage/abilities/keyword/LivingWeaponAbility.java index cf0a9dc4167..3a394f9a899 100644 --- a/Mage/src/mage/abilities/keyword/LivingWeaponAbility.java +++ b/Mage/src/mage/abilities/keyword/LivingWeaponAbility.java @@ -46,7 +46,7 @@ class LivingWeaponEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { GermToken token = new GermToken(); - token.putOntoBattlefield(1, game, source.getId(), source.getControllerId()); + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); Permanent p = game.getPermanent(token.getLastAddedToken()); if (p != null) { p.addAttachment(source.getSourceId(), game); diff --git a/Mage/src/mage/abilities/keyword/NinjutsuAbility.java b/Mage/src/mage/abilities/keyword/NinjutsuAbility.java index a6b7e514fa5..4896c7ef907 100644 --- a/Mage/src/mage/abilities/keyword/NinjutsuAbility.java +++ b/Mage/src/mage/abilities/keyword/NinjutsuAbility.java @@ -124,7 +124,7 @@ class NinjutsuEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Card card = game.getCard(source.getSourceId()); if (card != null) { - card.putOntoBattlefield(game, Zone.HAND, source.getId(), source.getControllerId()); + card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { UUID defendingPlayerId = null; diff --git a/Mage/src/mage/abilities/keyword/TransmuteAbility.java b/Mage/src/mage/abilities/keyword/TransmuteAbility.java index 1289bad9819..b268d2ef1ba 100644 --- a/Mage/src/mage/abilities/keyword/TransmuteAbility.java +++ b/Mage/src/mage/abilities/keyword/TransmuteAbility.java @@ -72,7 +72,7 @@ class TransmuteEffect extends OneShotEffect { for (UUID cardId : target.getTargets()) { Card card = player.getLibrary().remove(cardId, game); if (card != null) { - card.moveToZone(Zone.HAND, source.getId(), game, false); + card.moveToZone(Zone.HAND, source.getSourceId(), game, false); revealed.add(card); } } diff --git a/Mage/src/mage/players/ManaPool.java b/Mage/src/mage/players/ManaPool.java index b3566c6fe78..c53b72a2381 100644 --- a/Mage/src/mage/players/ManaPool.java +++ b/Mage/src/mage/players/ManaPool.java @@ -309,7 +309,7 @@ public class ManaPool implements Serializable { } else { this.manaItems.add(new ManaPoolItem(mana.getRed(), mana.getGreen(), mana.getBlue(), mana.getWhite(), mana.getBlack(), mana.getColorless(), source.getSourceId(), mana.getFlag())); } - GameEvent event = GameEvent.getEvent(GameEvent.EventType.MANA_ADDED, source.getSourceId(), source.getId(), source.getControllerId()); + GameEvent event = GameEvent.getEvent(GameEvent.EventType.MANA_ADDED, source.getId(), source.getSourceId(), source.getControllerId()); event.setData(mana.toString()); game.fireEvent(event); } diff --git a/Mage/src/mage/target/TargetImpl.java b/Mage/src/mage/target/TargetImpl.java index 3cf52888f9a..d4ae6c750ad 100644 --- a/Mage/src/mage/target/TargetImpl.java +++ b/Mage/src/mage/target/TargetImpl.java @@ -267,12 +267,12 @@ public abstract class TargetImpl implements Target { amount += targets.get(id); } if (source != null && !skipEvent) { - if (!game.replaceEvent(GameEvent.getEvent(EventType.TARGET, id, source.getId(), source.getControllerId()))) { + if (!game.replaceEvent(GameEvent.getEvent(EventType.TARGET, id, source.getSourceId(), source.getControllerId()))) { targets.put(id, amount); rememberZoneChangeCounter(id, game); chosen = targets.size() >= minNumberOfTargets; if (!skipEvent) { - game.fireEvent(GameEvent.getEvent(EventType.TARGETED, id, source.getId(), source.getControllerId())); + game.fireEvent(GameEvent.getEvent(EventType.TARGETED, id, source.getSourceId(), source.getControllerId())); } } } else { @@ -336,7 +336,7 @@ public abstract class TargetImpl implements Target { continue; // it's not legal so continue to have a look at other targeted objects } } - if (!notTarget && game.replaceEvent(GameEvent.getEvent(EventType.TARGET, targetId, source.getId(), source.getControllerId()))) { + if (!notTarget && game.replaceEvent(GameEvent.getEvent(EventType.TARGET, targetId, source.getSourceId(), source.getControllerId()))) { replacedTargets++; continue; } diff --git a/Mage/src/mage/target/common/TargetActivatedOrTriggeredAbility.java b/Mage/src/mage/target/common/TargetActivatedOrTriggeredAbility.java index 04f9b481499..4b4f4ae499d 100644 --- a/Mage/src/mage/target/common/TargetActivatedOrTriggeredAbility.java +++ b/Mage/src/mage/target/common/TargetActivatedOrTriggeredAbility.java @@ -63,6 +63,7 @@ public class TargetActivatedOrTriggeredAbility extends TargetObject { @Override public boolean canTarget(UUID id, Ability source, Game game) { + // rule 114.4. A spell or ability on the stack is an illegal target for itself. if (source != null && source.getId().equals(id)) { return false; }