From 736f91ec2fa0aeea9cccb8c5a6c310a1d7de7df1 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 26 May 2021 07:16:40 -0400 Subject: [PATCH] [MH2] Implemented Ravenous Squirrel --- .../src/mage/cards/r/RavenousSquirrel.java | 65 +++++++++++++++++++ Mage.Sets/src/mage/sets/ModernHorizons2.java | 1 + 2 files changed, 66 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RavenousSquirrel.java diff --git a/Mage.Sets/src/mage/cards/r/RavenousSquirrel.java b/Mage.Sets/src/mage/cards/r/RavenousSquirrel.java new file mode 100644 index 0000000000..70c6eb1338 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RavenousSquirrel.java @@ -0,0 +1,65 @@ +package mage.cards.r; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SacrificePermanentTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.target.common.TargetControlledPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RavenousSquirrel extends CardImpl { + + private static final FilterControlledPermanent filter + = new FilterControlledPermanent("an artifact or creature"); + + static { + filter.add(Predicates.or( + CardType.ARTIFACT.getPredicate(), + CardType.CREATURE.getPredicate() + )); + } + + public RavenousSquirrel(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B/G}"); + + this.subtype.add(SubType.SQUIRREL); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever you sacrifice an artifact or creature, put a +1/+1 counter on Ravenous Squirrel. + this.addAbility(new SacrificePermanentTriggeredAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filter + )); + + // {1}{B}{G}, Sacrifice an artifact or creature: You gain 1 life and draw a card. + Ability ability = new SimpleActivatedAbility(new GainLifeEffect(1), new ManaCostsImpl<>("{1}{B}{G}")); + ability.addEffect(new DrawCardSourceControllerEffect(1).concatBy("and")); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + this.addAbility(ability); + } + + private RavenousSquirrel(final RavenousSquirrel card) { + super(card); + } + + @Override + public RavenousSquirrel copy() { + return new RavenousSquirrel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ModernHorizons2.java b/Mage.Sets/src/mage/sets/ModernHorizons2.java index d78f43346b..45952eaeee 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons2.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons2.java @@ -56,6 +56,7 @@ public final class ModernHorizons2 extends ExpansionSet { cards.add(new SetCardInfo("Priest of Fell Rites", 208, Rarity.RARE, mage.cards.p.PriestOfFellRites.class)); cards.add(new SetCardInfo("Prismatic Ending", 25, Rarity.UNCOMMON, mage.cards.p.PrismaticEnding.class)); cards.add(new SetCardInfo("Profane Tutor", 97, Rarity.RARE, mage.cards.p.ProfaneTutor.class)); + cards.add(new SetCardInfo("Ravenous Squirrel", 211, Rarity.UNCOMMON, mage.cards.r.RavenousSquirrel.class)); cards.add(new SetCardInfo("Rishadan Dockhand", 59, Rarity.RARE, mage.cards.r.RishadanDockhand.class)); cards.add(new SetCardInfo("Sanctum Prelate", 491, Rarity.MYTHIC, mage.cards.s.SanctumPrelate.class)); cards.add(new SetCardInfo("Scalding Tarn", 254, Rarity.RARE, mage.cards.s.ScaldingTarn.class));