[MH2] Implemented Ravenous Squirrel

This commit is contained in:
Evan Kranzler 2021-05-26 07:16:40 -04:00
parent 5f716a12ba
commit 736f91ec2f
2 changed files with 66 additions and 0 deletions

View file

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

View file

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