[SNC] Implemented Cemetery Tampering

This commit is contained in:
Evan Kranzler 2022-04-12 18:22:39 -04:00
parent 0c71717f14
commit a719fa7fcf
2 changed files with 77 additions and 0 deletions

View file

@ -0,0 +1,76 @@
package mage.cards.c;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.HideawayPlayEffect;
import mage.abilities.keyword.HideawayAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class CemeteryTampering extends CardImpl {
public CemeteryTampering(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}");
// Hideaway 5
this.addAbility(new HideawayAbility(5));
// At the beginning of your upkeep, you may mill three cards. Then if there are twenty or more cards in your graveyard, you may play the exiled card without paying its mana cost.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
new CemeteryTamperingEffect(), TargetController.YOU, false
));
}
private CemeteryTampering(final CemeteryTampering card) {
super(card);
}
@Override
public CemeteryTampering copy() {
return new CemeteryTampering(this);
}
}
class CemeteryTamperingEffect extends OneShotEffect {
CemeteryTamperingEffect() {
super(Outcome.Benefit);
staticText = "you may mill three cards. Then if there are twenty or more cards in your graveyard, " +
"you may play the exiled card without paying its mana cost";
}
private CemeteryTamperingEffect(final CemeteryTamperingEffect effect) {
super(effect);
}
@Override
public CemeteryTamperingEffect copy() {
return new CemeteryTamperingEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
if (player.chooseUse(outcome, "Mill three cards?", source, game)) {
player.millCards(3, source, game);
}
if (player.getGraveyard().size() >= 20) {
new HideawayPlayEffect().apply(game, source);
}
return true;
}
}

View file

@ -40,6 +40,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet {
cards.add(new SetCardInfo("Buy Your Silence", 6, Rarity.COMMON, mage.cards.b.BuyYourSilence.class));
cards.add(new SetCardInfo("Cabaretti Ascendency", 172, Rarity.RARE, mage.cards.c.CabarettiAscendency.class));
cards.add(new SetCardInfo("Cabaretti Charm", 173, Rarity.UNCOMMON, mage.cards.c.CabarettiCharm.class));
cards.add(new SetCardInfo("Cemetery Tampering", 69, Rarity.RARE, mage.cards.c.CemeteryTampering.class));
cards.add(new SetCardInfo("Ceremonial Groundbreaker", 175, Rarity.UNCOMMON, mage.cards.c.CeremonialGroundbreaker.class));
cards.add(new SetCardInfo("Chrome Cat", 236, Rarity.COMMON, mage.cards.c.ChromeCat.class));
cards.add(new SetCardInfo("Cormela, Glamour Thief", 177, Rarity.UNCOMMON, mage.cards.c.CormelaGlamourThief.class));