diff --git a/Mage.Sets/src/mage/cards/f/FinneasAceArcher.java b/Mage.Sets/src/mage/cards/f/FinneasAceArcher.java new file mode 100644 index 00000000000..bc7443a7c8c --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FinneasAceArcher.java @@ -0,0 +1,102 @@ +package mage.cards.f; + +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.counter.AddCountersAllEffect; +import mage.abilities.keyword.ReachAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AnotherPredicate; +import mage.filter.predicate.permanent.TokenPredicate; +import mage.game.Game; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class FinneasAceArcher extends CardImpl { + + private static final FilterPermanent filter + = new FilterControlledCreaturePermanent("other creature you control that's a token or a Rabbit"); + + static { + filter.add(AnotherPredicate.instance); + filter.add(Predicates.or( + TokenPredicate.TRUE, + SubType.RABBIT.getPredicate() + )); + } + + public FinneasAceArcher(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{W}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.RABBIT); + this.subtype.add(SubType.ARCHER); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // Reach + this.addAbility(ReachAbility.getInstance()); + + // Whenever Finneas, Ace Archer attacks, put a +1/+1 counter on each other creature you control that's a token or a Rabbit. Then if creatures you control have total power 10 or greater, draw a card. + Ability ability = new AttacksTriggeredAbility( + new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter) + ); + ability.addEffect(new ConditionalOneShotEffect( + new DrawCardSourceControllerEffect(1), + FinneasAceArcherCondition.instance + ).concatBy("Then")); + this.addAbility(ability); + } + + private FinneasAceArcher(final FinneasAceArcher card) { + super(card); + } + + @Override + public FinneasAceArcher copy() { + return new FinneasAceArcher(this); + } +} + +enum FinneasAceArcherCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + return game + .getBattlefield() + .getActivePermanents( + StaticFilters.FILTER_CONTROLLED_CREATURE, + source.getControllerId(), source, game + ) + .stream() + .map(MageObject::getPower) + .mapToInt(MageInt::getValue) + .sum() >= 10; + } + + @Override + public String toString() { + return "creatures you control have total power 10 or greater"; + } +} diff --git a/Mage.Sets/src/mage/sets/Bloomburrow.java b/Mage.Sets/src/mage/sets/Bloomburrow.java index bd9e9d8856b..e2573231bb2 100644 --- a/Mage.Sets/src/mage/sets/Bloomburrow.java +++ b/Mage.Sets/src/mage/sets/Bloomburrow.java @@ -50,6 +50,7 @@ public final class Bloomburrow extends ExpansionSet { cards.add(new SetCardInfo("Feather of Flight", 13, Rarity.UNCOMMON, mage.cards.f.FeatherOfFlight.class)); cards.add(new SetCardInfo("Fell", 95, Rarity.UNCOMMON, mage.cards.f.Fell.class)); cards.add(new SetCardInfo("Finch Formation", 50, Rarity.COMMON, mage.cards.f.FinchFormation.class)); + cards.add(new SetCardInfo("Finneas, Ace Archer", 212, Rarity.RARE, mage.cards.f.FinneasAceArcher.class)); cards.add(new SetCardInfo("Flowerfoot Swordmaster", 14, Rarity.UNCOMMON, mage.cards.f.FlowerfootSwordmaster.class)); cards.add(new SetCardInfo("Forest", 278, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Galewind Moose", 173, Rarity.UNCOMMON, mage.cards.g.GalewindMoose.class));