[SNC] Implemented Cabaretti Ascendency

This commit is contained in:
Daniel Bomar 2022-04-12 13:40:41 -05:00
parent ec17073175
commit 35af7d6bec
No known key found for this signature in database
GPG key ID: C86C8658F4023918
2 changed files with 82 additions and 0 deletions

View file

@ -0,0 +1,81 @@
package mage.cards.c;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author weirddan455
*/
public final class CabarettiAscendency extends CardImpl {
public CabarettiAscendency(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{R}{G}{W}");
// At the beginning of your upkeep, look at the top card of your library. If it's a creature or planeswalker card, you may reveal it and put it in your hand. If you don't, you may put it on the bottom of your library.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CabarettiAscendencyEffect(), TargetController.YOU, false));
}
private CabarettiAscendency(final CabarettiAscendency card) {
super(card);
}
@Override
public CabarettiAscendency copy() {
return new CabarettiAscendency(this);
}
}
class CabarettiAscendencyEffect extends OneShotEffect {
public CabarettiAscendencyEffect() {
super(Outcome.DrawCard);
this.staticText = "look at the top card of your library. If it's a creature or planeswalker card, you may reveal it and put it in your hand. If you don't, you may put it on the bottom of your library";
}
private CabarettiAscendencyEffect(final CabarettiAscendencyEffect effect) {
super(effect);
}
@Override
public CabarettiAscendencyEffect copy() {
return new CabarettiAscendencyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
Card card = controller.getLibrary().getFromTop(game);
if (card == null) {
return false;
}
MageObject sourceObject = source.getSourceObject(game);
String objectName = sourceObject == null ? "Cabaretti Ascendency" : sourceObject.getIdName();
controller.lookAtCards(objectName, card, game);
if ((card.isCreature(game) || card.isPlaneswalker(game)) && controller.chooseUse(
Outcome.DrawCard, "Reveal " + card.getIdName() + " and put it in your hand?", source, game)) {
controller.revealCards(source, new CardsImpl(card), game);
controller.moveCards(card, Zone.HAND, source, game);
} else if (controller.chooseUse(Outcome.Neutral, "Put " + card.getIdName() + " on the bottom of your library?", source, game)) {
controller.putCardsOnBottomOfLibrary(card, game, source, false);
}
return true;
}
}

View file

@ -38,6 +38,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet {
cards.add(new SetCardInfo("Brokers Ascendancy", 170, Rarity.RARE, mage.cards.b.BrokersAscendancy.class));
cards.add(new SetCardInfo("Brokers Charm", 171, Rarity.UNCOMMON, mage.cards.b.BrokersCharm.class));
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("Ceremonial Groundbreaker", 175, Rarity.UNCOMMON, mage.cards.c.CeremonialGroundbreaker.class));
cards.add(new SetCardInfo("Chrome Cat", 236, Rarity.COMMON, mage.cards.c.ChromeCat.class));