From 6439c97e82aace2c2d59f67ff5e03e0ee1a06cd3 Mon Sep 17 00:00:00 2001 From: PurpleCrowbar <26198472+PurpleCrowbar@users.noreply.github.com> Date: Mon, 15 Jan 2024 03:34:37 +0000 Subject: [PATCH] [PH19] Implement The Cinematic Phoenix (#11657) --- .../dl/sources/ScryfallImageSupportCards.java | 1 + .../src/mage/cards/t/TheCinematicPhoenix.java | 111 ++++++++++++++++++ .../src/mage/sets/HeroesOfTheRealm2019.java | 26 ++++ 3 files changed, 138 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TheCinematicPhoenix.java create mode 100644 Mage.Sets/src/mage/sets/HeroesOfTheRealm2019.java diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSupportCards.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSupportCards.java index 394792190a9..b38bbb607ef 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSupportCards.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/ScryfallImageSupportCards.java @@ -469,6 +469,7 @@ public class ScryfallImageSupportCards { add("C20"); // Commander 2020 Edition add("M21"); // Core Set 2021 add("JMP"); // Jumpstart + add("PH19"); // 2019 Heroes of the Realm add("2XM"); // Double Masters add("AKR"); // Amonkhet Remastered add("ZNR"); // Zendikar Rising diff --git a/Mage.Sets/src/mage/cards/t/TheCinematicPhoenix.java b/Mage.Sets/src/mage/cards/t/TheCinematicPhoenix.java new file mode 100644 index 00000000000..61bb6999cdc --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TheCinematicPhoenix.java @@ -0,0 +1,111 @@ +package mage.cards.t; + +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.filter.common.FilterCreatureCard; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetControlledPermanent; + +import java.util.List; +import java.util.UUID; + +/** + * @author PurpleCrowbar + */ +public final class TheCinematicPhoenix extends CardImpl { + + private static final FilterCreatureCard filter = new FilterCreatureCard("legendary creature card from your graveyard"); + + static { + filter.add(SuperType.LEGENDARY.getPredicate()); + } + + public TheCinematicPhoenix(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{R}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.PHOENIX); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // Protection from red + this.addAbility(ProtectionAbility.from(ObjectColor.RED)); + + // {1}, {T}: Return target legendary creature card from your graveyard to the battlefield. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToBattlefieldTargetEffect(), new GenericManaCost(1)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCardInYourGraveyard(filter)); + this.addAbility(ability); + + // Tap six untapped creatures you control: Return The Cinematic Phoenix from your graveyard to the battlefield. If you tapped six legendary creatures this way, you win the game. + ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), + new TapTargetCost(new TargetControlledPermanent(6, StaticFilters.FILTER_CONTROLLED_UNTAPPED_CREATURES)) + ); + ability.addEffect(new TheCinematicPhoenixEffect()); + this.addAbility(ability); + } + + private TheCinematicPhoenix(final TheCinematicPhoenix card) { + super(card); + } + + @Override + public TheCinematicPhoenix copy() { + return new TheCinematicPhoenix(this); + } +} + +class TheCinematicPhoenixEffect extends OneShotEffect { + + TheCinematicPhoenixEffect() { + super(Outcome.Win); + this.staticText = "If you tapped six legendary creatures this way, you win the game"; + } + + private TheCinematicPhoenixEffect(final TheCinematicPhoenixEffect effect) { + super(effect); + } + + @Override + public TheCinematicPhoenixEffect copy() { + return new TheCinematicPhoenixEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + List tapped = (List) getValue("tappedPermanents"); + Player controller = game.getPlayer(source.getControllerId()); + if (tapped == null || tapped.isEmpty() || controller == null) { + return false; + } + if (tapped.stream().allMatch(permanent -> permanent.isLegendary(game))) { + controller.won(game); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/HeroesOfTheRealm2019.java b/Mage.Sets/src/mage/sets/HeroesOfTheRealm2019.java new file mode 100644 index 00000000000..cfd981d8c54 --- /dev/null +++ b/Mage.Sets/src/mage/sets/HeroesOfTheRealm2019.java @@ -0,0 +1,26 @@ +package mage.sets; + +import mage.cards.ExpansionSet; +import mage.constants.Rarity; +import mage.constants.SetType; + +/** + * https://scryfall.com/sets/ph19 + * @author PurpleCrowbar + */ +public class HeroesOfTheRealm2019 extends ExpansionSet { + + private static final HeroesOfTheRealm2019 instance = new HeroesOfTheRealm2019(); + + public static HeroesOfTheRealm2019 getInstance() { + return instance; + } + + private HeroesOfTheRealm2019() { + super("Heroes of the Realm 2019", "PH19", ExpansionSet.buildDate(2020, 8, 1), SetType.JOKESET); + this.hasBoosters = false; + this.hasBasicLands = false; + + cards.add(new SetCardInfo("The Cinematic Phoenix", 6, Rarity.MYTHIC, mage.cards.t.TheCinematicPhoenix.class)); + } +}