[CMR] Implemented Kitesail Skirmisher

This commit is contained in:
Evan Kranzler 2020-10-27 21:35:21 -04:00
parent 312a56ba6d
commit c4750e162b
2 changed files with 83 additions and 0 deletions

View file

@ -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<ObjectSourcePlayer<MageObject>> {
instance;
@Override
public boolean apply(ObjectSourcePlayer<MageObject> input, Game game) {
return Objects.equal(
game.getCombat().getDefenderId(input.getSourceId()),
game.getCombat().getDefenderId(input.getObject().getId())
);
}
}

View file

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