From 9ba949369e9f46ae366f555bb9e025b249d95347 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 5 Apr 2020 16:20:52 -0400 Subject: [PATCH] Implemented Insatiable Hemophage --- .../src/mage/cards/i/InsatiableHemophage.java | 53 +++++++++++++++++++ .../src/mage/sets/IkoriaLairOfBehemoths.java | 1 + .../common/SourceMutatedCount.java | 35 ++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/i/InsatiableHemophage.java create mode 100644 Mage/src/main/java/mage/abilities/dynamicvalue/common/SourceMutatedCount.java diff --git a/Mage.Sets/src/mage/cards/i/InsatiableHemophage.java b/Mage.Sets/src/mage/cards/i/InsatiableHemophage.java new file mode 100644 index 0000000000..118438619b --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/InsatiableHemophage.java @@ -0,0 +1,53 @@ +package mage.cards.i; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.MutatesSourceTriggeredAbility; +import mage.abilities.dynamicvalue.common.SourceMutatedCount; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.MutateAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class InsatiableHemophage extends CardImpl { + + public InsatiableHemophage(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); + + this.subtype.add(SubType.NIGHTMARE); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Mutate {2}{B} + this.addAbility(new MutateAbility(this, "{2}{B}")); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // Whenever this creature mutates, each opponent loses X life and you gain X life, where X is the number of times this creature has mutated. + Ability ability = new MutatesSourceTriggeredAbility( + new LoseLifeOpponentsEffect(SourceMutatedCount.instance).setText("each opponent loses X life") + ); + ability.addEffect(new GainLifeEffect(SourceMutatedCount.instance) + .setText("and you gain X life, where X is the number of times this creature has mutated")); + this.addAbility(ability); + } + + private InsatiableHemophage(final InsatiableHemophage card) { + super(card); + } + + @Override + public InsatiableHemophage copy() { + return new InsatiableHemophage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java b/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java index 406f967bd4..e50100765b 100644 --- a/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java +++ b/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java @@ -53,6 +53,7 @@ public final class IkoriaLairOfBehemoths extends ExpansionSet { cards.add(new SetCardInfo("Glowstone Recluse", 156, Rarity.UNCOMMON, mage.cards.g.GlowstoneRecluse.class)); cards.add(new SetCardInfo("Grimdancer", 90, Rarity.UNCOMMON, mage.cards.g.Grimdancer.class)); cards.add(new SetCardInfo("Indatha Crystal", 235, Rarity.UNCOMMON, mage.cards.i.IndathaCrystal.class)); + cards.add(new SetCardInfo("Insatiable Hemophage", 93, Rarity.UNCOMMON, mage.cards.i.InsatiableHemophage.class)); cards.add(new SetCardInfo("Ketria Crystal", 236, Rarity.UNCOMMON, mage.cards.k.KetriaCrystal.class)); cards.add(new SetCardInfo("Kogla, the Titan Ape", 162, Rarity.RARE, mage.cards.k.KoglaTheTitanApe.class)); cards.add(new SetCardInfo("Migration Path", 164, Rarity.UNCOMMON, mage.cards.m.MigrationPath.class)); diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SourceMutatedCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SourceMutatedCount.java new file mode 100644 index 0000000000..349828a0a5 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SourceMutatedCount.java @@ -0,0 +1,35 @@ +package mage.abilities.dynamicvalue.common; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.game.Game; + +/** + * @author TheElk801 + */ +public enum SourceMutatedCount implements DynamicValue { + + instance; + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + // TODO: Implement this + return 0; + } + + @Override + public SourceMutatedCount copy() { + return instance; + } + + @Override + public String toString() { + return "X"; + } + + @Override + public String getMessage() { + return "the number of times this creature has mutated"; + } +}