From 79b8aece5c4f2466923826fe846ce7bb02f79e91 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 25 May 2022 08:52:14 -0400 Subject: [PATCH] [CLB] Implemented Bhaal, Lord of Murder --- .../src/mage/cards/b/BhaalLordOfMurder.java | 88 +++++++++++++++++++ .../CommanderLegendsBattleForBaldursGate.java | 1 + 2 files changed, 89 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BhaalLordOfMurder.java diff --git a/Mage.Sets/src/mage/cards/b/BhaalLordOfMurder.java b/Mage.Sets/src/mage/cards/b/BhaalLordOfMurder.java new file mode 100644 index 00000000000..9aae7aa359f --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BhaalLordOfMurder.java @@ -0,0 +1,88 @@ +package mage.cards.b; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.combat.GoadTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.AnotherPredicate; +import mage.filter.predicate.permanent.TokenPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +import java.util.Objects; +import java.util.Optional; +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BhaalLordOfMurder extends CardImpl { + + private static final FilterPermanent filter + = new FilterControlledCreaturePermanent("another nontoken creature you control"); + + static { + filter.add(AnotherPredicate.instance); + filter.add(TokenPredicate.FALSE); + } + + public BhaalLordOfMurder(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{R}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.GOD); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // As long as your life total is less than or equal to half your starting life total, Bhaal, Lord of Murder has indestructible. + this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect( + new GainAbilitySourceEffect(IndestructibleAbility.getInstance()), BhaalLordOfMurderCondition.instance, + "as long as your life total is less than or equal to half your starting life total, {this} has indestructible" + ))); + + // Whenever another nontoken creature you control dies, put a +1/+1 counter on target creature and goad it. + Ability ability = new DiesCreatureTriggeredAbility( + new AddCountersTargetEffect(CounterType.P1P1.createInstance()), false, filter + ); + ability.addEffect(new GoadTargetEffect().setText("and goad it")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + private BhaalLordOfMurder(final BhaalLordOfMurder card) { + super(card); + } + + @Override + public BhaalLordOfMurder copy() { + return new BhaalLordOfMurder(this); + } +} + +enum BhaalLordOfMurderCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + return Optional.of(game.getPlayer(source.getControllerId())) + .filter(Objects::nonNull) + .map(Player::getLife) + .map(x -> 2 * x >= game.getStartingLife()) + .orElse(false); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java index c7d05aaabeb..a2e9ef72af2 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -44,6 +44,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Basilisk Collar", 300, Rarity.RARE, mage.cards.b.BasiliskCollar.class)); cards.add(new SetCardInfo("Battle Angels of Tyr", 9, Rarity.MYTHIC, mage.cards.b.BattleAngelsOfTyr.class)); cards.add(new SetCardInfo("Bhaal's Invoker", 163, Rarity.COMMON, mage.cards.b.BhaalsInvoker.class)); + cards.add(new SetCardInfo("Bhaal, Lord of Murder", 268, Rarity.RARE, mage.cards.b.BhaalLordOfMurder.class)); cards.add(new SetCardInfo("Blade of Selves", 301, Rarity.RARE, mage.cards.b.BladeOfSelves.class)); cards.add(new SetCardInfo("Blur", 58, Rarity.COMMON, mage.cards.b.Blur.class)); cards.add(new SetCardInfo("Bountiful Promenade", 348, Rarity.RARE, mage.cards.b.BountifulPromenade.class));