mirror of
https://github.com/correl/mage.git
synced 2024-11-26 19:19:54 +00:00
* Glade Gnarr - Removed unneccessary custom class.
This commit is contained in:
parent
7985728eb7
commit
456c405c11
1 changed files with 11 additions and 46 deletions
|
@ -30,25 +30,26 @@ package mage.sets.apocalypse;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.common.SpellCastAllTriggeredAbility;
|
||||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.constants.Zone;
|
import mage.filter.FilterSpell;
|
||||||
import mage.filter.FilterCard;
|
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
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
|
* @author Loki
|
||||||
*/
|
*/
|
||||||
public class GladeGnarr extends CardImpl {
|
public class GladeGnarr extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterSpell filter = new FilterSpell("a blue spell");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new ColorPredicate(ObjectColor.BLUE));
|
||||||
|
}
|
||||||
|
|
||||||
public GladeGnarr(UUID ownerId) {
|
public GladeGnarr(UUID ownerId) {
|
||||||
super(ownerId, 78, "Glade Gnarr", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{G}");
|
super(ownerId, 78, "Glade Gnarr", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{G}");
|
||||||
this.expansionSetCode = "APC";
|
this.expansionSetCode = "APC";
|
||||||
|
@ -56,7 +57,9 @@ public class GladeGnarr extends CardImpl {
|
||||||
|
|
||||||
this.power = new MageInt(4);
|
this.power = new MageInt(4);
|
||||||
this.toughness = new MageInt(4);
|
this.toughness = new MageInt(4);
|
||||||
this.addAbility(new GladeGnarrTriggeredAbility());
|
|
||||||
|
// Whenever a player casts a blue spell, Glade Gnarr gets +2/+2 until end of turn.
|
||||||
|
this.addAbility(new SpellCastAllTriggeredAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), filter, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public GladeGnarr(final GladeGnarr card) {
|
public GladeGnarr(final GladeGnarr card) {
|
||||||
|
@ -68,41 +71,3 @@ public class GladeGnarr extends CardImpl {
|
||||||
return new GladeGnarr(this);
|
return new GladeGnarr(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class GladeGnarrTriggeredAbility extends TriggeredAbilityImpl {
|
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("a blue spell");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new ColorPredicate(ObjectColor.BLUE));
|
|
||||||
}
|
|
||||||
|
|
||||||
public GladeGnarrTriggeredAbility() {
|
|
||||||
super(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public GladeGnarrTriggeredAbility(final GladeGnarrTriggeredAbility 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 GladeGnarrTriggeredAbility copy() {
|
|
||||||
return new GladeGnarrTriggeredAbility(this);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue