Made TriggeredAbility.checkEventType() abstract. Added missing implementations.

This commit is contained in:
emerald000 2015-06-19 02:29:16 -04:00
parent 7a4d4265a4
commit cfd92dc8d5
464 changed files with 5501 additions and 3845 deletions

View file

@ -28,21 +28,22 @@
package mage.sets.guildpact;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;
import mage.cards.CardImpl;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.stack.Spell;
import mage.abilities.effects.common.CopySpellForEachItCouldTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterInPlay;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.target.Target;
import mage.util.TargetAddress;
@ -88,17 +89,20 @@ class InkTreaderNephilimTriggeredAbility extends TriggeredAbilityImpl {
return new InkTreaderNephilimTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.SPELL_CAST;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null &&
(spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))){
for (Effect effect : getEffects()) {
effect.setValue("triggeringSpell", spell);
}
return true;
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null &&
(spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))){
for (Effect effect : getEffects()) {
effect.setValue("triggeringSpell", spell);
}
return true;
}
return false;
}