From ba0e9af5fd9c7c104f125851f41add1c6a663e93 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 23 Jun 2020 17:29:14 -0400 Subject: [PATCH] Implemented Bruvac the Grandiloquent (still needs refactoring --- .../mage/cards/b/BruvacTheGrandiloquent.java | 80 +++++++++++++++++++ Mage.Sets/src/mage/sets/Jumpstart.java | 1 + .../main/java/mage/game/events/GameEvent.java | 1 + 3 files changed, 82 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BruvacTheGrandiloquent.java diff --git a/Mage.Sets/src/mage/cards/b/BruvacTheGrandiloquent.java b/Mage.Sets/src/mage/cards/b/BruvacTheGrandiloquent.java new file mode 100644 index 00000000000..be1371b8650 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BruvacTheGrandiloquent.java @@ -0,0 +1,80 @@ +package mage.cards.b; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BruvacTheGrandiloquent extends CardImpl { + + public BruvacTheGrandiloquent(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.ADVISOR); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // If an opponent would mill one or more cards, they mill twice that many cards instead. + this.addAbility(new SimpleStaticAbility(new BruvacTheGrandiloquentReplacementEffect())); + } + + private BruvacTheGrandiloquent(final BruvacTheGrandiloquent card) { + super(card); + } + + @Override + public BruvacTheGrandiloquent copy() { + return new BruvacTheGrandiloquent(this); + } +} + +class BruvacTheGrandiloquentReplacementEffect extends ReplacementEffectImpl { + + BruvacTheGrandiloquentReplacementEffect() { + super(Duration.WhileOnBattlefield, Outcome.Neutral); + staticText = "If an opponent would mill one or more cards, they mill twice that many cards instead"; + } + + private BruvacTheGrandiloquentReplacementEffect(final BruvacTheGrandiloquentReplacementEffect effect) { + super(effect); + } + + @Override + public BruvacTheGrandiloquentReplacementEffect copy() { + return new BruvacTheGrandiloquentReplacementEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.MILL_CARDS; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return game.getOpponents(source.getControllerId()).contains(event.getPlayerId()); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + event.setAmount(CardUtil.addWithOverflowCheck(event.getAmount(), event.getAmount())); + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Jumpstart.java b/Mage.Sets/src/mage/sets/Jumpstart.java index bdfab43016e..6fc7e0aa64e 100644 --- a/Mage.Sets/src/mage/sets/Jumpstart.java +++ b/Mage.Sets/src/mage/sets/Jumpstart.java @@ -83,6 +83,7 @@ public final class Jumpstart extends ExpansionSet { cards.add(new SetCardInfo("Brightmare", 2, Rarity.UNCOMMON, mage.cards.b.Brightmare.class)); cards.add(new SetCardInfo("Brindle Shoat", 380, Rarity.UNCOMMON, mage.cards.b.BrindleShoat.class)); cards.add(new SetCardInfo("Brushstrider", 381, Rarity.UNCOMMON, mage.cards.b.Brushstrider.class)); + cards.add(new SetCardInfo("Bruvac the Grandiloquent", 10, Rarity.MYTHIC, mage.cards.b.BruvacTheGrandiloquent.class)); cards.add(new SetCardInfo("Bubbling Cauldron", 460, Rarity.UNCOMMON, mage.cards.b.BubblingCauldron.class)); cards.add(new SetCardInfo("Bulwark Giant", 93, Rarity.COMMON, mage.cards.b.BulwarkGiant.class)); cards.add(new SetCardInfo("Burglar Rat", 214, Rarity.COMMON, mage.cards.b.BurglarRat.class)); diff --git a/Mage/src/main/java/mage/game/events/GameEvent.java b/Mage/src/main/java/mage/game/events/GameEvent.java index d95756bc0d1..9af64c0c37c 100644 --- a/Mage/src/main/java/mage/game/events/GameEvent.java +++ b/Mage/src/main/java/mage/game/events/GameEvent.java @@ -88,6 +88,7 @@ public class GameEvent implements Serializable { CYCLE_CARD, CYCLED_CARD, CYCLE_DRAW, CLASH, CLASHED, DAMAGE_PLAYER, + MILL_CARDS, /* DAMAGED_PLAYER targetId the id of the damaged player sourceId sourceId of the ability which caused the damage