From 12c14e01318edcfb122dd269d8b4a73e9ee8a0d4 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 4 Nov 2022 19:51:20 -0400 Subject: [PATCH] [BRO] Implement Spotter Thopter --- .../src/mage/cards/s/SpotterThopter.java | 78 +++++++++++++++++++ Mage.Sets/src/mage/sets/TheBrothersWar.java | 1 + 2 files changed, 79 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SpotterThopter.java diff --git a/Mage.Sets/src/mage/cards/s/SpotterThopter.java b/Mage.Sets/src/mage/cards/s/SpotterThopter.java new file mode 100644 index 00000000000..172dffb0c48 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SpotterThopter.java @@ -0,0 +1,78 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.PrototypeAbility; +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.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SpotterThopter extends CardImpl { + + public SpotterThopter(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{8}"); + + this.subtype.add(SubType.THOPTER); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Prototype {3}{U} -- 2/3 + this.addAbility(new PrototypeAbility(this, "{3}{U}", 2, 3)); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Spotter Thopter enters the battlefield, scry X, where X is its power. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SpotterThopterEffect())); + } + + private SpotterThopter(final SpotterThopter card) { + super(card); + } + + @Override + public SpotterThopter copy() { + return new SpotterThopter(this); + } +} + +class SpotterThopterEffect extends OneShotEffect { + + SpotterThopterEffect() { + super(Outcome.Benefit); + staticText = "scry X, where X is its power"; + } + + private SpotterThopterEffect(final SpotterThopterEffect effect) { + super(effect); + } + + @Override + public SpotterThopterEffect copy() { + return new SpotterThopterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent permanent = source.getSourcePermanentOrLKI(game); + if (player == null || permanent == null) { + return false; + } + int power = permanent.getPower().getValue(); + return power > 0 && player.scry(power, source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/TheBrothersWar.java b/Mage.Sets/src/mage/sets/TheBrothersWar.java index 79659d92016..d2dd53aa2d2 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWar.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWar.java @@ -179,6 +179,7 @@ public final class TheBrothersWar extends ExpansionSet { cards.add(new SetCardInfo("Skitterbeam Battalion", 165, Rarity.MYTHIC, mage.cards.s.SkitterbeamBattalion.class)); cards.add(new SetCardInfo("Skystrike Officer", 62, Rarity.RARE, mage.cards.s.SkystrikeOfficer.class)); cards.add(new SetCardInfo("Splitting the Powerstone", 63, Rarity.UNCOMMON, mage.cards.s.SplittingThePowerstone.class)); + cards.add(new SetCardInfo("Spotter Thopter", 80, Rarity.UNCOMMON, mage.cards.s.SpotterThopter.class)); cards.add(new SetCardInfo("Static Net", 27, Rarity.UNCOMMON, mage.cards.s.StaticNet.class)); cards.add(new SetCardInfo("Stern Lesson", 64, Rarity.COMMON, mage.cards.s.SternLesson.class)); cards.add(new SetCardInfo("Stone Retrieval Unit", 248, Rarity.COMMON, mage.cards.s.StoneRetrievalUnit.class));