From e6f1b944cfed40b6757fcf23513ffaab7f8aa71e Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sun, 30 Mar 2025 16:54:30 -0400 Subject: [PATCH] [TDM] Implement Kotis, the Fangkeeper --- .../src/mage/cards/k/KotisTheFangkeeper.java | 87 +++++++++++++++++++ .../src/mage/sets/TarkirDragonstorm.java | 1 + 2 files changed, 88 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/k/KotisTheFangkeeper.java diff --git a/Mage.Sets/src/mage/cards/k/KotisTheFangkeeper.java b/Mage.Sets/src/mage/cards/k/KotisTheFangkeeper.java new file mode 100644 index 00000000000..131dce312ea --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KotisTheFangkeeper.java @@ -0,0 +1,87 @@ +package mage.cards.k; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.dynamicvalue.common.GetXValue; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.*; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ManaValuePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class KotisTheFangkeeper extends CardImpl { + + public KotisTheFangkeeper(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{G}{U}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.ZOMBIE); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Indestructible + this.addAbility(IndestructibleAbility.getInstance()); + + // Whenever Kotis deals combat damage to a player, exile the top X cards of their library, where X is the amount of damage dealt. You may cast any number of spells with mana value X or less from among them without paying their mana costs. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility( + new KotisTheFangkeeperEffect(), false, true + )); + } + + private KotisTheFangkeeper(final KotisTheFangkeeper card) { + super(card); + } + + @Override + public KotisTheFangkeeper copy() { + return new KotisTheFangkeeper(this); + } +} + +class KotisTheFangkeeperEffect extends OneShotEffect { + + KotisTheFangkeeperEffect() { + super(Outcome.Benefit); + staticText = "exile the top X cards of their library, where X is the amount of damage dealt. You may " + + "cast any number of spells with mana value X or less from among them without paying their mana costs"; + } + + private KotisTheFangkeeperEffect(final KotisTheFangkeeperEffect effect) { + super(effect); + } + + @Override + public KotisTheFangkeeperEffect copy() { + return new KotisTheFangkeeperEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); + int xValue = GetXValue.instance.calculate(game, source, this); + if (controller == null || player == null || xValue < 1) { + return false; + } + Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, xValue)); + controller.moveCards(cards, Zone.EXILED, source, game); + FilterCard filter = new FilterCard(); + filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, xValue + 1)); + CardUtil.castMultipleWithAttributeForFree(controller, source, game, cards, filter); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/TarkirDragonstorm.java b/Mage.Sets/src/mage/sets/TarkirDragonstorm.java index 77db055f0f4..3886386d249 100644 --- a/Mage.Sets/src/mage/sets/TarkirDragonstorm.java +++ b/Mage.Sets/src/mage/sets/TarkirDragonstorm.java @@ -111,6 +111,7 @@ public final class TarkirDragonstorm extends ExpansionSet { cards.add(new SetCardInfo("Kishla Skimmer", 201, Rarity.UNCOMMON, mage.cards.k.KishlaSkimmer.class)); cards.add(new SetCardInfo("Kishla Trawlers", 50, Rarity.UNCOMMON, mage.cards.k.KishlaTrawlers.class)); cards.add(new SetCardInfo("Kishla Village", 259, Rarity.RARE, mage.cards.k.KishlaVillage.class)); + cards.add(new SetCardInfo("Kotis, the Fangkeeper", 202, Rarity.RARE, mage.cards.k.KotisTheFangkeeper.class)); cards.add(new SetCardInfo("Krotiq Nestguard", 148, Rarity.COMMON, mage.cards.k.KrotiqNestguard.class)); cards.add(new SetCardInfo("Lightfoot Technique", 14, Rarity.COMMON, mage.cards.l.LightfootTechnique.class)); cards.add(new SetCardInfo("Loxodon Battle Priest", 15, Rarity.UNCOMMON, mage.cards.l.LoxodonBattlePriest.class));