From c4750e162b1899c0216ac5e7c6d391c4ca355d16 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 27 Oct 2020 21:35:21 -0400 Subject: [PATCH] [CMR] Implemented Kitesail Skirmisher --- .../src/mage/cards/k/KitesailSkirmisher.java | 82 +++++++++++++++++++ Mage.Sets/src/mage/sets/CommanderLegends.java | 1 + 2 files changed, 83 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/k/KitesailSkirmisher.java diff --git a/Mage.Sets/src/mage/cards/k/KitesailSkirmisher.java b/Mage.Sets/src/mage/cards/k/KitesailSkirmisher.java new file mode 100644 index 0000000000..22d7e11b0b --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KitesailSkirmisher.java @@ -0,0 +1,82 @@ +package mage.cards.k; + +import com.google.common.base.Objects; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.EncoreAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterAttackingCreature; +import mage.filter.predicate.ObjectSourcePlayer; +import mage.filter.predicate.ObjectSourcePlayerPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.game.Game; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class KitesailSkirmisher extends CardImpl { + + private static final FilterPermanent filter + = new FilterAttackingCreature("another target creature attacking the same player or planeswalker"); + + static { + filter.add(AnotherPredicate.instance); + filter.add(KitesailSkirmisherPredicate.instance); + } + + public KitesailSkirmisher(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.PIRATE); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever Kitesail Skirmisher attacks, another target creature attacking the same player or planeswalker gains flying until end of turn. + Ability ability = new AttacksTriggeredAbility(new GainAbilityTargetEffect( + FlyingAbility.getInstance(), Duration.EndOfTurn + ), false); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + + // Encore {4}{U} + this.addAbility(new EncoreAbility(new ManaCostsImpl<>("{4}{U}"))); + } + + private KitesailSkirmisher(final KitesailSkirmisher card) { + super(card); + } + + @Override + public KitesailSkirmisher copy() { + return new KitesailSkirmisher(this); + } +} + +enum KitesailSkirmisherPredicate implements ObjectSourcePlayerPredicate> { + instance; + + @Override + public boolean apply(ObjectSourcePlayer input, Game game) { + return Objects.equal( + game.getCombat().getDefenderId(input.getSourceId()), + game.getCombat().getDefenderId(input.getObject().getId()) + ); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/CommanderLegends.java b/Mage.Sets/src/mage/sets/CommanderLegends.java index 31e3c99802..5fbe9bfcca 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegends.java +++ b/Mage.Sets/src/mage/sets/CommanderLegends.java @@ -45,6 +45,7 @@ public final class CommanderLegends extends ExpansionSet { cards.add(new SetCardInfo("Interpret the Signs", 75, Rarity.UNCOMMON, mage.cards.i.InterpretTheSigns.class)); cards.add(new SetCardInfo("Keeper of the Accord", 27, Rarity.RARE, mage.cards.k.KeeperOfTheAccord.class)); cards.add(new SetCardInfo("Kitesail Corsair", 76, Rarity.COMMON, mage.cards.k.KitesailCorsair.class)); + cards.add(new SetCardInfo("Kitesail Skirmisher", 77, Rarity.COMMON, mage.cards.k.KitesailSkirmisher.class)); cards.add(new SetCardInfo("Kydele, Chosen of Kruphix", 524, Rarity.MYTHIC, mage.cards.k.KydeleChosenOfKruphix.class)); cards.add(new SetCardInfo("Maelstrom Colossus", 322, Rarity.COMMON, mage.cards.m.MaelstromColossus.class)); cards.add(new SetCardInfo("Maelstrom Wanderer", 526, Rarity.MYTHIC, mage.cards.m.MaelstromWanderer.class));