diff --git a/Mage.Sets/src/mage/cards/g/GrizzledWolverine.java b/Mage.Sets/src/mage/cards/g/GrizzledWolverine.java new file mode 100644 index 0000000000..18712cb7da --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GrizzledWolverine.java @@ -0,0 +1,65 @@ +package mage.cards.g; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.condition.Condition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GrizzledWolverine extends CardImpl { + + public GrizzledWolverine(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + + this.subtype.add(SubType.WOLVERINE); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {R}: Grizzled Wolverine gets +2/+0 until end of turn. Activate this ability only during the declare blockers step, only if at least one creature is blocking Grizzled Wolverine, and only once each turn. + this.addAbility(new LimitedTimesPerTurnActivatedAbility( + Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Duration.EndOfTurn), + new ManaCostsImpl("{R}"), 1, GrizzledWolverineCondition.instance + )); + } + + private GrizzledWolverine(final GrizzledWolverine card) { + super(card); + } + + @Override + public GrizzledWolverine copy() { + return new GrizzledWolverine(this); + } +} + +enum GrizzledWolverineCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + if (game.getPhase().getStep().getType() != PhaseStep.DECLARE_BLOCKERS) { + return false; + } + return game + .getCombat() + .getGroups() + .stream() + .anyMatch(combatGroup -> combatGroup.getAttackers().contains(source.getSourceId()) + && !combatGroup.getBlockers().isEmpty()); + } + + @Override + public String toString() { + return "during the declare blockers step, only if at least one creature is blocking {this},"; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/IceAge.java b/Mage.Sets/src/mage/sets/IceAge.java index f142cdf8c6..644cac60c7 100644 --- a/Mage.Sets/src/mage/sets/IceAge.java +++ b/Mage.Sets/src/mage/sets/IceAge.java @@ -150,6 +150,7 @@ public final class IceAge extends ExpansionSet { cards.add(new SetCardInfo("Gorilla Pack", 247, Rarity.COMMON, mage.cards.g.GorillaPack.class)); cards.add(new SetCardInfo("Gravebind", 129, Rarity.RARE, mage.cards.g.Gravebind.class)); cards.add(new SetCardInfo("Green Scarab", 28, Rarity.UNCOMMON, mage.cards.g.GreenScarab.class)); + cards.add(new SetCardInfo("Grizzled Wolverine", 192, Rarity.COMMON, mage.cards.g.GrizzledWolverine.class)); cards.add(new SetCardInfo("Hallowed Ground", 29, Rarity.UNCOMMON, mage.cards.h.HallowedGround.class)); cards.add(new SetCardInfo("Halls of Mist", 354, Rarity.RARE, mage.cards.h.HallsOfMist.class)); cards.add(new SetCardInfo("Heal", 30, Rarity.COMMON, mage.cards.h.Heal.class));