From 7cca8a84554fe2ee86a1f9ff9fa27556998bf9ca Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 31 Oct 2020 18:53:25 -0400 Subject: [PATCH] [CMR] Implemented Gnostro, Voice of the Crags --- .../mage/cards/g/GnostroVoiceOfTheCrags.java | 103 ++++++++++++++++++ Mage.Sets/src/mage/sets/CommanderLegends.java | 1 + 2 files changed, 104 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/g/GnostroVoiceOfTheCrags.java diff --git a/Mage.Sets/src/mage/cards/g/GnostroVoiceOfTheCrags.java b/Mage.Sets/src/mage/cards/g/GnostroVoiceOfTheCrags.java new file mode 100644 index 0000000000..efd915102f --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GnostroVoiceOfTheCrags.java @@ -0,0 +1,103 @@ +package mage.cards.g; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; +import mage.watchers.common.CastSpellLastTurnWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GnostroVoiceOfTheCrags extends CardImpl { + + public GnostroVoiceOfTheCrags(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{R}{W}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.CHIMERA); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {T}: Choose one. X is the number of spells you've cast this turn. + // • Scry X. + Ability ability = new SimpleActivatedAbility(new GnostroVoiceOfTheCragsEffect(), new TapSourceCost()); + ability.getModes().setChooseText("choose one. X is the number of spells you've cast this turn."); + + // • Gnostro, Voice of the Crags deals X damage to target creature. + Mode mode = new Mode(new DamageTargetEffect(GnostroVoiceOfTheCragsValue.instance) + .setText("{this} deals X damage to target creature")); + mode.addTarget(new TargetCreaturePermanent()); + ability.addMode(mode); + + // • You gain X life. + ability.addMode(new Mode(new GainLifeEffect(GnostroVoiceOfTheCragsValue.instance).setText("you gain X life"))); + } + + private GnostroVoiceOfTheCrags(final GnostroVoiceOfTheCrags card) { + super(card); + } + + @Override + public GnostroVoiceOfTheCrags copy() { + return new GnostroVoiceOfTheCrags(this); + } +} + +enum GnostroVoiceOfTheCragsValue implements DynamicValue { + instance; + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class); + return watcher == null ? 0 : watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(sourceAbility.getControllerId()); + } + + @Override + public GnostroVoiceOfTheCragsValue copy() { + return instance; + } + + @Override + public String getMessage() { + return ""; + } +} + +class GnostroVoiceOfTheCragsEffect extends OneShotEffect { + + GnostroVoiceOfTheCragsEffect() { + super(Outcome.Benefit); + staticText = "scry X"; + } + + private GnostroVoiceOfTheCragsEffect(final GnostroVoiceOfTheCragsEffect effect) { + super(effect); + } + + @Override + public GnostroVoiceOfTheCragsEffect copy() { + return new GnostroVoiceOfTheCragsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegends.java b/Mage.Sets/src/mage/sets/CommanderLegends.java index 70f08574c4..5f803db4b8 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegends.java +++ b/Mage.Sets/src/mage/sets/CommanderLegends.java @@ -81,6 +81,7 @@ public final class CommanderLegends extends ExpansionSet { cards.add(new SetCardInfo("Ghen, Arcanum Weaver", 275, Rarity.RARE, mage.cards.g.GhenArcanumWeaver.class)); cards.add(new SetCardInfo("Ghost of Ramirez DePietro", 71, Rarity.UNCOMMON, mage.cards.g.GhostOfRamirezDePietro.class)); cards.add(new SetCardInfo("Gift of Paradise", 229, Rarity.COMMON, mage.cards.g.GiftOfParadise.class)); + cards.add(new SetCardInfo("Gnostro, Voice of the Crags", 276, Rarity.RARE, mage.cards.g.GnostroVoiceOfTheCrags.class)); cards.add(new SetCardInfo("Gor Muldrak, Amphinologist", 277, Rarity.RARE, mage.cards.g.GorMuldrakAmphinologist.class)); cards.add(new SetCardInfo("Halana, Kessig Ranger", 231, Rarity.UNCOMMON, mage.cards.h.HalanaKessigRanger.class)); cards.add(new SetCardInfo("Horizon Scholar", 73, Rarity.UNCOMMON, mage.cards.h.HorizonScholar.class));