From de015172106d46e0e2b3aaea40ae6a3844fc244d Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 26 Oct 2020 19:37:02 -0400 Subject: [PATCH] [CMR] Implemented Siani, Eye of the Storm --- .../src/mage/cards/s/SianiEyeOfTheStorm.java | 90 +++++++++++++++++++ Mage.Sets/src/mage/sets/CommanderLegends.java | 1 + Utils/keywords.txt | 1 + 3 files changed, 92 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SianiEyeOfTheStorm.java diff --git a/Mage.Sets/src/mage/cards/s/SianiEyeOfTheStorm.java b/Mage.Sets/src/mage/cards/s/SianiEyeOfTheStorm.java new file mode 100644 index 0000000000..5e0cdaa38f --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SianiEyeOfTheStorm.java @@ -0,0 +1,90 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.PartnerAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.permanent.AttackingPredicate; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SianiEyeOfTheStorm extends CardImpl { + + public SianiEyeOfTheStorm(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.DJINN); + this.subtype.add(SubType.MONK); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever Siani, Eye of the Storm attacks, scry X, where X is the number of attacking creatures with flying. + this.addAbility(new AttacksTriggeredAbility(new SianiEyeOfTheStormEffect(), false)); + + // Partner + this.addAbility(PartnerAbility.getInstance()); + } + + private SianiEyeOfTheStorm(final SianiEyeOfTheStorm card) { + super(card); + } + + @Override + public SianiEyeOfTheStorm copy() { + return new SianiEyeOfTheStorm(this); + } +} + +class SianiEyeOfTheStormEffect extends OneShotEffect { + + private static final FilterPermanent filter = new FilterCreaturePermanent(); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + filter.add(AttackingPredicate.instance); + } + + SianiEyeOfTheStormEffect() { + super(Outcome.Benefit); + staticText = "scry X, where X is the number of attacking creatures with flying"; + } + + private SianiEyeOfTheStormEffect(final SianiEyeOfTheStormEffect effect) { + super(effect); + } + + @Override + public SianiEyeOfTheStormEffect copy() { + return new SianiEyeOfTheStormEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + int count = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game); + return count > 0 && player.scry(count, source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegends.java b/Mage.Sets/src/mage/sets/CommanderLegends.java index f7b7a3b852..7384f7f861 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegends.java +++ b/Mage.Sets/src/mage/sets/CommanderLegends.java @@ -46,6 +46,7 @@ public final class CommanderLegends extends ExpansionSet { cards.add(new SetCardInfo("Prying Eyes", 86, Rarity.COMMON, mage.cards.p.PryingEyes.class)); cards.add(new SetCardInfo("Rejuvenating Springs", 354, Rarity.RARE, mage.cards.r.RejuvenatingSprings.class)); cards.add(new SetCardInfo("Sengir, the Dark Baron", 149, Rarity.RARE, mage.cards.s.SengirTheDarkBaron.class)); + cards.add(new SetCardInfo("Siani, Eye of the Storm", 95, Rarity.UNCOMMON, mage.cards.s.SianiEyeOfTheStorm.class)); cards.add(new SetCardInfo("Siren Stormtamer", 96, Rarity.UNCOMMON, mage.cards.s.SirenStormtamer.class)); cards.add(new SetCardInfo("Spectator Seating", 356, Rarity.RARE, mage.cards.s.SpectatorSeating.class)); cards.add(new SetCardInfo("Supreme Will", 102, Rarity.UNCOMMON, mage.cards.s.SupremeWill.class)); diff --git a/Utils/keywords.txt b/Utils/keywords.txt index ac4cda1909..83e571e07d 100644 --- a/Utils/keywords.txt +++ b/Utils/keywords.txt @@ -70,6 +70,7 @@ Mutate|card, manaString| Myriad|new| Ninjutsu|cost| Outlast|cost| +Partner|instance| Persist|new| Phasing|instance| Plainscycling|cost|