From 9fef2a1692896c5a002b93311728e53f15754c73 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 5 Jul 2021 16:19:34 -0400 Subject: [PATCH] [AFR] Implemented Sylvan Shepherd --- .../src/mage/cards/s/SylvanShepherd.java | 53 +++++++++++++++++++ .../sets/AdventuresInTheForgottenRealms.java | 1 + .../common/AttacksTriggeredAbility.java | 10 ++-- 3 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/s/SylvanShepherd.java diff --git a/Mage.Sets/src/mage/cards/s/SylvanShepherd.java b/Mage.Sets/src/mage/cards/s/SylvanShepherd.java new file mode 100644 index 00000000000..2da60edbfd0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SylvanShepherd.java @@ -0,0 +1,53 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.RollDieWithResultTableEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SylvanShepherd extends CardImpl { + + public SylvanShepherd(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.DRUID); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // Whenever Sylvan Shepherd attacks, roll a d20. + RollDieWithResultTableEffect effect = new RollDieWithResultTableEffect(); + this.addAbility(new AttacksTriggeredAbility(effect)); + + // 1-9 | You gain 1 life. + effect.addTableEntry(1, 9, new GainLifeEffect(1)); + + // 10-19 | You gain 2 life. + effect.addTableEntry(10, 19, new GainLifeEffect(2)); + + // 20 | You gain 5 life. + effect.addTableEntry(20, 20, new GainLifeEffect(5)); + } + + private SylvanShepherd(final SylvanShepherd card) { + super(card); + } + + @Override + public SylvanShepherd copy() { + return new SylvanShepherd(this); + } +} diff --git a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java index 2d6f9d4c597..b9190eb7911 100644 --- a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java +++ b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java @@ -136,6 +136,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet { cards.add(new SetCardInfo("Soulknife Spy", 75, Rarity.COMMON, mage.cards.s.SoulknifeSpy.class)); cards.add(new SetCardInfo("Swamp", 270, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Swarming Goblins", 162, Rarity.COMMON, mage.cards.s.SwarmingGoblins.class)); + cards.add(new SetCardInfo("Sylvan Shepherd", 206, Rarity.COMMON, mage.cards.s.SylvanShepherd.class)); cards.add(new SetCardInfo("Targ Nar, Demon-Fang Gnoll", 234, Rarity.UNCOMMON, mage.cards.t.TargNarDemonFangGnoll.class)); cards.add(new SetCardInfo("Tasha's Hideous Laughter", 78, Rarity.RARE, mage.cards.t.TashasHideousLaughter.class)); cards.add(new SetCardInfo("The Deck of Many Things", 241, Rarity.MYTHIC, mage.cards.t.TheDeckOfManyThings.class)); diff --git a/Mage/src/main/java/mage/abilities/common/AttacksTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/AttacksTriggeredAbility.java index c9b3bb32910..3abb02559c3 100644 --- a/Mage/src/main/java/mage/abilities/common/AttacksTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/AttacksTriggeredAbility.java @@ -1,7 +1,5 @@ - package mage.abilities.common; -import java.util.UUID; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.constants.SetTargetPointer; @@ -10,8 +8,9 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.target.targetpointer.FixedTarget; +import java.util.UUID; + /** - * * @author BetaSteward_at_googlemail.com */ public class AttacksTriggeredAbility extends TriggeredAbilityImpl { @@ -19,6 +18,10 @@ public class AttacksTriggeredAbility extends TriggeredAbilityImpl { protected SetTargetPointer setTargetPointer; protected String text; + public AttacksTriggeredAbility(Effect effect) { + this(effect, false); + } + public AttacksTriggeredAbility(Effect effect, boolean optional) { this(effect, optional, null); } @@ -75,5 +78,4 @@ public class AttacksTriggeredAbility extends TriggeredAbilityImpl { public AttacksTriggeredAbility copy() { return new AttacksTriggeredAbility(this); } - }