From 1eb836d516afbda24f2785ff7e3fa09c493b3c08 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Tue, 12 Nov 2024 11:25:33 -0500 Subject: [PATCH] [J25] Implement Sandstorm Crasher --- .../src/mage/cards/s/SandstormCrasher.java | 85 +++++++++++++++++++ .../src/mage/sets/FoundationsJumpstart.java | 1 + 2 files changed, 86 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SandstormCrasher.java diff --git a/Mage.Sets/src/mage/cards/s/SandstormCrasher.java b/Mage.Sets/src/mage/cards/s/SandstormCrasher.java new file mode 100644 index 00000000000..565f89a3470 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SandstormCrasher.java @@ -0,0 +1,85 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BecomesExertSourceTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenCopyTargetEffect; +import mage.abilities.keyword.ExertAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SandstormCrasher extends CardImpl { + + public SandstormCrasher(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}"); + + this.subtype.add(SubType.MINOTAUR); + this.subtype.add(SubType.BERSERKER); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // You may exert Sandstorm Crasher as it attacks. When you do, create a tapped and attacking token that's a copy of target creature you control. Sacrifice the token at the beginning of the next end step. + BecomesExertSourceTriggeredAbility ability = new BecomesExertSourceTriggeredAbility(new SandstormCrasherEffect()); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(new ExertAbility(ability)); + } + + private SandstormCrasher(final SandstormCrasher card) { + super(card); + } + + @Override + public SandstormCrasher copy() { + return new SandstormCrasher(this); + } +} + +class SandstormCrasherEffect extends OneShotEffect { + + SandstormCrasherEffect() { + super(Outcome.Benefit); + staticText = "create a tapped and attacking token that's a copy of target creature you control. " + + "Sacrifice the token at the beginning of the next end step"; + } + + private SandstormCrasherEffect(final SandstormCrasherEffect effect) { + super(effect); + } + + @Override + public SandstormCrasherEffect copy() { + return new SandstormCrasherEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent == null) { + return false; + } + CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect( + null, null, false, 1, true, true + ); + effect.setSavedPermanent(permanent); + effect.apply(game, source); + effect.sacrificeTokensCreatedAtNextEndStep(game, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/FoundationsJumpstart.java b/Mage.Sets/src/mage/sets/FoundationsJumpstart.java index 4dc15b775bf..d777335a18b 100644 --- a/Mage.Sets/src/mage/sets/FoundationsJumpstart.java +++ b/Mage.Sets/src/mage/sets/FoundationsJumpstart.java @@ -562,6 +562,7 @@ public final class FoundationsJumpstart extends ExpansionSet { cards.add(new SetCardInfo("Sai, Master Thopterist", 63, Rarity.RARE, mage.cards.s.SaiMasterThopterist.class)); cards.add(new SetCardInfo("Sanctum Seeker", 485, Rarity.RARE, mage.cards.s.SanctumSeeker.class)); cards.add(new SetCardInfo("Sandsteppe Outcast", 248, Rarity.COMMON, mage.cards.s.SandsteppeOutcast.class)); + cards.add(new SetCardInfo("Sandstorm Crasher", 18, Rarity.RARE, mage.cards.s.SandstormCrasher.class)); cards.add(new SetCardInfo("Sangromancer", 122, Rarity.RARE, mage.cards.s.Sangromancer.class)); cards.add(new SetCardInfo("Saproling Migration", 709, Rarity.COMMON, mage.cards.s.SaprolingMigration.class)); cards.add(new SetCardInfo("Sarkhan's Rage", 594, Rarity.COMMON, mage.cards.s.SarkhansRage.class));