[GNT] implemented Inspired Sphinx

This commit is contained in:
Oleg Agafonov 2018-11-12 22:31:42 +04:00
parent a0e4791ad6
commit 209bccef0c
3 changed files with 93 additions and 1 deletions

View file

@ -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);
}
}

View file

@ -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));

View file

@ -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";
}
}