diff --git a/Mage.Sets/src/mage/cards/a/AnimatingFaerie.java b/Mage.Sets/src/mage/cards/a/AnimatingFaerie.java index d5845a452cc..64f2f4ece3f 100644 --- a/Mage.Sets/src/mage/cards/a/AnimatingFaerie.java +++ b/Mage.Sets/src/mage/cards/a/AnimatingFaerie.java @@ -43,16 +43,16 @@ public final class AnimatingFaerie extends AdventureCard { // Bring to Life // Target noncreature artifact you control becomes a 0/0 artifact creature. Put four +1/+1 counters on it. - this.getAdventureSpellAbility().addEffect(new AddCardTypeTargetEffect( + this.getSpellCard().getSpellAbility().addEffect(new AddCardTypeTargetEffect( Duration.EndOfGame, CardType.ARTIFACT, CardType.CREATURE ).setText("Target noncreature artifact you control becomes")); - this.getAdventureSpellAbility().addEffect(new SetPowerToughnessTargetEffect( + this.getSpellCard().getSpellAbility().addEffect(new SetPowerToughnessTargetEffect( 0, 0, Duration.EndOfGame ).setText("a 0/0 artifact creature.")); - this.getAdventureSpellAbility().addEffect(new AddCountersTargetEffect( + this.getSpellCard().getSpellAbility().addEffect(new AddCountersTargetEffect( CounterType.P1P1.createInstance(4) ).setText("Put four +1/+1 counters on it.")); - this.getAdventureSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellCard().getSpellAbility().addTarget(new TargetPermanent(filter)); } private AnimatingFaerie(final AnimatingFaerie card) { diff --git a/Mage.Sets/src/mage/cards/a/ArdenvaleTactician.java b/Mage.Sets/src/mage/cards/a/ArdenvaleTactician.java index cfafc8aac40..bc14efe0b1a 100644 --- a/Mage.Sets/src/mage/cards/a/ArdenvaleTactician.java +++ b/Mage.Sets/src/mage/cards/a/ArdenvaleTactician.java @@ -29,8 +29,8 @@ public final class ArdenvaleTactician extends AdventureCard { // Dizzying Swoop // Tap up to two target creatures. - this.getAdventureSpellAbility().addEffect(new TapTargetEffect()); - this.getAdventureSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); + this.getSpellCard().getSpellAbility().addEffect(new TapTargetEffect()); + this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); } private ArdenvaleTactician(final ArdenvaleTactician card) { diff --git a/Mage.Sets/src/mage/cards/b/BeanstalkGiant.java b/Mage.Sets/src/mage/cards/b/BeanstalkGiant.java index 18cd2db3f34..533ba125904 100644 --- a/Mage.Sets/src/mage/cards/b/BeanstalkGiant.java +++ b/Mage.Sets/src/mage/cards/b/BeanstalkGiant.java @@ -37,7 +37,7 @@ public final class BeanstalkGiant extends AdventureCard { // Fertile Footsteps // Search your library for a basic land card, put it onto the battlefield, then shuffle your library. - this.getAdventureSpellAbility().addEffect( + this.getSpellCard().getSpellAbility().addEffect( new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND)) ); } diff --git a/Mage.Sets/src/mage/cards/b/BonecrusherGiant.java b/Mage.Sets/src/mage/cards/b/BonecrusherGiant.java index 5d33e4e2289..8a756691c2e 100644 --- a/Mage.Sets/src/mage/cards/b/BonecrusherGiant.java +++ b/Mage.Sets/src/mage/cards/b/BonecrusherGiant.java @@ -34,9 +34,9 @@ public final class BonecrusherGiant extends AdventureCard { // Stomp // Damage can’t be prevented this turn. Stomp deals 2 damage to any target. - this.getAdventureSpellAbility().addEffect(new StompEffect()); - this.getAdventureSpellAbility().addEffect(new DamageTargetEffect(2)); - this.getAdventureSpellAbility().addTarget(new TargetAnyTarget()); + this.getSpellCard().getSpellAbility().addEffect(new StompEffect()); + this.getSpellCard().getSpellAbility().addEffect(new DamageTargetEffect(2)); + this.getSpellCard().getSpellAbility().addTarget(new TargetAnyTarget()); } private BonecrusherGiant(final BonecrusherGiant card) { diff --git a/Mage.Sets/src/mage/cards/b/BrazenBorrower.java b/Mage.Sets/src/mage/cards/b/BrazenBorrower.java index 14bc967401f..9a7d91a18c7 100644 --- a/Mage.Sets/src/mage/cards/b/BrazenBorrower.java +++ b/Mage.Sets/src/mage/cards/b/BrazenBorrower.java @@ -48,8 +48,8 @@ public final class BrazenBorrower extends AdventureCard { // Petty Theft // Return target nonland permanent an opponent controls to its owner's hand. - this.getAdventureSpellAbility().addEffect(new ReturnToHandTargetEffect()); - this.getAdventureSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellCard().getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellCard().getSpellAbility().addTarget(new TargetPermanent(filter)); } private BrazenBorrower(final BrazenBorrower card) { diff --git a/Mage.Sets/src/mage/cards/c/CuriousPair.java b/Mage.Sets/src/mage/cards/c/CuriousPair.java index f63363f9f3f..febc9db70ed 100644 --- a/Mage.Sets/src/mage/cards/c/CuriousPair.java +++ b/Mage.Sets/src/mage/cards/c/CuriousPair.java @@ -25,7 +25,7 @@ public final class CuriousPair extends AdventureCard { // Treats to Share // Create a Food token. - this.getAdventureSpellAbility().addEffect(new CreateTokenEffect(new FoodToken())); + this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new FoodToken())); } private CuriousPair(final CuriousPair card) { diff --git a/Mage.Sets/src/mage/cards/e/EmberethShieldbreaker.java b/Mage.Sets/src/mage/cards/e/EmberethShieldbreaker.java index 3e1b7bf98f7..fe781fc842c 100644 --- a/Mage.Sets/src/mage/cards/e/EmberethShieldbreaker.java +++ b/Mage.Sets/src/mage/cards/e/EmberethShieldbreaker.java @@ -25,8 +25,8 @@ public final class EmberethShieldbreaker extends AdventureCard { // Battle Display // Destroy target artifact. - this.getAdventureSpellAbility().addEffect(new DestroyTargetEffect()); - this.getAdventureSpellAbility().addTarget(new TargetArtifactPermanent()); + this.getSpellCard().getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellCard().getSpellAbility().addTarget(new TargetArtifactPermanent()); } private EmberethShieldbreaker(final EmberethShieldbreaker card) { diff --git a/Mage.Sets/src/mage/cards/f/FaeOfWishes.java b/Mage.Sets/src/mage/cards/f/FaeOfWishes.java index d6aa24c094c..94ef4621340 100644 --- a/Mage.Sets/src/mage/cards/f/FaeOfWishes.java +++ b/Mage.Sets/src/mage/cards/f/FaeOfWishes.java @@ -42,7 +42,7 @@ public final class FaeOfWishes extends AdventureCard { // Granted // You may choose a noncreature card you own from outside the game, reveal it, and put it into your hand. - this.getAdventureSpellAbility().addEffect(new WishEffect(StaticFilters.FILTER_CARD_A_NON_LAND)); + this.getSpellCard().getSpellAbility().addEffect(new WishEffect(StaticFilters.FILTER_CARD_A_NON_LAND)); } private FaeOfWishes(final FaeOfWishes card) { diff --git a/Mage.Sets/src/mage/cards/f/FaerieGuidemother.java b/Mage.Sets/src/mage/cards/f/FaerieGuidemother.java index 03d51364ce6..24425fc8f13 100644 --- a/Mage.Sets/src/mage/cards/f/FaerieGuidemother.java +++ b/Mage.Sets/src/mage/cards/f/FaerieGuidemother.java @@ -30,13 +30,13 @@ public final class FaerieGuidemother extends AdventureCard { // Gift of the Fae // Target creature gets +2/+1 and gains flying until end of turn. - this.getAdventureSpellAbility().addEffect(new BoostTargetEffect( + this.getSpellCard().getSpellAbility().addEffect(new BoostTargetEffect( 2, 1, Duration.EndOfTurn ).setText("Target creature gets +2/+1")); - this.getAdventureSpellAbility().addEffect(new GainAbilityTargetEffect( + this.getSpellCard().getSpellAbility().addEffect(new GainAbilityTargetEffect( FlyingAbility.getInstance(), Duration.EndOfTurn ).setText("and gains flying until end of turn")); - this.getAdventureSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); } private FaerieGuidemother(final FaerieGuidemother card) { diff --git a/Mage.Sets/src/mage/cards/f/FlaxenIntruder.java b/Mage.Sets/src/mage/cards/f/FlaxenIntruder.java index 8e0659ecd7a..105e7d16c03 100644 --- a/Mage.Sets/src/mage/cards/f/FlaxenIntruder.java +++ b/Mage.Sets/src/mage/cards/f/FlaxenIntruder.java @@ -44,7 +44,7 @@ public final class FlaxenIntruder extends AdventureCard { // Welcome Home // Create three 2/2 green Bear creature tokens. - this.getAdventureSpellAbility().addEffect(new CreateTokenEffect(new BearToken(), 3)); + this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new BearToken(), 3)); } private FlaxenIntruder(final FlaxenIntruder card) { diff --git a/Mage.Sets/src/mage/cards/f/FoulmireKnight.java b/Mage.Sets/src/mage/cards/f/FoulmireKnight.java index 4eb1a389b86..0e4756fb470 100644 --- a/Mage.Sets/src/mage/cards/f/FoulmireKnight.java +++ b/Mage.Sets/src/mage/cards/f/FoulmireKnight.java @@ -29,8 +29,8 @@ public final class FoulmireKnight extends AdventureCard { // Profane Insight // You draw a card and you lose 1 life. - this.getAdventureSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).setText("You draw a card and")); - this.getAdventureSpellAbility().addEffect(new LoseLifeSourceControllerEffect(1)); + this.getSpellCard().getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).setText("You draw a card and")); + this.getSpellCard().getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(1)); } private FoulmireKnight(final FoulmireKnight card) { diff --git a/Mage.Sets/src/mage/cards/g/GarenbrigCarver.java b/Mage.Sets/src/mage/cards/g/GarenbrigCarver.java index 311deb9a14f..403e453f53e 100644 --- a/Mage.Sets/src/mage/cards/g/GarenbrigCarver.java +++ b/Mage.Sets/src/mage/cards/g/GarenbrigCarver.java @@ -26,8 +26,8 @@ public final class GarenbrigCarver extends AdventureCard { // Shield's Might // Target creature gets +2/+2 until end of turn. - this.getAdventureSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); - this.getAdventureSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellCard().getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); + this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); } private GarenbrigCarver(final GarenbrigCarver card) { diff --git a/Mage.Sets/src/mage/cards/g/GiantKiller.java b/Mage.Sets/src/mage/cards/g/GiantKiller.java index 27ea0041560..07f05204659 100644 --- a/Mage.Sets/src/mage/cards/g/GiantKiller.java +++ b/Mage.Sets/src/mage/cards/g/GiantKiller.java @@ -47,8 +47,8 @@ public final class GiantKiller extends AdventureCard { // Chop Down // Destroy target creature with power 4 or greater. - this.getAdventureSpellAbility().addEffect(new DestroyTargetEffect()); - this.getAdventureSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellCard().getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellCard().getSpellAbility().addTarget(new TargetPermanent(filter)); } private GiantKiller(final GiantKiller card) { diff --git a/Mage.Sets/src/mage/cards/h/HypnoticSprite.java b/Mage.Sets/src/mage/cards/h/HypnoticSprite.java index 40868c5afb0..89b51318570 100644 --- a/Mage.Sets/src/mage/cards/h/HypnoticSprite.java +++ b/Mage.Sets/src/mage/cards/h/HypnoticSprite.java @@ -37,8 +37,8 @@ public final class HypnoticSprite extends AdventureCard { // Mesmeric Glare // Counter target spell with converted mana cost 3 or less. - this.getAdventureSpellAbility().addEffect(new CounterTargetEffect()); - this.getAdventureSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellCard().getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellCard().getSpellAbility().addTarget(new TargetSpell(filter)); } private HypnoticSprite(final HypnoticSprite card) { diff --git a/Mage.Sets/src/mage/cards/l/LonesomeUnicorn.java b/Mage.Sets/src/mage/cards/l/LonesomeUnicorn.java index ead17bfb3ea..fefbe07474b 100644 --- a/Mage.Sets/src/mage/cards/l/LonesomeUnicorn.java +++ b/Mage.Sets/src/mage/cards/l/LonesomeUnicorn.java @@ -28,7 +28,7 @@ public final class LonesomeUnicorn extends AdventureCard { // Rider in Need // Create a 2/2 white Knight creature token with vigilance. - this.getAdventureSpellAbility().addEffect(new CreateTokenEffect(new KnightToken())); + this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new KnightToken())); } private LonesomeUnicorn(final LonesomeUnicorn card) { diff --git a/Mage.Sets/src/mage/cards/l/LovestruckBeast.java b/Mage.Sets/src/mage/cards/l/LovestruckBeast.java index c38b70ed3cb..8c4904ccfb0 100644 --- a/Mage.Sets/src/mage/cards/l/LovestruckBeast.java +++ b/Mage.Sets/src/mage/cards/l/LovestruckBeast.java @@ -39,7 +39,7 @@ public final class LovestruckBeast extends AdventureCard { // Heart's Desire // Create a 1/1 white Human creature token. - this.getAdventureSpellAbility().addEffect(new CreateTokenEffect(new HumanToken())); + this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new HumanToken())); } private LovestruckBeast(final LovestruckBeast card) { diff --git a/Mage.Sets/src/mage/cards/m/MerchantOfTheVale.java b/Mage.Sets/src/mage/cards/m/MerchantOfTheVale.java index f89f695ad70..be27716805d 100644 --- a/Mage.Sets/src/mage/cards/m/MerchantOfTheVale.java +++ b/Mage.Sets/src/mage/cards/m/MerchantOfTheVale.java @@ -36,7 +36,7 @@ public final class MerchantOfTheVale extends AdventureCard { // Haggle // You may discard a card. If you do, draw a card. - this.getAdventureSpellAbility().addEffect(new DoIfCostPaid( + this.getSpellCard().getSpellAbility().addEffect(new DoIfCostPaid( new DrawCardSourceControllerEffect(1), new DiscardCardCost() )); } diff --git a/Mage.Sets/src/mage/cards/m/MerfolkSecretkeeper.java b/Mage.Sets/src/mage/cards/m/MerfolkSecretkeeper.java index fcc7b742a14..291c438190b 100644 --- a/Mage.Sets/src/mage/cards/m/MerfolkSecretkeeper.java +++ b/Mage.Sets/src/mage/cards/m/MerfolkSecretkeeper.java @@ -25,8 +25,8 @@ public final class MerfolkSecretkeeper extends AdventureCard { // Venture Deeper // Target player puts the top four cards of their library into their graveyard. - this.getAdventureSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(4)); - this.getAdventureSpellAbility().addTarget(new TargetPlayer()); + this.getSpellCard().getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(4)); + this.getSpellCard().getSpellAbility().addTarget(new TargetPlayer()); } private MerfolkSecretkeeper(final MerfolkSecretkeeper card) { diff --git a/Mage.Sets/src/mage/cards/m/MurderousRider.java b/Mage.Sets/src/mage/cards/m/MurderousRider.java index 24cf1b16f90..f32b9e0c274 100644 --- a/Mage.Sets/src/mage/cards/m/MurderousRider.java +++ b/Mage.Sets/src/mage/cards/m/MurderousRider.java @@ -37,11 +37,11 @@ public final class MurderousRider extends AdventureCard { // Swift End // Destroy target creature or planeswalker. You lose 2 life. - this.getAdventureSpellAbility().addEffect(new DestroyTargetEffect()); - this.getAdventureSpellAbility().addEffect( + this.getSpellCard().getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellCard().getSpellAbility().addEffect( new LoseLifeSourceControllerEffect(2).setText("You lose 2 life.") ); - this.getAdventureSpellAbility().addTarget(new TargetCreatureOrPlaneswalker()); + this.getSpellCard().getSpellAbility().addTarget(new TargetCreatureOrPlaneswalker()); } private MurderousRider(final MurderousRider card) { diff --git a/Mage.Sets/src/mage/cards/o/OakhameRanger.java b/Mage.Sets/src/mage/cards/o/OakhameRanger.java index ce7ff7ddd5d..9ebc7bb6597 100644 --- a/Mage.Sets/src/mage/cards/o/OakhameRanger.java +++ b/Mage.Sets/src/mage/cards/o/OakhameRanger.java @@ -34,7 +34,7 @@ public final class OakhameRanger extends AdventureCard { // Bring Back // Create two 1/1 white Human creature tokens. - this.getAdventureSpellAbility().addEffect(new CreateTokenEffect(new HumanToken(), 2)); + this.getSpellCard().getSpellAbility().addEffect(new CreateTokenEffect(new HumanToken(), 2)); } private OakhameRanger(final OakhameRanger card) { diff --git a/Mage.Sets/src/mage/cards/o/OrderOfMidnight.java b/Mage.Sets/src/mage/cards/o/OrderOfMidnight.java index ef5a0030c59..9829efb2a30 100644 --- a/Mage.Sets/src/mage/cards/o/OrderOfMidnight.java +++ b/Mage.Sets/src/mage/cards/o/OrderOfMidnight.java @@ -34,8 +34,8 @@ public final class OrderOfMidnight extends AdventureCard { // Alter Fate // Return target creature card from your graveyard to your hand. - this.getAdventureSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); - this.getAdventureSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); + this.getSpellCard().getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); + this.getSpellCard().getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); } private OrderOfMidnight(final OrderOfMidnight card) { diff --git a/Mage.Sets/src/mage/cards/q/QueenOfIce.java b/Mage.Sets/src/mage/cards/q/QueenOfIce.java index 0bbbf185f4b..d1fe38e761c 100644 --- a/Mage.Sets/src/mage/cards/q/QueenOfIce.java +++ b/Mage.Sets/src/mage/cards/q/QueenOfIce.java @@ -39,10 +39,10 @@ public final class QueenOfIce extends AdventureCard { // Rage of Winter // Tap target creature. It doesn’t untap during its controller’s next untap step. - this.getAdventureSpellAbility().addEffect(new TapTargetEffect()); - this.getAdventureSpellAbility().addEffect(new DontUntapInControllersNextUntapStepTargetEffect() + this.getSpellCard().getSpellAbility().addEffect(new TapTargetEffect()); + this.getSpellCard().getSpellAbility().addEffect(new DontUntapInControllersNextUntapStepTargetEffect() .setText("It doesn't untap during its controller's next untap step")); - this.getAdventureSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); } private QueenOfIce(final QueenOfIce card) { diff --git a/Mage.Sets/src/mage/cards/r/RealmCloakedGiant.java b/Mage.Sets/src/mage/cards/r/RealmCloakedGiant.java index ea2c8bdd571..b0326ebfbba 100644 --- a/Mage.Sets/src/mage/cards/r/RealmCloakedGiant.java +++ b/Mage.Sets/src/mage/cards/r/RealmCloakedGiant.java @@ -37,7 +37,7 @@ public final class RealmCloakedGiant extends AdventureCard { // Cast Off // Destroy all non-Giant creatures. - this.getAdventureSpellAbility().addEffect(new DestroyAllEffect(filter)); + this.getSpellCard().getSpellAbility().addEffect(new DestroyAllEffect(filter)); } private RealmCloakedGiant(final RealmCloakedGiant card) { diff --git a/Mage.Sets/src/mage/cards/r/ReaperOfNight.java b/Mage.Sets/src/mage/cards/r/ReaperOfNight.java index 6bdd66b0da2..580020f7741 100644 --- a/Mage.Sets/src/mage/cards/r/ReaperOfNight.java +++ b/Mage.Sets/src/mage/cards/r/ReaperOfNight.java @@ -41,8 +41,8 @@ public final class ReaperOfNight extends AdventureCard { // Harvest Fear // Target opponent discards two cards. - this.getAdventureSpellAbility().addEffect(new DiscardTargetEffect(2)); - this.getAdventureSpellAbility().addTarget(new TargetOpponent()); + this.getSpellCard().getSpellAbility().addEffect(new DiscardTargetEffect(2)); + this.getSpellCard().getSpellAbility().addTarget(new TargetOpponent()); } private ReaperOfNight(final ReaperOfNight card) { diff --git a/Mage.Sets/src/mage/cards/r/RimrockKnight.java b/Mage.Sets/src/mage/cards/r/RimrockKnight.java index 929b181a062..da237fdba34 100644 --- a/Mage.Sets/src/mage/cards/r/RimrockKnight.java +++ b/Mage.Sets/src/mage/cards/r/RimrockKnight.java @@ -30,8 +30,8 @@ public final class RimrockKnight extends AdventureCard { // Boulder Rush // Target creature gets +2/+0 until end of turn. - this.getAdventureSpellAbility().addEffect(new BoostTargetEffect(2, 0, Duration.EndOfTurn)); - this.getAdventureSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellCard().getSpellAbility().addEffect(new BoostTargetEffect(2, 0, Duration.EndOfTurn)); + this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); } private RimrockKnight(final RimrockKnight card) { diff --git a/Mage.Sets/src/mage/cards/r/RosethornAcolyte.java b/Mage.Sets/src/mage/cards/r/RosethornAcolyte.java index f396b6fcd87..354131f372f 100644 --- a/Mage.Sets/src/mage/cards/r/RosethornAcolyte.java +++ b/Mage.Sets/src/mage/cards/r/RosethornAcolyte.java @@ -28,7 +28,7 @@ public final class RosethornAcolyte extends AdventureCard { // Seasonal Ritual // Add one mana of any color. - this.getAdventureSpellAbility().addEffect(new AddManaOfAnyColorEffect()); + this.getSpellCard().getSpellAbility().addEffect(new AddManaOfAnyColorEffect()); } private RosethornAcolyte(final RosethornAcolyte card) { diff --git a/Mage.Sets/src/mage/cards/s/ShepherdOfTheFlock.java b/Mage.Sets/src/mage/cards/s/ShepherdOfTheFlock.java index 37c657ff450..2d08c676f9b 100644 --- a/Mage.Sets/src/mage/cards/s/ShepherdOfTheFlock.java +++ b/Mage.Sets/src/mage/cards/s/ShepherdOfTheFlock.java @@ -25,8 +25,8 @@ public final class ShepherdOfTheFlock extends AdventureCard { // Usher to Safety // Return target permanent you control to its owner’s hand. - this.getAdventureSpellAbility().addEffect(new ReturnToHandTargetEffect()); - this.getAdventureSpellAbility().addTarget(new TargetControlledPermanent()); + this.getSpellCard().getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellCard().getSpellAbility().addTarget(new TargetControlledPermanent()); } private ShepherdOfTheFlock(final ShepherdOfTheFlock card) { diff --git a/Mage.Sets/src/mage/cards/s/SilverflameSquire.java b/Mage.Sets/src/mage/cards/s/SilverflameSquire.java index 1e607a73ff4..6f0f0b7e8ce 100644 --- a/Mage.Sets/src/mage/cards/s/SilverflameSquire.java +++ b/Mage.Sets/src/mage/cards/s/SilverflameSquire.java @@ -27,9 +27,9 @@ public final class SilverflameSquire extends AdventureCard { // On Alert // Target creature gets +2/+2 until end of turn. Untap it. - this.getAdventureSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); - this.getAdventureSpellAbility().addEffect(new UntapTargetEffect().setText("Untap it")); - this.getAdventureSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellCard().getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); + this.getSpellCard().getSpellAbility().addEffect(new UntapTargetEffect().setText("Untap it")); + this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); } private SilverflameSquire(final SilverflameSquire card) { diff --git a/Mage.Sets/src/mage/cards/s/SmittenSwordmaster.java b/Mage.Sets/src/mage/cards/s/SmittenSwordmaster.java index 6b8641545e5..673f947b493 100644 --- a/Mage.Sets/src/mage/cards/s/SmittenSwordmaster.java +++ b/Mage.Sets/src/mage/cards/s/SmittenSwordmaster.java @@ -33,7 +33,7 @@ public final class SmittenSwordmaster extends AdventureCard { // Curry Favor // You gain X life and each opponent loses X life, where X is the number of Knights you control. - this.getAdventureSpellAbility().addEffect(new CurryFavorEffect()); + this.getSpellCard().getSpellAbility().addEffect(new CurryFavorEffect()); } private SmittenSwordmaster(final SmittenSwordmaster card) { diff --git a/Mage.Sets/src/mage/cards/t/TuinvaleTreefolk.java b/Mage.Sets/src/mage/cards/t/TuinvaleTreefolk.java index 117552adc9c..ba0d79dc7be 100644 --- a/Mage.Sets/src/mage/cards/t/TuinvaleTreefolk.java +++ b/Mage.Sets/src/mage/cards/t/TuinvaleTreefolk.java @@ -26,8 +26,8 @@ public final class TuinvaleTreefolk extends AdventureCard { // Oaken Boon // Put two +1/+1 counters on target creature. - this.getAdventureSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2))); - this.getAdventureSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellCard().getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2))); + this.getSpellCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); } private TuinvaleTreefolk(final TuinvaleTreefolk card) { diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java index 2a8c83a7695..25112e0fafd 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java @@ -327,8 +327,5 @@ public final class ThroneOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Worthy Knight", 36, Rarity.RARE, mage.cards.w.WorthyKnight.class)); cards.add(new SetCardInfo("Yorvo, Lord of Garenbrig", 185, Rarity.RARE, mage.cards.y.YorvoLordOfGarenbrig.class)); cards.add(new SetCardInfo("Youthful Knight", 37, Rarity.COMMON, mage.cards.y.YouthfulKnight.class)); - - // This is here to prevent the incomplete adventure implementation from causing problems and will be removed - cards.removeIf(setCardInfo -> AdventureCard.class.isAssignableFrom(setCardInfo.getCardClass())); } } diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraineCollectorsEdition.java b/Mage.Sets/src/mage/sets/ThroneOfEldraineCollectorsEdition.java index 9606cef6f0c..7edb2592788 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraineCollectorsEdition.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraineCollectorsEdition.java @@ -111,8 +111,5 @@ public final class ThroneOfEldraineCollectorsEdition extends ExpansionSet { cards.add(new SetCardInfo("Witch's Vengeance", 358, Rarity.RARE, mage.cards.w.WitchsVengeance.class)); cards.add(new SetCardInfo("Worthy Knight", 341, Rarity.RARE, mage.cards.w.WorthyKnight.class)); cards.add(new SetCardInfo("Yorvo, Lord of Garenbrig", 376, Rarity.RARE, mage.cards.y.YorvoLordOfGarenbrig.class)); - - // This is here to prevent the incomplete adventure implementation from causing problems and will be removed - cards.removeIf(setCardInfo -> AdventureCard.class.isAssignableFrom(setCardInfo.getCardClass())); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/adventure/CastAdventureCardsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/adventure/CastAdventureCardsTest.java new file mode 100644 index 00000000000..bc7a277ec75 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/adventure/CastAdventureCardsTest.java @@ -0,0 +1,20 @@ +package org.mage.test.cards.cost.adventure; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +public class CastAdventureCardsTest extends CardTestPlayerBase { + @Test + public void testCastCuriousPair() { + addCard(Zone.BATTLEFIELD, playerA, "Forest"); + addCard(Zone.HAND, playerA, "Curious Pair"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Curious Pair"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + assertPermanentCount(playerA, "Food", 1); + assertExileCount(playerA, "Curious Pair", 1); + assertGraveyardCount(playerA,0); + } +} diff --git a/Mage/src/main/java/mage/abilities/effects/common/ExileAdventureSpellEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ExileAdventureSpellEffect.java new file mode 100644 index 00000000000..a168ecb6307 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/common/ExileAdventureSpellEffect.java @@ -0,0 +1,98 @@ +package mage.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.MageSingleton; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.AdventureCard; +import mage.cards.AdventureCardSpell; +import mage.cards.Card; +import mage.constants.AsThoughEffectType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author phulin + */ +public class ExileAdventureSpellEffect extends OneShotEffect implements MageSingleton { + + private static final ExileAdventureSpellEffect instance = new ExileAdventureSpellEffect(); + + public static ExileAdventureSpellEffect getInstance() { + return instance; + } + + private ExileAdventureSpellEffect() { + super(Outcome.Exile); + staticText = ""; + } + + @Override + public ExileAdventureSpellEffect copy() { + return instance; + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Spell spell = game.getStack().getSpell(source.getId()); + if (spell != null && !spell.isCopy()) { + Card spellCard = spell.getCard(); + if (spellCard != null && spellCard instanceof AdventureCardSpell) { + AdventureCardSpell adventureSpellCard = (AdventureCardSpell) spellCard; + if (controller.moveCards(adventureSpellCard, Zone.EXILED, source, game)) { + ContinuousEffect effect = new AdventureCastFromExileEffect(); + effect.setTargetPointer(new FixedTarget(adventureSpellCard.getParentCard().getId(), game)); + game.addEffect(effect, source); + } + } + } + return true; + } + return false; + } +} + +class AdventureCastFromExileEffect extends AsThoughEffectImpl { + + public AdventureCastFromExileEffect() { + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.Custom, Outcome.Benefit); + staticText = "Then exile this card. You may cast the creature later from exile."; + } + + public AdventureCastFromExileEffect(final AdventureCastFromExileEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public AdventureCastFromExileEffect copy() { + return new AdventureCastFromExileEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + UUID targetId = getTargetPointer().getFirst(game, source); + if (targetId == null) { + this.discard(); + } else if (objectId.equals(targetId) + && affectedControllerId.equals(source.getControllerId())) { + Card card = game.getCard(objectId); + return card != null; + } + return false; + } +} \ No newline at end of file diff --git a/Mage/src/main/java/mage/abilities/keyword/AdventureCreatureAbility.java b/Mage/src/main/java/mage/abilities/keyword/AdventureCreatureAbility.java new file mode 100644 index 00000000000..fdb4318225f --- /dev/null +++ b/Mage/src/main/java/mage/abilities/keyword/AdventureCreatureAbility.java @@ -0,0 +1,124 @@ +package mage.abilities.keyword; + +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.Costs; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.Card; +import mage.cards.SplitCard; +import mage.constants.*; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ZoneChangeEvent; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * 702.32. Flashback + * + * 702.32a. Flashback appears on some instants and sorceries. It represents two + * static abilities: one that functions while the card is in a player‘s + * graveyard and the other that functions while the card is on the stack. + * Flashback [cost] means, "You may cast this card from your graveyard by paying + * [cost] rather than paying its mana cost" and, "If the flashback cost was + * paid, exile this card instead of putting it anywhere else any time it would + * leave the stack." Casting a spell using its flashback ability follows the + * rules for paying alternative costs in rules 601.2b and 601.2e–g. + * + * @author phulin + */ +public class AdventureCreatureAbility extends SpellAbility { + + private String abilityName; + private SpellAbility spellAbilityToResolve; + + public AdventureCreatureAbility(Cost cost) { + super(null, "", Zone.EXILED, SpellAbilityType.BASE, SpellAbilityCastMode.NORMAL); + this.setAdditionalCostsRuleVisible(false); + this.name = "Cast creature " + cost.getText(); + this.addCost(cost); + this.timing = TimingRule.SORCERY; + } + + public AdventureCreatureAbility(final AdventureCreatureAbility ability) { + super(ability); + this.spellAbilityType = ability.spellAbilityType; + this.abilityName = ability.abilityName; + this.spellAbilityToResolve = ability.spellAbilityToResolve; + } + + @Override + public ActivationStatus canActivate(UUID playerId, Game game) { + if (super.canActivate(playerId, game).canActivate()) { + Card card = game.getCard(getSourceId()); + if (card != null) { + // Card must be in the exile zone, and it must have been cast as an adventure. + if (game.getState().getZone(card.getId()) != Zone.EXILED) { + return ActivationStatus.getFalse(); + } + // FIXME: Make sure it was cast as an adventure. + return card.getSpellAbility().canActivate(playerId, game); + } + } + return ActivationStatus.getFalse(); + } + + @Override + public Costs getCosts() { + if (spellAbilityToResolve == null) { + return super.getCosts(); + } + return spellAbilityToResolve.getCosts(); + } + + @Override + public AdventureCreatureAbility copy() { + return new AdventureCreatureAbility(this); + } + + @Override + public String getRule(boolean all) { + return this.getRule(); + } + + @Override + public String getRule() { + StringBuilder sbRule = new StringBuilder("Cast from Adventure"); + /*if (!costs.isEmpty()) { + sbRule.append("—"); + } else { + sbRule.append(' '); + } + if (!manaCosts.isEmpty()) { + sbRule.append(manaCosts.getText()); + } + if (!costs.isEmpty()) { + if (!manaCosts.isEmpty()) { + sbRule.append(", "); + } + sbRule.append(costs.getText()); + sbRule.append('.'); + } + if (abilityName != null) { + sbRule.append(' '); + sbRule.append(abilityName); + } + sbRule.append(" (You may cast this card from your graveyard for its flashback cost. Then exile it.)");*/ + return sbRule.toString(); + } + + /** + * Used for split card in PlayerImpl method: + * getOtherUseableActivatedAbilities + * + * @param abilityName + */ + public void setAbilityName(String abilityName) { + this.abilityName = abilityName; + } + +} diff --git a/Mage/src/main/java/mage/cards/AdventureCard.java b/Mage/src/main/java/mage/cards/AdventureCard.java index af213591bb5..b132c4ebb72 100644 --- a/Mage/src/main/java/mage/cards/AdventureCard.java +++ b/Mage/src/main/java/mage/cards/AdventureCard.java @@ -1,8 +1,17 @@ package mage.cards; +import mage.abilities.Abilities; +import mage.abilities.AbilitiesImpl; +import mage.abilities.Ability; import mage.abilities.SpellAbility; -import mage.constants.CardType; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.common.ExileAdventureSpellEffect; +import mage.abilities.keyword.AdventureCreatureAbility; +import mage.constants.*; +import mage.game.Game; +import java.util.List; import java.util.UUID; /** @@ -10,17 +19,89 @@ import java.util.UUID; */ public abstract class AdventureCard extends CardImpl { - protected SpellAbility adventureSpellAbility = new SpellAbility(null, null); + /* The adventure spell card, i.e. Swift End. */ + protected Card spellCard; + /* The ability to cast the creature from exile. */ + protected SpellAbility adventureCreatureAbility; - public AdventureCard(UUID ownerId, CardSetInfo setInfo, CardType[] typesLeft, CardType[] typesRight, String costsLeft, String adventureName, String costsRight) { - super(ownerId, setInfo, typesLeft, costsLeft); + public AdventureCard(UUID ownerId, CardSetInfo setInfo, CardType[] types, CardType[] typesSpell, String costs, String adventureName, String costsSpell) { + super(ownerId, setInfo, types, costs); + spellCard = new AdventureCardSpellImpl(ownerId, setInfo, typesSpell, costsSpell, this); + spellCard.getSpellAbility().addEffect(ExileAdventureSpellEffect.getInstance()); + adventureCreatureAbility = new AdventureCreatureAbility(new ManaCostsImpl(costs)); } public AdventureCard(AdventureCard card) { super(card); + this.spellCard = card.getSpellCard().copy(); + ((AdventureCardSpell)this.spellCard).setParentCard(this); } - public SpellAbility getAdventureSpellAbility() { - return adventureSpellAbility; + public Card getSpellCard() { + return spellCard; + } + + @Override + public void assignNewId() { + super.assignNewId(); + spellCard.assignNewId(); + } + + @Override + public boolean moveToZone(Zone toZone, UUID sourceId, Game game, boolean flag, List appliedEffects) { + if (super.moveToZone(toZone, sourceId, game, flag, appliedEffects)) { + game.getState().setZone(getSpellCard().getId(), toZone); + return true; + } + return false; + } + + @Override + public void setZone(Zone zone, Game game) { + super.setZone(zone, game); + game.setZone(getSpellCard().getId(), zone); + } + + @Override + public boolean moveToExile(UUID exileId, String name, UUID sourceId, Game game, List appliedEffects) { + if (super.moveToExile(exileId, name, sourceId, game, appliedEffects)) { + Zone currentZone = game.getState().getZone(getId()); + game.getState().setZone(getSpellCard().getId(), currentZone); + return true; + } + return false; + } + + @Override + public boolean cast(Game game, Zone fromZone, SpellAbility ability, UUID controllerId) { + switch (ability.getSpellAbilityType()) { + case ADVENTURE_SPELL: + return this.getSpellCard().cast(game, fromZone, ability, controllerId); + default: + this.getSpellCard().getSpellAbility().setControllerId(controllerId); + return super.cast(game, fromZone, ability, controllerId); + } + } + + @Override + public Abilities getAbilities(Game game) { + Abilities allAbilities = new AbilitiesImpl<>(); + for (Ability ability : super.getAbilities(game)) { + if (ability instanceof SpellAbility + && ((SpellAbility) ability).getSpellAbilityType() != SpellAbilityType.SPLIT + && ((SpellAbility) ability).getSpellAbilityType() != SpellAbilityType.SPLIT_AFTERMATH) { + allAbilities.add(ability); + } + } + allAbilities.addAll(spellCard.getAbilities(game)); + return allAbilities; + } + + @Override + public void setOwnerId(UUID ownerId) { + super.setOwnerId(ownerId); + abilities.setControllerId(ownerId); + spellCard.getAbilities().setControllerId(ownerId); + spellCard.setOwnerId(ownerId); } } diff --git a/Mage/src/main/java/mage/cards/AdventureCardSpell.java b/Mage/src/main/java/mage/cards/AdventureCardSpell.java new file mode 100644 index 00000000000..5b873acc8d3 --- /dev/null +++ b/Mage/src/main/java/mage/cards/AdventureCardSpell.java @@ -0,0 +1,20 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.cards; + +/** + * + * @author phulin + */ +public interface AdventureCardSpell extends Card { + + @Override + AdventureCardSpell copy(); + + void setParentCard(AdventureCard card); + + AdventureCard getParentCard(); +} diff --git a/Mage/src/main/java/mage/cards/AdventureCardSpellImpl.java b/Mage/src/main/java/mage/cards/AdventureCardSpellImpl.java new file mode 100644 index 00000000000..ff55557b677 --- /dev/null +++ b/Mage/src/main/java/mage/cards/AdventureCardSpellImpl.java @@ -0,0 +1,89 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.cards; + +import mage.constants.CardType; +import mage.constants.SpellAbilityType; +import mage.constants.Zone; +import mage.game.Game; + +import java.util.List; +import java.util.UUID; + +/** + * + * @author phulin + */ +public class AdventureCardSpellImpl extends CardImpl implements AdventureCardSpell { + + private AdventureCard adventureCardParent; + + public AdventureCardSpellImpl(UUID ownerId, CardSetInfo setInfo, CardType[] cardTypes, String costs, AdventureCard adventureCardParent) { + super(ownerId, setInfo, cardTypes, costs, SpellAbilityType.ADVENTURE_SPELL); + this.adventureCardParent = adventureCardParent; + } + + public AdventureCardSpellImpl(final AdventureCardSpellImpl card) { + super(card); + this.adventureCardParent = card.adventureCardParent; + } + + @Override + public UUID getOwnerId() { + return adventureCardParent.getOwnerId(); + } + + @Override + public String getImageName() { + return adventureCardParent.getImageName(); + } + + @Override + public String getExpansionSetCode() { + return adventureCardParent.getExpansionSetCode(); + } + + @Override + public String getCardNumber() { + return adventureCardParent.getCardNumber(); + } + + @Override + public boolean moveToZone(Zone toZone, UUID sourceId, Game game, boolean flag, List appliedEffects) { + return adventureCardParent.moveToZone(toZone, sourceId, game, flag, appliedEffects); + } + + @Override + public boolean moveToExile(UUID exileId, String name, UUID sourceId, Game game, List appliedEffects) { + return adventureCardParent.moveToExile(exileId, name, sourceId, game, appliedEffects); + } + + @Override + public AdventureCard getMainCard() { + return adventureCardParent; + } + + @Override + public void setZone(Zone zone, Game game) { + game.setZone(adventureCardParent.getId(), zone); + game.setZone(adventureCardParent.getSpellCard().getId(), zone); + } + + @Override + public AdventureCardSpell copy() { + return new AdventureCardSpellImpl(this); + } + + @Override + public void setParentCard(AdventureCard card) { + this.adventureCardParent = card; + } + + @Override + public AdventureCard getParentCard() { + return this.adventureCardParent; + } +} diff --git a/Mage/src/main/java/mage/constants/SpellAbilityType.java b/Mage/src/main/java/mage/constants/SpellAbilityType.java index 509796a2a7a..22427d77be4 100644 --- a/Mage/src/main/java/mage/constants/SpellAbilityType.java +++ b/Mage/src/main/java/mage/constants/SpellAbilityType.java @@ -15,7 +15,7 @@ public enum SpellAbilityType { SPLIT_RIGHT("RightSplit SpellAbility"), MODE("Mode SpellAbility"), SPLICE("Spliced SpellAbility"), - ADVENTURE("Adventure SpellAbility"); + ADVENTURE_SPELL("Adventure SpellAbility"); private final String text;