From c4c768b8416c5bdb54a5bed9910fcc51e868bacf Mon Sep 17 00:00:00 2001 From: theelk801 Date: Wed, 27 Mar 2024 13:00:04 -0400 Subject: [PATCH] [OTC] Implement Stella Lee, Wild Card --- .../src/mage/cards/s/StellaLeeWildCard.java | 80 +++++++++++++++++++ .../OutlawsOfThunderJunctionCommander.java | 3 + .../mage/abilities/keyword/StormAbility.java | 9 ++- 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/s/StellaLeeWildCard.java diff --git a/Mage.Sets/src/mage/cards/s/StellaLeeWildCard.java b/Mage.Sets/src/mage/cards/s/StellaLeeWildCard.java new file mode 100644 index 00000000000..4c14e0ad59b --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/StellaLeeWildCard.java @@ -0,0 +1,80 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.common.CastSecondSpellTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.CopyTargetSpellEffect; +import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect; +import mage.abilities.keyword.StormAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterSpell; +import mage.filter.common.FilterInstantOrSorcerySpell; +import mage.game.Game; +import mage.target.TargetSpell; +import mage.watchers.common.CastSpellLastTurnWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class StellaLeeWildCard extends CardImpl { + + private static final FilterSpell filter = new FilterInstantOrSorcerySpell("instant or sorcery spell you control"); + + static { + filter.add(TargetController.YOU.getControllerPredicate()); + } + + public StellaLeeWildCard(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{R}"); + + this.supertype.add(SuperType.LEGENDARY); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Whenever you cast your second spell each turn, exile the top card of your library. Until the end of your next turn, you may play that card. + this.addAbility(new CastSecondSpellTriggeredAbility( + new ExileTopXMayPlayUntilEffect(1, Duration.UntilEndOfYourNextTurn) + )); + + // {T}: Copy target instant or sorcery spell you control. You may choose new targets for the copy. Activate only if you've cast three or more spells this turn. + Ability ability = new ActivateIfConditionActivatedAbility( + Zone.BATTLEFIELD, new CopyTargetSpellEffect(), + new TapSourceCost(), StellaLeeWildCardCondition.instance + ); + ability.addTarget(new TargetSpell(filter)); + this.addAbility(ability.addHint(StormAbility.getHint())); + } + + private StellaLeeWildCard(final StellaLeeWildCard card) { + super(card); + } + + @Override + public StellaLeeWildCard copy() { + return new StellaLeeWildCard(this); + } +} + +enum StellaLeeWildCardCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + return game + .getState() + .getWatcher(CastSpellLastTurnWatcher.class) + .getAmountOfSpellsPlayerCastOnCurrentTurn(source.getControllerId()) >= 3; + } + + @Override + public String toString() { + return "you've cast three or more spells this turn"; + } +} diff --git a/Mage.Sets/src/mage/sets/OutlawsOfThunderJunctionCommander.java b/Mage.Sets/src/mage/sets/OutlawsOfThunderJunctionCommander.java index 6ecb7598fec..8e238a6f9e9 100644 --- a/Mage.Sets/src/mage/sets/OutlawsOfThunderJunctionCommander.java +++ b/Mage.Sets/src/mage/sets/OutlawsOfThunderJunctionCommander.java @@ -1,6 +1,7 @@ package mage.sets; import mage.cards.ExpansionSet; +import mage.constants.Rarity; import mage.constants.SetType; /** @@ -17,5 +18,7 @@ public final class OutlawsOfThunderJunctionCommander extends ExpansionSet { private OutlawsOfThunderJunctionCommander() { super("Outlaws of Thunder Junction Commander", "OTC", ExpansionSet.buildDate(2024, 4, 19), SetType.SUPPLEMENTAL); this.hasBasicLands = false; + + cards.add(new SetCardInfo("Stella Lee, Wild Card", 3, Rarity.MYTHIC, mage.cards.s.StellaLeeWildCard.class)); } } diff --git a/Mage/src/main/java/mage/abilities/keyword/StormAbility.java b/Mage/src/main/java/mage/abilities/keyword/StormAbility.java index 014b160ccaa..bffd2ef6151 100644 --- a/Mage/src/main/java/mage/abilities/keyword/StormAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/StormAbility.java @@ -6,6 +6,7 @@ import mage.abilities.TriggeredAbilityImpl; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; +import mage.abilities.hint.Hint; import mage.abilities.hint.ValueHint; import mage.constants.Outcome; import mage.constants.Zone; @@ -21,9 +22,15 @@ import org.apache.log4j.Logger; */ public class StormAbility extends TriggeredAbilityImpl { + private static final Hint hint = new ValueHint("Spells cast this turn", SpellsCastThisTurnValue.instance); + + public static Hint getHint() { + return hint; + } + public StormAbility() { super(Zone.STACK, new StormEffect()); - this.addHint(new ValueHint("Spells cast this turn", SpellsCastThisTurnValue.instance)); + this.addHint(hint); } private StormAbility(final StormAbility ability) {