From caf632cbc4f8202a609ca97ce9b3d927b4a9cb2a Mon Sep 17 00:00:00 2001 From: Muz Date: Sat, 10 Jan 2026 12:25:04 -0600 Subject: [PATCH] [ECL] Implement Bristlebane Outrider (#14212) --- .../src/mage/cards/b/BristlebaneOutrider.java | 107 ++++++++++++++++++ Mage.Sets/src/mage/sets/LorwynEclipsed.java | 1 + 2 files changed, 108 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BristlebaneOutrider.java diff --git a/Mage.Sets/src/mage/cards/b/BristlebaneOutrider.java b/Mage.Sets/src/mage/cards/b/BristlebaneOutrider.java new file mode 100644 index 00000000000..0ddbd6c2fa3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BristlebaneOutrider.java @@ -0,0 +1,107 @@ +package mage.cards.b; + +import java.util.*; +import mage.MageInt; +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.keyword.DauntAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.constants.WatcherScope; +import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.watchers.Watcher; + +/** + * + * @author muz + */ +public final class BristlebaneOutrider extends CardImpl { + + public BristlebaneOutrider(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}"); + + this.subtype.add(SubType.KITHKIN); + this.subtype.add(SubType.KNIGHT); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // This creature can't be blocked by creatures with power 2 or less. + this.addAbility(new DauntAbility()); + + // As long as another creature entered the battlefield under your control this turn, this creature gets +2/+0. + this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect( + new BoostSourceEffect(2, 0, Duration.WhileOnBattlefield), + BristlebaneOutriderCondition.instance, "as long as another creature entered the battlefield under your control this turn, this creature gets +2/+0." + )), new BristlebaneOutriderWatcher()); + + } + + private BristlebaneOutrider(final BristlebaneOutrider card) { + super(card); + } + + @Override + public BristlebaneOutrider copy() { + return new BristlebaneOutrider(this); + } +} + +enum BristlebaneOutriderCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + return BristlebaneOutriderWatcher.checkPlayer(source, game); + } +} + +class BristlebaneOutriderWatcher extends Watcher { + + private final Map> creatureMap = new HashMap<>(); + private static final Set emptySet = Collections.unmodifiableSet(new HashSet<>()); + + BristlebaneOutriderWatcher() { + super(WatcherScope.GAME); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() != GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { + return; + } + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); + if (permanent == null) { + return; + } + if (permanent.isCreature(game)) { + creatureMap + .computeIfAbsent(permanent.getControllerId(), x -> new HashSet<>()) + .add(new MageObjectReference(permanent, game)); + } + } + + @Override + public void reset() { + super.reset(); + creatureMap.clear(); + } + + static boolean checkPlayer(Ability source, Game game) { + BristlebaneOutriderWatcher watcher = game.getState().getWatcher(BristlebaneOutriderWatcher.class); + return watcher + .creatureMap + .getOrDefault(source.getControllerId(), emptySet) + .stream() + .anyMatch(mor -> !mor.refersTo(source.getSourceObject(game), game)); + } +} diff --git a/Mage.Sets/src/mage/sets/LorwynEclipsed.java b/Mage.Sets/src/mage/sets/LorwynEclipsed.java index b5bceb5dcaa..2b731d4f652 100644 --- a/Mage.Sets/src/mage/sets/LorwynEclipsed.java +++ b/Mage.Sets/src/mage/sets/LorwynEclipsed.java @@ -68,6 +68,7 @@ public final class LorwynEclipsed extends ExpansionSet { cards.add(new SetCardInfo("Brigid's Command", 332, Rarity.RARE, mage.cards.b.BrigidsCommand.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Bristlebane Battler", 168, Rarity.RARE, mage.cards.b.BristlebaneBattler.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Bristlebane Battler", 325, Rarity.RARE, mage.cards.b.BristlebaneBattler.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Bristlebane Outrider", 169, Rarity.UNCOMMON, mage.cards.b.BristlebaneOutrider.class)); cards.add(new SetCardInfo("Burdened Stoneback", 8, Rarity.UNCOMMON, mage.cards.b.BurdenedStoneback.class)); cards.add(new SetCardInfo("Burning Curiosity", 129, Rarity.COMMON, mage.cards.b.BurningCuriosity.class)); cards.add(new SetCardInfo("Catharsis", 209, Rarity.MYTHIC, mage.cards.c.Catharsis.class, NON_FULL_USE_VARIOUS));