From 4c5d74b7ac884cbc2390d43f196789ea6c8fa97f Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 9 Aug 2019 21:55:38 -0400 Subject: [PATCH] Implemented Skyfire Phoenix --- .../src/mage/cards/s/SkyfirePhoenix.java | 74 +++++++++++++++++++ .../src/mage/sets/Commander2019Edition.java | 1 + 2 files changed, 75 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SkyfirePhoenix.java diff --git a/Mage.Sets/src/mage/cards/s/SkyfirePhoenix.java b/Mage.Sets/src/mage/cards/s/SkyfirePhoenix.java new file mode 100644 index 0000000000..062653e2c2 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SkyfirePhoenix.java @@ -0,0 +1,74 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.CommanderCardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.events.GameEvent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SkyfirePhoenix extends CardImpl { + + public SkyfirePhoenix(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + + this.subtype.add(SubType.PHOENIX); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // When you cast your commander, return Skyfire Phoenix from your graveyard to the battlefield. + this.addAbility(new SkyfirePhoenixTriggeredAbility()); + } + + private SkyfirePhoenix(final SkyfirePhoenix card) { + super(card); + } + + @Override + public SkyfirePhoenix copy() { + return new SkyfirePhoenix(this); + } +} + +class SkyfirePhoenixTriggeredAbility extends SpellCastControllerTriggeredAbility { + + SkyfirePhoenixTriggeredAbility() { + super(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), StaticFilters.FILTER_SPELL, false, false); + this.rule = "When you cast your commander, return {this} from your graveyard to the battlefield."; + } + + private SkyfirePhoenixTriggeredAbility(final SkyfirePhoenixTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return super.checkTrigger(event, game) && game.getCommandersIds( + game.getPlayer(getControllerId()), CommanderCardType.COMMANDER_OR_OATHBREAKER + ).contains(event.getTargetId()); + } + + @Override + public SkyfirePhoenixTriggeredAbility copy() { + return new SkyfirePhoenixTriggeredAbility(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Commander2019Edition.java b/Mage.Sets/src/mage/sets/Commander2019Edition.java index 672d3fc09a..39b310e470 100644 --- a/Mage.Sets/src/mage/sets/Commander2019Edition.java +++ b/Mage.Sets/src/mage/sets/Commander2019Edition.java @@ -237,6 +237,7 @@ public final class Commander2019Edition extends ExpansionSet { cards.add(new SetCardInfo("Simic Growth Chamber", 274, Rarity.UNCOMMON, mage.cards.s.SimicGrowthChamber.class)); cards.add(new SetCardInfo("Simic Guildgate", 275, Rarity.COMMON, mage.cards.s.SimicGuildgate.class)); cards.add(new SetCardInfo("Skinthinner", 129, Rarity.COMMON, mage.cards.s.Skinthinner.class)); + cards.add(new SetCardInfo("Skyfire Phoenix", 28, Rarity.RARE, mage.cards.s.SkyfirePhoenix.class)); cards.add(new SetCardInfo("Slice in Twain", 181, Rarity.UNCOMMON, mage.cards.s.SliceInTwain.class)); cards.add(new SetCardInfo("Sol Ring", 221, Rarity.UNCOMMON, mage.cards.s.SolRing.class)); cards.add(new SetCardInfo("Solemn Simulacrum", 222, Rarity.RARE, mage.cards.s.SolemnSimulacrum.class));