[SNC] Implemented Maestros Theater

This commit is contained in:
Evan Kranzler 2022-04-08 08:26:43 -04:00
parent 5f4de26044
commit 5b92f4d0fb
5 changed files with 72 additions and 8 deletions

View file

@ -0,0 +1,57 @@
package mage.cards.m;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.common.DoWhenCostPaid;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class MaestrosTheater extends CardImpl {
private static final FilterCard filter = new FilterCard("a basic Island, Swamp, or Mountain card");
static {
filter.add(SuperType.BASIC.getPredicate());
filter.add(Predicates.or(
SubType.ISLAND.getPredicate(),
SubType.SWAMP.getPredicate(),
SubType.MOUNTAIN.getPredicate()
));
}
public MaestrosTheater(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
// When Maestros Theater enters the battlefield, sacrifice it. When you do, search your library for a basic Island, Swamp, or Mountain card, put it onto the battlefield tapped, then shuffle and you gain 1 life.
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new SearchLibraryPutInPlayEffect(
new TargetCardInLibrary(filter), true, true
), false);
ability.addEffect(new GainLifeEffect(1).concatBy("and"));
this.addAbility(new EntersBattlefieldTriggeredAbility(new DoWhenCostPaid(
ability, new SacrificeSourceCost(), null, false
)));
}
private MaestrosTheater(final MaestrosTheater card) {
super(card);
}
@Override
public MaestrosTheater copy() {
return new MaestrosTheater(this);
}
}

View file

@ -40,6 +40,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet {
cards.add(new SetCardInfo("Light 'Em Up", 113, Rarity.COMMON, mage.cards.l.LightEmUp.class)); cards.add(new SetCardInfo("Light 'Em Up", 113, Rarity.COMMON, mage.cards.l.LightEmUp.class));
cards.add(new SetCardInfo("Lord Xander, the Collector", 197, Rarity.MYTHIC, mage.cards.l.LordXanderTheCollector.class)); cards.add(new SetCardInfo("Lord Xander, the Collector", 197, Rarity.MYTHIC, mage.cards.l.LordXanderTheCollector.class));
cards.add(new SetCardInfo("Maestros Charm", 199, Rarity.UNCOMMON, mage.cards.m.MaestrosCharm.class)); cards.add(new SetCardInfo("Maestros Charm", 199, Rarity.UNCOMMON, mage.cards.m.MaestrosCharm.class));
cards.add(new SetCardInfo("Maestros Theater", 251, Rarity.COMMON, mage.cards.m.MaestrosTheater.class));
cards.add(new SetCardInfo("Mountain", 268, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mountain", 268, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Murder", 88, Rarity.COMMON, mage.cards.m.Murder.class)); cards.add(new SetCardInfo("Murder", 88, Rarity.COMMON, mage.cards.m.Murder.class));
cards.add(new SetCardInfo("Obscura Charm", 208, Rarity.UNCOMMON, mage.cards.o.ObscuraCharm.class)); cards.add(new SetCardInfo("Obscura Charm", 208, Rarity.UNCOMMON, mage.cards.o.ObscuraCharm.class));

View file

@ -1,6 +1,5 @@
package mage.abilities.effects.common; package mage.abilities.effects.common;
import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.Mode; import mage.abilities.Mode;
import mage.abilities.common.delayed.ReflexiveTriggeredAbility; import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
@ -38,17 +37,23 @@ public class DoWhenCostPaid extends OneShotEffect {
this.optional = effect.optional; this.optional = effect.optional;
} }
private boolean checkOptional(Player player, Game game, Ability source) {
return optional && !player.chooseUse(
ability.getEffects().getOutcome(source, this.outcome),
CardUtil.replaceSourceName(
chooseUseText, CardUtil.getSourceName(game, source)
), source, game
);
}
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
MageObject mageObject = game.getObject(source); if (player == null) {
if (player == null || mageObject == null) {
return false; return false;
} }
String message = CardUtil.replaceSourceName(chooseUseText, mageObject.getLogName());
Outcome payOutcome = ability.getEffects().getOutcome(source, this.outcome);
if (!cost.canPay(source, source, player.getId(), game) if (!cost.canPay(source, source, player.getId(), game)
|| (optional && !player.chooseUse(payOutcome, message, source, game))) { || checkOptional(player, game, source)) {
return false; return false;
} }
cost.clearPaid(); cost.clearPaid();

