Merge pull request #5960 from jmharmon/master

Implement various Throne of Eldraine cards
This commit is contained in:
Evan Kranzler 2019-09-04 07:24:41 -04:00 committed by GitHub
commit c1e4cf0eff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 345 additions and 0 deletions

View file

@ -0,0 +1,71 @@
package mage.cards.g;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.mana.ActivatedManaAbilityImpl;
import mage.abilities.mana.AnyColorManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.custom.FoodToken;
import mage.target.common.TargetControlledPermanent;
import java.util.UUID;
/**
*
* @author jmharmon
*/
public final class GildedGoose extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Food");
static {
filter.add(new SubtypePredicate(SubType.FOOD));
}
public GildedGoose(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}");
this.subtype.add(SubType.BIRD);
this.power = new MageInt(0);
this.toughness = new MageInt(2);
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Gilded Goose enters the battlefield, create a Food token. (Its an artifact with {2}, {T}, Sacrifice this artifact: You gain 3 life.)
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new FoodToken()), false));
// {1}{G}, {T}: Create a Food token.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new FoodToken()), new ManaCostsImpl("{1}{G}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
// {T}, Sacrifice a Food: Add one mana of any color.
ActivatedManaAbilityImpl ability1 = new AnyColorManaAbility(new TapSourceCost());
ability1.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
this.addAbility(ability1);
}
public GildedGoose(final GildedGoose card) {
super(card);
}
@Override
public GildedGoose copy() {
return new GildedGoose(this);
}
}

View file

@ -0,0 +1,42 @@
package mage.cards.c;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import java.util.UUID;
/**
*
* @author jmharmon
*/
public final class CrystalSlipper extends CardImpl {
public CrystalSlipper(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}{R}");
this.subtype.add(SubType.EQUIPMENT);
// Equipped creature gets +1/+0 and has haste.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 0)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT)));
// Equip {1}
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1)));
}
public CrystalSlipper(final CrystalSlipper card) {
super(card);
}
@Override
public CrystalSlipper copy() {
return new CrystalSlipper(this);
}
}

View file

@ -0,0 +1,56 @@
package mage.cards.g;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.mana.AnyColorManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import java.util.UUID;
/**
*
* @author jmharmon
*/
public final class GoldenEgg extends CardImpl {
public GoldenEgg(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
this.subtype.add(SubType.FOOD);
// When Golden Egg enters the battlefield, draw a card.
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)));
// {1}, {T}: Sacrifice Golden Egg: Add one mana of any color.
Ability ability = new AnyColorManaAbility(new GenericManaCost(1));
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
// {2}, {T}, Sacrifice Golden Egg: You gain 3 life.
Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(3), new ManaCostsImpl("{2}"));
ability1.addCost(new TapSourceCost());
ability1.addCost(new SacrificeSourceCost());
this.addAbility(ability1);
}
public GoldenEgg(final GoldenEgg card) {
super(card);
}
@Override
public GoldenEgg copy() {
return new GoldenEgg(this);
}
}

View file

@ -0,0 +1,65 @@
package mage.cards.w;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.permanent.token.TokenImpl;
import java.util.UUID;
/**
*
* @author jmharmon
*/
public final class WishfulMerfolk extends CardImpl {
public WishfulMerfolk(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.subtype.add(SubType.MERFOLK);
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// Defender
this.addAbility(DefenderAbility.getInstance());
// {1}{U}: Wishful Merfolk loses defender and becomes a Human until end of turn.
//this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new WishfulMerfolkEffect(), new ManaCostsImpl("{1}{U}")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new WishfulMerfolkToken(), "", Duration.EndOfTurn), new ManaCostsImpl("{1}{U}")));
}
public WishfulMerfolk(final WishfulMerfolk card) {
super(card);
}
@Override
public WishfulMerfolk copy() {
return new WishfulMerfolk(this);
}
}
class WishfulMerfolkToken extends TokenImpl {
public WishfulMerfolkToken() {
super("Wishful Merfolk", "");
this.cardType.add(CardType.CREATURE);
this.subtype.add(SubType.HUMAN);
this.color.setBlue(true);
this.power = new MageInt(3);
this.toughness = new MageInt(2);
}
public WishfulMerfolkToken(final WishfulMerfolkToken token) {
super(token);
}
public WishfulMerfolkToken copy() {
return new WishfulMerfolkToken(this);
}
}

