From 0f75915b82598bacd6b23bf8ae638c128b2e569d Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 12 Jun 2020 19:57:57 -0400 Subject: [PATCH] Implemented Griffin Aerie --- Mage.Sets/src/mage/cards/g/GriffinAerie.java | 45 +++++++++++++++++++ .../src/mage/cards/i/IndulgingPatrician.java | 18 +++----- Mage.Sets/src/mage/sets/CoreSet2021.java | 1 + 3 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/g/GriffinAerie.java diff --git a/Mage.Sets/src/mage/cards/g/GriffinAerie.java b/Mage.Sets/src/mage/cards/g/GriffinAerie.java new file mode 100644 index 0000000000..86d992350b --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GriffinAerie.java @@ -0,0 +1,45 @@ +package mage.cards.g; + +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.YouGainedLifeCondition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.TargetController; +import mage.game.permanent.token.GriffinToken; +import mage.watchers.common.PlayerGainedLifeWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GriffinAerie extends CardImpl { + + private static final Condition condition = new YouGainedLifeCondition(ComparisonType.MORE_THAN, 2); + + public GriffinAerie(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + + // At the beginning of your end step, if you gained 3 or more life this turn, create a 2/2 white Griffin creature token with flying. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new BeginningOfEndStepTriggeredAbility( + new CreateTokenEffect(new GriffinToken()), TargetController.YOU, false + ), condition, "At the beginning of your end step, " + + "if you gained 3 or more life this turn, create a 2/2 white Griffin creature token with flying." + ), new PlayerGainedLifeWatcher()); + } + + private GriffinAerie(final GriffinAerie card) { + super(card); + } + + @Override + public GriffinAerie copy() { + return new GriffinAerie(this); + } +} diff --git a/Mage.Sets/src/mage/cards/i/IndulgingPatrician.java b/Mage.Sets/src/mage/cards/i/IndulgingPatrician.java index 8c969db225..91b06ca555 100644 --- a/Mage.Sets/src/mage/cards/i/IndulgingPatrician.java +++ b/Mage.Sets/src/mage/cards/i/IndulgingPatrician.java @@ -1,9 +1,9 @@ package mage.cards.i; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.condition.Condition; +import mage.abilities.condition.common.YouGainedLifeCondition; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.common.LoseLifeOpponentsEffect; import mage.abilities.keyword.FlyingAbility; @@ -11,9 +11,9 @@ import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.ComparisonType; import mage.constants.SubType; import mage.constants.TargetController; -import mage.game.Game; import mage.watchers.common.PlayerGainedLifeWatcher; import java.util.UUID; @@ -23,6 +23,8 @@ import java.util.UUID; */ public final class IndulgingPatrician extends CardImpl { + private static final Condition condition = new YouGainedLifeCondition(ComparisonType.MORE_THAN, 2); + public IndulgingPatrician(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{B}"); @@ -41,7 +43,7 @@ public final class IndulgingPatrician extends CardImpl { this.addAbility(new ConditionalInterveningIfTriggeredAbility( new BeginningOfEndStepTriggeredAbility( new LoseLifeOpponentsEffect(3), TargetController.YOU, false - ), IndulgingPatricianCondition.instance, "At the beginning of your end step, " + + ), condition, "At the beginning of your end step, " + "if you gained 3 or more life this turn, each opponent loses 3 life." ), new PlayerGainedLifeWatcher()); } @@ -55,13 +57,3 @@ public final class IndulgingPatrician extends CardImpl { return new IndulgingPatrician(this); } } - -enum IndulgingPatricianCondition implements Condition { - instance; - - @Override - public boolean apply(Game game, Ability source) { - PlayerGainedLifeWatcher watcher = game.getState().getWatcher(PlayerGainedLifeWatcher.class); - return watcher != null && watcher.getLifeGained(source.getControllerId()) >= 3; - } -} diff --git a/Mage.Sets/src/mage/sets/CoreSet2021.java b/Mage.Sets/src/mage/sets/CoreSet2021.java index 2a51dee9e9..338399a472 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2021.java +++ b/Mage.Sets/src/mage/sets/CoreSet2021.java @@ -79,6 +79,7 @@ public final class CoreSet2021 extends ExpansionSet { cards.add(new SetCardInfo("Garruk, Savage Herald", 336, Rarity.MYTHIC, mage.cards.g.GarrukSavageHerald.class)); cards.add(new SetCardInfo("Goblin Arsonist", 147, Rarity.COMMON, mage.cards.g.GoblinArsonist.class)); cards.add(new SetCardInfo("Grasp of Darkness", 102, Rarity.COMMON, mage.cards.g.GraspOfDarkness.class)); + cards.add(new SetCardInfo("Griffin Aerie", 22, Rarity.UNCOMMON, mage.cards.g.GriffinAerie.class)); cards.add(new SetCardInfo("Grim Tutor", 103, Rarity.MYTHIC, mage.cards.g.GrimTutor.class)); cards.add(new SetCardInfo("Havoc Jester", 149, Rarity.UNCOMMON, mage.cards.h.HavocJester.class)); cards.add(new SetCardInfo("Heartfire Immolator", 150, Rarity.UNCOMMON, mage.cards.h.HeartfireImmolator.class));