View file

@ -533,7 +533,7 @@ public final class CardUtil {
} }
public static String replaceSourceName(String message, String sourceName) { public static String replaceSourceName(String message, String sourceName) {
return message.replace("{this}", sourceName); return message != null ? message.replace("{this}", sourceName) : null;
} }
public static String booleanToFlipName(boolean flip) { public static String booleanToFlipName(boolean flip) {

View file

@ -43932,7 +43932,7 @@ Devilish Valet|Streets of New Capenna|105|R|{2}{R}|Creature - Devil Warrior|1|3|
Jaxis, the Troublemaker|Streets of New Capenna|112|R|{3}{R}|Legendary Creature - Human Warrior|2|3|{R}, {T}, Discard a card: Create a token that's a copy of another target creature you control. It gains haste and "When this creature dies, draw a card." Sacrifice it at the beginning of the next end step. Activate only as a sorcery.$Blitz {1}{R}| Jaxis, the Troublemaker|Streets of New Capenna|112|R|{3}{R}|Legendary Creature - Human Warrior|2|3|{R}, {T}, Discard a card: Create a token that's a copy of another target creature you control. It gains haste and "When this creature dies, draw a card." Sacrifice it at the beginning of the next end step. Activate only as a sorcery.$Blitz {1}{R}|
Light 'Em Up|Streets of New Capenna|113|C|{1}{R}|Sorcery|||Casualty 2$Light 'Em Up deals 2 damage to target creature or planeswalker.| Light 'Em Up|Streets of New Capenna|113|C|{1}{R}|Sorcery|||Casualty 2$Light 'Em Up deals 2 damage to target creature or planeswalker.|
Strangle|Streets of New Capenna|125|C|{R}|Sorcery|||Strangle deals 3 damage to target creature or planeswalker.| Strangle|Streets of New Capenna|125|C|{R}|Sorcery|||Strangle deals 3 damage to target creature or planeswalker.|
Urabask, Heretic Praetor|Streets of New Capenna|129|M|{3}{R}{R}|Legendary Creature - Phyrexian Praetor|4|4|Haste$At the beginning of your upkeep, exile the top card of your library. You may play it this turn.$At the beginning of each opponent's upkeep, the next time they would draw a card this turn, instead they exile the top card of their library. They may play it this turn.| Urabrask, Heretic Praetor|Streets of New Capenna|129|M|{3}{R}{R}|Legendary Creature - Phyrexian Praetor|4|4|Haste$At the beginning of your upkeep, exile the top card of your library. You may play it this turn.$At the beginning of each opponent's upkeep, the next time they would draw a card this turn, instead they exile the top card of their library. They may play it this turn.|
Courier's Briefcase|Streets of New Capenna|142|U|{1}{G}|Artifact - Treasure|||When Courier's Briefcase enters the battlefield, create a 1/1 green and white Citizen creature token.${T}, Sacrifice Courier's Briefcase: Add one mana of any color.${W}{U}{B}{R}{G}, {T}, Sacrifice Courier's Briefcase: Draw three cards.| Courier's Briefcase|Streets of New Capenna|142|U|{1}{G}|Artifact - Treasure|||When Courier's Briefcase enters the battlefield, create a 1/1 green and white Citizen creature token.${T}, Sacrifice Courier's Briefcase: Add one mana of any color.${W}{U}{B}{R}{G}, {T}, Sacrifice Courier's Briefcase: Draw three cards.|
Gala Greeters|Streets of New Capenna|148|R|{1}{G}|Creature - Elf Druid|1|1|Alliance — Whenever another creature enters the battlefield under your control, choose one that hasn't been chosen this turn—$• Put a +1/+1 counter on Gala Greeters.$• Create a tapped Treasure token.$• You gain 2 life.| Gala Greeters|Streets of New Capenna|148|R|{1}{G}|Creature - Elf Druid|1|1|Alliance — Whenever another creature enters the battlefield under your control, choose one that hasn't been chosen this turn—$• Put a +1/+1 counter on Gala Greeters.$• Create a tapped Treasure token.$• You gain 2 life.|
Brokers Ascendancy|Streets of New Capenna|170|R|{G}{W}{U}|Enchantment|||At the beginning of your end step, put a +1/+1 counter on each creature you control and a loyalty counter on each planeswalker you control.| Brokers Ascendancy|Streets of New Capenna|170|R|{G}{W}{U}|Enchantment|||At the beginning of your end step, put a +1/+1 counter on each creature you control and a loyalty counter on each planeswalker you control.|
@ -43952,6 +43952,7 @@ Chrome Cat|Streets of New Capenna|236|C|{3}|Artifact Creature - Cat|3|2|When Chr
Getaway Car|Streets of New Capenna|237|R|{3}|Artifact - Vehicle|4|3|Haste$Whenever Getaway Car attacks or blocks, return up to one target creature that crewed it this turn to its owner's hand.$Crew 1| Getaway Car|Streets of New Capenna|237|R|{3}|Artifact - Vehicle|4|3|Haste$Whenever Getaway Car attacks or blocks, return up to one target creature that crewed it this turn to its owner's hand.$Crew 1|
Botanical Plaza|Streets of New Capenna|247|C||Land|||Botanical Plaza enters the battlefield tapped.${T}: Add {G} or {W}.${2}{G}{W}, {T}, Sacrifice Botanical Plaza: Draw a card.| Botanical Plaza|Streets of New Capenna|247|C||Land|||Botanical Plaza enters the battlefield tapped.${T}: Add {G} or {W}.${2}{G}{W}, {T}, Sacrifice Botanical Plaza: Draw a card.|
Jetmir's Garden|Streets of New Capenna|250|R||Land - Mountain Forest Plains|||({T}: Add {R}, {G}, or {W}.)$Jetmir's Garden enters the battlefield tapped.$Cycling {3}| Jetmir's Garden|Streets of New Capenna|250|R||Land - Mountain Forest Plains|||({T}: Add {R}, {G}, or {W}.)$Jetmir's Garden enters the battlefield tapped.$Cycling {3}|
Maestros Theater|Streets of New Capenna|251|C||Land|||When Maestros Theater enters the battlefield, sacrifice it. When you do, search your library for a basic Island, Swamp, or Mountain card, put it onto the battlefield tapped, then shuffle and you gain 1 life.|
Racers' Ring|Streets of New Capenna|253|C||Land|||Racers' Ring enters the battlefield tapped.${T}: Add {R} or {G}.${2}{R}{G}, {T}, Sacrifice Racers' Ring: Draw a card.| Racers' Ring|Streets of New Capenna|253|C||Land|||Racers' Ring enters the battlefield tapped.${T}: Add {R} or {G}.${2}{R}{G}, {T}, Sacrifice Racers' Ring: Draw a card.|
Raffine's Tower|Streets of New Capenna|254|R||Land - Plains Island Swamp|||({T}: Add {W}, {U}, or {B}.)$Raffine's Tower enters the battlefield tapped.$Cycling {3}| Raffine's Tower|Streets of New Capenna|254|R||Land - Plains Island Swamp|||({T}: Add {W}, {U}, or {B}.)$Raffine's Tower enters the battlefield tapped.$Cycling {3}|
Skybridge Towers|Streets of New Capenna|256|C||Land|||Skybridge Towers enters the battlefield tapped.${T}: Add {W} or {U}.${2}{W}{U}, {T}, Sacrifice Skybridge Towers: Draw a card.| Skybridge Towers|Streets of New Capenna|256|C||Land|||Skybridge Towers enters the battlefield tapped.${T}: Add {W} or {U}.${2}{W}{U}, {T}, Sacrifice Skybridge Towers: Draw a card.|