View file

@ -0,0 +1,44 @@
package mage.cards.w;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.keyword.ScryEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import java.util.UUID;
/**
*
* @author jmharmon
*/
public final class WitchingWell extends CardImpl {
public WitchingWell(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{U}");
// When Witching Well enters the battlefield, scry 2.
this.addAbility(new EntersBattlefieldTriggeredAbility(new ScryEffect(2)));
// {3}{U}, Sacrifice Witching Well: Draw two cards.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(2), new ManaCostsImpl("{3}{U}"));
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
}
public WitchingWell(final WitchingWell card) {
super(card);
}
@Override
public WitchingWell copy() {
return new WitchingWell(this);
}
}

View file

@ -29,5 +29,10 @@ public final class ThroneOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Arcane Signet", 331, Rarity.COMMON, mage.cards.a.ArcaneSignet.class));
cards.add(new SetCardInfo("Chulane, Teller of Tales", 326, Rarity.MYTHIC, mage.cards.c.ChulaneTellerOfTales.class));
cards.add(new SetCardInfo("Crystal Slipper", 119, Rarity.COMMON, mage.cards.c.CrystalSlipper.class));
cards.add(new SetCardInfo("Gilded Goose", 160, Rarity.RARE, mage.cards.g.GildedGoose.class));
cards.add(new SetCardInfo("Golden Egg", 220, Rarity.COMMON, mage.cards.g.GoldenEgg.class));
cards.add(new SetCardInfo("Wishful Merfolk", 73, Rarity.COMMON, mage.cards.w.WishfulMerfolk.class));
cards.add(new SetCardInfo("Witching Well", 74, Rarity.COMMON, mage.cards.w.WitchingWell.class));
}
}

View file

@ -37,6 +37,7 @@ public enum SubType {
CLUE("Clue", SubTypeSet.ArtifactType),
CONTRAPTION("Contraption", SubTypeSet.ArtifactType),
EQUIPMENT("Equipment", SubTypeSet.ArtifactType),
FOOD("Food", SubTypeSet.ArtifactType),
FORTIFICATION("Fortification", SubTypeSet.ArtifactType),
TREASURE("Treasure", SubTypeSet.ArtifactType),
VEHICLE("Vehicle", SubTypeSet.ArtifactType),

View file

@ -0,0 +1,61 @@
package mage.game.permanent.token.custom;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.GainLifeEffect;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.permanent.token.TokenImpl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
*
* @author jmharmon
*/
public final class FoodToken extends TokenImpl {
static final private List<String> tokenImageSets = new ArrayList<>();
static {
tokenImageSets.addAll(Arrays.asList("ELD"));
}
public FoodToken() {
this(null, 0);
}
public FoodToken(String setCode) {
this(setCode, 0);
}
public FoodToken(String setCode, int tokenType) {
super("Food", "Food token");
availableImageSetCodes = tokenImageSets;
setOriginalExpansionSetCode(setCode);
cardType.add(CardType.ARTIFACT);
subtype.add(SubType.FOOD);
// {2}, {T}, Sacrifice this artifact: You gain 3 life.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(3), new GenericManaCost(2));
ability.addCost(new TapSourceCost());
SacrificeSourceCost cost = new SacrificeSourceCost();
cost.setText("Sacrifice this artifact");
ability.addCost(cost);
this.addAbility(ability);
}
public FoodToken(final FoodToken token) {
super(token);
}
public FoodToken copy() {
return new FoodToken(this);
}
}