From 37c7188fe7db44253cd378dccc08a61dbb4d11c3 Mon Sep 17 00:00:00 2001 From: PurpleCrowbar <26198472+PurpleCrowbar@users.noreply.github.com> Date: Thu, 3 Nov 2022 02:57:39 +0000 Subject: [PATCH] [BRO] Implement Goblin Blast-Runner --- .../src/mage/cards/g/GoblinBlastRunner.java | 76 +++++++++++++++++++ Mage.Sets/src/mage/sets/TheBrothersWar.java | 1 + 2 files changed, 77 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/g/GoblinBlastRunner.java diff --git a/Mage.Sets/src/mage/cards/g/GoblinBlastRunner.java b/Mage.Sets/src/mage/cards/g/GoblinBlastRunner.java new file mode 100644 index 0000000000..b532381e56 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GoblinBlastRunner.java @@ -0,0 +1,76 @@ +package mage.cards.g; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.hint.ConditionHint; +import mage.abilities.hint.Hint; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.game.Game; +import mage.watchers.common.PermanentsSacrificedWatcher; + +import java.util.UUID; + +/** + * @author PurpleCrowbar + */ +public final class GoblinBlastRunner extends CardImpl { + + public GoblinBlastRunner(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}"); + this.subtype.add(SubType.GOBLIN); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Goblin Blast-Runner gets +2/+0 and has menace as long as you sacrificed a permanent this turn. + Ability ability = new SimpleStaticAbility(new ConditionalContinuousEffect( + new BoostSourceEffect(2, 0, Duration.WhileOnBattlefield), + GoblinBlastRunnerCondition.instance, "{this} gets +2/+0" + )); + ability.addEffect(new ConditionalContinuousEffect( + new GainAbilitySourceEffect( + new MenaceAbility(false), Duration.WhileOnBattlefield + ), GoblinBlastRunnerCondition.instance, "and has menace as long as you sacrificed a permanent this turn" + )); + this.addAbility(ability.addHint(GoblinBlastRunnerCondition.getHint()), new PermanentsSacrificedWatcher()); + } + + private GoblinBlastRunner(final GoblinBlastRunner card) { + super(card); + } + + @Override + public GoblinBlastRunner copy() { + return new GoblinBlastRunner(this); + } +} + +enum GoblinBlastRunnerCondition implements Condition { + instance; + private static final Hint hint = new ConditionHint( + instance, "You've sacrificed a permanent this turn" + ); + + @Override + public boolean apply(Game game, Ability source) { + UUID player = source.getControllerId(); + PermanentsSacrificedWatcher watcher = game.getState().getWatcher(PermanentsSacrificedWatcher.class); + if (watcher == null) { + return false; + } + return watcher.getThisTurnSacrificedPermanents(player) != null; + } + + public static Hint getHint() { + return hint; + } +} diff --git a/Mage.Sets/src/mage/sets/TheBrothersWar.java b/Mage.Sets/src/mage/sets/TheBrothersWar.java index 9c1db9a7bd..af55f47b67 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWar.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWar.java @@ -69,6 +69,7 @@ public final class TheBrothersWar extends ExpansionSet { cards.add(new SetCardInfo("Gix's Command", 97, Rarity.RARE, mage.cards.g.GixsCommand.class)); cards.add(new SetCardInfo("Gixian Puppeteer", 99, Rarity.RARE, mage.cards.g.GixianPuppeteer.class)); cards.add(new SetCardInfo("Gnawing Vermin", 101, Rarity.UNCOMMON, mage.cards.g.GnawingVermin.class)); + cards.add(new SetCardInfo("Goblin Blast-Runner", 137, Rarity.COMMON, mage.cards.g.GoblinBlastRunner.class)); cards.add(new SetCardInfo("Go for the Throat", 102, Rarity.UNCOMMON, mage.cards.g.GoForTheThroat.class)); cards.add(new SetCardInfo("Goblin Firebomb", 235, Rarity.COMMON, mage.cards.g.GoblinFirebomb.class)); cards.add(new SetCardInfo("Gruesome Realization", 103, Rarity.UNCOMMON, mage.cards.g.GruesomeRealization.class));