From 7de85069237bb082aec4a0e5a941c6374d9126e6 Mon Sep 17 00:00:00 2001 From: jmharmon <37360760+jmharmon@users.noreply.github.com> Date: Wed, 4 Sep 2019 18:49:36 -0700 Subject: [PATCH 1/6] Implement Warlock creature type --- Mage/src/main/java/mage/constants/SubType.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Mage/src/main/java/mage/constants/SubType.java b/Mage/src/main/java/mage/constants/SubType.java index 449a6d7c1e..a917fb171f 100644 --- a/Mage/src/main/java/mage/constants/SubType.java +++ b/Mage/src/main/java/mage/constants/SubType.java @@ -353,6 +353,7 @@ public enum SubType { VOLVER("Volver", SubTypeSet.CreatureType), // W WALL("Wall", SubTypeSet.CreatureType), + WARLOCK("Warlock", SubTypeSet.CreatureType), WARRIOR("Warrior", SubTypeSet.CreatureType), WEEQUAY("Weequay", SubTypeSet.CreatureType, true), WEIRD("Weird", SubTypeSet.CreatureType), From e4212423656a3f6beca3492210bf9e1635e93274 Mon Sep 17 00:00:00 2001 From: jmharmon <37360760+jmharmon@users.noreply.github.com> Date: Wed, 4 Sep 2019 18:51:46 -0700 Subject: [PATCH 2/6] Implement a few more cards --- Mage.Sets/src/mage/sets/ThroneOfEldraine.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java index 554e5d8929..b94922cb9c 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java @@ -28,10 +28,14 @@ public final class ThroneOfEldraine extends ExpansionSet { this.maxCardNumberInBooster = 269; // unconfirmed for now cards.add(new SetCardInfo("Arcane Signet", 331, Rarity.COMMON, mage.cards.a.ArcaneSignet.class)); + cards.add(new SetCardInfo("Bake into a Pie", 76, Rarity.COMMON, mage.cards.b.BakeIntoAPie.class)); + cards.add(new SetCardInfo("Chittering Witch", 319, Rarity.RARE, mage.cards.c.ChitteringWitch.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("Fireborn Knight", 210, Rarity.UNCOMMON, mage.cards.f.FirebornKnight.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("Heraldic Banner", 222, Rarity.UNCOMMON, mage.cards.h.HeraldicBanner.class)); cards.add(new SetCardInfo("Maraleaf Pixie", 196, Rarity.UNCOMMON, mage.cards.m.MaraleafPixie.class)); cards.add(new SetCardInfo("Rankle, Master of Pranks", 356, Rarity.MYTHIC, mage.cards.r.RankleMasterOfPranks.class)); cards.add(new SetCardInfo("Run Away Together", 62, Rarity.COMMON, mage.cards.r.RunAwayTogether.class)); From cc58b9fb2d183528934c7d6d4a1f02f29c642c7a Mon Sep 17 00:00:00 2001 From: jmharmon <37360760+jmharmon@users.noreply.github.com> Date: Wed, 4 Sep 2019 18:56:22 -0700 Subject: [PATCH 3/6] Implement Fireborn Knight --- .../src/mage/cards/f/FirebornKnight.java | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/FirebornKnight.java diff --git a/Mage.Sets/src/mage/cards/f/FirebornKnight.java b/Mage.Sets/src/mage/cards/f/FirebornKnight.java new file mode 100644 index 0000000000..7a2d0e8298 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FirebornKnight.java @@ -0,0 +1,47 @@ +package mage.cards.f; + +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.Zone; + +import java.util.UUID; + +/** + * @author jmharmon + */ + +public final class FirebornKnight extends CardImpl { + + public FirebornKnight(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R/W}{R/W}{R/W}{R/W}"); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.KNIGHT); + + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Double strike + this.addAbility(DoubleStrikeAbility.getInstance()); + + // {R/W}{R/W}{R/W}{R/W}: Fireborn Knight gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), + new ManaCostsImpl("{R/W}{R/W}{R/W}{R/W}"))); + } + + public FirebornKnight(final FirebornKnight card) { + super(card); + } + + @Override + public FirebornKnight copy() { + return new FirebornKnight(this); + } +} From 7103791d86aba408d6dbfdd5d31d494baef75fc8 Mon Sep 17 00:00:00 2001 From: jmharmon <37360760+jmharmon@users.noreply.github.com> Date: Wed, 4 Sep 2019 18:57:11 -0700 Subject: [PATCH 4/6] Implement Chittering Witch --- .../src/mage/cards/c/ChitteringWitch.java | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/ChitteringWitch.java diff --git a/Mage.Sets/src/mage/cards/c/ChitteringWitch.java b/Mage.Sets/src/mage/cards/c/ChitteringWitch.java new file mode 100644 index 0000000000..645f8bf62f --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ChitteringWitch.java @@ -0,0 +1,60 @@ +package mage.cards.c; + +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.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.OpponentsCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; +import mage.game.permanent.token.RatToken; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author jmharmon + */ + +public final class ChitteringWitch extends CardImpl { + + public ChitteringWitch(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WARLOCK); + + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Chittering Witch enters the battlefield, create a number of 1/1 black Rat creature tokens equal to the number of opponents you have. + Effect effect = new CreateTokenEffect(new RatToken(), OpponentsCount.instance); + effect.setText("create a number of 1/1 black Rat creature tokens equal to the number of opponents you have"); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); + + // {1}{B}, Sacrifice a creature: Target creature gets -2/-2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -2, Duration.EndOfTurn), new ManaCostsImpl("{1}{B}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public ChitteringWitch(final ChitteringWitch card) { + super(card); + } + + @Override + public ChitteringWitch copy() { + return new ChitteringWitch(this); + } +} From 9346f3ec833a92d620dd4f563c5fb75812d742c5 Mon Sep 17 00:00:00 2001 From: jmharmon <37360760+jmharmon@users.noreply.github.com> Date: Wed, 4 Sep 2019 18:58:12 -0700 Subject: [PATCH 5/6] Implement Bake into a Pie --- Mage.Sets/src/mage/cards/b/BakeIntoAPie.java | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BakeIntoAPie.java diff --git a/Mage.Sets/src/mage/cards/b/BakeIntoAPie.java b/Mage.Sets/src/mage/cards/b/BakeIntoAPie.java new file mode 100644 index 0000000000..769b503759 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BakeIntoAPie.java @@ -0,0 +1,36 @@ +package mage.cards.b; + +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.permanent.token.custom.FoodToken; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author jmharmon + */ + +public final class BakeIntoAPie extends CardImpl { + + public BakeIntoAPie(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}{B}"); + + // Destroy target creature. Create a Food token. + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addEffect(new CreateTokenEffect(new FoodToken(), 1)); + } + + public BakeIntoAPie(final BakeIntoAPie card) { + super(card); + } + + @Override + public BakeIntoAPie copy() { + return new BakeIntoAPie(this); + } +} From 100f623df9529c329d0765e0092d8b4c4c639cdd Mon Sep 17 00:00:00 2001 From: jmharmon <37360760+jmharmon@users.noreply.github.com> Date: Wed, 4 Sep 2019 18:59:03 -0700 Subject: [PATCH 6/6] Implement Heraldic Banner --- .../src/mage/cards/h/HeraldicBanner.java | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/h/HeraldicBanner.java diff --git a/Mage.Sets/src/mage/cards/h/HeraldicBanner.java b/Mage.Sets/src/mage/cards/h/HeraldicBanner.java new file mode 100644 index 0000000000..6e40a48304 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HeraldicBanner.java @@ -0,0 +1,83 @@ +package mage.cards.h; + +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.ChooseColorEffect; +import mage.abilities.effects.mana.AddManaChosenColorEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author jmharmon + */ + +public final class HeraldicBanner extends CardImpl { + + public HeraldicBanner(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); + + // As Heraldic Banner enters the battlefield, choose a color. + this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect(Outcome.Benefit))); + + // Creatures you control of the chosen color get +1/+0. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HeraldicBannerEffect())); + + // {T}: Add one mana of the chosen color. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaChosenColorEffect(), new TapSourceCost())); + } + + public HeraldicBanner(final HeraldicBanner card) { + super(card); + } + + @Override + public HeraldicBanner copy() { + return new HeraldicBanner(this); + } +} + +class HeraldicBannerEffect extends ContinuousEffectImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + public HeraldicBannerEffect() { + super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); + staticText = "Creatures you control of the chosen color get +1/+0"; + } + + public HeraldicBannerEffect(final HeraldicBannerEffect effect) { + super(effect); + } + + @Override + public HeraldicBannerEffect copy() { + return new HeraldicBannerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + ObjectColor color = (ObjectColor) game.getState().getValue(permanent.getId() + "_color"); + if (color != null) { + for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + if (perm.getColor(game).contains(color)) { + perm.addPower(1); + } + } + } + } + return true; + } +}