From 860668acada494118e90be994a0e59693cdd74f3 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 8 Oct 2022 15:18:35 -0400 Subject: [PATCH] [CLB] Implemented Baeloth Barrityl, Entertainer --- .../cards/b/BaelothBarritylEntertainer.java | 91 +++++++++++++++++++ .../CommanderLegendsBattleForBaldursGate.java | 1 + 2 files changed, 92 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BaelothBarritylEntertainer.java diff --git a/Mage.Sets/src/mage/cards/b/BaelothBarritylEntertainer.java b/Mage.Sets/src/mage/cards/b/BaelothBarritylEntertainer.java new file mode 100644 index 0000000000..a09bf1be56 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BaelothBarritylEntertainer.java @@ -0,0 +1,91 @@ +package mage.cards.b; + +import mage.MageInt; +import mage.abilities.common.ChooseABackgroundAbility; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.combat.GoadAllEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.common.FilterOpponentsCreaturePermanent; +import mage.filter.predicate.ObjectSourcePlayer; +import mage.filter.predicate.ObjectSourcePlayerPredicate; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.AttackingPredicate; +import mage.filter.predicate.permanent.BlockingPredicate; +import mage.filter.predicate.permanent.GoadedPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.TreasureToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BaelothBarritylEntertainer extends CardImpl { + + private static final FilterPermanent filter = new FilterOpponentsCreaturePermanent(); + private static final FilterCreaturePermanent filter2 + = new FilterCreaturePermanent("a goaded attacking or blocking creature"); + + static { + filter.add(BaelothBarritylEntertainerPredicate.instance); + filter2.add(Predicates.or( + AttackingPredicate.instance, + BlockingPredicate.instance + )); + filter2.add(GoadedPredicate.instance); + } + + public BaelothBarritylEntertainer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.ELF); + this.subtype.add(SubType.SHAMAN); + this.power = new MageInt(2); + this.toughness = new MageInt(5); + + // Creatures your opponents control with power less than Baeloth Barrityl's power are goaded. + this.addAbility(new SimpleStaticAbility(new GoadAllEffect( + Duration.WhileOnBattlefield, filter, false + ).setText("creatures your opponents control with power less than {this}'s power are goaded"))); + + // Whenever a goaded attacking or blocking creature dies, you create a Treasure token. + this.addAbility(new DiesCreatureTriggeredAbility( + new CreateTokenEffect(new TreasureToken()) + .setText("you create a Treasure token"), + false, filter2 + )); + + // Choose a Background + this.addAbility(ChooseABackgroundAbility.getInstance()); + } + + private BaelothBarritylEntertainer(final BaelothBarritylEntertainer card) { + super(card); + } + + @Override + public BaelothBarritylEntertainer copy() { + return new BaelothBarritylEntertainer(this); + } +} + +enum BaelothBarritylEntertainerPredicate implements ObjectSourcePlayerPredicate { + instance; + + @Override + public boolean apply(ObjectSourcePlayer input, Game game) { + Permanent permanent = input.getSource().getSourcePermanentOrLKI(game); + return permanent != null && input.getObject().getPower().getValue() < permanent.getPower().getValue(); + } +} \ 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 03b15e431f..ca07af6d47 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -61,6 +61,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Aven Mindcensor", 688, Rarity.UNCOMMON, mage.cards.a.AvenMindcensor.class)); cards.add(new SetCardInfo("Avenging Hunter", 215, Rarity.COMMON, mage.cards.a.AvengingHunter.class)); cards.add(new SetCardInfo("Baba Lysaga, Night Witch", 266, Rarity.RARE, mage.cards.b.BabaLysagaNightWitch.class)); + cards.add(new SetCardInfo("Baeloth Barrityl, Entertainer", 655, Rarity.MYTHIC, mage.cards.b.BaelothBarritylEntertainer.class)); cards.add(new SetCardInfo("Bag of Holding", 299, Rarity.UNCOMMON, mage.cards.b.BagOfHolding.class)); cards.add(new SetCardInfo("Baldur's Gate", 345, Rarity.RARE, mage.cards.b.BaldursGate.class)); cards.add(new SetCardInfo("Balor", 162, Rarity.MYTHIC, mage.cards.b.Balor.class));