From feeed0f0fe5310541eb4eec8f7da190fe05fa2ea Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 2 Jun 2022 19:29:02 -0400 Subject: [PATCH] [CLB] Implemented Pegasus Guardian --- .../src/mage/cards/p/PegasusGuardian.java | 57 +++++++++++++++++++ .../CommanderLegendsBattleForBaldursGate.java | 1 + 2 files changed, 58 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/p/PegasusGuardian.java diff --git a/Mage.Sets/src/mage/cards/p/PegasusGuardian.java b/Mage.Sets/src/mage/cards/p/PegasusGuardian.java new file mode 100644 index 0000000000..e0c8e28129 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PegasusGuardian.java @@ -0,0 +1,57 @@ +package mage.cards.p; + +import mage.MageInt; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.condition.common.RevoltCondition; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.ExileTargetForSourceEffect; +import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.AdventureCard; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.game.permanent.token.PegasusToken; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.watchers.common.RevoltWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class PegasusGuardian extends AdventureCard { + + public PegasusGuardian(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, new CardType[]{CardType.INSTANT}, "{5}{W}", "Rescue the Foal", "{1}{W}"); + + this.subtype.add(SubType.PEGASUS); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // At the beginning of your end step, if a permanent you controlled left the battlefield this turn, create a 1/1 white Pegasus creature token with flying. + this.addAbility(new BeginningOfEndStepTriggeredAbility( + new CreateTokenEffect(new PegasusToken()), TargetController.YOU, + RevoltCondition.instance, false + ), new RevoltWatcher()); + + // Rescue the Foal + // Exile target creature you control, then return that card to the battlefield under its owner's control. + this.getSpellCard().getSpellAbility().addEffect(new ExileTargetForSourceEffect()); + this.getSpellCard().getSpellAbility().addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect(false, false)); + this.getSpellCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + } + + private PegasusGuardian(final PegasusGuardian card) { + super(card); + } + + @Override + public PegasusGuardian copy() { + return new PegasusGuardian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java index 9a69c5f0d0..22ede80286 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -406,6 +406,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Path of Ancestry", 907, Rarity.COMMON, mage.cards.p.PathOfAncestry.class)); cards.add(new SetCardInfo("Patriar's Seal", 332, Rarity.UNCOMMON, mage.cards.p.PatriarsSeal.class)); cards.add(new SetCardInfo("Patron of the Arts", 191, Rarity.COMMON, mage.cards.p.PatronOfTheArts.class)); + cards.add(new SetCardInfo("Pegasus Guardian", 36, Rarity.COMMON, mage.cards.p.PegasusGuardian.class)); cards.add(new SetCardInfo("Phyrexian Rager", 766, Rarity.COMMON, mage.cards.p.PhyrexianRager.class)); cards.add(new SetCardInfo("Phyrexian Revoker", 868, Rarity.RARE, mage.cards.p.PhyrexianRevoker.class)); cards.add(new SetCardInfo("Pilgrim's Eye", 333, Rarity.COMMON, mage.cards.p.PilgrimsEye.class));