From 70d107d1aaeef5939a0b16d094841f7552a865d7 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 16 Jan 2021 14:16:00 -0500 Subject: [PATCH] [KHM] Implemented Cosmos Elixir --- Mage.Sets/src/mage/cards/c/CosmosElixir.java | 52 ++++++++++++++++++++ Mage.Sets/src/mage/sets/Kaldheim.java | 1 + Utils/mtg-cards-data.txt | 1 + 3 files changed, 54 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CosmosElixir.java diff --git a/Mage.Sets/src/mage/cards/c/CosmosElixir.java b/Mage.Sets/src/mage/cards/c/CosmosElixir.java new file mode 100644 index 0000000000..038177976a --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CosmosElixir.java @@ -0,0 +1,52 @@ +package mage.cards.c; + +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class CosmosElixir extends CardImpl { + + public CosmosElixir(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); + + // At the beginning of your end step, draw a card if your life total is greater than your starting life total. Otherwise, you gain 2 life. + this.addAbility(new BeginningOfEndStepTriggeredAbility(new ConditionalOneShotEffect( + new DrawCardSourceControllerEffect(1), new GainLifeEffect(2), + CosmosElixirCondition.instance, "draw a card if your life total " + + "is greater than your starting life total. Otherwise, you gain 2 life" + ), TargetController.YOU, false)); + } + + private CosmosElixir(final CosmosElixir card) { + super(card); + } + + @Override + public CosmosElixir copy() { + return new CosmosElixir(this); + } +} + +enum CosmosElixirCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + return player != null && player.getLife() > game.getLife(); + } +} diff --git a/Mage.Sets/src/mage/sets/Kaldheim.java b/Mage.Sets/src/mage/sets/Kaldheim.java index 34501c1b2a..a3dbbbed6b 100644 --- a/Mage.Sets/src/mage/sets/Kaldheim.java +++ b/Mage.Sets/src/mage/sets/Kaldheim.java @@ -101,6 +101,7 @@ public final class Kaldheim extends ExpansionSet { cards.add(new SetCardInfo("Clarion Spirit", 6, Rarity.UNCOMMON, mage.cards.c.ClarionSpirit.class)); cards.add(new SetCardInfo("Cleaving Reaper", 376, Rarity.RARE, mage.cards.c.CleavingReaper.class)); cards.add(new SetCardInfo("Colossal Plow", 236, Rarity.UNCOMMON, mage.cards.c.ColossalPlow.class)); + cards.add(new SetCardInfo("Cosmos Elixir", 237, Rarity.RARE, mage.cards.c.CosmosElixir.class)); cards.add(new SetCardInfo("Crush the Weak", 128, Rarity.UNCOMMON, mage.cards.c.CrushTheWeak.class)); cards.add(new SetCardInfo("Cyclone Summoner", 52, Rarity.RARE, mage.cards.c.CycloneSummoner.class)); cards.add(new SetCardInfo("Darkbore Pathway", 254, Rarity.RARE, mage.cards.d.DarkborePathway.class)); diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 25afc8fa73..e84c3a1bcc 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -40204,6 +40204,7 @@ Vega, the Watcher|Kaldheim|233|U|{1}{W}{U}|Legendary Creature - Bird Spirit|2|2| Waking the Trolls|Kaldheim|234|R|{4}{R}{G}|Enchantment - Saga|||(As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.)$I — Destroy target land.$II — Put target land card from a graveyard onto the battlefield under your control.$III — Choose target opponent. If they control fewer lands than you, create a number of 4/4 green Troll Warrior creature tokens with trample equal to the difference.| Bloodline Pretender|Kaldheim|235|U|{3}|Artifact Creature - Shapeshifter|2|2|Changeling$As Bloodline Pretender enters the battlefield, choose a creature type.$Whenever another creature of the chosen type enters the battlefield under your control, put a +1/+1 counter on Bloodline Pretender.| Colossal Plow|Kaldheim|236|U|{2}|Artifact - Vehicle|6|3|Whenever Colossal Plow attacks, add {W}{W}{W} and you gain 3 life. Until end of turn, you don't lose this mana as steps and phases end.$Crew 6| +Cosmos Elixir|Kaldheim|237|R|{4}|Artifact|||At the beginning of your end step, draw a card if your life total is greater than your starting life total. Otherwise, you gain 2 life.| Funeral Longboat|Kaldheim|238|C|{2}|Artifact - Vehicle|3|3|Vigilance$Crew 1| Goldvein Pick|Kaldheim|239|C|{2}|Artifact - Equipment|||Equipped creature gets +1/+1.$Whenever equipped creature deals combat damage to a player, create a Treasure token.$Equip {1}| Maskwood Nexus|Kaldheim|240|R|{4}|Artifact|||Creatures you control are every creature type. The same is true for creature spells you control and creature cards you own that aren't on the battlefield.${3}, {T}: Create a 2/2 blue Shapeshifter creature token with changeling.|