[TDM] Implement Kotis, the Fangkeeper

This commit is contained in:
theelk801 2025-03-30 16:54:30 -04:00
parent 1ceee7b8b4
commit e6f1b944cf
2 changed files with 88 additions and 0 deletions

View file

@ -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;
}
}

View file

@ -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));