From 7694fd585dfff0c25f8ad7a4650b37d58b179e5c Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 13 Sep 2018 08:06:59 -0400 Subject: [PATCH] Implemented Erratic Cyclops --- .../src/mage/cards/e/ErraticCyclops.java | 89 +++++++++++++++++++ Mage.Sets/src/mage/sets/GuildsOfRavnica.java | 1 + 2 files changed, 90 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/e/ErraticCyclops.java diff --git a/Mage.Sets/src/mage/cards/e/ErraticCyclops.java b/Mage.Sets/src/mage/cards/e/ErraticCyclops.java new file mode 100644 index 00000000000..18816aa9cd0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/ErraticCyclops.java @@ -0,0 +1,89 @@ +package mage.cards.e; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.constants.SubType; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.Spell; + +/** + * + * @author TheElk801 + */ +public final class ErraticCyclops extends CardImpl { + + public ErraticCyclops(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}"); + + this.subtype.add(SubType.CYCLOPS); + this.subtype.add(SubType.SHAMAN); + this.power = new MageInt(0); + this.toughness = new MageInt(8); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Whenever you cast an instant or sorcery spell, Erratic Cyclops gets +X/+0 until end of turn, where X is that spell's converted mana cost. + this.addAbility(new ErraticCyclopsTriggeredAbility()); + } + + public ErraticCyclops(final ErraticCyclops card) { + super(card); + } + + @Override + public ErraticCyclops copy() { + return new ErraticCyclops(this); + } +} + +class ErraticCyclopsTriggeredAbility extends TriggeredAbilityImpl { + + public ErraticCyclopsTriggeredAbility() { + super(Zone.BATTLEFIELD, null, false); + } + + public ErraticCyclopsTriggeredAbility(final ErraticCyclopsTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SPELL_CAST; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.isControlledBy(controllerId) + && (spell.isInstant() || spell.isSorcery())) { + this.getEffects().clear(); + this.addEffect(new BoostSourceEffect( + spell.getConvertedManaCost(), 0, Duration.EndOfTurn + )); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you cast an instant or sorcery spell, " + + "{this} gets +X/+X until end of turn, " + + "where X is that spell's converted mana cost"; + } + + @Override + public ErraticCyclopsTriggeredAbility copy() { + return new ErraticCyclopsTriggeredAbility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/GuildsOfRavnica.java b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java index aa0752a90b6..7490b19aa47 100644 --- a/Mage.Sets/src/mage/sets/GuildsOfRavnica.java +++ b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java @@ -49,6 +49,7 @@ public final class GuildsOfRavnica extends ExpansionSet { cards.add(new SetCardInfo("District Guide", 128, Rarity.UNCOMMON, mage.cards.d.DistrictGuide.class)); cards.add(new SetCardInfo("Dream Eater", 38, Rarity.MYTHIC, mage.cards.d.DreamEater.class)); cards.add(new SetCardInfo("Emmara, Soul of the Accord", 168, Rarity.RARE, mage.cards.e.EmmaraSoulOfTheAccord.class)); + cards.add(new SetCardInfo("Erratic Cyclops", 98, Rarity.RARE, mage.cards.e.ErraticCyclops.class)); cards.add(new SetCardInfo("Expansion // Explosion", 224, Rarity.RARE, mage.cards.e.ExpansionExplosion.class)); cards.add(new SetCardInfo("Find // Finality", 225, Rarity.RARE, mage.cards.f.FindFinality.class)); cards.add(new SetCardInfo("Firemind's Research", 171, Rarity.RARE, mage.cards.f.FiremindsResearch.class));