From 01eb0cdfae783e2a535e75113256b91aef8b3e7b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 30 May 2022 11:47:31 -0400 Subject: [PATCH] [CLB] Implemented Vicious Battlerager --- .../src/mage/cards/v/ViciousBattlerager.java | 75 +++++++++++++++++++ .../CommanderLegendsBattleForBaldursGate.java | 1 + 2 files changed, 76 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/v/ViciousBattlerager.java diff --git a/Mage.Sets/src/mage/cards/v/ViciousBattlerager.java b/Mage.Sets/src/mage/cards/v/ViciousBattlerager.java new file mode 100644 index 00000000000..5d01108e6f5 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/ViciousBattlerager.java @@ -0,0 +1,75 @@ +package mage.cards.v; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BecomesBlockedByCreatureTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.TakeTheInitiativeEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.game.Game; + +import java.util.Objects; +import java.util.Optional; +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ViciousBattlerager extends CardImpl { + + public ViciousBattlerager(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); + + this.subtype.add(SubType.DWARF); + this.subtype.add(SubType.BARBARIAN); + this.power = new MageInt(1); + this.toughness = new MageInt(5); + + // When Vicious Battlerager enters the battlefield, you take the initiative. + this.addAbility(new EntersBattlefieldTriggeredAbility(new TakeTheInitiativeEffect())); + + // Spiked Retribution — Whenever Vicious Battlerager becomes blocked by a creature, that creature's controller loses 5 life. + this.addAbility(new BecomesBlockedByCreatureTriggeredAbility( + new ViciousBattleragerEffect(), false + ).withFlavorWord("Spiked Retribution")); + } + + private ViciousBattlerager(final ViciousBattlerager card) { + super(card); + } + + @Override + public ViciousBattlerager copy() { + return new ViciousBattlerager(this); + } +} + +class ViciousBattleragerEffect extends OneShotEffect { + + ViciousBattleragerEffect() { + super(Outcome.Benefit); + staticText = "that creature's controller loses 5 life"; + } + + private ViciousBattleragerEffect(final ViciousBattleragerEffect effect) { + super(effect); + } + + @Override + public ViciousBattleragerEffect copy() { + return new ViciousBattleragerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return Optional.of(game.getPlayer(game.getControllerId(getTargetPointer().getFirst(game, source)))) + .filter(Objects::nonNull) + .map(player -> player.loseLife(5, game, source, false) > 0) + .orElse(false); + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java index 93dd72760bc..35ecee7850f 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -276,6 +276,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Undermountain Adventurer", 260, Rarity.RARE, mage.cards.u.UndermountainAdventurer.class)); cards.add(new SetCardInfo("Universal Solvent", 342, Rarity.COMMON, mage.cards.u.UniversalSolvent.class)); cards.add(new SetCardInfo("Veteran Soldier", 48, Rarity.UNCOMMON, mage.cards.v.VeteranSoldier.class)); + cards.add(new SetCardInfo("Vicious Battlerager", 155, Rarity.COMMON, mage.cards.v.ViciousBattlerager.class)); cards.add(new SetCardInfo("Viconia, Drow Apostate", 156, Rarity.UNCOMMON, mage.cards.v.ViconiaDrowApostate.class)); cards.add(new SetCardInfo("Vrock", 157, Rarity.UNCOMMON, mage.cards.v.Vrock.class)); cards.add(new SetCardInfo("Wand of Wonder", 204, Rarity.RARE, mage.cards.w.WandOfWonder.class));