From 209bccef0cd78013012648ac724ea4a770bb1335 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Mon, 12 Nov 2018 22:31:42 +0400 Subject: [PATCH] [GNT] implemented Inspired Sphinx --- .../src/mage/cards/i/InspiredSphinx.java | 60 +++++++++++++++++++ Mage.Sets/src/mage/sets/GameNight.java | 2 +- .../dynamicvalue/common/OpponentsCount.java | 32 ++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/i/InspiredSphinx.java create mode 100644 Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsCount.java diff --git a/Mage.Sets/src/mage/cards/i/InspiredSphinx.java b/Mage.Sets/src/mage/cards/i/InspiredSphinx.java new file mode 100644 index 00000000000..2fe8e4e7a7c --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/InspiredSphinx.java @@ -0,0 +1,60 @@ +package mage.cards.i; + +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.OpponentsCount; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.FlashAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.ThopterColorlessToken; + +import java.util.UUID; + +/** + * @author JayDi85 + */ +public final class InspiredSphinx extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("Wizard"); + + static { + filter.add(new SubtypePredicate(SubType.WIZARD)); + } + + public InspiredSphinx(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}"); + this.subtype.add(SubType.SPHINX); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Inspired Sphinx enters the battlefield, draw cards equal to the number of opponents you have. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new DrawCardSourceControllerEffect(new OpponentsCount()).setText("draw cards equal to the number of opponents you have") + )); + + // {3}{U}: Create a colorless 1/1 Thopter artifact creature token with flying. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new ThopterColorlessToken()), new ManaCostsImpl<>("{3}{U}"))); + } + + public InspiredSphinx(final InspiredSphinx card) { + super(card); + } + + @Override + public InspiredSphinx copy() { + return new InspiredSphinx(this); + } +} diff --git a/Mage.Sets/src/mage/sets/GameNight.java b/Mage.Sets/src/mage/sets/GameNight.java index 36692297924..1a69efd0e55 100644 --- a/Mage.Sets/src/mage/sets/GameNight.java +++ b/Mage.Sets/src/mage/sets/GameNight.java @@ -48,7 +48,7 @@ public final class GameNight extends ExpansionSet { cards.add(new SetCardInfo("Howling Golem", 53, Rarity.UNCOMMON, mage.cards.h.HowlingGolem.class)); cards.add(new SetCardInfo("Hydrolash", 22, Rarity.UNCOMMON, mage.cards.h.Hydrolash.class)); cards.add(new SetCardInfo("Inspired Charge", 13, Rarity.COMMON, mage.cards.i.InspiredCharge.class)); - // TODO: cards.add(new SetCardInfo("Inspired Sphinx", 2, Rarity.MYTHIC, mage.cards.i.InspiredSphinx.class)); + cards.add(new SetCardInfo("Inspired Sphinx", 2, Rarity.MYTHIC, mage.cards.i.InspiredSphinx.class)); cards.add(new SetCardInfo("Inspiring Captain", 14, Rarity.COMMON, mage.cards.i.InspiringCaptain.class)); cards.add(new SetCardInfo("Island", 61, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Island", 62, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsCount.java new file mode 100644 index 00000000000..2435bb53add --- /dev/null +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/OpponentsCount.java @@ -0,0 +1,32 @@ +package mage.abilities.dynamicvalue.common; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.game.Game; + +/** + * @author JayDi85 + */ +public class OpponentsCount implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + return game.getOpponents(sourceAbility.getControllerId()).size(); + } + + @Override + public OpponentsCount copy() { + return new OpponentsCount(); + } + + @Override + public String getMessage() { + return "number of opponents you have"; + } + + @Override + public String toString() { + return "1"; + } +} \ No newline at end of file