[MH2] Implemented Squirrel Sanctuary

This commit is contained in:
Evan Kranzler 2021-05-25 08:58:06 -04:00
parent 62dff01110
commit 3c3b15b7c3
2 changed files with 53 additions and 0 deletions

View file

@ -0,0 +1,52 @@
package mage.cards.s;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.permanent.token.SquirrelToken;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SquirrelSanctuary extends CardImpl {
private static final FilterPermanent filter
= new FilterControlledCreaturePermanent("a nontoken creature you control");
static {
filter.add(Predicates.not(TokenPredicate.instance));
}
public SquirrelSanctuary(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}");
// When Squirrel Sanctuary enters the battlefield, create a 1/1 green Squirrel creature token.
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new SquirrelToken())));
// Whenever a nontoken creature you control dies, you may pay {1}. If you do, return Squirrel Sanctuary to its owner's hand.
this.addAbility(new DiesCreatureTriggeredAbility(new DoIfCostPaid(
new ReturnToHandSourceEffect(true), new GenericManaCost(1)
), false, filter));
}
private SquirrelSanctuary(final SquirrelSanctuary card) {
super(card);
}
@Override
public SquirrelSanctuary copy() {
return new SquirrelSanctuary(this);
}
}

View file

@ -52,6 +52,7 @@ public final class ModernHorizons2 extends ExpansionSet {
cards.add(new SetCardInfo("Scalding Tarn", 254, Rarity.RARE, mage.cards.s.ScaldingTarn.class));
cards.add(new SetCardInfo("Spreading Insurrection", 142, Rarity.UNCOMMON, mage.cards.s.SpreadingInsurrection.class));
cards.add(new SetCardInfo("Squirrel Mob", 286, Rarity.RARE, mage.cards.s.SquirrelMob.class));
cards.add(new SetCardInfo("Squirrel Sanctuary", 174, Rarity.UNCOMMON, mage.cards.s.SquirrelSanctuary.class));
cards.add(new SetCardInfo("Squirrel Sovereign", 175, Rarity.UNCOMMON, mage.cards.s.SquirrelSovereign.class));
cards.add(new SetCardInfo("Swamp", 485, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Thrasta, Tempest's Roar", 178, Rarity.MYTHIC, mage.cards.t.ThrastaTempestsRoar.class));