diff --git a/Mage.Sets/src/mage/cards/s/SharpshooterElf.java b/Mage.Sets/src/mage/cards/s/SharpshooterElf.java new file mode 100644 index 00000000000..6fe2a6120aa --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SharpshooterElf.java @@ -0,0 +1,72 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.CreaturesYouControlCount; +import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterOpponentsCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SharpshooterElf extends CardImpl { + + private static final FilterPermanent filter + = new FilterOpponentsCreaturePermanent("creature with flying an opponent controls"); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + private static final DynamicValue xValue = new SourcePermanentPowerCount(false); + + public SharpshooterElf(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); + + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.RANGER); + this.power = new MageInt(0); + this.toughness = new MageInt(2); + + // Reach + this.addAbility(ReachAbility.getInstance()); + + // Sharpshooter Elf's power is equal to the number of creatures you control. + this.addAbility(new SimpleStaticAbility( + Zone.ALL, new SetPowerSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame) + )); + + // When Sharpshooter Elf enters the battlefield, it deals damage equal to its power to target creature with flying an opponent controls. + Ability ability = new EntersBattlefieldTriggeredAbility( + new DamageTargetEffect(xValue, "it"), true + ); + ability.addTarget(new TargetPermanent(filter)); + } + + private SharpshooterElf(final SharpshooterElf card) { + super(card); + } + + @Override + public SharpshooterElf copy() { + return new SharpshooterElf(this); + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java index 48e0519897b..a8627e03e71 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -145,6 +145,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Sea of Clouds", 360, Rarity.RARE, mage.cards.s.SeaOfClouds.class)); cards.add(new SetCardInfo("Shadowheart, Dark Justiciar", 146, Rarity.RARE, mage.cards.s.ShadowheartDarkJusticiar.class)); cards.add(new SetCardInfo("Shameless Charlatan", 96, Rarity.RARE, mage.cards.s.ShamelessCharlatan.class)); + cards.add(new SetCardInfo("Sharpshooter Elf", 253, Rarity.UNCOMMON, mage.cards.s.SharpshooterElf.class)); cards.add(new SetCardInfo("Silvanus's Invoker", 254, Rarity.COMMON, mage.cards.s.SilvanussInvoker.class)); cards.add(new SetCardInfo("Skanos Dragonheart", 255, Rarity.UNCOMMON, mage.cards.s.SkanosDragonheart.class)); cards.add(new SetCardInfo("Skullwinder", 256, Rarity.UNCOMMON, mage.cards.s.Skullwinder.class));