diff --git a/Mage.Sets/src/mage/cards/s/SparktongueDragon.java b/Mage.Sets/src/mage/cards/s/SparktongueDragon.java new file mode 100644 index 00000000000..1e683affa27 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SparktongueDragon.java @@ -0,0 +1,114 @@ +package mage.cards.s; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.SendOptionUsedEventEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.common.TargetAnyTarget; + +/** + * + * @author TheElk801 + */ +public final class SparktongueDragon extends CardImpl { + + public SparktongueDragon(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + + this.subtype.add(SubType.DRAGON); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Sparktongue Dragon enters the battlefield, you may pay {2}{R}. When you do, it deals 3 damage to any target. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new DoIfCostPaid( + new SparktongueDragonCreateReflexiveTriggerEffect(), + new ManaCostsImpl("{2}{R}"), + "Pay {2}{R} to deal 3 damage?" + ).setText("you may pay {2}{R}. When you do, it deals 3 damage to any target") + )); + } + + public SparktongueDragon(final SparktongueDragon card) { + super(card); + } + + @Override + public SparktongueDragon copy() { + return new SparktongueDragon(this); + } +} + +class SparktongueDragonCreateReflexiveTriggerEffect extends OneShotEffect { + + public SparktongueDragonCreateReflexiveTriggerEffect() { + super(Outcome.Benefit); + this.staticText = "When you do, it deals 3 damage to any target"; + } + + public SparktongueDragonCreateReflexiveTriggerEffect(final SparktongueDragonCreateReflexiveTriggerEffect effect) { + super(effect); + } + + @Override + public SparktongueDragonCreateReflexiveTriggerEffect copy() { + return new SparktongueDragonCreateReflexiveTriggerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + game.addDelayedTriggeredAbility(new SparktongueDragonReflexiveTriggeredAbility(), source); + return new SendOptionUsedEventEffect().apply(game, source); + } +} + +class SparktongueDragonReflexiveTriggeredAbility extends DelayedTriggeredAbility { + + public SparktongueDragonReflexiveTriggeredAbility() { + super(new DamageTargetEffect(3), Duration.OneUse, false); + this.addTarget(new TargetAnyTarget()); + } + + public SparktongueDragonReflexiveTriggeredAbility(final SparktongueDragonReflexiveTriggeredAbility ability) { + super(ability); + } + + @Override + public SparktongueDragonReflexiveTriggeredAbility copy() { + return new SparktongueDragonReflexiveTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.OPTION_USED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getPlayerId().equals(this.getControllerId()) + && event.getSourceId().equals(this.getSourceId()); + } + + @Override + public String getRule() { + return "When you pay {2}{R}, {this} deals 3 damage to any target"; + } +} diff --git a/Mage.Sets/src/mage/sets/CoreSet2019.java b/Mage.Sets/src/mage/sets/CoreSet2019.java index f29f37376db..eaaff679187 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2019.java +++ b/Mage.Sets/src/mage/sets/CoreSet2019.java @@ -106,6 +106,7 @@ public final class CoreSet2019 extends ExpansionSet { cards.add(new SetCardInfo("Sleep", 74, Rarity.UNCOMMON, mage.cards.s.Sleep.class)); cards.add(new SetCardInfo("Snapping Drake", 75, Rarity.COMMON, mage.cards.s.SnappingDrake.class)); cards.add(new SetCardInfo("Sovereign's Bite", 120, Rarity.COMMON, mage.cards.s.SovereignsBite.class)); + cards.add(new SetCardInfo("Sparktongue Dragon", 159, Rarity.COMMON, mage.cards.s.SparktongueDragon.class)); cards.add(new SetCardInfo("Star-Crowned Stag", 38, Rarity.COMMON, mage.cards.s.StarCrownedStag.class)); cards.add(new SetCardInfo("Strangling Spores", 122, Rarity.COMMON, mage.cards.s.StranglingSpores.class)); cards.add(new SetCardInfo("Sun Sentinel", 307, Rarity.COMMON, mage.cards.s.SunSentinel.class));