From 0069f6181bd9ea27103d2ba41fd8be0324fe1458 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 24 Nov 2022 08:46:15 -0500 Subject: [PATCH] [J22] Implement Daring Piracy --- Mage.Sets/src/mage/cards/d/DaringPiracy.java | 65 +++++++++++++++++++ Mage.Sets/src/mage/sets/Jumpstart2022.java | 1 + .../game/permanent/token/PirateRedToken.java | 32 +++++++++ 3 files changed, 98 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/d/DaringPiracy.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/PirateRedToken.java diff --git a/Mage.Sets/src/mage/cards/d/DaringPiracy.java b/Mage.Sets/src/mage/cards/d/DaringPiracy.java new file mode 100644 index 0000000000..579aa1c9d1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DaringPiracy.java @@ -0,0 +1,65 @@ +package mage.cards.d; + +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfCombatTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.game.Game; +import mage.game.permanent.token.PirateRedToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DaringPiracy extends CardImpl { + + public DaringPiracy(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + + // At the beginning of your combat on your turn, create a 1/1 red Pirate creature token with menace and haste. Exile it at the beginning of the next end step. + this.addAbility(new BeginningOfCombatTriggeredAbility( + new DaringPiracyEffect(), TargetController.YOU, false + )); + } + + private DaringPiracy(final DaringPiracy card) { + super(card); + } + + @Override + public DaringPiracy copy() { + return new DaringPiracy(this); + } +} + +class DaringPiracyEffect extends OneShotEffect { + + DaringPiracyEffect() { + super(Outcome.Benefit); + staticText = "create a 1/1 red Pirate creature token with menace and haste. " + + "Exile it at the beginning of the next end step"; + } + + private DaringPiracyEffect(final DaringPiracyEffect effect) { + super(effect); + } + + @Override + public DaringPiracyEffect copy() { + return new DaringPiracyEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + CreateTokenEffect effect = new CreateTokenEffect(new PirateRedToken()); + effect.apply(game, source); + effect.exileTokensCreatedAtNextEndStep(game, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/Jumpstart2022.java b/Mage.Sets/src/mage/sets/Jumpstart2022.java index 26534a3743..a7a22bc3f9 100644 --- a/Mage.Sets/src/mage/sets/Jumpstart2022.java +++ b/Mage.Sets/src/mage/sets/Jumpstart2022.java @@ -35,6 +35,7 @@ public final class Jumpstart2022 extends ExpansionSet { cards.add(new SetCardInfo("Coldsteel Heart", 94, Rarity.UNCOMMON, mage.cards.c.ColdsteelHeart.class)); cards.add(new SetCardInfo("Conductor of Cacophony", 20, Rarity.UNCOMMON, mage.cards.c.ConductorOfCacophony.class)); cards.add(new SetCardInfo("Crypt Rats", 392, Rarity.UNCOMMON, mage.cards.c.CryptRats.class)); + cards.add(new SetCardInfo("Daring Piracy", 33, Rarity.UNCOMMON, mage.cards.d.DaringPiracy.class)); cards.add(new SetCardInfo("Deadly Plot", 22, Rarity.UNCOMMON, mage.cards.d.DeadlyPlot.class)); cards.add(new SetCardInfo("Demon of Catastrophes", 397, Rarity.RARE, mage.cards.d.DemonOfCatastrophes.class)); cards.add(new SetCardInfo("Diabolic Edict", 67, Rarity.COMMON, mage.cards.d.DiabolicEdict.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/PirateRedToken.java b/Mage/src/main/java/mage/game/permanent/token/PirateRedToken.java new file mode 100644 index 0000000000..c83ca3279a --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/PirateRedToken.java @@ -0,0 +1,32 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.MenaceAbility; +import mage.constants.CardType; +import mage.constants.SubType; + +/** + * @author TheElk801 + */ +public final class PirateRedToken extends TokenImpl { + + public PirateRedToken() { + super("Pirate Token", "1/1 red Pirate creature token with menace and haste"); + cardType.add(CardType.CREATURE); + color.setRed(true); + subtype.add(SubType.PIRATE); + power = new MageInt(1); + toughness = new MageInt(1); + addAbility(new MenaceAbility(false)); + addAbility(HasteAbility.getInstance()); + } + + public PirateRedToken(final PirateRedToken token) { + super(token); + } + + public PirateRedToken copy() { + return new PirateRedToken(this); + } +}