Implemented Erratic Cyclops

This commit is contained in:
Evan Kranzler 2018-09-13 08:06:59 -04:00
parent 4315772902
commit 7694fd585d
2 changed files with 90 additions and 0 deletions

View file

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

View file

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