diff --git a/Mage.Sets/src/mage/cards/a/AdarkarValkyrie.java b/Mage.Sets/src/mage/cards/a/AdarkarValkyrie.java index a8ac7a5a5c..beded6f827 100644 --- a/Mage.Sets/src/mage/cards/a/AdarkarValkyrie.java +++ b/Mage.Sets/src/mage/cards/a/AdarkarValkyrie.java @@ -120,7 +120,8 @@ class AdarkarValkyrieDelayedTriggeredAbility extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { if (((ZoneChangeEvent) event).isDiesEvent() - && mor.refersTo(((ZoneChangeEvent) event).getTarget(), game)) { + && mor.refersTo(((ZoneChangeEvent) event).getTarget(), game) + && game.getState().getZone(event.getTargetId()) == Zone.GRAVEYARD) { // must be in the graveyard getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game)); return true; diff --git a/Mage.Sets/src/mage/cards/m/MammothHarness.java b/Mage.Sets/src/mage/cards/m/MammothHarness.java index 94b3d80f82..48bde41bbe 100644 --- a/Mage.Sets/src/mage/cards/m/MammothHarness.java +++ b/Mage.Sets/src/mage/cards/m/MammothHarness.java @@ -1,4 +1,3 @@ - package mage.cards.m; import java.util.UUID; @@ -80,14 +79,14 @@ class MammothHarnessTriggeredAbility extends BlocksOrBecomesBlockedSourceTrigger if (event.getSourceId().equals(attachedTo.getId())) { Permanent blocked = game.getPermanent(event.getTargetId()); if (blocked != null && filter.match(blocked, game)) { - this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId())); + this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game)); return true; } } if (event.getTargetId().equals(attachedTo.getId())) { Permanent blocker = game.getPermanent(event.getSourceId()); if (blocker != null) { - this.getEffects().setTargetPointer(new FixedTarget(event.getSourceId())); + this.getEffects().setTargetPointer(new FixedTarget(event.getSourceId(), game)); return true; } } diff --git a/Mage.Sets/src/mage/cards/m/MassMutiny.java b/Mage.Sets/src/mage/cards/m/MassMutiny.java index 7394d7fedd..4ef9b39f30 100644 --- a/Mage.Sets/src/mage/cards/m/MassMutiny.java +++ b/Mage.Sets/src/mage/cards/m/MassMutiny.java @@ -88,11 +88,11 @@ class MassMutinyEffect extends OneShotEffect { Permanent targetCreature = game.getPermanent(target.getFirstTarget()); if (targetCreature != null) { ContinuousEffect effect1 = new GainControlTargetEffect(Duration.EndOfTurn); - effect1.setTargetPointer(new FixedTarget(targetCreature.getId())); + effect1.setTargetPointer(new FixedTarget(targetCreature.getId(), game)); game.addEffect(effect1, source); ContinuousEffect effect2 = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); - effect2.setTargetPointer(new FixedTarget(targetCreature.getId())); + effect2.setTargetPointer(new FixedTarget(targetCreature.getId(), game)); game.addEffect(effect2, source); targetCreature.untap(game); diff --git a/Mage.Sets/src/mage/cards/m/MobRule.java b/Mage.Sets/src/mage/cards/m/MobRule.java index 2dd3d2c175..66cc354304 100644 --- a/Mage.Sets/src/mage/cards/m/MobRule.java +++ b/Mage.Sets/src/mage/cards/m/MobRule.java @@ -1,4 +1,3 @@ - package mage.cards.m; import java.util.List; @@ -26,7 +25,7 @@ import mage.target.targetpointer.FixedTarget; public final class MobRule extends CardImpl { public MobRule(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{R}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{R}{R}"); // Choose one // Gain control of all creatures with power 4 or greater until end of turn. Untap those creatures. They gain haste until end of turn. @@ -83,7 +82,7 @@ class MobRuleEffect extends OneShotEffect { List creatures = game.getBattlefield().getAllActivePermanents(filter, game); for (Permanent creature : creatures) { ContinuousEffect effect = new MobRuleControlAllEffect(source.getControllerId()); - effect.setTargetPointer(new FixedTarget(creature.getId())); + effect.setTargetPointer(new FixedTarget(creature.getId(), game)); game.addEffect(effect, source); applied = true; } @@ -93,7 +92,7 @@ class MobRuleEffect extends OneShotEffect { } for (Permanent creature : creatures) { ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); - effect.setTargetPointer(new FixedTarget(creature.getId())); + effect.setTargetPointer(new FixedTarget(creature.getId(), game)); game.addEffect(effect, source); applied = true; } diff --git a/Mage.Sets/src/mage/cards/m/MoltenPrimordial.java b/Mage.Sets/src/mage/cards/m/MoltenPrimordial.java index f3426606bb..09fa9b1841 100644 --- a/Mage.Sets/src/mage/cards/m/MoltenPrimordial.java +++ b/Mage.Sets/src/mage/cards/m/MoltenPrimordial.java @@ -100,11 +100,11 @@ class MoltenPrimordialEffect extends OneShotEffect { Permanent targetCreature = game.getPermanent(target.getFirstTarget()); if (targetCreature != null) { ContinuousEffect effect1 = new GainControlTargetEffect(Duration.EndOfTurn); - effect1.setTargetPointer(new FixedTarget(targetCreature.getId())); + effect1.setTargetPointer(new FixedTarget(targetCreature.getId(), game)); game.addEffect(effect1, source); ContinuousEffect effect2 = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); - effect2.setTargetPointer(new FixedTarget(targetCreature.getId())); + effect2.setTargetPointer(new FixedTarget(targetCreature.getId(), game)); game.addEffect(effect2, source); targetCreature.untap(game); diff --git a/Mage.Sets/src/mage/cards/m/MyrBattlesphere.java b/Mage.Sets/src/mage/cards/m/MyrBattlesphere.java index 9dc9f7be71..d47e4bbdde 100644 --- a/Mage.Sets/src/mage/cards/m/MyrBattlesphere.java +++ b/Mage.Sets/src/mage/cards/m/MyrBattlesphere.java @@ -81,7 +81,7 @@ class MyrBattlesphereTriggeredAbility extends TriggeredAbilityImpl { Permanent source = game.getPermanent(event.getSourceId()); if (source != null && source.getId().equals(this.getSourceId())) { UUID defenderId = game.getCombat().getDefenderId(event.getSourceId()); - this.getEffects().get(0).setTargetPointer(new FixedTarget(defenderId)); + this.getEffects().get(0).setTargetPointer(new FixedTarget(defenderId, game)); return true; } return false; diff --git a/Mage.Sets/src/mage/cards/m/MysticReflection.java b/Mage.Sets/src/mage/cards/m/MysticReflection.java index 8cc8f5ebba..ba053bf183 100644 --- a/Mage.Sets/src/mage/cards/m/MysticReflection.java +++ b/Mage.Sets/src/mage/cards/m/MysticReflection.java @@ -88,7 +88,7 @@ class MysticReflectionEffect extends OneShotEffect { // The zone is ALL because if the targeted permanent leaves the battlefield, the replacement effect still applies. SimpleStaticAbility staticAbilityOnCard = new SimpleStaticAbility(Zone.ALL, new MysticReflectionReplacementEffect(watcher.getEnteredThisTurn(), source.getSourceId().toString())); MysticReflectionGainAbilityEffect gainAbilityEffect = new MysticReflectionGainAbilityEffect(staticAbilityOnCard); - gainAbilityEffect.setTargetPointer(new FixedTarget(targetedPermanent.getMainCard().getId())); + gainAbilityEffect.setTargetPointer(new FixedTarget(targetedPermanent.getMainCard().getId(), game)); game.addEffect(gainAbilityEffect, source); return true; } diff --git a/Mage.Sets/src/mage/cards/n/NecromanticSelection.java b/Mage.Sets/src/mage/cards/n/NecromanticSelection.java index 5b7e42c5b0..ca6dd93db7 100644 --- a/Mage.Sets/src/mage/cards/n/NecromanticSelection.java +++ b/Mage.Sets/src/mage/cards/n/NecromanticSelection.java @@ -1,4 +1,3 @@ - package mage.cards.n; import mage.MageObject; @@ -88,13 +87,14 @@ class NecromanticSelectionEffect extends OneShotEffect { } filter.add(Predicates.or(cardIdPredicates)); Target target = new TargetCardInGraveyard(filter); - if (controller.chooseTarget(outcome, target, source, game)) { + target.setNotTarget(true); + if (controller.chooseTarget(Outcome.Benefit, target, source, game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); ContinuousEffect effect = new BecomesBlackZombieAdditionEffect(); effect.setText("It's a black Zombie in addition to its other colors and types"); - effect.setTargetPointer(new FixedTarget(card.getId())); + effect.setTargetPointer(new FixedTarget(card.getId(), game)); game.addEffect(effect, source); } } diff --git a/Mage.Sets/src/mage/cards/n/NecropolisRegent.java b/Mage.Sets/src/mage/cards/n/NecropolisRegent.java index 16915ccbce..0e9fad4a39 100644 --- a/Mage.Sets/src/mage/cards/n/NecropolisRegent.java +++ b/Mage.Sets/src/mage/cards/n/NecropolisRegent.java @@ -1,4 +1,3 @@ - package mage.cards.n; import java.util.UUID; @@ -17,7 +16,6 @@ import mage.counters.CounterType; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -28,10 +26,9 @@ import mage.target.targetpointer.FixedTarget; public final class NecropolisRegent extends CardImpl { public NecropolisRegent(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}"); this.subtype.add(SubType.VAMPIRE); - this.power = new MageInt(6); this.toughness = new MageInt(5); @@ -79,7 +76,7 @@ class NecropolisRegentTriggeredAbility extends TriggeredAbilityImpl { if (creature != null && creature.isControlledBy(controllerId)) { this.getEffects().clear(); Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(event.getAmount())); - effect.setTargetPointer(new FixedTarget(creature.getId())); + effect.setTargetPointer(new FixedTarget(creature.getId(), game)); this.addEffect(effect); return true; } @@ -91,4 +88,4 @@ class NecropolisRegentTriggeredAbility extends TriggeredAbilityImpl { public String getRule() { return "Whenever a creature you control deals combat damage to a player, put that many +1/+1 counters on it."; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/n/NettlingImp.java b/Mage.Sets/src/mage/cards/n/NettlingImp.java index 8bd273d6ce..c9c98e3f4b 100644 --- a/Mage.Sets/src/mage/cards/n/NettlingImp.java +++ b/Mage.Sets/src/mage/cards/n/NettlingImp.java @@ -1,4 +1,3 @@ - package mage.cards.n; import java.util.UUID; @@ -102,7 +101,7 @@ class NettlingImpDelayedDestroyEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { DestroyTargetEffect effect = new DestroyTargetEffect(); - effect.setTargetPointer(new FixedTarget(source.getFirstTarget())); + effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game)); AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(Zone.ALL, effect, TargetController.ANY, new InvertCondition(TargetAttackedThisTurnCondition.instance)); delayedAbility.getDuration(); diff --git a/Mage.Sets/src/mage/cards/n/Norritt.java b/Mage.Sets/src/mage/cards/n/Norritt.java index ae6f04d6f6..7dd4f67886 100644 --- a/Mage.Sets/src/mage/cards/n/Norritt.java +++ b/Mage.Sets/src/mage/cards/n/Norritt.java @@ -102,7 +102,7 @@ class NorrittDelayedDestroyEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { DestroyTargetEffect effect = new DestroyTargetEffect(); - effect.setTargetPointer(new FixedTarget(source.getFirstTarget())); + effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game)); AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(Zone.ALL, effect, TargetController.ANY, new InvertCondition(TargetAttackedThisTurnCondition.instance)); delayedAbility.getDuration(); diff --git a/Mage.Sets/src/mage/cards/n/NoyanDarRoilShaper.java b/Mage.Sets/src/mage/cards/n/NoyanDarRoilShaper.java index 96fb75d16f..77213c1e22 100644 --- a/Mage.Sets/src/mage/cards/n/NoyanDarRoilShaper.java +++ b/Mage.Sets/src/mage/cards/n/NoyanDarRoilShaper.java @@ -1,4 +1,3 @@ - package mage.cards.n; import java.util.UUID; @@ -33,7 +32,7 @@ import mage.target.targetpointer.FixedTarget; * @author fireshoes */ public final class NoyanDarRoilShaper extends CardImpl { - + private static final FilterSpell filter = new FilterSpell("instant or sorcery card"); static { @@ -43,7 +42,7 @@ public final class NoyanDarRoilShaper extends CardImpl { } public NoyanDarRoilShaper(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{U}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.MERFOLK); this.subtype.add(SubType.ALLY); @@ -90,8 +89,8 @@ class NoyanDarEffect extends OneShotEffect { targetId = target.getFirstTarget(); } if (targetId != null) { - FixedTarget fixedTarget = new FixedTarget(targetId); - ContinuousEffect continuousEffect = new BecomesCreatureTargetEffect(new AwakenElementalToken(), false, true, Duration.Custom); + FixedTarget fixedTarget = new FixedTarget(targetId, game); + ContinuousEffect continuousEffect = new BecomesCreatureTargetEffect(new AwakenElementalToken(), false, true, Duration.EndOfGame); continuousEffect.setTargetPointer(fixedTarget); game.addEffect(continuousEffect, source); Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(3)); @@ -102,7 +101,6 @@ class NoyanDarEffect extends OneShotEffect { } } - class AwakenElementalToken extends TokenImpl { public AwakenElementalToken() { @@ -115,6 +113,7 @@ class AwakenElementalToken extends TokenImpl { this.addAbility(HasteAbility.getInstance()); } + public AwakenElementalToken(final AwakenElementalToken token) { super(token); } diff --git a/Mage.Sets/src/mage/cards/o/OracleEnVec.java b/Mage.Sets/src/mage/cards/o/OracleEnVec.java index fed320eeed..2a4658c0f3 100644 --- a/Mage.Sets/src/mage/cards/o/OracleEnVec.java +++ b/Mage.Sets/src/mage/cards/o/OracleEnVec.java @@ -66,9 +66,9 @@ class OracleEnVecEffect extends OneShotEffect { OracleEnVecEffect() { super(Outcome.Benefit); - this.staticText = "Target opponent chooses any number of creatures they control. During that player's next turn, " + - "the chosen creatures attack if able, and other creatures can't attack. At the beginning of that turn's end step, " + - "destroy each of the chosen creatures that didn't attack this turn"; + this.staticText = "Target opponent chooses any number of creatures they control. During that player's next turn, " + + "the chosen creatures attack if able, and other creatures can't attack. At the beginning of that turn's end step, " + + "destroy each of the chosen creatures that didn't attack this turn"; } OracleEnVecEffect(final OracleEnVecEffect effect) { @@ -270,7 +270,7 @@ class OracleEnVecDestroyEffect extends OneShotEffect { Permanent permanent = game.getPermanent(targetId); if (permanent != null && !watcher.getAttackedThisTurnCreatures().contains(new MageObjectReference(permanent, game))) { Effect effect = new DestroyTargetEffect(); - effect.setTargetPointer(new FixedTarget(targetId)); + effect.setTargetPointer(new FixedTarget(targetId, game)); effect.apply(game, source); } } diff --git a/Mage.Sets/src/mage/cards/o/OrderOfSuccession.java b/Mage.Sets/src/mage/cards/o/OrderOfSuccession.java index dca18beafa..6534644522 100644 --- a/Mage.Sets/src/mage/cards/o/OrderOfSuccession.java +++ b/Mage.Sets/src/mage/cards/o/OrderOfSuccession.java @@ -1,4 +1,3 @@ - package mage.cards.o; import java.util.HashMap; @@ -116,7 +115,7 @@ class OrderOfSuccessionEffect extends OneShotEffect { Permanent creature = game.getPermanent(entry.getValue()); if (creature != null) { ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfGame, player.getId()); - effect.setTargetPointer(new FixedTarget(creature.getId())); + effect.setTargetPointer(new FixedTarget(creature.getId(), game)); game.addEffect(effect, source); game.informPlayers(new StringBuilder(player.getLogName()).append(" gains control of ").append(creature.getName()).toString()); } diff --git a/Mage.Sets/src/mage/cards/p/PacksDisdain.java b/Mage.Sets/src/mage/cards/p/PacksDisdain.java index d1e9304561..176e990b42 100644 --- a/Mage.Sets/src/mage/cards/p/PacksDisdain.java +++ b/Mage.Sets/src/mage/cards/p/PacksDisdain.java @@ -1,4 +1,3 @@ - package mage.cards.p; import mage.abilities.Ability; @@ -66,12 +65,13 @@ class PacksDisdainEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Choice typeChoice = new ChoiceCreatureType(game.getObject(source.getSourceId())); - if (player != null && player.choose(Outcome.UnboostCreature, typeChoice, game)) { + if (player != null + && player.choose(Outcome.UnboostCreature, typeChoice, game)) { FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); filter.add(SubType.byDescription(typeChoice.getChoice()).getPredicate()); DynamicValue negativePermanentsCount = new PermanentsOnBattlefieldCount(filter, -1); ContinuousEffect effect = new BoostTargetEffect(negativePermanentsCount, negativePermanentsCount, Duration.EndOfTurn, true); - effect.setTargetPointer(new FixedTarget(source.getFirstTarget())); + effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game)); game.addEffect(effect, source); return true; } diff --git a/Mage.Sets/src/mage/cards/p/Paroxysm.java b/Mage.Sets/src/mage/cards/p/Paroxysm.java index c3b1a0228d..1a7a9cf730 100644 --- a/Mage.Sets/src/mage/cards/p/Paroxysm.java +++ b/Mage.Sets/src/mage/cards/p/Paroxysm.java @@ -97,7 +97,7 @@ class ParoxysmEffect extends OneShotEffect { creatureAttachedTo.destroy(source, game, false); } else { ContinuousEffect effect = new BoostTargetEffect(3, 3, Duration.EndOfTurn); - effect.setTargetPointer(new FixedTarget(creatureAttachedTo.getId())); + effect.setTargetPointer(new FixedTarget(creatureAttachedTo.getId(), game)); game.addEffect(effect, source); } return true; diff --git a/Mage.Sets/src/mage/cards/p/PatronOfTheVein.java b/Mage.Sets/src/mage/cards/p/PatronOfTheVein.java index df94f64b77..477afb8afd 100644 --- a/Mage.Sets/src/mage/cards/p/PatronOfTheVein.java +++ b/Mage.Sets/src/mage/cards/p/PatronOfTheVein.java @@ -1,4 +1,3 @@ - package mage.cards.p; import java.util.UUID; @@ -99,9 +98,10 @@ class PatronOfTheVeinCreatureDiesTriggeredAbility extends TriggeredAbilityImpl { if (((ZoneChangeEvent) event).isDiesEvent()) { if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { Card creature = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (creature != null && creature.isCreature(game)) { + if (creature != null + && creature.isCreature(game)) { for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(creature.getId())); + effect.setTargetPointer(new FixedTarget(creature.getId(), game)); } return true; } @@ -141,7 +141,7 @@ class PatronOfTheVeinExileCreatureEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if(controller == null){ + if (controller == null) { return false; } MageObject sourceObject = source.getSourceObject(game); @@ -149,7 +149,7 @@ class PatronOfTheVeinExileCreatureEffect extends OneShotEffect { if (card != null) { Effect effect = new ExileTargetEffect(); - effect.setTargetPointer(new FixedTarget(card.getId())); + effect.setTargetPointer(new FixedTarget(card.getId(), game)); effect.apply(game, source); } diff --git a/Mage.Sets/src/mage/cards/p/PhantasmalMount.java b/Mage.Sets/src/mage/cards/p/PhantasmalMount.java index a5eb8aed96..6778075b0a 100644 --- a/Mage.Sets/src/mage/cards/p/PhantasmalMount.java +++ b/Mage.Sets/src/mage/cards/p/PhantasmalMount.java @@ -25,7 +25,6 @@ import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.ToughnessPredicate; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.targetpointer.FixedTarget; @@ -88,15 +87,15 @@ class PhantasmalMountEffect extends OneShotEffect { Permanent targetCreature = game.getPermanent(source.getFirstTarget()); if (targetCreature != null) { ContinuousEffect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn); - effect.setTargetPointer(new FixedTarget(source.getFirstTarget())); + effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game)); game.addEffect(effect, source); Effect sacrificeCreatureEffect = new SacrificeTargetEffect(); Effect sacrificePhantasmalMountEffect = new SacrificeTargetEffect(); ContinuousEffect gainAbility = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn); - gainAbility.setTargetPointer(new FixedTarget(source.getFirstTarget())); + gainAbility.setTargetPointer(new FixedTarget(source.getFirstTarget(), game)); game.addEffect(gainAbility, source); - sacrificeCreatureEffect.setTargetPointer(new FixedTarget(source.getFirstTarget())); - sacrificePhantasmalMountEffect.setTargetPointer(new FixedTarget(source.getSourceId())); + sacrificeCreatureEffect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game)); + sacrificePhantasmalMountEffect.setTargetPointer(new FixedTarget(source.getSourceId(), game)); DelayedTriggeredAbility dTA = new PhantasmalMountDelayedTriggeredAbility( sacrificeCreatureEffect, source.getSourceId()); diff --git a/Mage.Sets/src/mage/cards/p/Preacher.java b/Mage.Sets/src/mage/cards/p/Preacher.java index 7894f9c48f..7da377b76d 100644 --- a/Mage.Sets/src/mage/cards/p/Preacher.java +++ b/Mage.Sets/src/mage/cards/p/Preacher.java @@ -80,7 +80,7 @@ class PreacherEffect extends OneShotEffect { new GainControlTargetEffect(Duration.Custom), sourceTappedCondition, "Gain control of target creature of an opponent's choice that they control for as long as {this} remains tapped"); - effect.setTargetPointer(new FixedTarget(targetPermanent.getId())); + effect.setTargetPointer(new FixedTarget(targetPermanent.getId(), game)); game.addEffect(effect, source); return true; } diff --git a/Mage.Sets/src/mage/cards/r/RafiqOfTheMany.java b/Mage.Sets/src/mage/cards/r/RafiqOfTheMany.java index 4d8efab7b1..9a67669eca 100644 --- a/Mage.Sets/src/mage/cards/r/RafiqOfTheMany.java +++ b/Mage.Sets/src/mage/cards/r/RafiqOfTheMany.java @@ -1,5 +1,3 @@ - - package mage.cards.r; import java.util.UUID; @@ -18,7 +16,6 @@ import mage.constants.SuperType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -28,8 +25,7 @@ import mage.target.targetpointer.FixedTarget; public final class RafiqOfTheMany extends CardImpl { public RafiqOfTheMany(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{W}{U}"); - + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{W}{U}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.HUMAN); @@ -77,10 +73,10 @@ class RafiqOfTheManyAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (game.isActivePlayer(this.controllerId) ) { + if (game.isActivePlayer(this.controllerId)) { if (game.getCombat().attacksAlone()) { - for (Effect effect: this.getEffects()) { - effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0))); + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0), game)); } return true; } diff --git a/Mage.Sets/src/mage/cards/r/RagingRiver.java b/Mage.Sets/src/mage/cards/r/RagingRiver.java index 9fb3086d78..a712afc088 100644 --- a/Mage.Sets/src/mage/cards/r/RagingRiver.java +++ b/Mage.Sets/src/mage/cards/r/RagingRiver.java @@ -144,7 +144,7 @@ class RagingRiverEffect extends OneShotEffect { } } RestrictionEffect effect = new CantBeBlockedByAllTargetEffect(filter, Duration.EndOfCombat); - effect.setTargetPointer(new FixedTarget(attacker.getId())); + effect.setTargetPointer(new FixedTarget(attacker.getId(), game)); game.addEffect(effect, source); } } diff --git a/Mage.Sets/src/mage/cards/r/RagsRiches.java b/Mage.Sets/src/mage/cards/r/RagsRiches.java index 8845d27793..25443012c5 100644 --- a/Mage.Sets/src/mage/cards/r/RagsRiches.java +++ b/Mage.Sets/src/mage/cards/r/RagsRiches.java @@ -86,8 +86,8 @@ class RichesEffect extends OneShotEffect { // Has to be done as a separate loop in case there's a situation where one creature's // controller depends on another creatures controller. for (UUID target : creaturesToSteal) { - GainControlTargetEffect eff = new GainControlTargetEffect(Duration.Custom, true); - eff.setTargetPointer(new FixedTarget(target)); + GainControlTargetEffect eff = new GainControlTargetEffect(Duration.EndOfGame, true); + eff.setTargetPointer(new FixedTarget(target, game)); game.addEffect(eff, source); } diff --git a/Mage.Sets/src/mage/cards/r/RakingCanopy.java b/Mage.Sets/src/mage/cards/r/RakingCanopy.java index 848687ad96..99684f0b71 100644 --- a/Mage.Sets/src/mage/cards/r/RakingCanopy.java +++ b/Mage.Sets/src/mage/cards/r/RakingCanopy.java @@ -1,4 +1,3 @@ - package mage.cards.r; import java.util.UUID; @@ -12,7 +11,6 @@ import mage.constants.CardType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -23,8 +21,7 @@ import mage.target.targetpointer.FixedTarget; public final class RakingCanopy extends CardImpl { public RakingCanopy(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{G}"); // Whenever a creature with flying attacks you, Raking Canopy deals 4 damage to it. this.addAbility(new RakingCanopyTriggeredAbility()); @@ -63,12 +60,13 @@ class RakingCanopyTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent attacker = game.getPermanent(event.getSourceId()); - if (attacker == null || !attacker.getAbilities().contains(FlyingAbility.getInstance())) { + if (attacker == null + || !attacker.getAbilities().contains(FlyingAbility.getInstance())) { return false; } if (event.getTargetId().equals(this.getControllerId())) { for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(attacker.getId())); + effect.setTargetPointer(new FixedTarget(attacker.getId(), game)); } return true; } diff --git a/Mage.Sets/src/mage/cards/r/ReinsOfPower.java b/Mage.Sets/src/mage/cards/r/ReinsOfPower.java index c9e99f5e58..7f1ab2982c 100644 --- a/Mage.Sets/src/mage/cards/r/ReinsOfPower.java +++ b/Mage.Sets/src/mage/cards/r/ReinsOfPower.java @@ -1,4 +1,3 @@ - package mage.cards.r; import java.util.HashSet; @@ -32,7 +31,7 @@ import mage.target.targetpointer.FixedTarget; public final class ReinsOfPower extends CardImpl { public ReinsOfPower(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); // Untap all creatures you control and all creatures target opponent controls. You and that opponent each gain control of all creatures the other controls until end of turn. Those creatures gain haste until end of turn. this.getSpellAbility().addEffect(new ReinsOfPowerEffect()); @@ -50,21 +49,21 @@ public final class ReinsOfPower extends CardImpl { } class ReinsOfPowerEffect extends OneShotEffect { - + ReinsOfPowerEffect() { super(Outcome.Benefit); this.staticText = "Untap all creatures you control and all creatures target opponent controls. You and that opponent each gain control of all creatures the other controls until end of turn. Those creatures gain haste until end of turn"; } - + ReinsOfPowerEffect(final ReinsOfPowerEffect effect) { super(effect); } - + @Override public ReinsOfPowerEffect copy() { return new ReinsOfPowerEffect(this); } - + @Override public boolean apply(Game game, Ability source) { UUID opponentId = this.getTargetPointer().getFirst(game, source); @@ -73,7 +72,7 @@ class ReinsOfPowerEffect extends OneShotEffect { FilterCreaturePermanent filter = new FilterCreaturePermanent(); filter.add(Predicates.or(new ControllerIdPredicate(source.getControllerId()), new ControllerIdPredicate(opponentId))); new UntapAllEffect(filter).apply(game, source); - + // You and that opponent each gain control of all creatures the other controls until end of turn. Set yourCreatures = new HashSet<>(); Set opponentCreatures = new HashSet<>(); @@ -87,18 +86,18 @@ class ReinsOfPowerEffect extends OneShotEffect { } for (UUID creatureId : yourCreatures) { ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn, opponentId); - effect.setTargetPointer(new FixedTarget(creatureId)); + effect.setTargetPointer(new FixedTarget(creatureId, game)); game.addEffect(effect, source); } for (UUID creatureId : opponentCreatures) { ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn); - effect.setTargetPointer(new FixedTarget(creatureId)); + effect.setTargetPointer(new FixedTarget(creatureId, game)); game.addEffect(effect, source); } - + // Those creatures gain haste until end of turn. game.addEffect(new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.EndOfTurn, filter), source); - + return true; } return false; diff --git a/Mage.Sets/src/mage/cards/r/RevengeStarWars.java b/Mage.Sets/src/mage/cards/r/RevengeStarWars.java index a005bdf42a..37566433ea 100644 --- a/Mage.Sets/src/mage/cards/r/RevengeStarWars.java +++ b/Mage.Sets/src/mage/cards/r/RevengeStarWars.java @@ -1,4 +1,3 @@ - package mage.cards.r; import java.util.UUID; @@ -59,7 +58,6 @@ enum LostLifeCondition implements Condition { instance; - @Override public boolean apply(Game game, Ability source) { PlayerLostLifeWatcher watcher = game.getState().getWatcher(PlayerLostLifeWatcher.class); @@ -92,7 +90,7 @@ class RevengeEffect extends OneShotEffect { Permanent target = game.getPermanent(targetPointer.getFirst(game, source)); if (target != null && target.isCreature(game)) { ContinuousEffect effect = new BoostTargetEffect(4, 0, Duration.EndOfTurn); - effect.setTargetPointer(new FixedTarget(target.getId())); + effect.setTargetPointer(new FixedTarget(target.getId(), game)); game.addEffect(effect, source); return true; } diff --git a/Mage.Sets/src/mage/cards/r/RideDown.java b/Mage.Sets/src/mage/cards/r/RideDown.java index d3fd09a88b..d06a77ad22 100644 --- a/Mage.Sets/src/mage/cards/r/RideDown.java +++ b/Mage.Sets/src/mage/cards/r/RideDown.java @@ -1,4 +1,3 @@ - package mage.cards.r; import java.util.UUID; @@ -34,8 +33,7 @@ public final class RideDown extends CardImpl { } public RideDown(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}{W}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}{W}"); // Destroy target blocking creature. Creatures that were blocked by that creature this combat gain trample until end of turn. this.getSpellAbility().addEffect(new RideDownEffect()); @@ -77,9 +75,9 @@ class RideDownEffect extends OneShotEffect { if (blockingCreature != null) { for (CombatGroup combatGroup : game.getCombat().getGroups()) { if (combatGroup.getBlockers().contains(blockingCreature.getId())) { - for (UUID attackerId: combatGroup.getAttackers()) { + for (UUID attackerId : combatGroup.getAttackers()) { ContinuousEffect effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); - effect.setTargetPointer(new FixedTarget(attackerId)); + effect.setTargetPointer(new FixedTarget(attackerId, game)); game.addEffect(effect, source); } break; diff --git a/Mage.Sets/src/mage/cards/r/RighteousIndignation.java b/Mage.Sets/src/mage/cards/r/RighteousIndignation.java index a9df817204..e9476d1f95 100644 --- a/Mage.Sets/src/mage/cards/r/RighteousIndignation.java +++ b/Mage.Sets/src/mage/cards/r/RighteousIndignation.java @@ -11,7 +11,6 @@ import mage.constants.Duration; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -67,7 +66,7 @@ class RighteousIndignationTriggeredAbility extends TriggeredAbilityImpl { if (blocked != null) { if (blocked.getColor(game).contains(ObjectColor.BLACK) || blocked.getColor(game).contains(ObjectColor.RED)) { - getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId())); + getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId(), game)); return true; } } diff --git a/Mage.Sets/src/mage/cards/r/RiskyMove.java b/Mage.Sets/src/mage/cards/r/RiskyMove.java index 4bdc0a3363..c6769da6b5 100644 --- a/Mage.Sets/src/mage/cards/r/RiskyMove.java +++ b/Mage.Sets/src/mage/cards/r/RiskyMove.java @@ -1,4 +1,3 @@ - package mage.cards.r; import java.util.UUID; @@ -72,21 +71,25 @@ class RiskyMoveGetControlEffect extends OneShotEffect { MageObject sourceObject = source.getSourceObject(game); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Player newController = game.getPlayer(getTargetPointer().getFirst(game, source)); - if (newController != null && controller != null && sourceObject != null && sourceObject.equals(sourcePermanent)) { + if (newController != null + && controller != null + && sourceObject != null + && sourceObject.equals(sourcePermanent)) { // remove old control effects of the same player for (ContinuousEffect effect : game.getState().getContinuousEffects().getLayeredEffects(game)) { if (effect instanceof GainControlTargetEffect) { UUID checkId = (UUID) effect.getValue("RiskyMoveSourceId"); UUID controllerId = (UUID) effect.getValue("RiskyMoveControllerId"); - if (source.getSourceId().equals(checkId) && newController.getId().equals(controllerId)) { + if (source.getSourceId().equals(checkId) + && newController.getId().equals(controllerId)) { effect.discard(); } } } - ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, true, newController.getId()); + ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfGame, true, newController.getId()); effect.setValue("RiskyMoveSourceId", source.getSourceId()); effect.setValue("RiskyMoveControllerId", newController.getId()); - effect.setTargetPointer(new FixedTarget(sourcePermanent.getId())); + effect.setTargetPointer(new FixedTarget(sourcePermanent.getId(), game)); effect.setText("and gains control of it"); game.addEffect(effect, source); return true; @@ -122,11 +125,10 @@ class RiskyMoveTriggeredAbility extends TriggeredAbilityImpl { @Override public String getTriggerPhrase() { - return "When you gain control of {this} from another player, " ; + return "When you gain control of {this} from another player, "; } } - class RiskyMoveFlipCoinEffect extends OneShotEffect { public RiskyMoveFlipCoinEffect() { @@ -149,14 +151,18 @@ class RiskyMoveFlipCoinEffect extends OneShotEffect { if (controller != null) { Target target1 = new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent(), true); Target target2 = new TargetOpponent(true); - + if (target1.canChoose(source.getSourceId(), controller.getId(), game)) { - while (!target1.isChosen() && target1.canChoose(source.getSourceId(), controller.getId(), game) && controller.canRespond()) { + while (!target1.isChosen() + && target1.canChoose(source.getSourceId(), controller.getId(), game) + && controller.canRespond()) { controller.chooseTarget(outcome, target1, source, game); } } if (target2.canChoose(source.getSourceId(), controller.getId(), game)) { - while (!target2.isChosen() && target2.canChoose(source.getSourceId(), controller.getId(), game) && controller.canRespond()) { + while (!target2.isChosen() + && target2.canChoose(source.getSourceId(), controller.getId(), game) + && controller.canRespond()) { controller.chooseTarget(outcome, target2, source, game); } } @@ -164,7 +170,7 @@ class RiskyMoveFlipCoinEffect extends OneShotEffect { Player chosenOpponent = game.getPlayer(target2.getFirstTarget()); if (!controller.flipCoin(source, game, true)) { if (permanent != null && chosenOpponent != null) { - ContinuousEffect effect = new RiskyMoveCreatureGainControlEffect(Duration.Custom, chosenOpponent.getId()); + ContinuousEffect effect = new RiskyMoveCreatureGainControlEffect(Duration.EndOfGame, chosenOpponent.getId()); effect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(effect, source); game.informPlayers(chosenOpponent.getLogName() + " has gained control of " + permanent.getLogName()); diff --git a/Mage.Sets/src/mage/cards/s/SereneMaster.java b/Mage.Sets/src/mage/cards/s/SereneMaster.java index dfec175229..56629a3f2e 100644 --- a/Mage.Sets/src/mage/cards/s/SereneMaster.java +++ b/Mage.Sets/src/mage/cards/s/SereneMaster.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -30,7 +29,7 @@ import mage.target.targetpointer.FixedTarget; public final class SereneMaster extends CardImpl { public SereneMaster(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.MONK); @@ -83,10 +82,10 @@ class SereneMasterEffect extends OneShotEffect { int newSourcePower = attackingCreature.getPower().getValue(); int newAttackerPower = sourceCreature.getPower().getValue(); ContinuousEffect effect = new SetPowerToughnessTargetEffect(newSourcePower, sourceCreature.getToughness().getValue(), Duration.EndOfCombat); - effect.setTargetPointer(new FixedTarget(source.getSourceId())); + effect.setTargetPointer(new FixedTarget(source.getSourceId(), game)); game.addEffect(effect, source); effect = new SetPowerToughnessTargetEffect(newAttackerPower, attackingCreature.getToughness().getValue(), Duration.EndOfCombat); - effect.setTargetPointer(new FixedTarget(attackingCreature.getId())); + effect.setTargetPointer(new FixedTarget(attackingCreature.getId(), game)); game.addEffect(effect, source); return true; } diff --git a/Mage.Sets/src/mage/cards/s/ShedWeakness.java b/Mage.Sets/src/mage/cards/s/ShedWeakness.java index c2e924c0ed..1ad5728a2a 100644 --- a/Mage.Sets/src/mage/cards/s/ShedWeakness.java +++ b/Mage.Sets/src/mage/cards/s/ShedWeakness.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -71,7 +70,7 @@ class MayRemoveM1M1CouterTargetEffect extends OneShotEffect { if (target.getCounters(game).getCount(CounterType.M1M1) > 0) { if (controller.chooseUse(outcome, "Remove a -1/-1 counter from " + target.getIdName() + "?", source, game)) { Effect effect = new RemoveCounterTargetEffect(CounterType.M1M1.createInstance()); - effect.setTargetPointer(new FixedTarget(target.getId())); + effect.setTargetPointer(new FixedTarget(target.getId(), game)); effect.apply(game, source); } } @@ -84,4 +83,3 @@ class MayRemoveM1M1CouterTargetEffect extends OneShotEffect { return new MayRemoveM1M1CouterTargetEffect(this); } } - diff --git a/Mage.Sets/src/mage/cards/s/ShowOfDominance.java b/Mage.Sets/src/mage/cards/s/ShowOfDominance.java index 1a362d45c6..cfbf79b586 100644 --- a/Mage.Sets/src/mage/cards/s/ShowOfDominance.java +++ b/Mage.Sets/src/mage/cards/s/ShowOfDominance.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -91,7 +90,7 @@ class ShowOfDominanceEffect extends OneShotEffect { } } if (selectedCreature != null) { - FixedTarget target = new FixedTarget(selectedCreature.getId()); + FixedTarget target = new FixedTarget(selectedCreature.getId(), game); Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(4)); effect.setTargetPointer(target); diff --git a/Mage.Sets/src/mage/cards/s/SigilCaptain.java b/Mage.Sets/src/mage/cards/s/SigilCaptain.java index d3de9ccc49..01922dd744 100644 --- a/Mage.Sets/src/mage/cards/s/SigilCaptain.java +++ b/Mage.Sets/src/mage/cards/s/SigilCaptain.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -14,7 +13,6 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -25,12 +23,10 @@ import mage.target.targetpointer.FixedTarget; public final class SigilCaptain extends CardImpl { public SigilCaptain(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{W}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{W}{W}"); this.subtype.add(SubType.RHINO); this.subtype.add(SubType.SOLDIER); - - this.power = new MageInt(3); this.toughness = new MageInt(3); @@ -73,7 +69,7 @@ class SigilCaptainTriggeredAbility extends TriggeredAbilityImpl { && permanent.getPower().getValue() == 1 && permanent.getToughness().getValue() == 1) { for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); + effect.setTargetPointer(new FixedTarget(event.getTargetId(), game)); } return true; } diff --git a/Mage.Sets/src/mage/cards/s/SigilOfValor.java b/Mage.Sets/src/mage/cards/s/SigilOfValor.java index e6102aab63..c166c545d9 100644 --- a/Mage.Sets/src/mage/cards/s/SigilOfValor.java +++ b/Mage.Sets/src/mage/cards/s/SigilOfValor.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -33,7 +32,7 @@ import mage.target.targetpointer.FixedTarget; public final class SigilOfValor extends CardImpl { public SigilOfValor(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); this.subtype.add(SubType.EQUIPMENT); // Whenever equipped creature attacks alone, it gets +1/+1 until end of turn for each other creature you control. @@ -81,7 +80,7 @@ class SigilOfValorTriggeredAbility extends TriggeredAbilityImpl { UUID attackerId = game.getCombat().getAttackers().get(0); if (equipment != null && equipment.isAttachedTo(attackerId)) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(attackerId)); + this.getEffects().get(0).setTargetPointer(new FixedTarget(attackerId, game)); return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java b/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java index 17745fbfe4..97859ef9b3 100644 --- a/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java +++ b/Mage.Sets/src/mage/cards/s/SilverfurPartisan.java @@ -83,7 +83,7 @@ class CreaturesYouControlBecomesTargetTriggeredAbility extends TriggeredAbilityI || object.isSorcery(game)) { if (getTargets().isEmpty()) { for (Effect effect : getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); + effect.setTargetPointer(new FixedTarget(event.getTargetId(), game)); } } return true; diff --git a/Mage.Sets/src/mage/cards/s/SkyfireKirin.java b/Mage.Sets/src/mage/cards/s/SkyfireKirin.java index aee7bfba35..f3061d7995 100644 --- a/Mage.Sets/src/mage/cards/s/SkyfireKirin.java +++ b/Mage.Sets/src/mage/cards/s/SkyfireKirin.java @@ -102,7 +102,7 @@ class SkyfireKirinEffect extends OneShotEffect { } if (targetCreature != null) { ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn); - effect.setTargetPointer(new FixedTarget(targetCreature.getId())); + effect.setTargetPointer(new FixedTarget(targetCreature.getId(), game)); game.addEffect(effect, source); return true; } diff --git a/Mage.Sets/src/mage/cards/s/SokenzanRenegade.java b/Mage.Sets/src/mage/cards/s/SokenzanRenegade.java index 7e699568f6..e51dfa55c2 100644 --- a/Mage.Sets/src/mage/cards/s/SokenzanRenegade.java +++ b/Mage.Sets/src/mage/cards/s/SokenzanRenegade.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -94,8 +93,8 @@ class SokenzanRenegadeEffect extends OneShotEffect { } } if (newController != null) { - ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, newController.getId()); - effect.setTargetPointer(new FixedTarget(sourcePermanent.getId())); + ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfGame, newController.getId()); + effect.setTargetPointer(new FixedTarget(sourcePermanent.getId(), game)); game.addEffect(effect, source); if (!source.isControlledBy(newController.getId())) { game.informPlayers(newController.getLogName() + " got control of " + sourcePermanent.getLogName()); diff --git a/Mage.Sets/src/mage/cards/s/SoulScarMage.java b/Mage.Sets/src/mage/cards/s/SoulScarMage.java index ba360f06b9..48a236ad18 100644 --- a/Mage.Sets/src/mage/cards/s/SoulScarMage.java +++ b/Mage.Sets/src/mage/cards/s/SoulScarMage.java @@ -1,4 +1,3 @@ - package mage.cards.s; import mage.MageInt; @@ -71,7 +70,7 @@ class SoulScarMageDamageReplacementEffect extends ReplacementEffectImpl { Permanent toGetCounters = game.getPermanent(event.getTargetId()); if (toGetCounters != null) { AddCountersTargetEffect addCounters = new AddCountersTargetEffect(CounterType.M1M1.createInstance(), StaticValue.get(event.getAmount())); - addCounters.setTargetPointer(new FixedTarget(toGetCounters.getId())); + addCounters.setTargetPointer(new FixedTarget(toGetCounters.getId(), game)); addCounters.apply(game, source); return true; } diff --git a/Mage.Sets/src/mage/cards/s/SovereignsOfLostAlara.java b/Mage.Sets/src/mage/cards/s/SovereignsOfLostAlara.java index 3e55f7e6b4..32c7082410 100644 --- a/Mage.Sets/src/mage/cards/s/SovereignsOfLostAlara.java +++ b/Mage.Sets/src/mage/cards/s/SovereignsOfLostAlara.java @@ -77,7 +77,7 @@ class CreatureControlledAttacksAloneTriggeredAbility extends TriggeredAbilityImp public boolean checkTrigger(GameEvent event, Game game) { if (game.isActivePlayer(this.controllerId)) { if (game.getCombat().attacksAlone()) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0))); + this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0), game)); return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SpinalGraft.java b/Mage.Sets/src/mage/cards/s/SpinalGraft.java index 5b07b2a3f4..d2079b8f6b 100644 --- a/Mage.Sets/src/mage/cards/s/SpinalGraft.java +++ b/Mage.Sets/src/mage/cards/s/SpinalGraft.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -17,7 +16,6 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -30,7 +28,7 @@ import mage.target.targetpointer.FixedTarget; public final class SpinalGraft extends CardImpl { public SpinalGraft(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); this.subtype.add(SubType.AURA); // Enchant creature @@ -38,10 +36,10 @@ public final class SpinalGraft extends CardImpl { this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); this.addAbility(new EnchantAbility(auraTarget.getTargetName())); - + // Enchanted creature gets +3/+3. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Duration.WhileOnBattlefield))); - + // When enchanted creature becomes the target of a spell or ability, destroy that creature. It can't be regenerated. this.addAbility(new SpinalGraftTriggeredAbility()); } @@ -57,15 +55,15 @@ public final class SpinalGraft extends CardImpl { } class SpinalGraftTriggeredAbility extends TriggeredAbilityImpl { - + public SpinalGraftTriggeredAbility() { super(Zone.BATTLEFIELD, new DestroyTargetEffect(true)); } - + public SpinalGraftTriggeredAbility(final SpinalGraftTriggeredAbility ability) { super(ability); } - + @Override public SpinalGraftTriggeredAbility copy() { return new SpinalGraftTriggeredAbility(this); @@ -75,20 +73,20 @@ class SpinalGraftTriggeredAbility extends TriggeredAbilityImpl { public boolean checkEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.TARGETED; } - + @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanent(sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { UUID enchanted = enchantment.getAttachedTo(); if (event.getTargetId().equals(enchanted)) { - getEffects().get(0).setTargetPointer(new FixedTarget(enchanted)); + getEffects().get(0).setTargetPointer(new FixedTarget(enchanted, game)); return true; } } return false; } - + @Override public String getRule() { return "When enchanted creature becomes the target of a spell or ability, destroy that creature. It can't be regenerated."; diff --git a/Mage.Sets/src/mage/cards/s/Sporogenesis.java b/Mage.Sets/src/mage/cards/s/Sporogenesis.java index 5d3f1461ca..1659defc86 100644 --- a/Mage.Sets/src/mage/cards/s/Sporogenesis.java +++ b/Mage.Sets/src/mage/cards/s/Sporogenesis.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -52,7 +51,7 @@ public final class Sporogenesis extends CardImpl { this.addAbility(new SporogenesisTriggeredAbility()); // When Sporogenesis leaves the battlefield, remove all fungus counters from all creatures. - this.addAbility(new LeavesBattlefieldTriggeredAbility(new SporogenesisRemoveCountersEffect(), false)); + this.addAbility(new LeavesBattlefieldTriggeredAbility(new SporogenesisRemoveCountersEffect(), false)); } private Sporogenesis(final Sporogenesis card) { @@ -94,7 +93,7 @@ class SporogenesisTriggeredAbility extends TriggeredAbilityImpl { && permanent.isCreature(game) && permanent.getCounters(game).containsKey(CounterType.FUNGUS)) { Effect effect = this.getEffects().get(0); - effect.setTargetPointer(new FixedTarget(event.getTargetId())); + effect.setTargetPointer(new FixedTarget(event.getTargetId(), game)); return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SwordOfKaldra.java b/Mage.Sets/src/mage/cards/s/SwordOfKaldra.java index 8db9ab11fa..85702677c7 100644 --- a/Mage.Sets/src/mage/cards/s/SwordOfKaldra.java +++ b/Mage.Sets/src/mage/cards/s/SwordOfKaldra.java @@ -1,4 +1,3 @@ - package mage.cards.s; import mage.abilities.TriggeredAbilityImpl; @@ -71,7 +70,7 @@ class SwordOfKaldraTriggeredAbility extends TriggeredAbilityImpl { if (equipment != null && equipment.getAttachedTo() != null && event.getSourceId().equals(equipment.getAttachedTo())) { - getEffects().setTargetPointer(new FixedTarget(event.getTargetId())); + getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game)); return true; } return false; @@ -79,7 +78,7 @@ class SwordOfKaldraTriggeredAbility extends TriggeredAbilityImpl { @Override public String getTriggerPhrase() { - return "Whenever equipped creature deals damage to a creature, " ; + return "Whenever equipped creature deals damage to a creature, "; } }