From 39d83d9e210f52a1da591ae58aeb3861d55a991b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 24 May 2019 21:59:59 -0400 Subject: [PATCH] Implemented Hexdrinker --- Mage.Sets/src/mage/cards/h/Hexdrinker.java | 88 +++++++++++++++++++++ Mage.Sets/src/mage/sets/ModernHorizons.java | 1 + 2 files changed, 89 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/h/Hexdrinker.java diff --git a/Mage.Sets/src/mage/cards/h/Hexdrinker.java b/Mage.Sets/src/mage/cards/h/Hexdrinker.java new file mode 100644 index 0000000000..9cc50eb781 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/Hexdrinker.java @@ -0,0 +1,88 @@ +package mage.cards.h; + +import mage.MageInt; +import mage.MageObject; +import mage.abilities.AbilitiesImpl; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.LevelUpAbility; +import mage.abilities.keyword.LevelerCardBuilder; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardSetInfo; +import mage.cards.LevelerCard; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class Hexdrinker extends LevelerCard { + + private static final FilterCard filter = new FilterCard("instants"); + + static { + filter.add(new CardTypePredicate(CardType.INSTANT)); + } + + public Hexdrinker(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}"); + + this.subtype.add(SubType.SNAKE); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Level up {1} + this.addAbility(new LevelUpAbility(new ManaCostsImpl("{1}"))); + + // LEVEL 3-7 + // 4/4 + // Protection from instants + // LEVEL 8+ + // 6/6 + // Protection from everything + this.addAbilities(LevelerCardBuilder.construct( + new LevelerCardBuilder.LevelAbility( + 3, 7, new AbilitiesImpl(new ProtectionAbility(filter)), 4, 4 + ), + new LevelerCardBuilder.LevelAbility( + 8, -1, new AbilitiesImpl(new HexdrinkerProtectionAbility()), 6, 6 + ) + )); + + this.setMaxLevelCounters(8); + } + + private Hexdrinker(final Hexdrinker card) { + super(card); + } + + @Override + public Hexdrinker copy() { + return new Hexdrinker(this); + } +} + +class HexdrinkerProtectionAbility extends ProtectionAbility { + + HexdrinkerProtectionAbility() { + super(new FilterCard("everything")); + } + + private HexdrinkerProtectionAbility(final HexdrinkerProtectionAbility ability) { + super(ability); + } + + @Override + public HexdrinkerProtectionAbility copy() { + return new HexdrinkerProtectionAbility(this); + } + + @Override + public boolean canTarget(MageObject source, Game game) { + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/ModernHorizons.java b/Mage.Sets/src/mage/sets/ModernHorizons.java index cf2a15b191..e12e3ce80f 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons.java @@ -64,6 +64,7 @@ public final class ModernHorizons extends ExpansionSet { cards.add(new SetCardInfo("Goblin War Party", 131, Rarity.COMMON, mage.cards.g.GoblinWarParty.class)); cards.add(new SetCardInfo("Good-Fortune Unicorn", 201, Rarity.UNCOMMON, mage.cards.g.GoodFortuneUnicorn.class)); cards.add(new SetCardInfo("Headless Specter", 95, Rarity.COMMON, mage.cards.h.HeadlessSpecter.class)); + cards.add(new SetCardInfo("Hexdrinker", 168, Rarity.MYTHIC, mage.cards.h.Hexdrinker.class)); cards.add(new SetCardInfo("Hollowhead Sliver", 132, Rarity.UNCOMMON, mage.cards.h.HollowheadSliver.class)); cards.add(new SetCardInfo("Ice-Fang Coatl", 203, Rarity.RARE, mage.cards.i.IceFangCoatl.class)); cards.add(new SetCardInfo("Impostor of the Sixth Pride", 14, Rarity.COMMON, mage.cards.i.ImpostorOfTheSixthPride.class));