From 1d8aa446a5b85b7da21a8cd1d1b582c38342fa94 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Tue, 2 Apr 2024 16:01:29 -0400 Subject: [PATCH] [OTJ] Implement The Gitrog, Ravenous Ride --- .../cards/c/CalamityGallopingInferno.java | 3 +- .../src/mage/cards/f/FortuneLoyalSteed.java | 3 +- Mage.Sets/src/mage/cards/g/GiantBeaver.java | 3 +- .../src/mage/cards/r/RamblingPossum.java | 3 +- .../mage/cards/t/TheGitrogRavenousRide.java | 114 ++++++++++++++++++ .../mage/sets/OutlawsOfThunderJunction.java | 1 + .../mage/abilities/keyword/SaddleAbility.java | 2 + 7 files changed, 121 insertions(+), 8 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/t/TheGitrogRavenousRide.java diff --git a/Mage.Sets/src/mage/cards/c/CalamityGallopingInferno.java b/Mage.Sets/src/mage/cards/c/CalamityGallopingInferno.java index b57141ebe4a..33229316e6d 100644 --- a/Mage.Sets/src/mage/cards/c/CalamityGallopingInferno.java +++ b/Mage.Sets/src/mage/cards/c/CalamityGallopingInferno.java @@ -21,7 +21,6 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPermanent; -import mage.watchers.common.SaddledMountWatcher; import java.util.UUID; @@ -43,7 +42,7 @@ public final class CalamityGallopingInferno extends CardImpl { this.addAbility(HasteAbility.getInstance()); // Whenever Calamity, Galloping Inferno attacks while saddled, choose a nonlegendary creature that saddled it this turn and create a tapped and attacking token that's a copy of it. Sacrifice that token at the beginning of the next end step. Repeat this process once. - this.addAbility(new AttacksWhileSaddledTriggeredAbility(new CalamityGallopingInfernoEffect()), new SaddledMountWatcher()); + this.addAbility(new AttacksWhileSaddledTriggeredAbility(new CalamityGallopingInfernoEffect())); // Saddle 1 this.addAbility(new SaddleAbility(1)); diff --git a/Mage.Sets/src/mage/cards/f/FortuneLoyalSteed.java b/Mage.Sets/src/mage/cards/f/FortuneLoyalSteed.java index 51556508fc0..5b08cd4f2cf 100644 --- a/Mage.Sets/src/mage/cards/f/FortuneLoyalSteed.java +++ b/Mage.Sets/src/mage/cards/f/FortuneLoyalSteed.java @@ -24,7 +24,6 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPermanent; import mage.target.targetpointer.FixedTargets; -import mage.watchers.common.SaddledMountWatcher; import java.util.ArrayList; import java.util.List; @@ -51,7 +50,7 @@ public final class FortuneLoyalSteed extends CardImpl { // Whenever Fortune attacks while saddled, at end of combat, exile it and up to one creature that saddled it this turn, then return those cards to the battlefield under their owner's control. this.addAbility(new AttacksWhileSaddledTriggeredAbility(new CreateDelayedTriggeredAbilityEffect( new AtTheEndOfCombatDelayedTriggeredAbility(new FortuneLoyalSteedEffect()) - )), new SaddledMountWatcher()); + ))); // Saddle 1 this.addAbility(new SaddleAbility(1)); diff --git a/Mage.Sets/src/mage/cards/g/GiantBeaver.java b/Mage.Sets/src/mage/cards/g/GiantBeaver.java index eebcc316ae2..a167d691449 100644 --- a/Mage.Sets/src/mage/cards/g/GiantBeaver.java +++ b/Mage.Sets/src/mage/cards/g/GiantBeaver.java @@ -15,7 +15,6 @@ import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.SaddledSourceThisTurnPredicate; import mage.target.TargetPermanent; -import mage.watchers.common.SaddledMountWatcher; import java.util.UUID; @@ -44,7 +43,7 @@ public final class GiantBeaver extends CardImpl { // Whenever Giant Beaver attacks while saddled, put a +1/+1 counter on target creature that saddled it this turn. Ability ability = new AttacksWhileSaddledTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance())); ability.addTarget(new TargetPermanent(filter)); - this.addAbility(ability, new SaddledMountWatcher()); + this.addAbility(ability); // Saddle 3 this.addAbility(new SaddleAbility(3)); diff --git a/Mage.Sets/src/mage/cards/r/RamblingPossum.java b/Mage.Sets/src/mage/cards/r/RamblingPossum.java index 0781a9cc936..83ab173cced 100644 --- a/Mage.Sets/src/mage/cards/r/RamblingPossum.java +++ b/Mage.Sets/src/mage/cards/r/RamblingPossum.java @@ -16,7 +16,6 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPermanent; -import mage.watchers.common.SaddledMountWatcher; import java.util.Objects; import java.util.Set; @@ -41,7 +40,7 @@ public final class RamblingPossum extends CardImpl { 1, 2, Duration.EndOfTurn, "it" )); ability.addEffect(new RamblingPossumEffect()); - this.addAbility(ability, new SaddledMountWatcher()); + this.addAbility(ability); // Saddle 1 this.addAbility(new SaddleAbility(1)); diff --git a/Mage.Sets/src/mage/cards/t/TheGitrogRavenousRide.java b/Mage.Sets/src/mage/cards/t/TheGitrogRavenousRide.java new file mode 100644 index 00000000000..27e4b14ee58 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TheGitrogRavenousRide.java @@ -0,0 +1,114 @@ +package mage.cards.t; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.SaddleAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.*; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.SaddledSourceThisTurnPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInHand; +import mage.target.common.TargetSacrifice; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TheGitrogRavenousRide extends CardImpl { + + public TheGitrogRavenousRide(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{G}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.FROG); + this.subtype.add(SubType.HORROR); + this.subtype.add(SubType.MOUNT); + this.power = new MageInt(6); + this.toughness = new MageInt(5); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // Whenever The Gitrog, Ravenous Ride deals combat damage to a player, you may sacrifice a creature that saddled it this turn. If you do, draw X cards, then put up to X land cards from your hand onto the battlefield tapped, where X is the sacrificed creature's power. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new TheGitrogRavenousRideEffect(), false)); + + // Saddle 1 + this.addAbility(new SaddleAbility(1)); + } + + private TheGitrogRavenousRide(final TheGitrogRavenousRide card) { + super(card); + } + + @Override + public TheGitrogRavenousRide copy() { + return new TheGitrogRavenousRide(this); + } +} + +class TheGitrogRavenousRideEffect extends OneShotEffect { + + private static final FilterPermanent filter = new FilterCreaturePermanent("creature that saddled it this turn"); + + static { + filter.add(SaddledSourceThisTurnPredicate.instance); + } + + TheGitrogRavenousRideEffect() { + super(Outcome.Benefit); + staticText = "you may sacrifice a creature that saddled it this turn. " + + "If you do, draw X cards, then put up to X land cards from your hand onto the battlefield tapped, " + + "where X is the sacrificed creature's power"; + } + + private TheGitrogRavenousRideEffect(final TheGitrogRavenousRideEffect effect) { + super(effect); + } + + @Override + public TheGitrogRavenousRideEffect copy() { + return new TheGitrogRavenousRideEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + TargetSacrifice target = new TargetSacrifice(0, 1, filter); + player.choose(outcome, target, source, game); + Permanent permanent = game.getPermanent(target.getFirstTarget()); + if (permanent == null) { + return false; + } + int power = permanent.getPower().getValue(); + permanent.sacrifice(source, game); + player.drawCards(power, source, game); + TargetCard targetCard = new TargetCardInHand(0, power, StaticFilters.FILTER_CARD_LANDS); + player.choose(outcome, player.getHand(), targetCard, source, game); + Cards cards = new CardsImpl(targetCard.getTargets()); + player.moveCards( + cards.getCards(game), Zone.BATTLEFIELD, source, game, + true, false, false, null + ); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java b/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java index 5d17e081bb4..9ce6568d284 100644 --- a/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java +++ b/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java @@ -258,6 +258,7 @@ public final class OutlawsOfThunderJunction extends ExpansionSet { cards.add(new SetCardInfo("Take for a Ride", 148, Rarity.UNCOMMON, mage.cards.t.TakeForARide.class)); cards.add(new SetCardInfo("Take the Fall", 73, Rarity.COMMON, mage.cards.t.TakeTheFall.class)); cards.add(new SetCardInfo("Terror of the Peaks", 149, Rarity.MYTHIC, mage.cards.t.TerrorOfThePeaks.class)); + cards.add(new SetCardInfo("The Gitrog, Ravenous Ride", 206, Rarity.MYTHIC, mage.cards.t.TheGitrogRavenousRide.class)); cards.add(new SetCardInfo("The Key to the Vault", 54, Rarity.RARE, mage.cards.t.TheKeyToTheVault.class)); cards.add(new SetCardInfo("This Town Ain't Big Enough", 74, Rarity.UNCOMMON, mage.cards.t.ThisTownAintBigEnough.class)); cards.add(new SetCardInfo("Three Steps Ahead", 75, Rarity.RARE, mage.cards.t.ThreeStepsAhead.class)); diff --git a/Mage/src/main/java/mage/abilities/keyword/SaddleAbility.java b/Mage/src/main/java/mage/abilities/keyword/SaddleAbility.java index 09432f063ca..3add5303ef5 100644 --- a/Mage/src/main/java/mage/abilities/keyword/SaddleAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/SaddleAbility.java @@ -20,6 +20,7 @@ import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.target.Target; import mage.target.common.TargetControlledCreaturePermanent; +import mage.watchers.common.SaddledMountWatcher; import java.awt.*; import java.util.Objects; @@ -39,6 +40,7 @@ public class SaddleAbility extends SimpleActivatedAbility { this.value = value; this.addHint(hint); this.setTiming(TimingRule.SORCERY); + this.addWatcher(new SaddledMountWatcher()); } private SaddleAbility(final SaddleAbility ability) {