From ad032ca1de4ff9217c75ff62002d39cac8fb6934 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sat, 8 Apr 2023 19:22:40 -0400 Subject: [PATCH] [MOM] Implement Sun-Blessed Guardian / Furnace-Blessed Conqueror --- .../mage/cards/f/FurnaceBlessedConqueror.java | 88 +++++++++++++++++++ .../src/mage/cards/s/SunBlessedGuardian.java | 42 +++++++++ .../src/mage/sets/MarchOfTheMachine.java | 2 + 3 files changed, 132 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/FurnaceBlessedConqueror.java create mode 100644 Mage.Sets/src/mage/cards/s/SunBlessedGuardian.java diff --git a/Mage.Sets/src/mage/cards/f/FurnaceBlessedConqueror.java b/Mage.Sets/src/mage/cards/f/FurnaceBlessedConqueror.java new file mode 100644 index 0000000000..3b69d44dcf --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FurnaceBlessedConqueror.java @@ -0,0 +1,88 @@ +package mage.cards.f; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenCopyTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class FurnaceBlessedConqueror extends CardImpl { + + public FurnaceBlessedConqueror(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, ""); + + this.subtype.add(SubType.PHYREXIAN); + this.subtype.add(SubType.CLERIC); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + this.color.setWhite(true); + this.color.setRed(true); + this.nightCard = true; + + // Whenever Furnace-Blessed Conqueror attacks, create a tapped and attacking token that's a copy of it. Put a +1/+1 counter on that token for each +1/+1 counter on Furnace-Blessed Conqueror. Sacrifice that token at the beginning of the next end step. + this.addAbility(new AttacksTriggeredAbility(new FurnaceBlessedConquerorEffect())); + } + + private FurnaceBlessedConqueror(final FurnaceBlessedConqueror card) { + super(card); + } + + @Override + public FurnaceBlessedConqueror copy() { + return new FurnaceBlessedConqueror(this); + } +} + +class FurnaceBlessedConquerorEffect extends OneShotEffect { + + FurnaceBlessedConquerorEffect() { + super(Outcome.Benefit); + staticText = "create a tapped and attacking token that's a copy of it. " + + "Put a +1/+1 counter on that token for each +1/+1 counter on {this}. " + + "Sacrifice that token at the beginning of the next end step"; + } + + private FurnaceBlessedConquerorEffect(final FurnaceBlessedConquerorEffect effect) { + super(effect); + } + + @Override + public FurnaceBlessedConquerorEffect copy() { + return new FurnaceBlessedConquerorEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = source.getSourcePermanentIfItStillExists(game); + if (permanent == null) { + return false; + } + CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect( + null, null, false, 1, true, true + ); + effect.setSavedPermanent(permanent); + effect.apply(game, source); + effect.sacrificeTokensCreatedAtNextEndStep(game, source); + int counters = permanent.getCounters(game).getCount(CounterType.P1P1); + if (counters < 1) { + return true; + } + for (Permanent token : effect.getAddedPermanents()) { + token.addCounters(CounterType.P1P1.createInstance(counters), source, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/s/SunBlessedGuardian.java b/Mage.Sets/src/mage/cards/s/SunBlessedGuardian.java new file mode 100644 index 0000000000..4a19774bc9 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SunBlessedGuardian.java @@ -0,0 +1,42 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.TransformSourceEffect; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SunBlessedGuardian extends CardImpl { + + public SunBlessedGuardian(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.CLERIC); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + this.secondSideCardClazz = mage.cards.f.FurnaceBlessedConqueror.class; + + // {5}{R/P}: Transform Sun-Blessed Guardian. Activate only as a sorcery. + this.addAbility(new TransformAbility()); + this.addAbility(new ActivateAsSorceryActivatedAbility(new TransformSourceEffect(), new ManaCostsImpl<>("{5}{R/P}"))); + } + + private SunBlessedGuardian(final SunBlessedGuardian card) { + super(card); + } + + @Override + public SunBlessedGuardian copy() { + return new SunBlessedGuardian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java index c62b86033d..91b1062ede 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java @@ -95,6 +95,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Furnace Gremlin", 139, Rarity.UNCOMMON, mage.cards.f.FurnaceGremlin.class)); cards.add(new SetCardInfo("Furnace Host Charger", 140, Rarity.COMMON, mage.cards.f.FurnaceHostCharger.class)); cards.add(new SetCardInfo("Furnace Reins", 141, Rarity.UNCOMMON, mage.cards.f.FurnaceReins.class)); + cards.add(new SetCardInfo("Furnace-Blessed Conqueror", 38, Rarity.UNCOMMON, mage.cards.f.FurnaceBlessedConqueror.class)); cards.add(new SetCardInfo("Furtive Analyst", 59, Rarity.COMMON, mage.cards.f.FurtiveAnalyst.class)); cards.add(new SetCardInfo("Gift of Compleation", 106, Rarity.UNCOMMON, mage.cards.g.GiftOfCompleation.class)); cards.add(new SetCardInfo("Gitaxian Mindstinger", 88, Rarity.COMMON, mage.cards.g.GitaxianMindstinger.class)); @@ -205,6 +206,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Storm the Seedcore", 206, Rarity.UNCOMMON, mage.cards.s.StormTheSeedcore.class)); cards.add(new SetCardInfo("Stormclaw Rager", 254, Rarity.UNCOMMON, mage.cards.s.StormclawRager.class)); cards.add(new SetCardInfo("Streetwise Negotiator", 207, Rarity.UNCOMMON, mage.cards.s.StreetwiseNegotiator.class)); + cards.add(new SetCardInfo("Sun-Blessed Guardian", 38, Rarity.UNCOMMON, mage.cards.s.SunBlessedGuardian.class)); cards.add(new SetCardInfo("Sunder the Gateway", 39, Rarity.COMMON, mage.cards.s.SunderTheGateway.class)); cards.add(new SetCardInfo("Sunfall", 40, Rarity.RARE, mage.cards.s.Sunfall.class)); cards.add(new SetCardInfo("Swamp", 279, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));