mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
GrafMole bug fix
This commit is contained in:
parent
74322819eb
commit
5f956bb69d
1 changed files with 39 additions and 4 deletions
|
@ -29,13 +29,15 @@ package mage.sets.shadowsoverinnistrad;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.common.SacrificeAllTriggeredAbility;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.effects.common.GainLifeEffect;
|
import mage.abilities.effects.common.GainLifeEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.constants.TargetController;
|
import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.game.Game;
|
||||||
|
import mage.game.events.GameEvent;
|
||||||
|
import mage.game.events.GameEvent.EventType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -52,7 +54,7 @@ public class GrafMole extends CardImpl {
|
||||||
this.toughness = new MageInt(4);
|
this.toughness = new MageInt(4);
|
||||||
|
|
||||||
// Whenever you sacrifice a Clue, you gain 3 life.
|
// Whenever you sacrifice a Clue, you gain 3 life.
|
||||||
this.addAbility(new SacrificeAllTriggeredAbility(new GainLifeEffect(3), new FilterCreaturePermanent("Clue", "a Clue"), TargetController.YOU, false));
|
this.addAbility(new GrafMoleTriggeredAbility());
|
||||||
}
|
}
|
||||||
|
|
||||||
public GrafMole(final GrafMole card) {
|
public GrafMole(final GrafMole card) {
|
||||||
|
@ -64,3 +66,36 @@ public class GrafMole extends CardImpl {
|
||||||
return new GrafMole(this);
|
return new GrafMole(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class GrafMoleTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
|
public GrafMoleTriggeredAbility() {
|
||||||
|
super(Zone.BATTLEFIELD, new GainLifeEffect(3));
|
||||||
|
setLeavesTheBattlefieldTrigger(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrafMoleTriggeredAbility(final GrafMoleTriggeredAbility ability) {
|
||||||
|
super(ability);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GrafMoleTriggeredAbility copy() {
|
||||||
|
return new GrafMoleTriggeredAbility(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
|
return event.getType() == EventType.SACRIFICED_PERMANENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
|
return event.getPlayerId().equals(this.getControllerId())
|
||||||
|
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getSubtype().contains("Clue");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRule() {
|
||||||
|
return "Whenever you sacrifice a Clue, " + super.getRule();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue