From d93475a5bb8b1f5438634196acad6bab1f1833f4 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 11 Sep 2021 18:08:35 -0400 Subject: [PATCH] refactored flashback to remove unnecessary timing rule argument --- .../src/mage/cards/a/AbandonThePost.java | 2 +- Mage.Sets/src/mage/cards/a/AcornHarvest.java | 2 +- .../src/mage/cards/a/AncestralTribute.java | 2 +- Mage.Sets/src/mage/cards/a/AncientGrudge.java | 2 +- .../src/mage/cards/a/AngelfireIgnition.java | 2 +- .../src/mage/cards/a/ArcaneInfusion.java | 2 +- .../src/mage/cards/a/ArmyOfTheDamned.java | 2 +- Mage.Sets/src/mage/cards/a/ArtfulDodge.java | 2 +- .../src/mage/cards/b/BackdraftHellkite.java | 10 +---- Mage.Sets/src/mage/cards/b/BashToBits.java | 2 +- Mage.Sets/src/mage/cards/b/BattleScreech.java | 2 +- Mage.Sets/src/mage/cards/b/BeastAttack.java | 2 +- .../src/mage/cards/b/BlastFromThePast.java | 2 +- .../src/mage/cards/b/BumpInTheNight.java | 2 +- Mage.Sets/src/mage/cards/b/BurningOil.java | 2 +- Mage.Sets/src/mage/cards/c/CabalTherapy.java | 7 ++-- .../src/mage/cards/c/CacklingCounterpart.java | 2 +- .../src/mage/cards/c/CalibratedBlast.java | 2 +- Mage.Sets/src/mage/cards/c/CallOfTheHerd.java | 2 +- Mage.Sets/src/mage/cards/c/CanopyClaws.java | 2 +- Mage.Sets/src/mage/cards/c/CantStayAway.java | 2 +- Mage.Sets/src/mage/cards/c/ChainersEdict.java | 2 +- .../mage/cards/c/ChatterOfTheSquirrel.java | 2 +- .../src/mage/cards/c/ChillOfForeboding.java | 2 +- Mage.Sets/src/mage/cards/c/CoffinPurge.java | 2 +- Mage.Sets/src/mage/cards/c/Conflagrate.java | 2 +- Mage.Sets/src/mage/cards/c/CorpseCobble.java | 2 +- .../src/mage/cards/c/CrawlFromTheCellar.java | 2 +- .../src/mage/cards/c/CreepingRenaissance.java | 2 +- .../src/mage/cards/c/CripplingFatigue.java | 2 +- .../src/mage/cards/c/CroakingCounterpart.java | 2 +- Mage.Sets/src/mage/cards/c/CrushOfWurms.java | 2 +- Mage.Sets/src/mage/cards/d/DeadlyAllure.java | 2 +- Mage.Sets/src/mage/cards/d/DeepAnalysis.java | 2 +- .../src/mage/cards/d/DeepReconnaissance.java | 2 +- Mage.Sets/src/mage/cards/d/DefyGravity.java | 2 +- Mage.Sets/src/mage/cards/d/Dematerialize.java | 2 +- .../src/mage/cards/d/DesperateRavings.java | 2 +- Mage.Sets/src/mage/cards/d/DevilsPlay.java | 2 +- .../src/mage/cards/d/DireStrainRampage.java | 2 +- .../src/mage/cards/d/DiregrafRebirth.java | 2 +- .../src/mage/cards/d/DivineReckoning.java | 2 +- .../src/mage/cards/d/DralnuLichLord.java | 29 ++++++-------- Mage.Sets/src/mage/cards/d/DreadReturn.java | 2 +- Mage.Sets/src/mage/cards/d/DreamTwist.java | 2 +- Mage.Sets/src/mage/cards/d/DryadsRevival.java | 2 +- Mage.Sets/src/mage/cards/e/EarthRift.java | 2 +- Mage.Sets/src/mage/cards/e/EchoOfEons.java | 2 +- .../src/mage/cards/e/ElectricRevelation.java | 2 +- .../src/mage/cards/e/ElephantAmbush.java | 2 +- Mage.Sets/src/mage/cards/e/Embolden.java | 2 +- .../src/mage/cards/e/EngulfingFlames.java | 2 +- .../src/mage/cards/f/FaithfulMending.java | 2 +- .../src/mage/cards/f/FaithlessLooting.java | 2 +- .../src/mage/cards/f/FeelingOfDread.java | 2 +- Mage.Sets/src/mage/cards/f/FerventDenial.java | 2 +- Mage.Sets/src/mage/cards/f/Firebolt.java | 2 +- Mage.Sets/src/mage/cards/f/FirecatBlitz.java | 2 +- .../src/mage/cards/f/FiresOfUndeath.java | 2 +- Mage.Sets/src/mage/cards/f/FlaringPain.java | 2 +- .../src/mage/cards/f/FlashOfDefiance.java | 2 +- .../src/mage/cards/f/FlashOfInsight.java | 2 +- Mage.Sets/src/mage/cards/f/FolkMedicine.java | 2 +- .../src/mage/cards/f/ForbiddenAlchemy.java | 2 +- .../src/mage/cards/g/GalvanicIteration.java | 2 +- Mage.Sets/src/mage/cards/g/GazeOfJustice.java | 2 +- Mage.Sets/src/mage/cards/g/Geistflame.java | 2 +- .../src/mage/cards/g/GhoulcallersHarvest.java | 2 +- Mage.Sets/src/mage/cards/g/GnawToTheBone.java | 2 +- .../src/mage/cards/g/GraspOfPhantoms.java | 2 +- Mage.Sets/src/mage/cards/g/GrizzlyFate.java | 2 +- .../src/mage/cards/h/HomesteadCourage.java | 2 +- Mage.Sets/src/mage/cards/h/HowlingGale.java | 2 +- Mage.Sets/src/mage/cards/h/HungryForMore.java | 2 +- .../src/mage/cards/i/IgniteTheFuture.java | 2 +- .../src/mage/cards/i/IncreasingAmbition.java | 2 +- .../src/mage/cards/i/IncreasingConfusion.java | 2 +- .../src/mage/cards/i/IncreasingDevotion.java | 2 +- .../src/mage/cards/i/IncreasingSavagery.java | 2 +- .../src/mage/cards/i/IncreasingVengeance.java | 2 +- Mage.Sets/src/mage/cards/j/JoinTheDance.java | 2 +- Mage.Sets/src/mage/cards/k/Kaleidoscorch.java | 2 +- .../src/mage/cards/k/KrosanReclamation.java | 2 +- Mage.Sets/src/mage/cards/l/LavaDart.java | 2 +- .../cards/l/LierDiscipleOfTheDrowned.java | 4 +- .../src/mage/cards/l/LightningSurge.java | 2 +- .../src/mage/cards/l/LingeringSouls.java | 2 +- Mage.Sets/src/mage/cards/m/MarshalingCry.java | 2 +- Mage.Sets/src/mage/cards/m/MassDiminish.java | 2 +- .../src/mage/cards/m/MemorysJourney.java | 2 +- .../src/mage/cards/m/MoanOfTheUnhallowed.java | 2 +- .../src/mage/cards/m/MomentaryBlink.java | 2 +- Mage.Sets/src/mage/cards/m/MomentsPeace.java | 2 +- Mage.Sets/src/mage/cards/m/MorbidHunger.java | 2 +- Mage.Sets/src/mage/cards/m/MorgueTheft.java | 2 +- .../src/mage/cards/m/MysticRetrieval.java | 2 +- .../src/mage/cards/m/MysticalTeachings.java | 2 +- .../src/mage/cards/n/NightbirdsClutches.java | 2 +- .../src/mage/cards/p/ParallelEvolution.java | 2 +- Mage.Sets/src/mage/cards/p/PastInFlames.java | 36 +++++++---------- .../src/mage/cards/p/PathToTheFestival.java | 2 +- .../src/mage/cards/p/PrismaticStrands.java | 2 +- .../src/mage/cards/p/PurifyTheGrave.java | 2 +- .../src/mage/cards/r/RallyThePeasants.java | 2 +- .../src/mage/cards/r/RayOfDistortion.java | 2 +- .../src/mage/cards/r/RayOfRevelation.java | 2 +- .../src/mage/cards/r/ReapTheSeagraf.java | 2 +- .../src/mage/cards/r/RecklessCharge.java | 2 +- Mage.Sets/src/mage/cards/r/Recoup.java | 40 ++++++++----------- Mage.Sets/src/mage/cards/r/RiteOfHarmony.java | 2 +- Mage.Sets/src/mage/cards/r/RoarOfTheWurm.java | 2 +- .../src/mage/cards/r/RollingTemblor.java | 2 +- Mage.Sets/src/mage/cards/r/RottenReunion.java | 2 +- Mage.Sets/src/mage/cards/s/SacredFire.java | 2 +- Mage.Sets/src/mage/cards/s/SavingGrasp.java | 2 +- .../src/mage/cards/s/ScorchingMissile.java | 2 +- .../mage/cards/s/ScourAllPossibilities.java | 2 +- .../src/mage/cards/s/SecretsOfTheKey.java | 2 +- Mage.Sets/src/mage/cards/s/SeizeTheDay.java | 2 +- .../src/mage/cards/s/SeverTheBloodline.java | 2 +- .../src/mage/cards/s/SevinnesReclamation.java | 2 +- .../src/mage/cards/s/ShadowbeastSighting.java | 2 +- .../src/mage/cards/s/ShatteredPerception.java | 2 +- .../src/mage/cards/s/SilentDeparture.java | 2 +- Mage.Sets/src/mage/cards/s/SkullFracture.java | 2 +- Mage.Sets/src/mage/cards/s/SmitingHelix.java | 2 +- .../src/mage/cards/s/SnapcasterMage.java | 22 +++------- .../src/mage/cards/s/SpiderSpawning.java | 2 +- Mage.Sets/src/mage/cards/s/SpiritFlare.java | 2 +- .../src/mage/cards/s/StranglingSoot.java | 2 +- Mage.Sets/src/mage/cards/s/StrikeItRich.java | 2 +- Mage.Sets/src/mage/cards/s/SylvanMight.java | 2 +- Mage.Sets/src/mage/cards/t/ThinkTwice.java | 2 +- .../src/mage/cards/t/ThrillOfTheHunt.java | 2 +- .../src/mage/cards/t/TrackersInstincts.java | 2 +- .../src/mage/cards/t/TraitorsClutch.java | 2 +- .../src/mage/cards/t/TravelPreparations.java | 2 +- Mage.Sets/src/mage/cards/t/TurnTheEarth.java | 2 +- Mage.Sets/src/mage/cards/u/UnburialRites.java | 2 +- Mage.Sets/src/mage/cards/v/VolcanicSpray.java | 2 +- .../src/mage/cards/v/VolleyOfBoulders.java | 2 +- Mage.Sets/src/mage/cards/w/WildHunger.java | 2 +- .../abilities/keyword/FlashbackAbility.java | 4 +- Mage/src/main/java/mage/cards/CardImpl.java | 2 +- Utils/keywords.txt | 2 +- 145 files changed, 192 insertions(+), 234 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AbandonThePost.java b/Mage.Sets/src/mage/cards/a/AbandonThePost.java index 267cc544ad..f32e342fc9 100644 --- a/Mage.Sets/src/mage/cards/a/AbandonThePost.java +++ b/Mage.Sets/src/mage/cards/a/AbandonThePost.java @@ -25,7 +25,7 @@ public final class AbandonThePost extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); // Flashback {3}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{3}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{3}{R}"))); } private AbandonThePost(final AbandonThePost card) { diff --git a/Mage.Sets/src/mage/cards/a/AcornHarvest.java b/Mage.Sets/src/mage/cards/a/AcornHarvest.java index c52ef3374c..ccd4e55a21 100644 --- a/Mage.Sets/src/mage/cards/a/AcornHarvest.java +++ b/Mage.Sets/src/mage/cards/a/AcornHarvest.java @@ -26,7 +26,7 @@ public final class AcornHarvest extends CardImpl { this.getSpellAbility().addEffect(new CreateTokenEffect(new SquirrelToken(), 2)); // Flashback-{1}{G} - Pay 3 life. - FlashbackAbility ability = new FlashbackAbility(new ManaCostsImpl("{1}{G}"), TimingRule.SORCERY); + FlashbackAbility ability = new FlashbackAbility(this, new ManaCostsImpl("{1}{G}")); ability.addCost(new PayLifeCost(3)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/a/AncestralTribute.java b/Mage.Sets/src/mage/cards/a/AncestralTribute.java index 28bde5e75a..ba9b95b70c 100644 --- a/Mage.Sets/src/mage/cards/a/AncestralTribute.java +++ b/Mage.Sets/src/mage/cards/a/AncestralTribute.java @@ -27,7 +27,7 @@ public final class AncestralTribute extends CardImpl { this.getSpellAbility().addEffect(new GainLifeEffect((new CardsInControllerGraveyardCount(new FilterCard(), 2)))); // Flashback {9}{W}{W}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{9}{W}{W}{W}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{9}{W}{W}{W}"))); } diff --git a/Mage.Sets/src/mage/cards/a/AncientGrudge.java b/Mage.Sets/src/mage/cards/a/AncientGrudge.java index 5503f190d3..733954463f 100644 --- a/Mage.Sets/src/mage/cards/a/AncientGrudge.java +++ b/Mage.Sets/src/mage/cards/a/AncientGrudge.java @@ -23,7 +23,7 @@ public final class AncientGrudge extends CardImpl { this.getSpellAbility().addTarget(new TargetArtifactPermanent()); // Flashback {G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{G}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{G}"))); } private AncientGrudge(final AncientGrudge card) { diff --git a/Mage.Sets/src/mage/cards/a/AngelfireIgnition.java b/Mage.Sets/src/mage/cards/a/AngelfireIgnition.java index b7c091c891..84d0f7c284 100644 --- a/Mage.Sets/src/mage/cards/a/AngelfireIgnition.java +++ b/Mage.Sets/src/mage/cards/a/AngelfireIgnition.java @@ -42,7 +42,7 @@ public final class AngelfireIgnition extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Flashback {2}{R}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{2}{R}{W}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{2}{R}{W}"))); } private AngelfireIgnition(final AngelfireIgnition card) { diff --git a/Mage.Sets/src/mage/cards/a/ArcaneInfusion.java b/Mage.Sets/src/mage/cards/a/ArcaneInfusion.java index 5bdc4825d7..33cb5d8ca3 100644 --- a/Mage.Sets/src/mage/cards/a/ArcaneInfusion.java +++ b/Mage.Sets/src/mage/cards/a/ArcaneInfusion.java @@ -32,7 +32,7 @@ public final class ArcaneInfusion extends CardImpl { "Put the rest on the bottom of your library in a random order.")); // Flashback {3}{U}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{3}{U}{R}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{3}{U}{R}"))); } private ArcaneInfusion(final ArcaneInfusion card) { diff --git a/Mage.Sets/src/mage/cards/a/ArmyOfTheDamned.java b/Mage.Sets/src/mage/cards/a/ArmyOfTheDamned.java index 08285b4742..a220f66c4e 100644 --- a/Mage.Sets/src/mage/cards/a/ArmyOfTheDamned.java +++ b/Mage.Sets/src/mage/cards/a/ArmyOfTheDamned.java @@ -23,7 +23,7 @@ public final class ArmyOfTheDamned extends CardImpl { this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken(), 13, true, false)); // Flashback {7}{B}{B}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{7}{B}{B}{B}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{7}{B}{B}{B}"))); } private ArmyOfTheDamned(final ArmyOfTheDamned card) { diff --git a/Mage.Sets/src/mage/cards/a/ArtfulDodge.java b/Mage.Sets/src/mage/cards/a/ArtfulDodge.java index 7f31e547ad..c2d8926523 100644 --- a/Mage.Sets/src/mage/cards/a/ArtfulDodge.java +++ b/Mage.Sets/src/mage/cards/a/ArtfulDodge.java @@ -25,7 +25,7 @@ public final class ArtfulDodge extends CardImpl { this.getSpellAbility().addEffect(new CantBeBlockedTargetEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Flashback {U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{U}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{U}"))); } private ArtfulDodge(final ArtfulDodge card) { diff --git a/Mage.Sets/src/mage/cards/b/BackdraftHellkite.java b/Mage.Sets/src/mage/cards/b/BackdraftHellkite.java index e500f89c21..712d08a104 100644 --- a/Mage.Sets/src/mage/cards/b/BackdraftHellkite.java +++ b/Mage.Sets/src/mage/cards/b/BackdraftHellkite.java @@ -93,15 +93,7 @@ class BackdraftHellkiteEffect extends ContinuousEffectImpl { if (card == null) { return; } - FlashbackAbility ability = null; - if (card.isInstant(game)) { - ability = new FlashbackAbility(card.getManaCost(), TimingRule.INSTANT); - } else if (card.isSorcery(game)) { - ability = new FlashbackAbility(card.getManaCost(), TimingRule.SORCERY); - } - if (ability == null) { - return; - } + FlashbackAbility ability = new FlashbackAbility(card, card.getManaCost()); ability.setSourceId(cardId); ability.setControllerId(card.getOwnerId()); game.getState().addOtherAbility(card, ability); diff --git a/Mage.Sets/src/mage/cards/b/BashToBits.java b/Mage.Sets/src/mage/cards/b/BashToBits.java index 07a23d0c60..5f1db4474e 100644 --- a/Mage.Sets/src/mage/cards/b/BashToBits.java +++ b/Mage.Sets/src/mage/cards/b/BashToBits.java @@ -27,7 +27,7 @@ public final class BashToBits extends CardImpl { Target target = new TargetArtifactPermanent(); this.getSpellAbility().addTarget(target); // Flashback {4}{R}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{R}{R}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{4}{R}{R}"))); } private BashToBits(final BashToBits card) { diff --git a/Mage.Sets/src/mage/cards/b/BattleScreech.java b/Mage.Sets/src/mage/cards/b/BattleScreech.java index 3922c90a5c..feb673697c 100644 --- a/Mage.Sets/src/mage/cards/b/BattleScreech.java +++ b/Mage.Sets/src/mage/cards/b/BattleScreech.java @@ -37,7 +37,7 @@ public final class BattleScreech extends CardImpl { this.getSpellAbility().addEffect(new CreateTokenEffect(new BirdToken(), 2)); // Flashback-Tap three untapped white creatures you control. - this.addAbility(new FlashbackAbility(new TapTargetCost(new TargetControlledCreaturePermanent(3,3, filter, true)), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new TapTargetCost(new TargetControlledCreaturePermanent(3,3, filter, true)))); } private BattleScreech(final BattleScreech card) { diff --git a/Mage.Sets/src/mage/cards/b/BeastAttack.java b/Mage.Sets/src/mage/cards/b/BeastAttack.java index b33e287fee..3f90496f98 100644 --- a/Mage.Sets/src/mage/cards/b/BeastAttack.java +++ b/Mage.Sets/src/mage/cards/b/BeastAttack.java @@ -24,7 +24,7 @@ public final class BeastAttack extends CardImpl { this.getSpellAbility().addEffect(new CreateTokenEffect(new BeastToken2())); // Flashback {2}{G}{G}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{G}{G}{G}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{2}{G}{G}{G}"))); } private BeastAttack(final BeastAttack card) { diff --git a/Mage.Sets/src/mage/cards/b/BlastFromThePast.java b/Mage.Sets/src/mage/cards/b/BlastFromThePast.java index 72af5d013e..97bdd6bc46 100644 --- a/Mage.Sets/src/mage/cards/b/BlastFromThePast.java +++ b/Mage.Sets/src/mage/cards/b/BlastFromThePast.java @@ -35,7 +35,7 @@ public final class BlastFromThePast extends CardImpl { // Kicker {2}{R} this.addAbility(new KickerAbility("{2}{R}")); // Flashback {3}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{R}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{3}{R}"))); // Buyback {4}{R} this.addAbility(new BuybackAbility("{4}{R}")); diff --git a/Mage.Sets/src/mage/cards/b/BumpInTheNight.java b/Mage.Sets/src/mage/cards/b/BumpInTheNight.java index 70072d56b6..4bb42bf639 100644 --- a/Mage.Sets/src/mage/cards/b/BumpInTheNight.java +++ b/Mage.Sets/src/mage/cards/b/BumpInTheNight.java @@ -24,7 +24,7 @@ public final class BumpInTheNight extends CardImpl { this.getSpellAbility().addTarget(new TargetOpponent()); // Flashback {5}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{R}"))); } private BumpInTheNight(final BumpInTheNight card) { diff --git a/Mage.Sets/src/mage/cards/b/BurningOil.java b/Mage.Sets/src/mage/cards/b/BurningOil.java index 0eeaa8c0cd..2106bcf3a7 100644 --- a/Mage.Sets/src/mage/cards/b/BurningOil.java +++ b/Mage.Sets/src/mage/cards/b/BurningOil.java @@ -25,7 +25,7 @@ public final class BurningOil extends CardImpl { this.getSpellAbility().addTarget(new TargetAttackingOrBlockingCreature()); this.getSpellAbility().addEffect(new DamageTargetEffect(3)); // Flashback {3}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{W}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{3}{W}"))); } private BurningOil(final BurningOil card) { diff --git a/Mage.Sets/src/mage/cards/c/CabalTherapy.java b/Mage.Sets/src/mage/cards/c/CabalTherapy.java index 597a6da161..59cd97eef5 100644 --- a/Mage.Sets/src/mage/cards/c/CabalTherapy.java +++ b/Mage.Sets/src/mage/cards/c/CabalTherapy.java @@ -12,7 +12,6 @@ import mage.cards.CardSetInfo; import mage.cards.Cards; import mage.constants.CardType; import mage.constants.Outcome; -import mage.constants.TimingRule; import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; @@ -36,9 +35,9 @@ public final class CabalTherapy extends CardImpl { this.getSpellAbility().addEffect(new CabalTherapyEffect()); // Flashback-Sacrifice a creature. - this.addAbility(new FlashbackAbility( - new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT, true)), - TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new SacrificeTargetCost( + new TargetControlledCreaturePermanent(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT) + ))); } private CabalTherapy(final CabalTherapy card) { diff --git a/Mage.Sets/src/mage/cards/c/CacklingCounterpart.java b/Mage.Sets/src/mage/cards/c/CacklingCounterpart.java index 92121d3c46..290d6ae92c 100644 --- a/Mage.Sets/src/mage/cards/c/CacklingCounterpart.java +++ b/Mage.Sets/src/mage/cards/c/CacklingCounterpart.java @@ -24,7 +24,7 @@ public final class CacklingCounterpart extends CardImpl { this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); // Flashback {5}{U}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{U}{U}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{U}{U}"))); } private CacklingCounterpart(final CacklingCounterpart card) { diff --git a/Mage.Sets/src/mage/cards/c/CalibratedBlast.java b/Mage.Sets/src/mage/cards/c/CalibratedBlast.java index 320cb6f805..adf7d89564 100644 --- a/Mage.Sets/src/mage/cards/c/CalibratedBlast.java +++ b/Mage.Sets/src/mage/cards/c/CalibratedBlast.java @@ -28,7 +28,7 @@ public final class CalibratedBlast extends CardImpl { this.getSpellAbility().addEffect(new CalibratedBlastEffect()); // Flashback {3}{R}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{3}{R}{R}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{3}{R}{R}"))); } private CalibratedBlast(final CalibratedBlast card) { diff --git a/Mage.Sets/src/mage/cards/c/CallOfTheHerd.java b/Mage.Sets/src/mage/cards/c/CallOfTheHerd.java index 7a3b3cb739..f5973d64a6 100644 --- a/Mage.Sets/src/mage/cards/c/CallOfTheHerd.java +++ b/Mage.Sets/src/mage/cards/c/CallOfTheHerd.java @@ -24,7 +24,7 @@ public final class CallOfTheHerd extends CardImpl { // Create a 3/3 green Elephant creature token. this.getSpellAbility().addEffect(new CreateTokenEffect(new ElephantToken())); // Flashback {3}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{3}{G}"))); } private CallOfTheHerd(final CallOfTheHerd card) { diff --git a/Mage.Sets/src/mage/cards/c/CanopyClaws.java b/Mage.Sets/src/mage/cards/c/CanopyClaws.java index 1fb66de446..5fe1dae8e8 100644 --- a/Mage.Sets/src/mage/cards/c/CanopyClaws.java +++ b/Mage.Sets/src/mage/cards/c/CanopyClaws.java @@ -26,7 +26,7 @@ public final class CanopyClaws extends CardImpl { this.getSpellAbility().addEffect(new LoseAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Flashback {G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{G}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{G}"))); } private CanopyClaws(final CanopyClaws card) { diff --git a/Mage.Sets/src/mage/cards/c/CantStayAway.java b/Mage.Sets/src/mage/cards/c/CantStayAway.java index 0d72ab474c..813896ec60 100644 --- a/Mage.Sets/src/mage/cards/c/CantStayAway.java +++ b/Mage.Sets/src/mage/cards/c/CantStayAway.java @@ -44,7 +44,7 @@ public final class CantStayAway extends CardImpl { this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); // Flashback {3}{W}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{3}{W}{B}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{3}{W}{B}"))); } private CantStayAway(final CantStayAway card) { diff --git a/Mage.Sets/src/mage/cards/c/ChainersEdict.java b/Mage.Sets/src/mage/cards/c/ChainersEdict.java index b4956b0b7d..c9b3423661 100644 --- a/Mage.Sets/src/mage/cards/c/ChainersEdict.java +++ b/Mage.Sets/src/mage/cards/c/ChainersEdict.java @@ -26,7 +26,7 @@ public final class ChainersEdict extends CardImpl { this.getSpellAbility().addTarget(new TargetPlayer()); // Flashback {5}{B}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{B}{B}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{B}{B}"))); } private ChainersEdict(final ChainersEdict card) { diff --git a/Mage.Sets/src/mage/cards/c/ChatterOfTheSquirrel.java b/Mage.Sets/src/mage/cards/c/ChatterOfTheSquirrel.java index 0357a1e387..f0ab9129de 100644 --- a/Mage.Sets/src/mage/cards/c/ChatterOfTheSquirrel.java +++ b/Mage.Sets/src/mage/cards/c/ChatterOfTheSquirrel.java @@ -25,7 +25,7 @@ public final class ChatterOfTheSquirrel extends CardImpl { this.getSpellAbility().addEffect(new CreateTokenEffect(new SquirrelToken())); // Flashback {1}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{1}{G}"))); } private ChatterOfTheSquirrel(final ChatterOfTheSquirrel card) { diff --git a/Mage.Sets/src/mage/cards/c/ChillOfForeboding.java b/Mage.Sets/src/mage/cards/c/ChillOfForeboding.java index aa52573d3a..ed7c2f47eb 100644 --- a/Mage.Sets/src/mage/cards/c/ChillOfForeboding.java +++ b/Mage.Sets/src/mage/cards/c/ChillOfForeboding.java @@ -23,7 +23,7 @@ public final class ChillOfForeboding extends CardImpl { this.getSpellAbility().addEffect(new MillCardsEachPlayerEffect(5, TargetController.ANY)); // Flashback {7}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{7}{U}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{7}{U}"))); } private ChillOfForeboding(final ChillOfForeboding card) { diff --git a/Mage.Sets/src/mage/cards/c/CoffinPurge.java b/Mage.Sets/src/mage/cards/c/CoffinPurge.java index 8bd9edf701..60cd3162de 100644 --- a/Mage.Sets/src/mage/cards/c/CoffinPurge.java +++ b/Mage.Sets/src/mage/cards/c/CoffinPurge.java @@ -26,7 +26,7 @@ public final class CoffinPurge extends CardImpl { this.getSpellAbility().addTarget(new TargetCardInGraveyard()); // Flashback {B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{B}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{B}"))); } private CoffinPurge(final CoffinPurge card) { diff --git a/Mage.Sets/src/mage/cards/c/Conflagrate.java b/Mage.Sets/src/mage/cards/c/Conflagrate.java index 0c9ed5d6fb..f988a7b82d 100644 --- a/Mage.Sets/src/mage/cards/c/Conflagrate.java +++ b/Mage.Sets/src/mage/cards/c/Conflagrate.java @@ -33,7 +33,7 @@ public final class Conflagrate extends CardImpl { this.getSpellAbility().addTarget(new TargetAnyTargetAmount(xValue)); // Flashback-{R}{R}, Discard X cards. - Ability ability = new FlashbackAbility(new ManaCostsImpl("{R}{R}"), TimingRule.SORCERY); + Ability ability = new FlashbackAbility(this, new ManaCostsImpl("{R}{R}")); ability.addCost(new DiscardXTargetCost(new FilterCard("cards"))); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/c/CorpseCobble.java b/Mage.Sets/src/mage/cards/c/CorpseCobble.java index 8cd490110b..91d695c606 100644 --- a/Mage.Sets/src/mage/cards/c/CorpseCobble.java +++ b/Mage.Sets/src/mage/cards/c/CorpseCobble.java @@ -38,7 +38,7 @@ public final class CorpseCobble extends CardImpl { this.getSpellAbility().addEffect(new CorpseCobbleEffect()); // Flashback {3}{U}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{3}{U}{B}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{3}{U}{B}"))); } private CorpseCobble(final CorpseCobble card) { diff --git a/Mage.Sets/src/mage/cards/c/CrawlFromTheCellar.java b/Mage.Sets/src/mage/cards/c/CrawlFromTheCellar.java index 804b31d1c9..84d2f9f38d 100644 --- a/Mage.Sets/src/mage/cards/c/CrawlFromTheCellar.java +++ b/Mage.Sets/src/mage/cards/c/CrawlFromTheCellar.java @@ -37,7 +37,7 @@ public final class CrawlFromTheCellar extends CardImpl { this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent(0, 1, filter, false)); // Flashback {3}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{3}{B}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{3}{B}"))); } private CrawlFromTheCellar(final CrawlFromTheCellar card) { diff --git a/Mage.Sets/src/mage/cards/c/CreepingRenaissance.java b/Mage.Sets/src/mage/cards/c/CreepingRenaissance.java index 7edb1ee3f1..10f09e1f1d 100644 --- a/Mage.Sets/src/mage/cards/c/CreepingRenaissance.java +++ b/Mage.Sets/src/mage/cards/c/CreepingRenaissance.java @@ -33,7 +33,7 @@ public final class CreepingRenaissance extends CardImpl { this.getSpellAbility().addEffect(new CreepingRenaissanceEffect()); // Flashback {5}{G}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{G}{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{G}{G}"))); } private CreepingRenaissance(final CreepingRenaissance card) { diff --git a/Mage.Sets/src/mage/cards/c/CripplingFatigue.java b/Mage.Sets/src/mage/cards/c/CripplingFatigue.java index ac4a7e05f6..5a8a8e0b1c 100644 --- a/Mage.Sets/src/mage/cards/c/CripplingFatigue.java +++ b/Mage.Sets/src/mage/cards/c/CripplingFatigue.java @@ -28,7 +28,7 @@ public final class CripplingFatigue extends CardImpl { this.getSpellAbility().addEffect(new BoostTargetEffect(-2, -2, Duration.EndOfTurn)); // Flashback-{1}{B}, Pay 3 life - Ability ability = new FlashbackAbility(new ManaCostsImpl("{1}{B}"), TimingRule.SORCERY); + Ability ability = new FlashbackAbility(this, new ManaCostsImpl("{1}{B}")); ability.addCost(new PayLifeCost(3)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/c/CroakingCounterpart.java b/Mage.Sets/src/mage/cards/c/CroakingCounterpart.java index 5fb85942c3..a7172e5821 100644 --- a/Mage.Sets/src/mage/cards/c/CroakingCounterpart.java +++ b/Mage.Sets/src/mage/cards/c/CroakingCounterpart.java @@ -42,7 +42,7 @@ public final class CroakingCounterpart extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); // Flashback {3}{G}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{3}{G}{U}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{3}{G}{U}"))); } private CroakingCounterpart(final CroakingCounterpart card) { diff --git a/Mage.Sets/src/mage/cards/c/CrushOfWurms.java b/Mage.Sets/src/mage/cards/c/CrushOfWurms.java index 208402f61b..68b48a02f9 100644 --- a/Mage.Sets/src/mage/cards/c/CrushOfWurms.java +++ b/Mage.Sets/src/mage/cards/c/CrushOfWurms.java @@ -23,7 +23,7 @@ public final class CrushOfWurms extends CardImpl { // Put three 6/6 green Wurm creature tokens onto the battlefield. this.getSpellAbility().addEffect(new CreateTokenEffect(new WurmToken(), 3)); // Flashback {9}{G}{G}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{9}{G}{G}{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{9}{G}{G}{G}"))); } private CrushOfWurms(final CrushOfWurms card) { diff --git a/Mage.Sets/src/mage/cards/d/DeadlyAllure.java b/Mage.Sets/src/mage/cards/d/DeadlyAllure.java index 3beea7c54c..a7550779d9 100644 --- a/Mage.Sets/src/mage/cards/d/DeadlyAllure.java +++ b/Mage.Sets/src/mage/cards/d/DeadlyAllure.java @@ -33,7 +33,7 @@ public final class DeadlyAllure extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Flashback {G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{G}"))); } diff --git a/Mage.Sets/src/mage/cards/d/DeepAnalysis.java b/Mage.Sets/src/mage/cards/d/DeepAnalysis.java index 8b9341d4ac..b9b51f2bd2 100644 --- a/Mage.Sets/src/mage/cards/d/DeepAnalysis.java +++ b/Mage.Sets/src/mage/cards/d/DeepAnalysis.java @@ -26,7 +26,7 @@ public final class DeepAnalysis extends CardImpl { this.getSpellAbility().addTarget(new TargetPlayer()); // Flashback-{1}{U}, Pay 3 life. - FlashbackAbility ability = new FlashbackAbility(new ManaCostsImpl("{1}{U}"), TimingRule.SORCERY); + FlashbackAbility ability = new FlashbackAbility(this, new ManaCostsImpl("{1}{U}")); ability.addCost(new PayLifeCost(3)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/d/DeepReconnaissance.java b/Mage.Sets/src/mage/cards/d/DeepReconnaissance.java index 651eed5e88..14c9c7c6ce 100644 --- a/Mage.Sets/src/mage/cards/d/DeepReconnaissance.java +++ b/Mage.Sets/src/mage/cards/d/DeepReconnaissance.java @@ -26,7 +26,7 @@ public final class DeepReconnaissance extends CardImpl { // Search your library for a basic land card and put that card onto the battlefield tapped. Then shuffle your library. this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true, true)); // Flashback {4}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{4}{G}"))); } private DeepReconnaissance(final DeepReconnaissance card) { diff --git a/Mage.Sets/src/mage/cards/d/DefyGravity.java b/Mage.Sets/src/mage/cards/d/DefyGravity.java index 468aa3f829..7c94505a3d 100644 --- a/Mage.Sets/src/mage/cards/d/DefyGravity.java +++ b/Mage.Sets/src/mage/cards/d/DefyGravity.java @@ -26,7 +26,7 @@ public final class DefyGravity extends CardImpl { this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Flashback {U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{U}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{U}"))); } private DefyGravity(final DefyGravity card) { diff --git a/Mage.Sets/src/mage/cards/d/Dematerialize.java b/Mage.Sets/src/mage/cards/d/Dematerialize.java index 289d9aacf1..8a42a17c84 100644 --- a/Mage.Sets/src/mage/cards/d/Dematerialize.java +++ b/Mage.Sets/src/mage/cards/d/Dematerialize.java @@ -25,7 +25,7 @@ public final class Dematerialize extends CardImpl { this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent()); // Flashback {5}{U}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{U}{U}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{U}{U}"))); } private Dematerialize(final Dematerialize card) { diff --git a/Mage.Sets/src/mage/cards/d/DesperateRavings.java b/Mage.Sets/src/mage/cards/d/DesperateRavings.java index b36ff25a4d..868562aad8 100644 --- a/Mage.Sets/src/mage/cards/d/DesperateRavings.java +++ b/Mage.Sets/src/mage/cards/d/DesperateRavings.java @@ -29,7 +29,7 @@ public final class DesperateRavings extends CardImpl { // Draw two cards, then discard a card at random. this.getSpellAbility().addEffect(new DesperateRavingsEffect()); // Flashback {2}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{U}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{2}{U}"))); } private DesperateRavings(final DesperateRavings card) { diff --git a/Mage.Sets/src/mage/cards/d/DevilsPlay.java b/Mage.Sets/src/mage/cards/d/DevilsPlay.java index a6b959ccbd..15b3150a29 100644 --- a/Mage.Sets/src/mage/cards/d/DevilsPlay.java +++ b/Mage.Sets/src/mage/cards/d/DevilsPlay.java @@ -26,7 +26,7 @@ public final class DevilsPlay extends CardImpl { this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.REGULAR)); this.getSpellAbility().addTarget(new TargetAnyTarget()); // Flashback {X}{R}{R}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{X}{R}{R}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{X}{R}{R}{R}"))); } private DevilsPlay(final DevilsPlay card) { diff --git a/Mage.Sets/src/mage/cards/d/DireStrainRampage.java b/Mage.Sets/src/mage/cards/d/DireStrainRampage.java index 5b4e90df05..1b9f3feaea 100644 --- a/Mage.Sets/src/mage/cards/d/DireStrainRampage.java +++ b/Mage.Sets/src/mage/cards/d/DireStrainRampage.java @@ -50,7 +50,7 @@ public final class DireStrainRampage extends CardImpl { this.getSpellAbility().addTarget(new TargetPermanent(filter)); // Flashback {3}{R}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{3}{R}{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{3}{R}{G}"))); } private DireStrainRampage(final DireStrainRampage card) { diff --git a/Mage.Sets/src/mage/cards/d/DiregrafRebirth.java b/Mage.Sets/src/mage/cards/d/DiregrafRebirth.java index 3634044f72..6a7d1186ac 100644 --- a/Mage.Sets/src/mage/cards/d/DiregrafRebirth.java +++ b/Mage.Sets/src/mage/cards/d/DiregrafRebirth.java @@ -37,7 +37,7 @@ public final class DiregrafRebirth extends CardImpl { this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); // Flashback {5}{B}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{5}{B}{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{5}{B}{G}"))); } private DiregrafRebirth(final DiregrafRebirth card) { diff --git a/Mage.Sets/src/mage/cards/d/DivineReckoning.java b/Mage.Sets/src/mage/cards/d/DivineReckoning.java index bf59ff23b4..946a25e980 100644 --- a/Mage.Sets/src/mage/cards/d/DivineReckoning.java +++ b/Mage.Sets/src/mage/cards/d/DivineReckoning.java @@ -35,7 +35,7 @@ public final class DivineReckoning extends CardImpl { this.getSpellAbility().addEffect(new DivineReckoningEffect()); // Flashback {5}{W}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{W}{W}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{W}{W}"))); } private DivineReckoning(final DivineReckoning card) { diff --git a/Mage.Sets/src/mage/cards/d/DralnuLichLord.java b/Mage.Sets/src/mage/cards/d/DralnuLichLord.java index 1470d9d36d..fc97de4668 100644 --- a/Mage.Sets/src/mage/cards/d/DralnuLichLord.java +++ b/Mage.Sets/src/mage/cards/d/DralnuLichLord.java @@ -1,7 +1,5 @@ - package mage.cards.d; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -23,21 +21,24 @@ import mage.game.events.DamageEvent; import mage.game.events.GameEvent; import mage.target.common.TargetCardInYourGraveyard; +import java.util.UUID; + /** - * * @author emerald000 */ public final class DralnuLichLord extends CardImpl { - + private static final FilterCard filter = new FilterCard("instant or sorcery card in your graveyard"); + static { filter.add(Predicates.or( CardType.INSTANT.getPredicate(), - CardType.SORCERY.getPredicate())); + CardType.SORCERY.getPredicate() + )); } public DralnuLichLord(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{B}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.ZOMBIE); this.subtype.add(SubType.WIZARD); @@ -46,10 +47,10 @@ public final class DralnuLichLord extends CardImpl { this.toughness = new MageInt(3); // If damage would be dealt to Dralnu, Lich Lord, sacrifice that many permanents instead. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DralnuLichLordReplacementEffect())); - + this.addAbility(new SimpleStaticAbility(new DralnuLichLordReplacementEffect())); + // {tap}: Target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DralnuLichLordFlashbackEffect(), new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(new DralnuLichLordFlashbackEffect(), new TapSourceCost()); ability.addTarget(new TargetCardInYourGraveyard(filter)); this.addAbility(ability); } @@ -85,7 +86,7 @@ class DralnuLichLordReplacementEffect extends ReplacementEffectImpl { public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.DAMAGE_PERMANENT; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { return event.getTargetId().equals(source.getSourceId()); @@ -117,13 +118,7 @@ class DralnuLichLordFlashbackEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { Card card = game.getCard(targetPointer.getFirst(game, source)); if (card != null) { - FlashbackAbility ability; - if (card.isInstant(game)) { - ability = new FlashbackAbility(card.getManaCost(), TimingRule.INSTANT); - } - else { - ability = new FlashbackAbility(card.getManaCost(), TimingRule.SORCERY); - } + FlashbackAbility ability = new FlashbackAbility(card, card.getManaCost()); ability.setSourceId(card.getId()); ability.setControllerId(card.getOwnerId()); game.getState().addOtherAbility(card, ability); diff --git a/Mage.Sets/src/mage/cards/d/DreadReturn.java b/Mage.Sets/src/mage/cards/d/DreadReturn.java index f68946f58a..76d8a35e5c 100644 --- a/Mage.Sets/src/mage/cards/d/DreadReturn.java +++ b/Mage.Sets/src/mage/cards/d/DreadReturn.java @@ -30,7 +30,7 @@ public final class DreadReturn extends CardImpl { this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); // Flashback-Sacrifice three creatures. - this.addAbility(new FlashbackAbility(new SacrificeTargetCost(new TargetControlledPermanent(3, filter)), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new SacrificeTargetCost(new TargetControlledPermanent(3, filter)))); } private DreadReturn(final DreadReturn card) { diff --git a/Mage.Sets/src/mage/cards/d/DreamTwist.java b/Mage.Sets/src/mage/cards/d/DreamTwist.java index 96eca41bc0..5aadffe592 100644 --- a/Mage.Sets/src/mage/cards/d/DreamTwist.java +++ b/Mage.Sets/src/mage/cards/d/DreamTwist.java @@ -25,7 +25,7 @@ public final class DreamTwist extends CardImpl { this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(3)); // Flashback {1}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{U}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{1}{U}"))); } private DreamTwist(final DreamTwist card) { diff --git a/Mage.Sets/src/mage/cards/d/DryadsRevival.java b/Mage.Sets/src/mage/cards/d/DryadsRevival.java index e49405fc4b..cdecd89d77 100644 --- a/Mage.Sets/src/mage/cards/d/DryadsRevival.java +++ b/Mage.Sets/src/mage/cards/d/DryadsRevival.java @@ -24,7 +24,7 @@ public final class DryadsRevival extends CardImpl { this.getSpellAbility().addTarget(new TargetCardInYourGraveyard()); // Flashback {4}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{4}{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{4}{G}"))); } private DryadsRevival(final DryadsRevival card) { diff --git a/Mage.Sets/src/mage/cards/e/EarthRift.java b/Mage.Sets/src/mage/cards/e/EarthRift.java index 3a8b6ff66b..812dab060f 100644 --- a/Mage.Sets/src/mage/cards/e/EarthRift.java +++ b/Mage.Sets/src/mage/cards/e/EarthRift.java @@ -25,7 +25,7 @@ public final class EarthRift extends CardImpl { this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetLandPermanent()); // Flashback {5}{R}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{R}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{R}{R}"))); } private EarthRift(final EarthRift card) { diff --git a/Mage.Sets/src/mage/cards/e/EchoOfEons.java b/Mage.Sets/src/mage/cards/e/EchoOfEons.java index c831c4b65f..742b095f6e 100644 --- a/Mage.Sets/src/mage/cards/e/EchoOfEons.java +++ b/Mage.Sets/src/mage/cards/e/EchoOfEons.java @@ -27,7 +27,7 @@ public final class EchoOfEons extends CardImpl { this.getSpellAbility().addEffect(effect); // Flashback {2}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{U}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{2}{U}"))); } private EchoOfEons(final EchoOfEons card) { diff --git a/Mage.Sets/src/mage/cards/e/ElectricRevelation.java b/Mage.Sets/src/mage/cards/e/ElectricRevelation.java index 363f68c596..7396bf6733 100644 --- a/Mage.Sets/src/mage/cards/e/ElectricRevelation.java +++ b/Mage.Sets/src/mage/cards/e/ElectricRevelation.java @@ -26,7 +26,7 @@ public final class ElectricRevelation extends CardImpl { this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2)); // Flashback {3}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{3}{R}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{3}{R}"))); } private ElectricRevelation(final ElectricRevelation card) { diff --git a/Mage.Sets/src/mage/cards/e/ElephantAmbush.java b/Mage.Sets/src/mage/cards/e/ElephantAmbush.java index 454ea23557..493271104f 100644 --- a/Mage.Sets/src/mage/cards/e/ElephantAmbush.java +++ b/Mage.Sets/src/mage/cards/e/ElephantAmbush.java @@ -24,7 +24,7 @@ public final class ElephantAmbush extends CardImpl { // Create a 3/3 green Elephant creature token. this.getSpellAbility().addEffect(new CreateTokenEffect(new ElephantToken())); // Flashback {6}{G}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{6}{G}{G}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{6}{G}{G}"))); } private ElephantAmbush(final ElephantAmbush card) { diff --git a/Mage.Sets/src/mage/cards/e/Embolden.java b/Mage.Sets/src/mage/cards/e/Embolden.java index bc28d57311..ab93ab68df 100644 --- a/Mage.Sets/src/mage/cards/e/Embolden.java +++ b/Mage.Sets/src/mage/cards/e/Embolden.java @@ -26,7 +26,7 @@ public final class Embolden extends CardImpl { this.getSpellAbility().addTarget(new TargetAnyTargetAmount(4)); // Flashback {1}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{W}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{1}{W}"))); } diff --git a/Mage.Sets/src/mage/cards/e/EngulfingFlames.java b/Mage.Sets/src/mage/cards/e/EngulfingFlames.java index f837f06ad3..7f81b63295 100644 --- a/Mage.Sets/src/mage/cards/e/EngulfingFlames.java +++ b/Mage.Sets/src/mage/cards/e/EngulfingFlames.java @@ -28,7 +28,7 @@ public final class EngulfingFlames extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new CantRegenerateTargetEffect(Duration.EndOfTurn, "It")); // Flashback {3}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{R}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{3}{R}"))); } private EngulfingFlames(final EngulfingFlames card) { diff --git a/Mage.Sets/src/mage/cards/f/FaithfulMending.java b/Mage.Sets/src/mage/cards/f/FaithfulMending.java index 7025bd611c..ee079d3841 100644 --- a/Mage.Sets/src/mage/cards/f/FaithfulMending.java +++ b/Mage.Sets/src/mage/cards/f/FaithfulMending.java @@ -26,7 +26,7 @@ public final class FaithfulMending extends CardImpl { this.getSpellAbility().addEffect(new DiscardControllerEffect(2).concatBy(", then")); // Flashback {1}{W}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{1}{W}{U}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{1}{W}{U}"))); } private FaithfulMending(final FaithfulMending card) { diff --git a/Mage.Sets/src/mage/cards/f/FaithlessLooting.java b/Mage.Sets/src/mage/cards/f/FaithlessLooting.java index 754a3b292a..c2c63fd555 100644 --- a/Mage.Sets/src/mage/cards/f/FaithlessLooting.java +++ b/Mage.Sets/src/mage/cards/f/FaithlessLooting.java @@ -23,7 +23,7 @@ public final class FaithlessLooting extends CardImpl { // Draw two cards, then discard two cards. this.getSpellAbility().addEffect(new DrawDiscardControllerEffect(2,2)); // Flashback {2}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{2}{R}"))); } private FaithlessLooting(final FaithlessLooting card) { diff --git a/Mage.Sets/src/mage/cards/f/FeelingOfDread.java b/Mage.Sets/src/mage/cards/f/FeelingOfDread.java index 7193345862..a47b8bf95b 100644 --- a/Mage.Sets/src/mage/cards/f/FeelingOfDread.java +++ b/Mage.Sets/src/mage/cards/f/FeelingOfDread.java @@ -26,7 +26,7 @@ public final class FeelingOfDread extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); // Flashback {1}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{U}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{1}{U}"))); } private FeelingOfDread(final FeelingOfDread card) { diff --git a/Mage.Sets/src/mage/cards/f/FerventDenial.java b/Mage.Sets/src/mage/cards/f/FerventDenial.java index 7c20d75425..d7c4fc8f21 100644 --- a/Mage.Sets/src/mage/cards/f/FerventDenial.java +++ b/Mage.Sets/src/mage/cards/f/FerventDenial.java @@ -25,7 +25,7 @@ public final class FerventDenial extends CardImpl { this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addTarget(new TargetSpell()); // Flashback {5}{U}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{U}{U}"),TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{U}{U}"))); } private FerventDenial(final FerventDenial card) { diff --git a/Mage.Sets/src/mage/cards/f/Firebolt.java b/Mage.Sets/src/mage/cards/f/Firebolt.java index 13c0f66375..a012d1cd26 100644 --- a/Mage.Sets/src/mage/cards/f/Firebolt.java +++ b/Mage.Sets/src/mage/cards/f/Firebolt.java @@ -25,7 +25,7 @@ public final class Firebolt extends CardImpl { this.getSpellAbility().addEffect(new DamageTargetEffect(2)); this.getSpellAbility().addTarget(new TargetAnyTarget()); // Flashback {4}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{4}{R}"))); } private Firebolt(final Firebolt card) { diff --git a/Mage.Sets/src/mage/cards/f/FirecatBlitz.java b/Mage.Sets/src/mage/cards/f/FirecatBlitz.java index ea733f26ed..c6527f4225 100644 --- a/Mage.Sets/src/mage/cards/f/FirecatBlitz.java +++ b/Mage.Sets/src/mage/cards/f/FirecatBlitz.java @@ -41,7 +41,7 @@ public final class FirecatBlitz extends CardImpl { this.getSpellAbility().addEffect(new FirecatBlitzEffect()); // Flashback-{R}{R}, Sacrifice X Mountains. - Ability ability = new FlashbackAbility(new SacrificeXTargetCost(filter), TimingRule.SORCERY); + Ability ability = new FlashbackAbility(this, new SacrificeXTargetCost(filter)); ability.addManaCost(new ManaCostsImpl("{R}{R}")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/f/FiresOfUndeath.java b/Mage.Sets/src/mage/cards/f/FiresOfUndeath.java index 987c925344..7d8ceb162a 100644 --- a/Mage.Sets/src/mage/cards/f/FiresOfUndeath.java +++ b/Mage.Sets/src/mage/cards/f/FiresOfUndeath.java @@ -25,7 +25,7 @@ public final class FiresOfUndeath extends CardImpl { this.getSpellAbility().addTarget(new TargetAnyTarget()); this.getSpellAbility().addEffect(new DamageTargetEffect(2)); // Flashback {5}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{B}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{B}"))); } private FiresOfUndeath(final FiresOfUndeath card) { diff --git a/Mage.Sets/src/mage/cards/f/FlaringPain.java b/Mage.Sets/src/mage/cards/f/FlaringPain.java index dc37fbd259..4c80330baa 100644 --- a/Mage.Sets/src/mage/cards/f/FlaringPain.java +++ b/Mage.Sets/src/mage/cards/f/FlaringPain.java @@ -24,7 +24,7 @@ public final class FlaringPain extends CardImpl { // Damage can't be prevented this turn. this.getSpellAbility().addEffect(new DamageCantBePreventedEffect(Duration.EndOfTurn, "Damage can't be prevented this turn", false, false)); // Flashback {R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{R}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{R}"))); } private FlaringPain(final FlaringPain card) { diff --git a/Mage.Sets/src/mage/cards/f/FlashOfDefiance.java b/Mage.Sets/src/mage/cards/f/FlashOfDefiance.java index b63c718e0e..8635f90a1d 100644 --- a/Mage.Sets/src/mage/cards/f/FlashOfDefiance.java +++ b/Mage.Sets/src/mage/cards/f/FlashOfDefiance.java @@ -38,7 +38,7 @@ public final class FlashOfDefiance extends CardImpl { this.getSpellAbility().addEffect(new CantBlockAllEffect(filter, Duration.EndOfTurn)); // Flashback-{1}{R}, Pay 3 life. - Ability ability = new FlashbackAbility(new ManaCostsImpl("{1}{R}"), TimingRule.SORCERY); + Ability ability = new FlashbackAbility(this, new ManaCostsImpl("{1}{R}")); ability.addCost(new PayLifeCost(3)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/f/FlashOfInsight.java b/Mage.Sets/src/mage/cards/f/FlashOfInsight.java index 6e1a3c210a..c0eee07e07 100644 --- a/Mage.Sets/src/mage/cards/f/FlashOfInsight.java +++ b/Mage.Sets/src/mage/cards/f/FlashOfInsight.java @@ -37,7 +37,7 @@ public final class FlashOfInsight extends CardImpl { this.getSpellAbility().addEffect(new FlashOfInsightEffect()); // Flashback-{1}{U}, Exile X blue cards from your graveyard. - Ability ability = new FlashbackAbility(new ManaCostsImpl("{1}{U}"), TimingRule.INSTANT); + Ability ability = new FlashbackAbility(this, new ManaCostsImpl("{1}{U}")); FilterCard filter = new FilterCard("blue cards from your graveyard"); filter.add(new ColorPredicate(ObjectColor.BLUE)); filter.add(Predicates.not(new CardIdPredicate(getId()))); diff --git a/Mage.Sets/src/mage/cards/f/FolkMedicine.java b/Mage.Sets/src/mage/cards/f/FolkMedicine.java index 84634147aa..aead1d9791 100644 --- a/Mage.Sets/src/mage/cards/f/FolkMedicine.java +++ b/Mage.Sets/src/mage/cards/f/FolkMedicine.java @@ -25,7 +25,7 @@ public final class FolkMedicine extends CardImpl { DynamicValue amount = new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE); this.getSpellAbility().addEffect(new GainLifeEffect(amount)); // Flashback {1}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{W}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{1}{W}"))); } private FolkMedicine(final FolkMedicine card) { diff --git a/Mage.Sets/src/mage/cards/f/ForbiddenAlchemy.java b/Mage.Sets/src/mage/cards/f/ForbiddenAlchemy.java index 0c7335a50e..cdc2e92ae5 100644 --- a/Mage.Sets/src/mage/cards/f/ForbiddenAlchemy.java +++ b/Mage.Sets/src/mage/cards/f/ForbiddenAlchemy.java @@ -26,7 +26,7 @@ public final class ForbiddenAlchemy extends CardImpl { StaticFilters.FILTER_CARD, Zone.GRAVEYARD, false, false, false, Zone.HAND, false)); // Flashback {6}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{6}{B}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{6}{B}"))); } private ForbiddenAlchemy(final ForbiddenAlchemy card) { diff --git a/Mage.Sets/src/mage/cards/g/GalvanicIteration.java b/Mage.Sets/src/mage/cards/g/GalvanicIteration.java index f275674801..892dbebc04 100644 --- a/Mage.Sets/src/mage/cards/g/GalvanicIteration.java +++ b/Mage.Sets/src/mage/cards/g/GalvanicIteration.java @@ -29,7 +29,7 @@ public final class GalvanicIteration extends CardImpl { this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new GalvanicIterationAbility())); // Flashback {1}{U}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{1}{U}{R}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{1}{U}{R}"))); } private GalvanicIteration(final GalvanicIteration card) { diff --git a/Mage.Sets/src/mage/cards/g/GazeOfJustice.java b/Mage.Sets/src/mage/cards/g/GazeOfJustice.java index d7b02929bd..12647541dd 100644 --- a/Mage.Sets/src/mage/cards/g/GazeOfJustice.java +++ b/Mage.Sets/src/mage/cards/g/GazeOfJustice.java @@ -41,7 +41,7 @@ public final class GazeOfJustice extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Flashback {5}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{W}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{W}"))); } private GazeOfJustice(final GazeOfJustice card) { diff --git a/Mage.Sets/src/mage/cards/g/Geistflame.java b/Mage.Sets/src/mage/cards/g/Geistflame.java index e783c6ba0a..7d8c774cd6 100644 --- a/Mage.Sets/src/mage/cards/g/Geistflame.java +++ b/Mage.Sets/src/mage/cards/g/Geistflame.java @@ -25,7 +25,7 @@ public final class Geistflame extends CardImpl { this.getSpellAbility().addTarget(new TargetAnyTarget()); // Flashback {3}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{R}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{3}{R}"))); } private Geistflame(final Geistflame card) { diff --git a/Mage.Sets/src/mage/cards/g/GhoulcallersHarvest.java b/Mage.Sets/src/mage/cards/g/GhoulcallersHarvest.java index f33a3f7245..e4173903f2 100644 --- a/Mage.Sets/src/mage/cards/g/GhoulcallersHarvest.java +++ b/Mage.Sets/src/mage/cards/g/GhoulcallersHarvest.java @@ -39,7 +39,7 @@ public final class GhoulcallersHarvest extends CardImpl { this.getSpellAbility().addHint(hint); // Flashback {3}{B}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{3}{B}{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{3}{B}{G}"))); } private GhoulcallersHarvest(final GhoulcallersHarvest card) { diff --git a/Mage.Sets/src/mage/cards/g/GnawToTheBone.java b/Mage.Sets/src/mage/cards/g/GnawToTheBone.java index 288092df27..26949fb457 100644 --- a/Mage.Sets/src/mage/cards/g/GnawToTheBone.java +++ b/Mage.Sets/src/mage/cards/g/GnawToTheBone.java @@ -26,7 +26,7 @@ public final class GnawToTheBone extends CardImpl { this.getSpellAbility().addEffect(new GainLifeEffect(value)); // Flashback {2}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{G}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{2}{G}"))); } private GnawToTheBone(final GnawToTheBone card) { diff --git a/Mage.Sets/src/mage/cards/g/GraspOfPhantoms.java b/Mage.Sets/src/mage/cards/g/GraspOfPhantoms.java index da3ca2980b..31fb236694 100644 --- a/Mage.Sets/src/mage/cards/g/GraspOfPhantoms.java +++ b/Mage.Sets/src/mage/cards/g/GraspOfPhantoms.java @@ -26,7 +26,7 @@ public final class GraspOfPhantoms extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Flashback {7}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{7}{U}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{7}{U}"))); } private GraspOfPhantoms(final GraspOfPhantoms card) { diff --git a/Mage.Sets/src/mage/cards/g/GrizzlyFate.java b/Mage.Sets/src/mage/cards/g/GrizzlyFate.java index 7a79d495b1..fe9b432feb 100644 --- a/Mage.Sets/src/mage/cards/g/GrizzlyFate.java +++ b/Mage.Sets/src/mage/cards/g/GrizzlyFate.java @@ -33,7 +33,7 @@ public final class GrizzlyFate extends CardImpl { this.getSpellAbility().addEffect(effect); // Flashback {5}{G}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{G}{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{G}{G}"))); } private GrizzlyFate(final GrizzlyFate card) { diff --git a/Mage.Sets/src/mage/cards/h/HomesteadCourage.java b/Mage.Sets/src/mage/cards/h/HomesteadCourage.java index 6e1986628e..2b01159683 100644 --- a/Mage.Sets/src/mage/cards/h/HomesteadCourage.java +++ b/Mage.Sets/src/mage/cards/h/HomesteadCourage.java @@ -31,7 +31,7 @@ public final class HomesteadCourage extends CardImpl { this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); // Flashback {W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{W}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{W}"))); } private HomesteadCourage(final HomesteadCourage card) { diff --git a/Mage.Sets/src/mage/cards/h/HowlingGale.java b/Mage.Sets/src/mage/cards/h/HowlingGale.java index 1ec9b6e4a5..7c8ae9fae7 100644 --- a/Mage.Sets/src/mage/cards/h/HowlingGale.java +++ b/Mage.Sets/src/mage/cards/h/HowlingGale.java @@ -36,7 +36,7 @@ public final class HowlingGale extends CardImpl { effect.setText("and each player"); this.getSpellAbility().addEffect(effect); // Flashback {1}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{G}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{1}{G}"))); } private HowlingGale(final HowlingGale card) { diff --git a/Mage.Sets/src/mage/cards/h/HungryForMore.java b/Mage.Sets/src/mage/cards/h/HungryForMore.java index 3e52774302..2c91750e36 100644 --- a/Mage.Sets/src/mage/cards/h/HungryForMore.java +++ b/Mage.Sets/src/mage/cards/h/HungryForMore.java @@ -31,7 +31,7 @@ public final class HungryForMore extends CardImpl { this.getSpellAbility().addEffect(new HungryForMoreEffect()); // Flashback {1}{B}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{1}{B}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{1}{B}{R}"))); } private HungryForMore(final HungryForMore card) { diff --git a/Mage.Sets/src/mage/cards/i/IgniteTheFuture.java b/Mage.Sets/src/mage/cards/i/IgniteTheFuture.java index 9fdf7a6aaa..4883b16f65 100644 --- a/Mage.Sets/src/mage/cards/i/IgniteTheFuture.java +++ b/Mage.Sets/src/mage/cards/i/IgniteTheFuture.java @@ -28,7 +28,7 @@ public final class IgniteTheFuture extends CardImpl { this.getSpellAbility().addEffect(new IgniteTheFutureEffect()); // Flashback {7}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{7}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{7}{R}"))); } private IgniteTheFuture(final IgniteTheFuture card) { diff --git a/Mage.Sets/src/mage/cards/i/IncreasingAmbition.java b/Mage.Sets/src/mage/cards/i/IncreasingAmbition.java index eae6ce33ed..f32b6cfb44 100644 --- a/Mage.Sets/src/mage/cards/i/IncreasingAmbition.java +++ b/Mage.Sets/src/mage/cards/i/IncreasingAmbition.java @@ -37,7 +37,7 @@ public final class IncreasingAmbition extends CardImpl { )); // Flashback {7}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{7}{B}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{7}{B}"))); } private IncreasingAmbition(final IncreasingAmbition card) { diff --git a/Mage.Sets/src/mage/cards/i/IncreasingConfusion.java b/Mage.Sets/src/mage/cards/i/IncreasingConfusion.java index 410c76d2e7..7e6f63dd96 100644 --- a/Mage.Sets/src/mage/cards/i/IncreasingConfusion.java +++ b/Mage.Sets/src/mage/cards/i/IncreasingConfusion.java @@ -29,7 +29,7 @@ public final class IncreasingConfusion extends CardImpl { this.getSpellAbility().addTarget(new TargetPlayer()); // Flashback {X}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{X}{U}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{X}{U}"))); } private IncreasingConfusion(final IncreasingConfusion card) { diff --git a/Mage.Sets/src/mage/cards/i/IncreasingDevotion.java b/Mage.Sets/src/mage/cards/i/IncreasingDevotion.java index 7c78a06360..fa318c4bdd 100644 --- a/Mage.Sets/src/mage/cards/i/IncreasingDevotion.java +++ b/Mage.Sets/src/mage/cards/i/IncreasingDevotion.java @@ -29,7 +29,7 @@ public final class IncreasingDevotion extends CardImpl { this.getSpellAbility().addEffect(new IncreasingDevotionEffect()); // Flashback {7}{W}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{7}{W}{W}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{7}{W}{W}"))); } private IncreasingDevotion(final IncreasingDevotion card) { diff --git a/Mage.Sets/src/mage/cards/i/IncreasingSavagery.java b/Mage.Sets/src/mage/cards/i/IncreasingSavagery.java index 096e5b95f1..5eddaae842 100644 --- a/Mage.Sets/src/mage/cards/i/IncreasingSavagery.java +++ b/Mage.Sets/src/mage/cards/i/IncreasingSavagery.java @@ -30,7 +30,7 @@ public final class IncreasingSavagery extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Flashback {5}{G}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{G}{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{G}{G}"))); } private IncreasingSavagery(final IncreasingSavagery card) { diff --git a/Mage.Sets/src/mage/cards/i/IncreasingVengeance.java b/Mage.Sets/src/mage/cards/i/IncreasingVengeance.java index 166fef9d02..78b4b1d479 100644 --- a/Mage.Sets/src/mage/cards/i/IncreasingVengeance.java +++ b/Mage.Sets/src/mage/cards/i/IncreasingVengeance.java @@ -41,7 +41,7 @@ public final class IncreasingVengeance extends CardImpl { this.getSpellAbility().addTarget(target); // Flashback {3}{R}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{R}{R}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{3}{R}{R}"))); } private IncreasingVengeance(final IncreasingVengeance card) { diff --git a/Mage.Sets/src/mage/cards/j/JoinTheDance.java b/Mage.Sets/src/mage/cards/j/JoinTheDance.java index 78f62ccdd8..a62b20cd8d 100644 --- a/Mage.Sets/src/mage/cards/j/JoinTheDance.java +++ b/Mage.Sets/src/mage/cards/j/JoinTheDance.java @@ -23,7 +23,7 @@ public final class JoinTheDance extends CardImpl { this.getSpellAbility().addEffect(new CreateTokenEffect(new HumanToken(), 2)); // Flashback {3}{G}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{3}{G}{W}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{3}{G}{W}"))); } private JoinTheDance(final JoinTheDance card) { diff --git a/Mage.Sets/src/mage/cards/k/Kaleidoscorch.java b/Mage.Sets/src/mage/cards/k/Kaleidoscorch.java index 8eaf49672e..8bee5084d5 100644 --- a/Mage.Sets/src/mage/cards/k/Kaleidoscorch.java +++ b/Mage.Sets/src/mage/cards/k/Kaleidoscorch.java @@ -28,7 +28,7 @@ public final class Kaleidoscorch extends CardImpl { this.getSpellAbility().setAbilityWord(AbilityWord.CONVERGE); // Flashback {4}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{4}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{4}{R}"))); } private Kaleidoscorch(final Kaleidoscorch card) { diff --git a/Mage.Sets/src/mage/cards/k/KrosanReclamation.java b/Mage.Sets/src/mage/cards/k/KrosanReclamation.java index fb95f86803..5673055830 100644 --- a/Mage.Sets/src/mage/cards/k/KrosanReclamation.java +++ b/Mage.Sets/src/mage/cards/k/KrosanReclamation.java @@ -26,7 +26,7 @@ public final class KrosanReclamation extends CardImpl { this.getSpellAbility().addTarget(new TargetCardInTargetPlayersGraveyard(2)); // Flashback {1}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{G}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{1}{G}"))); } private KrosanReclamation(final KrosanReclamation card) { diff --git a/Mage.Sets/src/mage/cards/l/LavaDart.java b/Mage.Sets/src/mage/cards/l/LavaDart.java index b6228d7b6d..8842cc5176 100644 --- a/Mage.Sets/src/mage/cards/l/LavaDart.java +++ b/Mage.Sets/src/mage/cards/l/LavaDart.java @@ -34,7 +34,7 @@ public final class LavaDart extends CardImpl { this.getSpellAbility().addTarget(new TargetAnyTarget()); // Flashback-Sacrifice a Mountain. - this.addAbility(new FlashbackAbility(new SacrificeTargetCost(new TargetControlledPermanent(filter)), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new SacrificeTargetCost(new TargetControlledPermanent(filter)))); } private LavaDart(final LavaDart card) { diff --git a/Mage.Sets/src/mage/cards/l/LierDiscipleOfTheDrowned.java b/Mage.Sets/src/mage/cards/l/LierDiscipleOfTheDrowned.java index 87af1a11a5..2eb3748b1a 100644 --- a/Mage.Sets/src/mage/cards/l/LierDiscipleOfTheDrowned.java +++ b/Mage.Sets/src/mage/cards/l/LierDiscipleOfTheDrowned.java @@ -104,9 +104,7 @@ class LierDiscipleOfTheDrownedFlashbackEffect extends ContinuousEffectImpl { return false; } for (Card card : player.getGraveyard().getCards(StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, game)) { - Ability ability = new FlashbackAbility( - card.getManaCost(), card.isInstant(game) ? TimingRule.INSTANT : TimingRule.SORCERY - ); + Ability ability = new FlashbackAbility(card, card.getManaCost()); ability.setSourceId(card.getId()); ability.setControllerId(card.getOwnerId()); game.getState().addOtherAbility(card, ability); diff --git a/Mage.Sets/src/mage/cards/l/LightningSurge.java b/Mage.Sets/src/mage/cards/l/LightningSurge.java index 3d2aec4148..0c2bdf6f2e 100644 --- a/Mage.Sets/src/mage/cards/l/LightningSurge.java +++ b/Mage.Sets/src/mage/cards/l/LightningSurge.java @@ -33,7 +33,7 @@ public final class LightningSurge extends CardImpl { this.getSpellAbility().addEffect(effect); // Flashback {5}{R}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{R}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{R}{R}"))); } private LightningSurge(final LightningSurge card) { diff --git a/Mage.Sets/src/mage/cards/l/LingeringSouls.java b/Mage.Sets/src/mage/cards/l/LingeringSouls.java index 51d53922b2..109d50883a 100644 --- a/Mage.Sets/src/mage/cards/l/LingeringSouls.java +++ b/Mage.Sets/src/mage/cards/l/LingeringSouls.java @@ -23,7 +23,7 @@ public final class LingeringSouls extends CardImpl { // Create two 1/1 white Spirit creature tokens with flying. this.getSpellAbility().addEffect(new CreateTokenEffect(new SpiritWhiteToken(), 2)); // Flashback {1}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{B}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{1}{B}"))); } private LingeringSouls(final LingeringSouls card) { diff --git a/Mage.Sets/src/mage/cards/m/MarshalingCry.java b/Mage.Sets/src/mage/cards/m/MarshalingCry.java index e02d033bcd..7a2535de65 100644 --- a/Mage.Sets/src/mage/cards/m/MarshalingCry.java +++ b/Mage.Sets/src/mage/cards/m/MarshalingCry.java @@ -36,7 +36,7 @@ public final class MarshalingCry extends CardImpl { this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}"))); // Flashback {3}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{W}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{3}{W}"))); } private MarshalingCry(final MarshalingCry card) { diff --git a/Mage.Sets/src/mage/cards/m/MassDiminish.java b/Mage.Sets/src/mage/cards/m/MassDiminish.java index d11f660cbe..4cc90e77d0 100644 --- a/Mage.Sets/src/mage/cards/m/MassDiminish.java +++ b/Mage.Sets/src/mage/cards/m/MassDiminish.java @@ -31,7 +31,7 @@ public final class MassDiminish extends CardImpl { this.getSpellAbility().addTarget(new TargetPlayer()); // Flashback {3}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{U}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{3}{U}"))); } private MassDiminish(final MassDiminish card) { diff --git a/Mage.Sets/src/mage/cards/m/MemorysJourney.java b/Mage.Sets/src/mage/cards/m/MemorysJourney.java index cd3dba5db4..9ed78043b0 100644 --- a/Mage.Sets/src/mage/cards/m/MemorysJourney.java +++ b/Mage.Sets/src/mage/cards/m/MemorysJourney.java @@ -26,7 +26,7 @@ public final class MemorysJourney extends CardImpl { this.getSpellAbility().addTarget(new TargetCardInTargetPlayersGraveyard(3)); // Flashback {G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{G}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{G}"))); } private MemorysJourney(final MemorysJourney card) { diff --git a/Mage.Sets/src/mage/cards/m/MoanOfTheUnhallowed.java b/Mage.Sets/src/mage/cards/m/MoanOfTheUnhallowed.java index 3e59ada135..4b3ccb090c 100644 --- a/Mage.Sets/src/mage/cards/m/MoanOfTheUnhallowed.java +++ b/Mage.Sets/src/mage/cards/m/MoanOfTheUnhallowed.java @@ -24,7 +24,7 @@ public final class MoanOfTheUnhallowed extends CardImpl { this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken(), 2)); // Flashback {5}{B}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{B}{B}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{B}{B}"))); } private MoanOfTheUnhallowed(final MoanOfTheUnhallowed card) { diff --git a/Mage.Sets/src/mage/cards/m/MomentaryBlink.java b/Mage.Sets/src/mage/cards/m/MomentaryBlink.java index b1e127743e..16da351539 100644 --- a/Mage.Sets/src/mage/cards/m/MomentaryBlink.java +++ b/Mage.Sets/src/mage/cards/m/MomentaryBlink.java @@ -26,7 +26,7 @@ public final class MomentaryBlink extends CardImpl { this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect(false, false)); // Flashback {3}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{U}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{3}{U}"))); } private MomentaryBlink(final MomentaryBlink card) { diff --git a/Mage.Sets/src/mage/cards/m/MomentsPeace.java b/Mage.Sets/src/mage/cards/m/MomentsPeace.java index ffc81e051a..6fa6f598d5 100644 --- a/Mage.Sets/src/mage/cards/m/MomentsPeace.java +++ b/Mage.Sets/src/mage/cards/m/MomentsPeace.java @@ -24,7 +24,7 @@ public final class MomentsPeace extends CardImpl { this.getSpellAbility().addEffect(new PreventAllDamageByAllPermanentsEffect(Duration.EndOfTurn, true)); // Flashback {2}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{G}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{2}{G}"))); } private MomentsPeace(final MomentsPeace card) { diff --git a/Mage.Sets/src/mage/cards/m/MorbidHunger.java b/Mage.Sets/src/mage/cards/m/MorbidHunger.java index ef554322be..60453a85ee 100644 --- a/Mage.Sets/src/mage/cards/m/MorbidHunger.java +++ b/Mage.Sets/src/mage/cards/m/MorbidHunger.java @@ -27,7 +27,7 @@ public final class MorbidHunger extends CardImpl { this.getSpellAbility().addTarget(new TargetAnyTarget()); this.getSpellAbility().addEffect(new GainLifeEffect(3)); // Flashback {7}{B}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{7}{B}{B}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{7}{B}{B}"))); } diff --git a/Mage.Sets/src/mage/cards/m/MorgueTheft.java b/Mage.Sets/src/mage/cards/m/MorgueTheft.java index 2063f2697a..c2046bc60c 100644 --- a/Mage.Sets/src/mage/cards/m/MorgueTheft.java +++ b/Mage.Sets/src/mage/cards/m/MorgueTheft.java @@ -24,7 +24,7 @@ public final class MorgueTheft extends CardImpl { this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE)); // Flashback {4}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{B}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{4}{B}"))); } diff --git a/Mage.Sets/src/mage/cards/m/MysticRetrieval.java b/Mage.Sets/src/mage/cards/m/MysticRetrieval.java index 0bdf0f1860..36fd978faf 100644 --- a/Mage.Sets/src/mage/cards/m/MysticRetrieval.java +++ b/Mage.Sets/src/mage/cards/m/MysticRetrieval.java @@ -34,7 +34,7 @@ public final class MysticRetrieval extends CardImpl { this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); // Flashback {2}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{2}{R}"))); } private MysticRetrieval(final MysticRetrieval card) { diff --git a/Mage.Sets/src/mage/cards/m/MysticalTeachings.java b/Mage.Sets/src/mage/cards/m/MysticalTeachings.java index 5f2075c478..3678e99a79 100644 --- a/Mage.Sets/src/mage/cards/m/MysticalTeachings.java +++ b/Mage.Sets/src/mage/cards/m/MysticalTeachings.java @@ -37,7 +37,7 @@ public final class MysticalTeachings extends CardImpl { // Search your library for an instant card or a card with flash, reveal it, and put it into your hand. Then shuffle your library. this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true)); // Flashback {5}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{B}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{B}"))); } private MysticalTeachings(final MysticalTeachings card) { diff --git a/Mage.Sets/src/mage/cards/n/NightbirdsClutches.java b/Mage.Sets/src/mage/cards/n/NightbirdsClutches.java index 64cf3b93a3..d5a6ade10e 100644 --- a/Mage.Sets/src/mage/cards/n/NightbirdsClutches.java +++ b/Mage.Sets/src/mage/cards/n/NightbirdsClutches.java @@ -26,7 +26,7 @@ public final class NightbirdsClutches extends CardImpl { this.getSpellAbility().addEffect(new CantBlockTargetEffect(Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); // Flashback {3}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{3}{R}"))); } private NightbirdsClutches(final NightbirdsClutches card) { diff --git a/Mage.Sets/src/mage/cards/p/ParallelEvolution.java b/Mage.Sets/src/mage/cards/p/ParallelEvolution.java index 764fb26385..46ce42596c 100644 --- a/Mage.Sets/src/mage/cards/p/ParallelEvolution.java +++ b/Mage.Sets/src/mage/cards/p/ParallelEvolution.java @@ -31,7 +31,7 @@ public final class ParallelEvolution extends CardImpl { this.getSpellAbility().addEffect(new ParallelEvolutionEffect()); // Flashback {4}{G}{G}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{G}{G}{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{4}{G}{G}{G}"))); } private ParallelEvolution(final ParallelEvolution card) { diff --git a/Mage.Sets/src/mage/cards/p/PastInFlames.java b/Mage.Sets/src/mage/cards/p/PastInFlames.java index 509c98ec84..4477908a72 100644 --- a/Mage.Sets/src/mage/cards/p/PastInFlames.java +++ b/Mage.Sets/src/mage/cards/p/PastInFlames.java @@ -22,12 +22,11 @@ public final class PastInFlames extends CardImpl { public PastInFlames(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}"); - // Each instant and sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. this.getSpellAbility().addEffect(new PastInFlamesEffect()); // Flashback {4}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{4}{R}"))); } @@ -73,25 +72,18 @@ class PastInFlamesEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.getGraveyard().stream().filter((cardId) -> (affectedObjectList.contains(new MageObjectReference(cardId, game)))).forEachOrdered((cardId) -> { - Card card = game.getCard(cardId); - if (card != null) { - FlashbackAbility ability = null; - if (card.isInstant(game)) { - ability = new FlashbackAbility(card.getManaCost(), TimingRule.INSTANT); - } else if (card.isSorcery(game)) { - ability = new FlashbackAbility(card.getManaCost(), TimingRule.SORCERY); - } - if (ability != null) { - ability.setSourceId(cardId); - ability.setControllerId(card.getOwnerId()); - game.getState().addOtherAbility(card, ability); - } - } - }); - return true; + if (player == null) { + return false; } - return false; + player.getGraveyard().stream().filter((cardId) -> (affectedObjectList.contains(new MageObjectReference(cardId, game)))).forEachOrdered((cardId) -> { + Card card = game.getCard(cardId); + if (card != null) { + FlashbackAbility ability = new FlashbackAbility(card, card.getManaCost()); + ability.setSourceId(cardId); + ability.setControllerId(card.getOwnerId()); + game.getState().addOtherAbility(card, ability); + } + }); + return true; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/p/PathToTheFestival.java b/Mage.Sets/src/mage/cards/p/PathToTheFestival.java index 2b9bb72719..3964b46d1e 100644 --- a/Mage.Sets/src/mage/cards/p/PathToTheFestival.java +++ b/Mage.Sets/src/mage/cards/p/PathToTheFestival.java @@ -39,7 +39,7 @@ public final class PathToTheFestival extends CardImpl { this.getSpellAbility().addHint(DomainHint.instance); // Flashback {4}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{4}{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{4}{G}"))); } private PathToTheFestival(final PathToTheFestival card) { diff --git a/Mage.Sets/src/mage/cards/p/PrismaticStrands.java b/Mage.Sets/src/mage/cards/p/PrismaticStrands.java index ac8e713ca2..803605e2a2 100644 --- a/Mage.Sets/src/mage/cards/p/PrismaticStrands.java +++ b/Mage.Sets/src/mage/cards/p/PrismaticStrands.java @@ -44,7 +44,7 @@ public final class PrismaticStrands extends CardImpl { this.getSpellAbility().addEffect(new PrismaticStrandsEffect()); // Flashback-Tap an untapped white creature you control. - this.addAbility(new FlashbackAbility(new TapTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false)), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new TapTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false)))); } private PrismaticStrands(final PrismaticStrands card) { diff --git a/Mage.Sets/src/mage/cards/p/PurifyTheGrave.java b/Mage.Sets/src/mage/cards/p/PurifyTheGrave.java index 4c75313121..cca1e6de82 100644 --- a/Mage.Sets/src/mage/cards/p/PurifyTheGrave.java +++ b/Mage.Sets/src/mage/cards/p/PurifyTheGrave.java @@ -26,7 +26,7 @@ public final class PurifyTheGrave extends CardImpl { this.getSpellAbility().addTarget(new TargetCardInGraveyard()); // Flashback {W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{W}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{W}"))); } private PurifyTheGrave(final PurifyTheGrave card) { diff --git a/Mage.Sets/src/mage/cards/r/RallyThePeasants.java b/Mage.Sets/src/mage/cards/r/RallyThePeasants.java index eadf036525..5f75b77de9 100644 --- a/Mage.Sets/src/mage/cards/r/RallyThePeasants.java +++ b/Mage.Sets/src/mage/cards/r/RallyThePeasants.java @@ -24,7 +24,7 @@ public final class RallyThePeasants extends CardImpl { this.getSpellAbility().addEffect(new BoostControlledEffect(2, 0, Duration.EndOfTurn)); // Flashback {2}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{R}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{2}{R}"))); } private RallyThePeasants(final RallyThePeasants card) { diff --git a/Mage.Sets/src/mage/cards/r/RayOfDistortion.java b/Mage.Sets/src/mage/cards/r/RayOfDistortion.java index fabf4c432c..05d26a6554 100644 --- a/Mage.Sets/src/mage/cards/r/RayOfDistortion.java +++ b/Mage.Sets/src/mage/cards/r/RayOfDistortion.java @@ -26,7 +26,7 @@ public final class RayOfDistortion extends CardImpl { this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT)); // Flashback {4}{W}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{W}{W}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{4}{W}{W}"))); } private RayOfDistortion(final RayOfDistortion card) { diff --git a/Mage.Sets/src/mage/cards/r/RayOfRevelation.java b/Mage.Sets/src/mage/cards/r/RayOfRevelation.java index 701114b54d..c6747afdf4 100644 --- a/Mage.Sets/src/mage/cards/r/RayOfRevelation.java +++ b/Mage.Sets/src/mage/cards/r/RayOfRevelation.java @@ -25,7 +25,7 @@ public final class RayOfRevelation extends CardImpl { this.getSpellAbility().addTarget(new TargetEnchantmentPermanent()); this.getSpellAbility().addEffect(new DestroyTargetEffect()); // Flashback {G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{G}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{G}"))); } private RayOfRevelation(final RayOfRevelation card) { diff --git a/Mage.Sets/src/mage/cards/r/ReapTheSeagraf.java b/Mage.Sets/src/mage/cards/r/ReapTheSeagraf.java index 8562bc2241..8cfa7c141a 100644 --- a/Mage.Sets/src/mage/cards/r/ReapTheSeagraf.java +++ b/Mage.Sets/src/mage/cards/r/ReapTheSeagraf.java @@ -19,7 +19,7 @@ public final class ReapTheSeagraf extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}"); this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken())); - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{U}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{4}{U}"))); } private ReapTheSeagraf(final ReapTheSeagraf card) { diff --git a/Mage.Sets/src/mage/cards/r/RecklessCharge.java b/Mage.Sets/src/mage/cards/r/RecklessCharge.java index 0208a3d353..4b1fcb8c42 100644 --- a/Mage.Sets/src/mage/cards/r/RecklessCharge.java +++ b/Mage.Sets/src/mage/cards/r/RecklessCharge.java @@ -31,7 +31,7 @@ public final class RecklessCharge extends CardImpl { ).setText("and gains haste until end of turn")); // Flashback {2}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{2}{R}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{2}{R}"))); } private RecklessCharge(final RecklessCharge card) { diff --git a/Mage.Sets/src/mage/cards/r/Recoup.java b/Mage.Sets/src/mage/cards/r/Recoup.java index bb144aa111..d6aaf7223f 100644 --- a/Mage.Sets/src/mage/cards/r/Recoup.java +++ b/Mage.Sets/src/mage/cards/r/Recoup.java @@ -1,7 +1,5 @@ - package mage.cards.r; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.ContinuousEffectImpl; @@ -9,38 +7,34 @@ import mage.abilities.keyword.FlashbackAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.constants.TimingRule; +import mage.constants.*; import mage.filter.FilterCard; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; +import java.util.UUID; + /** - * * @author cbt33, BetaSteward (PastInFlames) */ public final class Recoup extends CardImpl { - + private static final FilterCard filter = new FilterCard("sorcery card"); - - static{ + + static { filter.add(CardType.SORCERY.getPredicate()); } public Recoup(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}"); // Target sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. this.getSpellAbility().addEffect(new RecoupEffect()); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); + // Flashback {3}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{3}{R}"))); } private Recoup(final Recoup card) { @@ -69,20 +63,20 @@ class RecoupEffect extends ContinuousEffectImpl { return new RecoupEffect(this); } - @Override + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - Card card = game.getCard(targetPointer.getFirst(game, source)); - if (card != null) { - FlashbackAbility ability = new FlashbackAbility(card.getManaCost(), TimingRule.SORCERY); + if (player == null) { + return false; + } + Card card = game.getCard(targetPointer.getFirst(game, source)); + if (card != null) { + FlashbackAbility ability = new FlashbackAbility(card, card.getManaCost()); ability.setSourceId(card.getId()); ability.setControllerId(card.getOwnerId()); game.getState().addOtherAbility(card, ability); return true; - } } return false; + } } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/r/RiteOfHarmony.java b/Mage.Sets/src/mage/cards/r/RiteOfHarmony.java index 1a16039ac8..d5e5db6d7c 100644 --- a/Mage.Sets/src/mage/cards/r/RiteOfHarmony.java +++ b/Mage.Sets/src/mage/cards/r/RiteOfHarmony.java @@ -32,7 +32,7 @@ public final class RiteOfHarmony extends CardImpl { getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new RiteOfHarmonyTriggeredAbility())); // Flashback {2}{G}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{G}{W}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{2}{G}{W}"))); } diff --git a/Mage.Sets/src/mage/cards/r/RoarOfTheWurm.java b/Mage.Sets/src/mage/cards/r/RoarOfTheWurm.java index 09bb68a1e2..6138c75592 100644 --- a/Mage.Sets/src/mage/cards/r/RoarOfTheWurm.java +++ b/Mage.Sets/src/mage/cards/r/RoarOfTheWurm.java @@ -25,7 +25,7 @@ public final class RoarOfTheWurm extends CardImpl { this.getSpellAbility().addEffect(new CreateTokenEffect(new WurmToken())); // Flashback {3}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{3}{G}"))); } private RoarOfTheWurm(final RoarOfTheWurm card) { diff --git a/Mage.Sets/src/mage/cards/r/RollingTemblor.java b/Mage.Sets/src/mage/cards/r/RollingTemblor.java index d6da7bb290..ac06b6b7f2 100644 --- a/Mage.Sets/src/mage/cards/r/RollingTemblor.java +++ b/Mage.Sets/src/mage/cards/r/RollingTemblor.java @@ -33,7 +33,7 @@ public final class RollingTemblor extends CardImpl { // Rolling Temblor deals 2 damage to each creature without flying. this.getSpellAbility().addEffect(new DamageAllEffect(2, filter)); // Flashback {4}{R}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{R}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{4}{R}{R}"))); } private RollingTemblor(final RollingTemblor card) { diff --git a/Mage.Sets/src/mage/cards/r/RottenReunion.java b/Mage.Sets/src/mage/cards/r/RottenReunion.java index 535fa76a6a..d720c4f480 100644 --- a/Mage.Sets/src/mage/cards/r/RottenReunion.java +++ b/Mage.Sets/src/mage/cards/r/RottenReunion.java @@ -27,7 +27,7 @@ public final class RottenReunion extends CardImpl { this.getSpellAbility().addTarget(new TargetCardInGraveyard(0, 1)); // Flashback {1}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{1}{B}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{1}{B}"))); } private RottenReunion(final RottenReunion card) { diff --git a/Mage.Sets/src/mage/cards/s/SacredFire.java b/Mage.Sets/src/mage/cards/s/SacredFire.java index 4d0a65072d..27efc4e4c8 100644 --- a/Mage.Sets/src/mage/cards/s/SacredFire.java +++ b/Mage.Sets/src/mage/cards/s/SacredFire.java @@ -26,7 +26,7 @@ public final class SacredFire extends CardImpl { this.getSpellAbility().addTarget(new TargetAnyTarget()); // Flashback {4}{R}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{4}{R}{W}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{4}{R}{W}"))); } private SacredFire(final SacredFire card) { diff --git a/Mage.Sets/src/mage/cards/s/SavingGrasp.java b/Mage.Sets/src/mage/cards/s/SavingGrasp.java index 588d35a825..775056361d 100644 --- a/Mage.Sets/src/mage/cards/s/SavingGrasp.java +++ b/Mage.Sets/src/mage/cards/s/SavingGrasp.java @@ -33,7 +33,7 @@ public final class SavingGrasp extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); // Flashback {W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{W}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{W}"))); } private SavingGrasp(final SavingGrasp card) { diff --git a/Mage.Sets/src/mage/cards/s/ScorchingMissile.java b/Mage.Sets/src/mage/cards/s/ScorchingMissile.java index dec85edfaa..8a217d2ff8 100644 --- a/Mage.Sets/src/mage/cards/s/ScorchingMissile.java +++ b/Mage.Sets/src/mage/cards/s/ScorchingMissile.java @@ -25,7 +25,7 @@ public final class ScorchingMissile extends CardImpl { this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker()); // Flashback {9}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{9}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{9}{R}"))); } diff --git a/Mage.Sets/src/mage/cards/s/ScourAllPossibilities.java b/Mage.Sets/src/mage/cards/s/ScourAllPossibilities.java index 6ce1b3d0f2..9018a5534a 100644 --- a/Mage.Sets/src/mage/cards/s/ScourAllPossibilities.java +++ b/Mage.Sets/src/mage/cards/s/ScourAllPossibilities.java @@ -24,7 +24,7 @@ public final class ScourAllPossibilities extends CardImpl { this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).concatBy(", then")); // Flashback {4}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{U}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{4}{U}"))); } diff --git a/Mage.Sets/src/mage/cards/s/SecretsOfTheKey.java b/Mage.Sets/src/mage/cards/s/SecretsOfTheKey.java index 52e01b162a..4e0874441e 100644 --- a/Mage.Sets/src/mage/cards/s/SecretsOfTheKey.java +++ b/Mage.Sets/src/mage/cards/s/SecretsOfTheKey.java @@ -31,7 +31,7 @@ public final class SecretsOfTheKey extends CardImpl { )); // Flashback {3}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{3}{U}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{3}{U}"))); } private SecretsOfTheKey(final SecretsOfTheKey card) { diff --git a/Mage.Sets/src/mage/cards/s/SeizeTheDay.java b/Mage.Sets/src/mage/cards/s/SeizeTheDay.java index 0ef6c503e9..8c9e698c07 100644 --- a/Mage.Sets/src/mage/cards/s/SeizeTheDay.java +++ b/Mage.Sets/src/mage/cards/s/SeizeTheDay.java @@ -27,7 +27,7 @@ public final class SeizeTheDay extends CardImpl { this.getSpellAbility().addEffect(new AddCombatAndMainPhaseEffect()); // Flashback {2}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{2}{R}"))); } private SeizeTheDay(final SeizeTheDay card) { diff --git a/Mage.Sets/src/mage/cards/s/SeverTheBloodline.java b/Mage.Sets/src/mage/cards/s/SeverTheBloodline.java index c470cdb91c..4c94dc9d2e 100644 --- a/Mage.Sets/src/mage/cards/s/SeverTheBloodline.java +++ b/Mage.Sets/src/mage/cards/s/SeverTheBloodline.java @@ -34,7 +34,7 @@ public final class SeverTheBloodline extends CardImpl { this.getSpellAbility().addEffect(new SeverTheBloodlineEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Flashback {5}{B}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{B}{B}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{B}{B}"))); } private SeverTheBloodline(final SeverTheBloodline card) { diff --git a/Mage.Sets/src/mage/cards/s/SevinnesReclamation.java b/Mage.Sets/src/mage/cards/s/SevinnesReclamation.java index e60c3d2378..0cf6945e4b 100644 --- a/Mage.Sets/src/mage/cards/s/SevinnesReclamation.java +++ b/Mage.Sets/src/mage/cards/s/SevinnesReclamation.java @@ -40,7 +40,7 @@ public final class SevinnesReclamation extends CardImpl { this.getSpellAbility().addEffect(new SevinnesReclamationEffect()); // Flashback {4}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{W}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{4}{W}"))); } private SevinnesReclamation(final SevinnesReclamation card) { diff --git a/Mage.Sets/src/mage/cards/s/ShadowbeastSighting.java b/Mage.Sets/src/mage/cards/s/ShadowbeastSighting.java index f51827fc8e..6fdbb21cf8 100644 --- a/Mage.Sets/src/mage/cards/s/ShadowbeastSighting.java +++ b/Mage.Sets/src/mage/cards/s/ShadowbeastSighting.java @@ -23,7 +23,7 @@ public final class ShadowbeastSighting extends CardImpl { this.getSpellAbility().addEffect(new CreateTokenEffect(new BeastToken2())); // Flashback {6}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{6}{G}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{6}{G}"))); } private ShadowbeastSighting(final ShadowbeastSighting card) { diff --git a/Mage.Sets/src/mage/cards/s/ShatteredPerception.java b/Mage.Sets/src/mage/cards/s/ShatteredPerception.java index f5383b5fb6..f678090975 100644 --- a/Mage.Sets/src/mage/cards/s/ShatteredPerception.java +++ b/Mage.Sets/src/mage/cards/s/ShatteredPerception.java @@ -22,7 +22,7 @@ public final class ShatteredPerception extends CardImpl { // Discard all the cards in your hand, then draw that many cards. this.getSpellAbility().addEffect(new DiscardHandDrawSameNumberSourceEffect()); // Flashback {5}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{R}"))); } private ShatteredPerception(final ShatteredPerception card) { diff --git a/Mage.Sets/src/mage/cards/s/SilentDeparture.java b/Mage.Sets/src/mage/cards/s/SilentDeparture.java index c3770e0e07..d0e8e7cb8a 100644 --- a/Mage.Sets/src/mage/cards/s/SilentDeparture.java +++ b/Mage.Sets/src/mage/cards/s/SilentDeparture.java @@ -25,7 +25,7 @@ public final class SilentDeparture extends CardImpl { this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); // Flashback {4}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{U}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{4}{U}"))); } private SilentDeparture(final SilentDeparture card) { diff --git a/Mage.Sets/src/mage/cards/s/SkullFracture.java b/Mage.Sets/src/mage/cards/s/SkullFracture.java index 9ae9ca4646..a4186e6dd2 100644 --- a/Mage.Sets/src/mage/cards/s/SkullFracture.java +++ b/Mage.Sets/src/mage/cards/s/SkullFracture.java @@ -26,7 +26,7 @@ public final class SkullFracture extends CardImpl { this.getSpellAbility().addEffect(new DiscardTargetEffect(1)); this.getSpellAbility().addTarget(new TargetPlayer()); // Flashback {3}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{B}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{3}{B}"))); } private SkullFracture(final SkullFracture card) { diff --git a/Mage.Sets/src/mage/cards/s/SmitingHelix.java b/Mage.Sets/src/mage/cards/s/SmitingHelix.java index a2c6ec0951..7dba0e9b9b 100644 --- a/Mage.Sets/src/mage/cards/s/SmitingHelix.java +++ b/Mage.Sets/src/mage/cards/s/SmitingHelix.java @@ -26,7 +26,7 @@ public final class SmitingHelix extends CardImpl { this.getSpellAbility().addTarget(new TargetAnyTarget()); // Flashback {R}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{R}{W}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{R}{W}"))); } private SmitingHelix(final SmitingHelix card) { diff --git a/Mage.Sets/src/mage/cards/s/SnapcasterMage.java b/Mage.Sets/src/mage/cards/s/SnapcasterMage.java index 75abfda093..58a03c9c02 100644 --- a/Mage.Sets/src/mage/cards/s/SnapcasterMage.java +++ b/Mage.Sets/src/mage/cards/s/SnapcasterMage.java @@ -1,7 +1,6 @@ package mage.cards.s; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -11,20 +10,15 @@ import mage.abilities.keyword.FlashbackAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.constants.TimingRule; +import mage.constants.*; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.game.Game; import mage.target.common.TargetCardInYourGraveyard; +import java.util.UUID; + /** - * * @author BetaSteward */ public final class SnapcasterMage extends CardImpl { @@ -38,7 +32,7 @@ public final class SnapcasterMage extends CardImpl { } public SnapcasterMage(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WIZARD); @@ -84,13 +78,7 @@ class SnapcasterMageEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { Card card = game.getCard(targetPointer.getFirst(game, source)); if (card != null) { - FlashbackAbility ability; - if (card.isInstant(game)) { - ability = new FlashbackAbility(card.getManaCost(), TimingRule.INSTANT); - } - else { - ability = new FlashbackAbility(card.getManaCost(), TimingRule.SORCERY); - } + FlashbackAbility ability = new FlashbackAbility(card, card.getManaCost()); ability.setSourceId(card.getId()); ability.setControllerId(card.getOwnerId()); game.getState().addOtherAbility(card, ability); diff --git a/Mage.Sets/src/mage/cards/s/SpiderSpawning.java b/Mage.Sets/src/mage/cards/s/SpiderSpawning.java index 5a0a669947..41bf430997 100644 --- a/Mage.Sets/src/mage/cards/s/SpiderSpawning.java +++ b/Mage.Sets/src/mage/cards/s/SpiderSpawning.java @@ -24,7 +24,7 @@ public final class SpiderSpawning extends CardImpl { // Create a 1/2 green Spider creature token with reach for each creature card in your graveyard. this.getSpellAbility().addEffect(new CreateTokenEffect(new SpiderToken(), new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE))); // Flashback {6}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{6}{B}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{6}{B}"))); } private SpiderSpawning(final SpiderSpawning card) { diff --git a/Mage.Sets/src/mage/cards/s/SpiritFlare.java b/Mage.Sets/src/mage/cards/s/SpiritFlare.java index a45cf540d5..e1190693ad 100644 --- a/Mage.Sets/src/mage/cards/s/SpiritFlare.java +++ b/Mage.Sets/src/mage/cards/s/SpiritFlare.java @@ -45,7 +45,7 @@ public final class SpiritFlare extends CardImpl { this.getSpellAbility().addTarget(new TargetPermanent(filter2)); // Flashback-{1}{W}, Pay 3 life. - FlashbackAbility ability = new FlashbackAbility(new ManaCostsImpl("{1}{W}"), TimingRule.INSTANT); + FlashbackAbility ability = new FlashbackAbility(this, new ManaCostsImpl<>("{1}{W}")); ability.addCost(new PayLifeCost(3)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/StranglingSoot.java b/Mage.Sets/src/mage/cards/s/StranglingSoot.java index 854599d26c..b5061c16ab 100644 --- a/Mage.Sets/src/mage/cards/s/StranglingSoot.java +++ b/Mage.Sets/src/mage/cards/s/StranglingSoot.java @@ -32,7 +32,7 @@ public final class StranglingSoot extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); this.getSpellAbility().addEffect(new DestroyTargetEffect()); // Flashback {5}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{5}{R}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{5}{R}"))); } private StranglingSoot(final StranglingSoot card) { diff --git a/Mage.Sets/src/mage/cards/s/StrikeItRich.java b/Mage.Sets/src/mage/cards/s/StrikeItRich.java index 27e974ad19..5e3f94dae0 100644 --- a/Mage.Sets/src/mage/cards/s/StrikeItRich.java +++ b/Mage.Sets/src/mage/cards/s/StrikeItRich.java @@ -23,7 +23,7 @@ public final class StrikeItRich extends CardImpl { this.getSpellAbility().addEffect(new CreateTokenEffect(new TreasureToken())); // Flashback {2}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{2}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{2}{R}"))); } private StrikeItRich(final StrikeItRich card) { diff --git a/Mage.Sets/src/mage/cards/s/SylvanMight.java b/Mage.Sets/src/mage/cards/s/SylvanMight.java index 8452ea5ce7..8345379ada 100644 --- a/Mage.Sets/src/mage/cards/s/SylvanMight.java +++ b/Mage.Sets/src/mage/cards/s/SylvanMight.java @@ -33,7 +33,7 @@ public final class SylvanMight extends CardImpl { this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Flashback {2}{G}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{G}{G}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{2}{G}{G}"))); } private SylvanMight(final SylvanMight card) { diff --git a/Mage.Sets/src/mage/cards/t/ThinkTwice.java b/Mage.Sets/src/mage/cards/t/ThinkTwice.java index 9f5268db67..093263187e 100644 --- a/Mage.Sets/src/mage/cards/t/ThinkTwice.java +++ b/Mage.Sets/src/mage/cards/t/ThinkTwice.java @@ -24,7 +24,7 @@ public final class ThinkTwice extends CardImpl { this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); // Flashback {2}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{U}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{2}{U}"))); } private ThinkTwice(final ThinkTwice card) { diff --git a/Mage.Sets/src/mage/cards/t/ThrillOfTheHunt.java b/Mage.Sets/src/mage/cards/t/ThrillOfTheHunt.java index a411ec865b..edae096557 100644 --- a/Mage.Sets/src/mage/cards/t/ThrillOfTheHunt.java +++ b/Mage.Sets/src/mage/cards/t/ThrillOfTheHunt.java @@ -25,7 +25,7 @@ public final class ThrillOfTheHunt extends CardImpl { this.getSpellAbility().addEffect(new BoostTargetEffect(1, 2, Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Flashback {W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{W}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{W}"))); } private ThrillOfTheHunt(final ThrillOfTheHunt card) { diff --git a/Mage.Sets/src/mage/cards/t/TrackersInstincts.java b/Mage.Sets/src/mage/cards/t/TrackersInstincts.java index cf4ed011de..a224dec3fe 100644 --- a/Mage.Sets/src/mage/cards/t/TrackersInstincts.java +++ b/Mage.Sets/src/mage/cards/t/TrackersInstincts.java @@ -33,7 +33,7 @@ public final class TrackersInstincts extends CardImpl { // Reveal the top four cards of your library. Put a creature card from among them into your hand and the rest into your graveyard. this.getSpellAbility().addEffect(new TrackersInstinctsEffect()); // Flashback {2}{U} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{U}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{2}{U}"))); } private TrackersInstincts(final TrackersInstincts card) { diff --git a/Mage.Sets/src/mage/cards/t/TraitorsClutch.java b/Mage.Sets/src/mage/cards/t/TraitorsClutch.java index 54601a12cc..50b5d830ef 100644 --- a/Mage.Sets/src/mage/cards/t/TraitorsClutch.java +++ b/Mage.Sets/src/mage/cards/t/TraitorsClutch.java @@ -38,7 +38,7 @@ public final class TraitorsClutch extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Flashback {1}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{B}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{1}{B}"))); } private TraitorsClutch(final TraitorsClutch card) { diff --git a/Mage.Sets/src/mage/cards/t/TravelPreparations.java b/Mage.Sets/src/mage/cards/t/TravelPreparations.java index ab9c5767b9..ae2d1e296c 100644 --- a/Mage.Sets/src/mage/cards/t/TravelPreparations.java +++ b/Mage.Sets/src/mage/cards/t/TravelPreparations.java @@ -29,7 +29,7 @@ public final class TravelPreparations extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); // Flashback {1}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{W}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{1}{W}"))); } private TravelPreparations(final TravelPreparations card) { diff --git a/Mage.Sets/src/mage/cards/t/TurnTheEarth.java b/Mage.Sets/src/mage/cards/t/TurnTheEarth.java index 4298dca55f..a7c2fc214b 100644 --- a/Mage.Sets/src/mage/cards/t/TurnTheEarth.java +++ b/Mage.Sets/src/mage/cards/t/TurnTheEarth.java @@ -28,7 +28,7 @@ public final class TurnTheEarth extends CardImpl { this.getSpellAbility().addTarget(new TargetCardInGraveyard(0, 3)); // Flashback {1}{G} - this.addAbility(new FlashbackAbility(new ManaCostsImpl<>("{1}{G}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{1}{G}"))); } private TurnTheEarth(final TurnTheEarth card) { diff --git a/Mage.Sets/src/mage/cards/u/UnburialRites.java b/Mage.Sets/src/mage/cards/u/UnburialRites.java index 222d344b74..269246ac26 100644 --- a/Mage.Sets/src/mage/cards/u/UnburialRites.java +++ b/Mage.Sets/src/mage/cards/u/UnburialRites.java @@ -25,7 +25,7 @@ public final class UnburialRites extends CardImpl { this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); // Flashback {3}{W} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{W}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{3}{W}"))); } private UnburialRites(final UnburialRites card) { diff --git a/Mage.Sets/src/mage/cards/v/VolcanicSpray.java b/Mage.Sets/src/mage/cards/v/VolcanicSpray.java index 0d7ccbe348..86995eb086 100644 --- a/Mage.Sets/src/mage/cards/v/VolcanicSpray.java +++ b/Mage.Sets/src/mage/cards/v/VolcanicSpray.java @@ -32,7 +32,7 @@ public final class VolcanicSpray extends CardImpl { // Volcanic Spray deals 1 damage to each creature without flying and each player. this.getSpellAbility().addEffect(new DamageEverythingEffect(1, filter)); // Flashback {1}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{1}{R}"))); } private VolcanicSpray(final VolcanicSpray card) { diff --git a/Mage.Sets/src/mage/cards/v/VolleyOfBoulders.java b/Mage.Sets/src/mage/cards/v/VolleyOfBoulders.java index 5387b0f86a..2918562e23 100644 --- a/Mage.Sets/src/mage/cards/v/VolleyOfBoulders.java +++ b/Mage.Sets/src/mage/cards/v/VolleyOfBoulders.java @@ -25,7 +25,7 @@ public final class VolleyOfBoulders extends CardImpl { this.getSpellAbility().addEffect(new DamageMultiEffect(6)); this.getSpellAbility().addTarget(new TargetAnyTargetAmount(6)); // Flashback {R}{R}{R}{R}{R}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{R}{R}{R}{R}{R}{R}"),TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{R}{R}{R}{R}{R}{R}"))); } private VolleyOfBoulders(final VolleyOfBoulders card) { diff --git a/Mage.Sets/src/mage/cards/w/WildHunger.java b/Mage.Sets/src/mage/cards/w/WildHunger.java index 76225d35d9..6b213997a2 100644 --- a/Mage.Sets/src/mage/cards/w/WildHunger.java +++ b/Mage.Sets/src/mage/cards/w/WildHunger.java @@ -29,7 +29,7 @@ public final class WildHunger extends CardImpl { this.getSpellAbility().addEffect(new BoostTargetEffect(3, 1, Duration.EndOfTurn)); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn)); // Flashback {3}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{R}"), TimingRule.INSTANT)); + this.addAbility(new FlashbackAbility(this, new ManaCostsImpl("{3}{R}"))); } private WildHunger(final WildHunger card) { diff --git a/Mage/src/main/java/mage/abilities/keyword/FlashbackAbility.java b/Mage/src/main/java/mage/abilities/keyword/FlashbackAbility.java index 968ffeee61..6347b1ef2d 100644 --- a/Mage/src/main/java/mage/abilities/keyword/FlashbackAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/FlashbackAbility.java @@ -38,12 +38,12 @@ public class FlashbackAbility extends SpellAbility { private String abilityName; private SpellAbility spellAbilityToResolve; - public FlashbackAbility(Cost cost, TimingRule timingRule) { + public FlashbackAbility(Card card, Cost cost) { super(null, "", Zone.GRAVEYARD, SpellAbilityType.BASE_ALTERNATE, SpellAbilityCastMode.FLASHBACK); this.setAdditionalCostsRuleVisible(false); this.name = "Flashback " + cost.getText(); this.addCost(cost); - this.timing = timingRule; + this.timing = card.isSorcery() ? TimingRule.SORCERY : TimingRule.INSTANT; } public FlashbackAbility(final FlashbackAbility ability) { diff --git a/Mage/src/main/java/mage/cards/CardImpl.java b/Mage/src/main/java/mage/cards/CardImpl.java index c3741f4a45..014c740079 100644 --- a/Mage/src/main/java/mage/cards/CardImpl.java +++ b/Mage/src/main/java/mage/cards/CardImpl.java @@ -271,7 +271,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card { && mainCardState != null && !mainCardState.hasLostAllAbilities() && mainCardState.getAbilities().containsClass(FlashbackAbility.class)) { - FlashbackAbility flash = new FlashbackAbility(this.getManaCost(), this.isInstant(game) ? TimingRule.INSTANT : TimingRule.SORCERY); + FlashbackAbility flash = new FlashbackAbility(this, this.getManaCost()); flash.setSourceId(this.getId()); flash.setControllerId(this.getOwnerId()); flash.setSpellAbilityType(this.getSpellAbility().getSpellAbilityType()); diff --git a/Utils/keywords.txt b/Utils/keywords.txt index 6e62c8744d..1dc14e6026 100644 --- a/Utils/keywords.txt +++ b/Utils/keywords.txt @@ -43,7 +43,7 @@ Fear|instance| First strike|instance| Flanking|new| Flash|instance| -Flashback|cost| +Flashback|card, cost| Flying|instance| Forestcycling|cost| Forestwalk|new|