From e14fe1f426e7f8ee989f4049ce1b11f41dbb7dfb Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Thu, 4 Nov 2021 16:47:01 -0500 Subject: [PATCH] [VOW] Implemented Heron of Hope --- Mage.Sets/src/mage/cards/h/HeronOfHope.java | 89 +++++++++++++++++++ .../src/mage/sets/InnistradCrimsonVow.java | 1 + 2 files changed, 90 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/h/HeronOfHope.java diff --git a/Mage.Sets/src/mage/cards/h/HeronOfHope.java b/Mage.Sets/src/mage/cards/h/HeronOfHope.java new file mode 100644 index 0000000000..bb50322bd8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HeronOfHope.java @@ -0,0 +1,89 @@ +package mage.cards.h; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.LifelinkAbility; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author weirddan455 + */ +public final class HeronOfHope extends CardImpl { + + public HeronOfHope(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}"); + + this.subtype.add(SubType.BIRD); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // If you would gain life, you gain that much life plus 1 instead. + this.addAbility(new SimpleStaticAbility(new HeronOfHopeEffect())); + + // {1}{W}: Heron of Hope gains lifelink until end of turn. + this.addAbility(new SimpleActivatedAbility( + new GainAbilitySourceEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn), + new ManaCostsImpl<>("{1}{W}") + )); + } + + private HeronOfHope(final HeronOfHope card) { + super(card); + } + + @Override + public HeronOfHope copy() { + return new HeronOfHope(this); + } +} + +class HeronOfHopeEffect extends ReplacementEffectImpl { + + public HeronOfHopeEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "If you would gain life, you gain that much life plus 1 instead"; + } + + private HeronOfHopeEffect(final HeronOfHopeEffect effect) { + super(effect); + } + + @Override + public HeronOfHopeEffect copy() { + return new HeronOfHopeEffect(this); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + event.setAmount(event.getAmount() + 1); + return false; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.GAIN_LIFE; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return source.isControlledBy(event.getPlayerId()); + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index a675015d92..f3a16b2cc1 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -97,6 +97,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Hallowed Haunting", 17, Rarity.MYTHIC, mage.cards.h.HallowedHaunting.class)); cards.add(new SetCardInfo("Headless Rider", 118, Rarity.RARE, mage.cards.h.HeadlessRider.class)); cards.add(new SetCardInfo("Hero's Downfall", 120, Rarity.UNCOMMON, mage.cards.h.HerosDownfall.class)); + cards.add(new SetCardInfo("Heron of Hope", 18, Rarity.COMMON, mage.cards.h.HeronOfHope.class)); cards.add(new SetCardInfo("Honeymoon Hearse", 160, Rarity.UNCOMMON, mage.cards.h.HoneymoonHearse.class)); cards.add(new SetCardInfo("Honored Heirloom", 257, Rarity.COMMON, mage.cards.h.HonoredHeirloom.class)); cards.add(new SetCardInfo("Infestation Expert", 206, Rarity.UNCOMMON, mage.cards.i.InfestationExpert.class));