From 7a8feb501724d94e86cd801c3c1aea81839623e3 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 8 Apr 2022 09:05:02 -0400 Subject: [PATCH] [SNC] Implemented Ziatora, the Incinerator --- .../mage/cards/z/ZiatoraTheIncinerator.java | 97 +++++++++++++++++++ .../src/mage/sets/StreetsOfNewCapenna.java | 1 + 2 files changed, 98 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/z/ZiatoraTheIncinerator.java diff --git a/Mage.Sets/src/mage/cards/z/ZiatoraTheIncinerator.java b/Mage.Sets/src/mage/cards/z/ZiatoraTheIncinerator.java new file mode 100644 index 0000000000..1590eee30e --- /dev/null +++ b/Mage.Sets/src/mage/cards/z/ZiatoraTheIncinerator.java @@ -0,0 +1,97 @@ +package mage.cards.z; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.delayed.ReflexiveTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.TreasureToken; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.common.TargetAnyTarget; +import mage.target.common.TargetControlledPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ZiatoraTheIncinerator extends CardImpl { + + public ZiatoraTheIncinerator(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{R}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.DEMON); + this.subtype.add(SubType.DRAGON); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // At the beginning of your end step, you may sacrifice another creature. When you do, Ziatora, the Incinerator deals damage equal to that creature's power to any target and you create three Treasure tokens. + this.addAbility(new BeginningOfEndStepTriggeredAbility( + new ZiatoraTheIncineratorEffect(), TargetController.YOU, false + )); + } + + private ZiatoraTheIncinerator(final ZiatoraTheIncinerator card) { + super(card); + } + + @Override + public ZiatoraTheIncinerator copy() { + return new ZiatoraTheIncinerator(this); + } +} + +class ZiatoraTheIncineratorEffect extends OneShotEffect { + + ZiatoraTheIncineratorEffect() { + super(Outcome.Benefit); + staticText = "you may sacrifice another creature. When you do, {this} deals damage " + + "equal to that creature's power to any target and you create three Treasure tokens"; + } + + private ZiatoraTheIncineratorEffect(final ZiatoraTheIncineratorEffect effect) { + super(effect); + } + + @Override + public ZiatoraTheIncineratorEffect copy() { + return new ZiatoraTheIncineratorEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + TargetPermanent target = new TargetControlledPermanent( + 0, 1, StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE, true + ); + player.choose(Outcome.Sacrifice, target, source, game); + Permanent permanent = game.getPermanent(target.getFirstTarget()); + if (permanent == null || !permanent.sacrifice(source, game)) { + return false; + } + ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility( + new DamageTargetEffect(permanent.getPower().getValue()), false + ); + ability.addEffect(new CreateTokenEffect(new TreasureToken(), 3).concatBy("and")); + ability.addTarget(new TargetAnyTarget()); + game.fireReflexiveTriggeredAbility(ability, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java index f41fb42f62..ea5310389d 100644 --- a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java +++ b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java @@ -65,6 +65,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet { cards.add(new SetCardInfo("Waterfront District", 259, Rarity.COMMON, mage.cards.w.WaterfrontDistrict.class)); cards.add(new SetCardInfo("Xander's Lounge", 260, Rarity.RARE, mage.cards.x.XandersLounge.class)); cards.add(new SetCardInfo("Ziatora's Proving Ground", 261, Rarity.RARE, mage.cards.z.ZiatorasProvingGround.class)); + cards.add(new SetCardInfo("Ziatora, the Incinerator", 231, Rarity.MYTHIC, mage.cards.z.ZiatoraTheIncinerator.class)); cards.removeIf(setCardInfo -> unfinished.contains(setCardInfo.getName())); // remove when shield counters are implemented }