From ae93425faa4ce5fbe1ca4bf994ee588c05510673 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 7 Apr 2020 08:44:31 -0400 Subject: [PATCH] Implemented Exuberant Wolfbear --- .../src/mage/cards/e/ExuberantWolfbear.java | 84 +++++++++++++++++++ .../src/mage/sets/IkoriaLairOfBehemoths.java | 1 + 2 files changed, 85 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/e/ExuberantWolfbear.java diff --git a/Mage.Sets/src/mage/cards/e/ExuberantWolfbear.java b/Mage.Sets/src/mage/cards/e/ExuberantWolfbear.java new file mode 100644 index 00000000000..7b2432fd808 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/ExuberantWolfbear.java @@ -0,0 +1,84 @@ +package mage.cards.e; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ExuberantWolfbear extends CardImpl { + + private static final FilterPermanent filter + = new FilterControlledPermanent(SubType.HUMAN, "Human you control"); + + public ExuberantWolfbear(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}"); + + this.subtype.add(SubType.WOLF); + this.subtype.add(SubType.BEAR); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Whenever Exuberant Wolfbear attacks, you may change the base power and toughness of target Human you control to Exuberant Wolfbear's power and toughness until end of turn. + Ability ability = new AttacksTriggeredAbility(new ExuberantWolfbearEffect(), true); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + private ExuberantWolfbear(final ExuberantWolfbear card) { + super(card); + } + + @Override + public ExuberantWolfbear copy() { + return new ExuberantWolfbear(this); + } +} + +class ExuberantWolfbearEffect extends OneShotEffect { + + ExuberantWolfbearEffect() { + super(Outcome.Benefit); + staticText = "change the base power and toughness of target Human you control " + + "to {this}'s power and toughness until end of turn"; + } + + private ExuberantWolfbearEffect(final ExuberantWolfbearEffect effect) { + super(effect); + } + + @Override + public ExuberantWolfbearEffect copy() { + return new ExuberantWolfbearEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (permanent == null) { + return false; + } + game.addEffect(new SetPowerToughnessTargetEffect( + permanent.getPower().getValue(), + permanent.getToughness().getValue(), + Duration.EndOfTurn + ), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java b/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java index e79ef7de4a3..a06b28ab9ef 100644 --- a/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java +++ b/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java @@ -81,6 +81,7 @@ public final class IkoriaLairOfBehemoths extends ExpansionSet { cards.add(new SetCardInfo("Dreamtail Heron", 47, Rarity.COMMON, mage.cards.d.DreamtailHeron.class)); cards.add(new SetCardInfo("Essence Scatter", 49, Rarity.COMMON, mage.cards.e.EssenceScatter.class)); cards.add(new SetCardInfo("Everquill Phoenix", 114, Rarity.RARE, mage.cards.e.EverquillPhoenix.class)); + cards.add(new SetCardInfo("Exuberant Wolfbear", 151, Rarity.COMMON, mage.cards.e.ExuberantWolfbear.class)); cards.add(new SetCardInfo("Fertilid", 152, Rarity.COMMON, mage.cards.f.Fertilid.class)); cards.add(new SetCardInfo("Flourishing Fox", 13, Rarity.UNCOMMON, mage.cards.f.FlourishingFox.class)); cards.add(new SetCardInfo("Footfall Crater", 118, Rarity.UNCOMMON, mage.cards.f.FootfallCrater.class));