[CMR] Implemented Gnostro, Voice of the Crags

This commit is contained in:
Evan Kranzler 2020-10-31 18:53:25 -04:00
parent b82b213939
commit 7cca8a8455
2 changed files with 104 additions and 0 deletions

View file

@ -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;
}
}

View file

@ -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("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("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("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("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("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)); cards.add(new SetCardInfo("Horizon Scholar", 73, Rarity.UNCOMMON, mage.cards.h.HorizonScholar.class));