From d6dd122e268408a494eddce0fa799126e6d2733a Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 6 Nov 2022 10:39:54 -0500 Subject: [PATCH] [BRO] Implement Steel Seraph --- Mage.Sets/src/mage/cards/s/SteelSeraph.java | 105 ++++++++++++++++++++ Mage.Sets/src/mage/sets/TheBrothersWar.java | 1 + 2 files changed, 106 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SteelSeraph.java diff --git a/Mage.Sets/src/mage/cards/s/SteelSeraph.java b/Mage.Sets/src/mage/cards/s/SteelSeraph.java new file mode 100644 index 00000000000..1822b6ecfc7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SteelSeraph.java @@ -0,0 +1,105 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfCombatTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.abilities.keyword.PrototypeAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetControlledCreaturePermanent; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SteelSeraph extends CardImpl { + + public SteelSeraph(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}"); + + this.subtype.add(SubType.ANGEL); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Prototype {1}{W}{W} -- 3/3 + this.addAbility(new PrototypeAbility(this, "{1}{W}{W}", 3, 3)); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // At the beginning of combat on your turn, target creature you control gains your choice of flying, vigilance, or lifelink until end of turn. + Ability ability = new BeginningOfCombatTriggeredAbility( + new SteelSeraphEffect(), TargetController.YOU, false + ); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + } + + private SteelSeraph(final SteelSeraph card) { + super(card); + } + + @Override + public SteelSeraph copy() { + return new SteelSeraph(this); + } +} + +class SteelSeraphEffect extends OneShotEffect { + + private static final Map map = new HashMap<>(); + + static { + map.put("Flying", FlyingAbility.getInstance()); + map.put("Vigilance", VigilanceAbility.getInstance()); + map.put("Lifelink", LifelinkAbility.getInstance()); + } + + SteelSeraphEffect() { + super(Outcome.Benefit); + staticText = "target creature you control gains your choice of flying, vigilance, or lifelink until end of turn"; + } + + private SteelSeraphEffect(final SteelSeraphEffect effect) { + super(effect); + } + + @Override + public SteelSeraphEffect copy() { + return new SteelSeraphEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Choice choice = new ChoiceImpl(true); + choice.setMessage("Choose an ability"); + choice.setChoices(map.keySet()); + player.choose(outcome, choice, game); + Ability ability = map.getOrDefault(choice.getChoice(), null); + if (ability == null) { + return false; + } + game.addEffect(new GainAbilityTargetEffect(ability), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/TheBrothersWar.java b/Mage.Sets/src/mage/sets/TheBrothersWar.java index 01c15d286b5..4f8b981ca4d 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWar.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWar.java @@ -217,6 +217,7 @@ public final class TheBrothersWar extends ExpansionSet { 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("Steel Exemplar", 246, Rarity.UNCOMMON, mage.cards.s.SteelExemplar.class)); + cards.add(new SetCardInfo("Steel Seraph", 38, Rarity.RARE, mage.cards.s.SteelSeraph.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)); cards.add(new SetCardInfo("Su-Chi Cave Guard", 249, Rarity.UNCOMMON, mage.cards.s.SuChiCaveGuard.class));