* Some minor updates.

This commit is contained in:
LevelX2 2015-03-20 18:31:44 +01:00
parent 5975074cc0
commit e09141b1fc
2 changed files with 14 additions and 10 deletions

View file

@ -79,17 +79,21 @@ class MaelstromNexusTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.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());
FirstSpellCastThisTurnWatcher watcher = (FirstSpellCastThisTurnWatcher) game.getState().getWatchers().get("FirstSpellCastThisTurn", this.getSourceId());
if (spell != null
&& watcher != null
&& watcher.conditionMet()) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(spell.getSourceId()));
return true;
}
Spell spell = game.getStack().getSpell(event.getTargetId());
FirstSpellCastThisTurnWatcher watcher = (FirstSpellCastThisTurnWatcher) game.getState().getWatchers().get("FirstSpellCastThisTurn", this.getSourceId());
if (spell != null
&& watcher != null
&& watcher.conditionMet()) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(spell.getSourceId()));
return true;
}
return false;
}