From 85e4ba837acdae1e2d37a1474b4a16f1fcb4ef25 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Fri, 24 Jan 2025 12:01:49 -0500 Subject: [PATCH] [DFT] Implement Sab Sunen, Luxa Embodied --- .../mage/cards/s/SabSunenLuxaEmbodied.java | 90 +++++++++++++++++++ Mage.Sets/src/mage/sets/Aetherdrift.java | 1 + 2 files changed, 91 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SabSunenLuxaEmbodied.java diff --git a/Mage.Sets/src/mage/cards/s/SabSunenLuxaEmbodied.java b/Mage.Sets/src/mage/cards/s/SabSunenLuxaEmbodied.java new file mode 100644 index 00000000000..da37bff00f9 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SabSunenLuxaEmbodied.java @@ -0,0 +1,90 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.dynamicvalue.common.CountersSourceCount; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.combat.CantAttackBlockUnlessConditionSourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.abilities.keyword.ReachAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.triggers.BeginningOfFirstMainTriggeredAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.counters.CounterType; +import mage.game.Game; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SabSunenLuxaEmbodied extends CardImpl { + + public SabSunenLuxaEmbodied(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{U}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.GOD); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Reach + this.addAbility(ReachAbility.getInstance()); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Indestructible + this.addAbility(IndestructibleAbility.getInstance()); + + // Sab-Sunen can't attack or block unless it has an even number of counters on it. + this.addAbility(new SimpleStaticAbility(new CantAttackBlockUnlessConditionSourceEffect(SabSunenLuxaEmbodiedCondition.EVEN))); + + // At the beginning of your first main phase, put a +1/+1 counter on Sab-Sunen. Then if it has an odd number of counters on it, draw two cards. + Ability ability = new BeginningOfFirstMainTriggeredAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()) + ); + ability.addEffect(new ConditionalOneShotEffect( + new DrawCardSourceControllerEffect(2), SabSunenLuxaEmbodiedCondition.ODD, + "then if it has an odd number of counters on it, draw two cards" + )); + this.addAbility(ability); + } + + private SabSunenLuxaEmbodied(final SabSunenLuxaEmbodied card) { + super(card); + } + + @Override + public SabSunenLuxaEmbodied copy() { + return new SabSunenLuxaEmbodied(this); + } +} + +enum SabSunenLuxaEmbodiedCondition implements Condition { + EVEN(0), + ODD(1); + private final int parity; + + SabSunenLuxaEmbodiedCondition(int parity) { + this.parity = parity; + } + + @Override + public boolean apply(Game game, Ability source) { + return CountersSourceCount.ANY.calculate(game, source, null) % 2 == parity; + } + + @Override + public String toString() { + return "it has an " + (parity == 0 ? "even" : "odd") + " number of counters on it"; + } +} diff --git a/Mage.Sets/src/mage/sets/Aetherdrift.java b/Mage.Sets/src/mage/sets/Aetherdrift.java index 65b8d31fdf0..6b11b43c78b 100644 --- a/Mage.Sets/src/mage/sets/Aetherdrift.java +++ b/Mage.Sets/src/mage/sets/Aetherdrift.java @@ -65,6 +65,7 @@ public final class Aetherdrift extends ExpansionSet { cards.add(new SetCardInfo("Riverpyre Verge", 260, Rarity.RARE, mage.cards.r.RiverpyreVerge.class)); cards.add(new SetCardInfo("Rocketeer Boostbuggy", 220, Rarity.UNCOMMON, mage.cards.r.RocketeerBoostbuggy.class)); cards.add(new SetCardInfo("Rugged Highlands", 262, Rarity.COMMON, mage.cards.r.RuggedHighlands.class)); + cards.add(new SetCardInfo("Sab-Sunen, Luxa Embodied", 221, Rarity.MYTHIC, mage.cards.s.SabSunenLuxaEmbodied.class)); cards.add(new SetCardInfo("Scoured Barrens", 263, Rarity.COMMON, mage.cards.s.ScouredBarrens.class)); cards.add(new SetCardInfo("Stock Up", 67, Rarity.UNCOMMON, mage.cards.s.StockUp.class)); cards.add(new SetCardInfo("Streaking Oilgorger", 107, Rarity.COMMON, mage.cards.s.StreakingOilgorger.class));