mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
* Jaya Ballard - Fixed that the created emblem's ability did cause game breaking errors.
This commit is contained in:
parent
618c89ee91
commit
290be87073
1 changed files with 9 additions and 7 deletions
|
@ -20,6 +20,7 @@ import mage.game.Game;
|
|||
import mage.game.command.Emblem;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.players.Player;
|
||||
import mage.watchers.common.CastFromGraveyardWatcher;
|
||||
|
||||
|
@ -113,13 +114,14 @@ class JayaBallardReplacementEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
if (card.isInstant() || card.isSorcery()) {
|
||||
// TODO: Find a way to check, that the spell from graveyard was really cast by the ability of the emblem.
|
||||
// currently every spell cast from graveyard will be exiled.
|
||||
CastFromGraveyardWatcher watcher = (CastFromGraveyardWatcher) game.getState().getWatchers().get(CastFromGraveyardWatcher.class.getSimpleName());
|
||||
return watcher != null && watcher.spellWasCastFromGraveyard(event.getTargetId(), game.getState().getZoneChangeCounter(event.getTargetId()));
|
||||
if (Zone.GRAVEYARD == ((ZoneChangeEvent) event).getToZone()) {
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
if (card != null && (card.isInstant() || card.isSorcery())) {
|
||||
// TODO: Find a way to check, that the spell from graveyard was really cast by the ability of the emblem.
|
||||
// currently every spell cast from graveyard will be exiled.
|
||||
CastFromGraveyardWatcher watcher = (CastFromGraveyardWatcher) game.getState().getWatchers().get(CastFromGraveyardWatcher.class.getSimpleName());
|
||||
return watcher != null && watcher.spellWasCastFromGraveyard(event.getTargetId(), game.getState().getZoneChangeCounter(event.getTargetId()));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue