From 2c9022d9332a354b204fda15ee8fbeb58bd1ef14 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Thu, 25 Jan 2024 21:02:39 -0500 Subject: [PATCH] [MKM] Implement Rubblebelt Braggart --- .../src/mage/cards/r/RubblebeltBraggart.java | 59 +++++++++++++++++++ .../src/mage/sets/MurdersAtKarlovManor.java | 1 + 2 files changed, 60 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RubblebeltBraggart.java diff --git a/Mage.Sets/src/mage/cards/r/RubblebeltBraggart.java b/Mage.Sets/src/mage/cards/r/RubblebeltBraggart.java new file mode 100644 index 00000000000..28cbb640338 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RubblebeltBraggart.java @@ -0,0 +1,59 @@ +package mage.cards.r; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.SuspectSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.game.Game; + +import java.util.Optional; +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RubblebeltBraggart extends CardImpl { + + public RubblebeltBraggart(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}"); + + this.subtype.add(SubType.VIASHINO); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Whenever Rubblebelt Braggart attacks, if it's not suspected, you may suspect it. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new AttacksTriggeredAbility(new SuspectSourceEffect(), true), + RubblebeltBraggartCondition.instance, "Whenever {this} attacks, " + + "if it's not suspected, you may suspect it." + )); + } + + private RubblebeltBraggart(final RubblebeltBraggart card) { + super(card); + } + + @Override + public RubblebeltBraggart copy() { + return new RubblebeltBraggart(this); + } +} + +enum RubblebeltBraggartCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + return Optional + .ofNullable(source.getSourcePermanentIfItStillExists(game)) + .map(permanent -> !permanent.isSuspected()) + .orElse(false); + } +} diff --git a/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java b/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java index dd8bed11502..8b7c42081ee 100644 --- a/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java +++ b/Mage.Sets/src/mage/sets/MurdersAtKarlovManor.java @@ -132,6 +132,7 @@ public final class MurdersAtKarlovManor extends ExpansionSet { cards.add(new SetCardInfo("Repeat Offender", 101, Rarity.COMMON, mage.cards.r.RepeatOffender.class)); cards.add(new SetCardInfo("Riftburst Hellion", 228, Rarity.COMMON, mage.cards.r.RiftburstHellion.class)); cards.add(new SetCardInfo("Rot Farm Mortipede", 102, Rarity.COMMON, mage.cards.r.RotFarmMortipede.class)); + cards.add(new SetCardInfo("Rubblebelt Braggart", 143, Rarity.COMMON, mage.cards.r.RubblebeltBraggart.class)); cards.add(new SetCardInfo("Rubblebelt Maverick", 174, Rarity.COMMON, mage.cards.r.RubblebeltMaverick.class)); cards.add(new SetCardInfo("Sanctuary Wall", 32, Rarity.UNCOMMON, mage.cards.s.SanctuaryWall.class)); cards.add(new SetCardInfo("Sanguine Savior", 230, Rarity.COMMON, mage.cards.s.SanguineSavior.class));