From be03991af5b1b387960ac2b226a0f76ec63f8b59 Mon Sep 17 00:00:00 2001 From: PurpleCrowbar <26198472+PurpleCrowbar@users.noreply.github.com> Date: Tue, 18 Apr 2023 04:02:38 +0100 Subject: [PATCH] [MOC] Implement Elenda and Azor --- Mage.Sets/src/mage/cards/e/ElendaAndAzor.java | 99 +++++++++++++++++++ .../mage/sets/MarchOfTheMachineCommander.java | 2 + 2 files changed, 101 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/e/ElendaAndAzor.java diff --git a/Mage.Sets/src/mage/cards/e/ElendaAndAzor.java b/Mage.Sets/src/mage/cards/e/ElendaAndAzor.java new file mode 100644 index 00000000000..b679b5ec016 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/ElendaAndAzor.java @@ -0,0 +1,99 @@ +package mage.cards.e; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.costs.mana.ManaCosts; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.CardsDrawnThisTurnDynamicValue; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.WardAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.permanent.token.VampireKnightToken; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author PurpleCrowbar + */ +public final class ElendaAndAzor extends CardImpl { + + public ElendaAndAzor(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{U}{B}"); + addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.VAMPIRE, SubType.KNIGHT, SubType.SPHINX); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Ward {2} + this.addAbility(new WardAbility(new ManaCostsImpl<>("{2}"))); + + // Whenever Elenda and Azor attacks, you may pay {X}{W}{U}{B}. If you do, draw X cards. + this.addAbility(new AttacksTriggeredAbility(new ElendaAndAzorEffect(), false)); + + // At the beginning of each end step, you may pay 4 life. If you do, create a number of 1/1 black Vampire + // Knight creature tokens with lifelink equal to the number of cards you've drawn this turn. + this.addAbility(new BeginningOfEndStepTriggeredAbility(new DoIfCostPaid(new CreateTokenEffect( + new VampireKnightToken(), CardsDrawnThisTurnDynamicValue.instance) + .setText("create a number of 1/1 black Vampire Knight creature tokens with lifelink " + + "equal to the number of cards you've drawn this turn"), new PayLifeCost(4)), + TargetController.ANY, false).addHint(CardsDrawnThisTurnDynamicValue.getHint())); + } + + private ElendaAndAzor(final ElendaAndAzor card) { + super(card); + } + + @Override + public ElendaAndAzor copy() { + return new ElendaAndAzor(this); + } +} + +class ElendaAndAzorEffect extends OneShotEffect { + + ElendaAndAzorEffect() { + super(Outcome.Benefit); + staticText = "you may pay {X}{W}{U}{B}. If you do, draw X cards"; + } + + ElendaAndAzorEffect(final ElendaAndAzorEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + ManaCosts cost = new ManaCostsImpl<>("{X}{W}{U}{B}"); + if (controller.chooseUse(Outcome.Damage, "Pay " + cost.getText() + "? If you do, draw X cards.", source, game)) { + int costX = controller.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source); + cost.add(new GenericManaCost(costX)); + if (cost.pay(source, game, source, source.getControllerId(), false, null)) { + controller.resetStoredBookmark(game); // otherwise you can undo the payment + controller.drawCards(costX, source, game); + return true; + } + } + } + return false; + } + + @Override + public ElendaAndAzorEffect copy() { + return new ElendaAndAzorEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java b/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java index 73cb61fbace..4c1fd039596 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java @@ -94,6 +94,8 @@ public final class MarchOfTheMachineCommander extends ExpansionSet { cards.add(new SetCardInfo("Duergar Hedge-Mage", 324, Rarity.UNCOMMON, mage.cards.d.DuergarHedgeMage.class)); cards.add(new SetCardInfo("Duplicant", 355, Rarity.RARE, mage.cards.d.Duplicant.class)); cards.add(new SetCardInfo("Echo Storm", 221, Rarity.RARE, mage.cards.e.EchoStorm.class)); + cards.add(new SetCardInfo("Elenda and Azor", 6, Rarity.MYTHIC, mage.cards.e.ElendaAndAzor.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Elenda and Azor", 90, Rarity.MYTHIC, mage.cards.e.ElendaAndAzor.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Elite Scaleguard", 181, Rarity.UNCOMMON, mage.cards.e.EliteScaleguard.class)); cards.add(new SetCardInfo("Elspeth, Sun's Champion", 182, Rarity.MYTHIC, mage.cards.e.ElspethSunsChampion.class)); cards.add(new SetCardInfo("Emergent Woodwurm", 37, Rarity.RARE, mage.cards.e.EmergentWoodwurm.class));