From 36fe1d68f5cd6b61dbf76b2e29bb78d221d53481 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 18 Apr 2019 17:55:36 -0400 Subject: [PATCH] Implemented Snarespinner --- Mage.Sets/src/mage/cards/s/Snarespinner.java | 78 ++++++++++++++++++++ Mage.Sets/src/mage/sets/WarOfTheSpark.java | 1 + 2 files changed, 79 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/Snarespinner.java diff --git a/Mage.Sets/src/mage/cards/s/Snarespinner.java b/Mage.Sets/src/mage/cards/s/Snarespinner.java new file mode 100644 index 0000000000..d738467dd8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/Snarespinner.java @@ -0,0 +1,78 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class Snarespinner extends CardImpl { + + public Snarespinner(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); + + this.subtype.add(SubType.SPIDER); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Reach + this.addAbility(ReachAbility.getInstance()); + + // Whenever Snarespinner blocks a creature with flying, Snarespinner gets +2/+0 until end of turn. + this.addAbility(new SnarespinnerTriggeredAbility()); + } + + private Snarespinner(final Snarespinner card) { + super(card); + } + + @Override + public Snarespinner copy() { + return new Snarespinner(this); + } +} + +class SnarespinnerTriggeredAbility extends TriggeredAbilityImpl { + + SnarespinnerTriggeredAbility() { + super(Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Duration.EndOfTurn), false); + } + + private SnarespinnerTriggeredAbility(final SnarespinnerTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.BLOCKER_DECLARED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getSourceId().equals(this.getSourceId()) + && game.getPermanent(event.getTargetId()).getAbilities().containsKey(FlyingAbility.getInstance().getId()); + } + + @Override + public String getRule() { + return "Whenever {this} blocks a creature with flying, {} gets +2/+0 until end of turn"; + } + + @Override + public SnarespinnerTriggeredAbility copy() { + return new SnarespinnerTriggeredAbility(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/WarOfTheSpark.java b/Mage.Sets/src/mage/sets/WarOfTheSpark.java index f2d82c4d4a..7a6eaa6987 100644 --- a/Mage.Sets/src/mage/sets/WarOfTheSpark.java +++ b/Mage.Sets/src/mage/sets/WarOfTheSpark.java @@ -224,6 +224,7 @@ public final class WarOfTheSpark extends ExpansionSet { cards.add(new SetCardInfo("Shriekdiver", 103, Rarity.COMMON, mage.cards.s.Shriekdiver.class)); cards.add(new SetCardInfo("Silent Submersible", 66, Rarity.RARE, mage.cards.s.SilentSubmersible.class)); cards.add(new SetCardInfo("Single Combat", 30, Rarity.RARE, mage.cards.s.SingleCombat.class)); + cards.add(new SetCardInfo("Snarespinner", 176, Rarity.COMMON, mage.cards.s.Snarespinner.class)); cards.add(new SetCardInfo("Solar Blaze", 216, Rarity.RARE, mage.cards.s.SolarBlaze.class)); cards.add(new SetCardInfo("Sorin's Thirst", 104, Rarity.COMMON, mage.cards.s.SorinsThirst.class)); cards.add(new SetCardInfo("Sorin, Vengeful Bloodlord", 217, Rarity.RARE, mage.cards.s.SorinVengefulBloodlord.class));