From a442a59606121bf5b94d9096c01072343009839a Mon Sep 17 00:00:00 2001 From: Thomas Winwood Date: Sun, 14 Apr 2019 01:45:21 +0100 Subject: [PATCH] Implement Gift of the Woods --- .../src/mage/cards/g/GiftOfTheWoods.java | 54 +++++++++++++++++++ Mage.Sets/src/mage/sets/Alliances.java | 2 + 2 files changed, 56 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/g/GiftOfTheWoods.java diff --git a/Mage.Sets/src/mage/cards/g/GiftOfTheWoods.java b/Mage.Sets/src/mage/cards/g/GiftOfTheWoods.java new file mode 100644 index 0000000000..185f1a9eb7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GiftOfTheWoods.java @@ -0,0 +1,54 @@ + +package mage.cards.g; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.Outcome; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Ketsuban + */ +public final class GiftOfTheWoods extends CardImpl { + + public GiftOfTheWoods(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[] { CardType.ENCHANTMENT }, "{G}"); + + this.subtype.add(SubType.AURA); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + this.getSpellAbility().addTarget(auraTarget); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Whenever enchanted creature blocks or becomes blocked, it gets +0/+3 until + // end of turn and you gain 1 life. + Ability ability2 = new BlocksOrBecomesBlockedTriggeredAbility( + new BoostEnchantedEffect(0, 3, Duration.EndOfTurn), false); + ability2.addEffect(new GainLifeEffect(1).concatBy("and")); + this.addAbility(ability2); + } + + public GiftOfTheWoods(final GiftOfTheWoods card) { + super(card); + } + + @Override + public GiftOfTheWoods copy() { + return new GiftOfTheWoods(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Alliances.java b/Mage.Sets/src/mage/sets/Alliances.java index c8be8d1dfc..8d5089f908 100644 --- a/Mage.Sets/src/mage/sets/Alliances.java +++ b/Mage.Sets/src/mage/sets/Alliances.java @@ -83,6 +83,8 @@ public final class Alliances extends ExpansionSet { cards.add(new SetCardInfo("Fyndhorn Druid", "90a", Rarity.COMMON, mage.cards.f.FyndhornDruid.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Fyndhorn Druid", "90b", Rarity.COMMON, mage.cards.f.FyndhornDruid.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Gargantuan Gorilla", 91, Rarity.RARE, mage.cards.g.GargantuanGorilla.class)); + cards.add(new SetCardInfo("Gift of the Woods", "92a", Rarity.COMMON, mage.cards.g.GiftOfTheWoods.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Gift of the Woods", "92b", Rarity.COMMON, mage.cards.g.GiftOfTheWoods.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Gorilla Berserkers", "93a", Rarity.COMMON, mage.cards.g.GorillaBerserkers.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Gorilla Berserkers", "93b", Rarity.COMMON, mage.cards.g.GorillaBerserkers.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Gorilla Chieftain", "94a", Rarity.COMMON, mage.cards.g.GorillaChieftain.class, NON_FULL_USE_VARIOUS));