From 62cc7806016811b60c786a863150934e3e7e1445 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 1 Nov 2022 21:42:41 -0400 Subject: [PATCH] [BRO] Implement Su-Chi Cave Guard --- .../src/mage/cards/s/SuChiCaveGuard.java | 78 +++++++++++++++++++ Mage.Sets/src/mage/sets/TheBrothersWar.java | 1 + 2 files changed, 79 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SuChiCaveGuard.java diff --git a/Mage.Sets/src/mage/cards/s/SuChiCaveGuard.java b/Mage.Sets/src/mage/cards/s/SuChiCaveGuard.java new file mode 100644 index 0000000000..cc13228d90 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SuChiCaveGuard.java @@ -0,0 +1,78 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.DiesSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.abilities.keyword.WardAbility; +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.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SuChiCaveGuard extends CardImpl { + + public SuChiCaveGuard(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{8}"); + + this.subtype.add(SubType.CONSTRUCT); + this.power = new MageInt(8); + this.toughness = new MageInt(8); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // Ward {4} + this.addAbility(new WardAbility(new ManaCostsImpl<>("{4}"))); + + // When Su-Chi Cave Guard dies, add eight {C}. Until end of turn, you don't lose this mana as steps and phases end. + this.addAbility(new DiesSourceTriggeredAbility(new SuChiCaveGuardEffect())); + } + + private SuChiCaveGuard(final SuChiCaveGuard card) { + super(card); + } + + @Override + public SuChiCaveGuard copy() { + return new SuChiCaveGuard(this); + } +} + +class SuChiCaveGuardEffect extends OneShotEffect { + + SuChiCaveGuardEffect() { + super(Outcome.Benefit); + staticText = "add eight {C}. Until end of turn, you don't lose this mana as steps and phases end"; + } + + private SuChiCaveGuardEffect(final SuChiCaveGuardEffect effect) { + super(effect); + } + + @Override + public SuChiCaveGuardEffect copy() { + return new SuChiCaveGuardEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.getManaPool().addMana(Mana.ColorlessMana(8), game, source, true); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/TheBrothersWar.java b/Mage.Sets/src/mage/sets/TheBrothersWar.java index 40b076d40f..dcd7dd2ea8 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWar.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWar.java @@ -96,6 +96,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("Splitting the Powerstone", 63, Rarity.UNCOMMON, mage.cards.s.SplittingThePowerstone.class)); cards.add(new SetCardInfo("Stern Lesson", 64, Rarity.COMMON, mage.cards.s.SternLesson.class)); + cards.add(new SetCardInfo("Su-Chi Cave Guard", 249, Rarity.UNCOMMON, mage.cards.s.SuChiCaveGuard.class)); cards.add(new SetCardInfo("Surge Engine", 81, Rarity.MYTHIC, mage.cards.s.SurgeEngine.class)); cards.add(new SetCardInfo("Survivor of Korlis", 28, Rarity.COMMON, mage.cards.s.SurvivorOfKorlis.class)); cards.add(new SetCardInfo("Swamp", 282, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS));