From 8b843b4ca93c94e57c85a0fc57a656a10b1011e4 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 9 Sep 2020 11:03:24 -0400 Subject: [PATCH] [ZNR] Implemented Master of Winds --- Mage.Sets/src/mage/cards/m/MasterOfWinds.java | 86 +++++++++++++++++++ Mage.Sets/src/mage/sets/ZendikarRising.java | 1 + 2 files changed, 87 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MasterOfWinds.java diff --git a/Mage.Sets/src/mage/cards/m/MasterOfWinds.java b/Mage.Sets/src/mage/cards/m/MasterOfWinds.java new file mode 100644 index 0000000000..804259ae0f --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MasterOfWinds.java @@ -0,0 +1,86 @@ +package mage.cards.m; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawDiscardControllerEffect; +import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MasterOfWinds extends CardImpl { + + public MasterOfWinds(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + + this.subtype.add(SubType.SPHINX); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Master of Winds enters the battlefield, draw two cards, then discard a card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawDiscardControllerEffect(2, 1))); + + // Whenever you cast an instant, sorcery, or Wizard spell, you may have Master of Winds's base power and toughness become 4/1 or 1/4 until end of turn. + this.addAbility(new SpellCastControllerTriggeredAbility( + new MasterOfWindsEffect(), StaticFilters.FILTER_SPELL_INSTANT_SORCERY_WIZARD, true + )); + } + + private MasterOfWinds(final MasterOfWinds card) { + super(card); + } + + @Override + public MasterOfWinds copy() { + return new MasterOfWinds(this); + } +} + +class MasterOfWindsEffect extends OneShotEffect { + + MasterOfWindsEffect() { + super(Outcome.Benefit); + staticText = "have {this}'s base power and toughness become 4/1 or 1/4 until end of turn"; + } + + private MasterOfWindsEffect(final MasterOfWindsEffect effect) { + super(effect); + } + + @Override + public MasterOfWindsEffect copy() { + return new MasterOfWindsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + int power = player.chooseUse( + Outcome.Neutral, "Have this creature become a 4/1 or a 1/4?", + null, "4/1", "1/4", source, game + ) ? 4 : 1; + game.addEffect(new SetPowerToughnessSourceEffect( + power, 5 - power, Duration.EndOfTurn, SubLayer.SetPT_7b + ), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/ZendikarRising.java b/Mage.Sets/src/mage/sets/ZendikarRising.java index 9c1cdc8d4d..9f7509d926 100644 --- a/Mage.Sets/src/mage/sets/ZendikarRising.java +++ b/Mage.Sets/src/mage/sets/ZendikarRising.java @@ -227,6 +227,7 @@ public final class ZendikarRising extends ExpansionSet { cards.add(new SetCardInfo("Malakir Blood-Priest", 110, Rarity.COMMON, mage.cards.m.MalakirBloodPriest.class)); cards.add(new SetCardInfo("Malakir Mire", 111, Rarity.UNCOMMON, mage.cards.m.MalakirMire.class)); cards.add(new SetCardInfo("Malakir Rebirth", 111, Rarity.UNCOMMON, mage.cards.m.MalakirRebirth.class)); + cards.add(new SetCardInfo("Master of Winds", 68, Rarity.RARE, mage.cards.m.MasterOfWinds.class)); cards.add(new SetCardInfo("Maul of the Skyclaves", 27, Rarity.RARE, mage.cards.m.MaulOfTheSkyclaves.class)); cards.add(new SetCardInfo("Merfolk Falconer", 69, Rarity.UNCOMMON, mage.cards.m.MerfolkFalconer.class)); cards.add(new SetCardInfo("Merfolk Windrobber", 70, Rarity.UNCOMMON, mage.cards.m.MerfolkWindrobber.class));