[OTJ] Implement Kellan, the Kid

This commit is contained in:
theelk801 2024-04-03 20:56:22 -04:00
parent c51b299707
commit 36251c23a1
2 changed files with 99 additions and 0 deletions

View file

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

View file

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