From 36251c23a1448ffb1759437e61d9d44b8510bc3b Mon Sep 17 00:00:00 2001 From: theelk801 Date: Wed, 3 Apr 2024 20:56:22 -0400 Subject: [PATCH] [OTJ] Implement Kellan, the Kid --- Mage.Sets/src/mage/cards/k/KellanTheKid.java | 98 +++++++++++++++++++ .../mage/sets/OutlawsOfThunderJunction.java | 1 + 2 files changed, 99 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/k/KellanTheKid.java diff --git a/Mage.Sets/src/mage/cards/k/KellanTheKid.java b/Mage.Sets/src/mage/cards/k/KellanTheKid.java new file mode 100644 index 00000000000..29f91651fe2 --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KellanTheKid.java @@ -0,0 +1,98 @@ +package mage.cards.k; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.CardsImpl; +import mage.constants.*; +import mage.filter.FilterCard; +import mage.filter.FilterSpell; +import mage.filter.StaticFilters; +import mage.filter.common.FilterPermanentCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.card.CastFromZonePredicate; +import mage.filter.predicate.mageobject.ManaValuePredicate; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class KellanTheKid extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a spell from anywhere other than your hand"); + + static { + filter.add(Predicates.not(new CastFromZonePredicate(Zone.HAND))); + } + + public KellanTheKid(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{W}{U}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.FAERIE); + this.subtype.add(SubType.ROGUE); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Lifelink + this.addAbility(LifelinkAbility.getInstance()); + + // Whenever you cast a spell from anywhere other than your hand, you may cast a permanent spell with equal or lesser mana value from your hand without paying its mana cost. If you don't, you may put a land card from your hand onto the battlefield. + this.addAbility(new SpellCastControllerTriggeredAbility(new KellanTheKidEffect(), filter, false)); + } + + private KellanTheKid(final KellanTheKid card) { + super(card); + } + + @Override + public KellanTheKid copy() { + return new KellanTheKid(this); + } +} + +class KellanTheKidEffect extends OneShotEffect { + + KellanTheKidEffect() { + super(Outcome.Benefit); + staticText = "you may cast a permanent spell with equal or lesser mana value from your hand without " + + "paying its mana cost. If you don't, you may put a land card from your hand onto the battlefield"; + } + + private KellanTheKidEffect(final KellanTheKidEffect effect) { + super(effect); + } + + @Override + public KellanTheKidEffect copy() { + return new KellanTheKidEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Spell spell = (Spell) getValue("spellCast"); + if (player == null || spell == null) { + return false; + } + FilterCard filter = new FilterPermanentCard(); + filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, spell.getManaValue() + 1)); + return CardUtil.castSpellWithAttributesForFree(player, source, game, new CardsImpl(player.getHand()), filter) + || new PutCardFromHandOntoBattlefieldEffect(StaticFilters.FILTER_CARD_LAND).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java b/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java index 5b2b750cb64..d53b6c09a93 100644 --- a/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java +++ b/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java @@ -147,6 +147,7 @@ public final class OutlawsOfThunderJunction extends ExpansionSet { cards.add(new SetCardInfo("Kaervek, the Punisher", 92, Rarity.RARE, mage.cards.k.KaervekThePunisher.class)); cards.add(new SetCardInfo("Kambal, Profiteering Mayor", 211, Rarity.RARE, mage.cards.k.KambalProfiteeringMayor.class)); cards.add(new SetCardInfo("Kellan Joins Up", 212, Rarity.RARE, mage.cards.k.KellanJoinsUp.class)); + cards.add(new SetCardInfo("Kellan, the Kid", 213, Rarity.MYTHIC, mage.cards.k.KellanTheKid.class)); cards.add(new SetCardInfo("Kraum, Violent Cacophony", 214, Rarity.UNCOMMON, mage.cards.k.KraumViolentCacophony.class)); cards.add(new SetCardInfo("Lassoed by the Law", 18, Rarity.UNCOMMON, mage.cards.l.LassoedByTheLaw.class)); cards.add(new SetCardInfo("Laughing Jasper Flint", 215, Rarity.RARE, mage.cards.l.LaughingJasperFlint.class));