From a6fc9e8299bec50892149e8d14182c51a7e5b8c8 Mon Sep 17 00:00:00 2001 From: Neil Gentleman Date: Sat, 7 Nov 2015 04:00:58 -0800 Subject: [PATCH] update Bog Gnarr to match Glade Gnarr re: 456c405c11cac3789155adc06662a79225758136 --- .../src/mage/sets/apocalypse/BogGnarr.java | 58 ++++--------------- 1 file changed, 11 insertions(+), 47 deletions(-) diff --git a/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java b/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java index efc75cfd61..560c89d024 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java +++ b/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java @@ -31,25 +31,26 @@ package mage.sets.apocalypse; import java.util.UUID; import mage.MageInt; import mage.ObjectColor; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SpellCastAllTriggeredAbility; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.FilterCard; +import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.ColorPredicate; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.stack.Spell; /** * @author Loki */ public class BogGnarr extends CardImpl { + private static final FilterSpell filter = new FilterSpell("a black spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + public BogGnarr(UUID ownerId) { super(ownerId, 76, "Bog Gnarr", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); this.expansionSetCode = "APC"; @@ -57,7 +58,9 @@ public class BogGnarr extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(new BogGnarrTriggeredAbility()); + + // Whenever a player casts a black spell, Bog Gnarr gets +2/+2 until end of turn. + this.addAbility(new SpellCastAllTriggeredAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), filter, false)); } public BogGnarr(final BogGnarr card) { @@ -68,43 +71,4 @@ public class BogGnarr extends CardImpl { public BogGnarr copy() { return new BogGnarr(this); } - } - -class BogGnarrTriggeredAbility extends TriggeredAbilityImpl { - - private static final FilterCard filter = new FilterCard("a black spell"); - - static { - filter.add(new ColorPredicate(ObjectColor.BLACK)); - } - - public BogGnarrTriggeredAbility() { - super(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), false); - } - - public BogGnarrTriggeredAbility(final BogGnarrTriggeredAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null && filter.match(spell, game); - } - - @Override - public String getRule() { - return "Whenever a player casts " + filter.getMessage() + ", " + super.getRule(); - } - - @Override - public BogGnarrTriggeredAbility copy() { - return new BogGnarrTriggeredAbility(this); - } -} \ No newline at end of file