From e465eab1bc81c9c4e9cf2aba1a012d42aeba9450 Mon Sep 17 00:00:00 2001 From: Susucre <34709007+Susucre@users.noreply.github.com> Date: Wed, 27 Mar 2024 22:27:11 +0100 Subject: [PATCH] [OTJ] Implement Bovine Intervention --- .../src/mage/cards/b/BovineIntervention.java | 46 +++++++++++++++++++ .../mage/sets/OutlawsOfThunderJunction.java | 1 + .../mage/game/permanent/token/Ox22Token.java | 31 +++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BovineIntervention.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/Ox22Token.java diff --git a/Mage.Sets/src/mage/cards/b/BovineIntervention.java b/Mage.Sets/src/mage/cards/b/BovineIntervention.java new file mode 100644 index 00000000000..a314d7ebb34 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BovineIntervention.java @@ -0,0 +1,46 @@ +package mage.cards.b; + +import mage.abilities.effects.common.CreateTokenControllerTargetPermanentEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.game.permanent.token.Ox22Token; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author Susucr + */ +public final class BovineIntervention extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact or creature"); + + static { + filter.add(Predicates.or( + CardType.ARTIFACT.getPredicate(), + CardType.CREATURE.getPredicate()) + ); + } + + public BovineIntervention(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}"); + + // Destroy target artifact or creature. Its controller creates a 2/2 white Ox creature token. + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addEffect(new CreateTokenControllerTargetPermanentEffect(new Ox22Token())); + } + + private BovineIntervention(final BovineIntervention card) { + super(card); + } + + @Override + public BovineIntervention copy() { + return new BovineIntervention(this); + } +} diff --git a/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java b/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java index 76129110611..03bd04b91c1 100644 --- a/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java +++ b/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java @@ -31,6 +31,7 @@ public final class OutlawsOfThunderJunction extends ExpansionSet { cards.add(new SetCardInfo("Armored Armadillo", 3, Rarity.COMMON, mage.cards.a.ArmoredArmadillo.class)); cards.add(new SetCardInfo("Blooming Marsh", 266, Rarity.RARE, mage.cards.b.BloomingMarsh.class)); cards.add(new SetCardInfo("Botanical Sanctum", 267, Rarity.RARE, mage.cards.b.BotanicalSanctum.class)); + cards.add(new SetCardInfo("Bovine Intervention", 6, Rarity.UNCOMMON, mage.cards.b.BovineIntervention.class)); cards.add(new SetCardInfo("Bristling Backwoods", 253, Rarity.COMMON, mage.cards.b.BristlingBackwoods.class)); cards.add(new SetCardInfo("Colossal Rattlewurm", 159, Rarity.RARE, mage.cards.c.ColossalRattlewurm.class)); cards.add(new SetCardInfo("Concealed Courtyard", 268, Rarity.RARE, mage.cards.c.ConcealedCourtyard.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/Ox22Token.java b/Mage/src/main/java/mage/game/permanent/token/Ox22Token.java new file mode 100644 index 00000000000..9f52a5ccd33 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/Ox22Token.java @@ -0,0 +1,31 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.constants.CardType; +import mage.constants.SubType; + +/** + * @author Susucr + */ +public final class Ox22Token extends TokenImpl { + + public Ox22Token() { + super("Ox Token", "2/2 white Ox creature token"); + + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add(SubType.OX); + power = new MageInt(2); + toughness = new MageInt(2); + + } + + private Ox22Token(final Ox22Token token) { + super(token); + } + + @Override + public Ox22Token copy() { + return new Ox22Token(this); + } +}