diff --git a/Mage.Sets/src/mage/cards/f/FlourishingHunter.java b/Mage.Sets/src/mage/cards/f/FlourishingHunter.java new file mode 100644 index 0000000000..95717e8dd4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FlourishingHunter.java @@ -0,0 +1,79 @@ +package mage.cards.f; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author weirddan455 + */ +public final class FlourishingHunter extends CardImpl { + + public FlourishingHunter(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + + this.subtype.add(SubType.WOLF); + this.subtype.add(SubType.SPIRIT); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // When Flourishing Hunter enters the battlefield, you gain life equal to the greatest toughness among other creatures you control. + this.addAbility(new EntersBattlefieldTriggeredAbility(new FlourishingHunterEffect())); + } + + private FlourishingHunter(final FlourishingHunter card) { + super(card); + } + + @Override + public FlourishingHunter copy() { + return new FlourishingHunter(this); + } +} + +class FlourishingHunterEffect extends OneShotEffect { + + public FlourishingHunterEffect() { + super(Outcome.GainLife); + staticText = "you gain life equal to the greatest toughness among other creatures you control"; + } + + private FlourishingHunterEffect(final FlourishingHunterEffect effect) { + super(effect); + } + + @Override + public FlourishingHunterEffect copy() { + return new FlourishingHunterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + int greatestToughness = 0; + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controller.getId())) { + if (permanent.isCreature(game) && !permanent.getId().equals(source.getSourceId())) { + int toughness = permanent.getToughness().getValue(); + if (toughness > greatestToughness) { + greatestToughness = toughness; + } + } + } + controller.gainLife(greatestToughness, game, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index f720b88f6a..a675015d92 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -81,6 +81,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Fearful Villager", 157, Rarity.COMMON, mage.cards.f.FearfulVillager.class)); cards.add(new SetCardInfo("Fearsome Werewolf", 157, Rarity.COMMON, mage.cards.f.FearsomeWerewolf.class)); cards.add(new SetCardInfo("Fell Stinger", 112, Rarity.UNCOMMON, mage.cards.f.FellStinger.class)); + cards.add(new SetCardInfo("Flourishing Hunter", 199, Rarity.COMMON, mage.cards.f.FlourishingHunter.class)); cards.add(new SetCardInfo("Forest", 276, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Frenzied Devils", 159, Rarity.UNCOMMON, mage.cards.f.FrenziedDevils.class)); cards.add(new SetCardInfo("Geistlight Snare", 60, Rarity.UNCOMMON, mage.cards.g.GeistlightSnare.class));