Package mage.watchers

Examples of mage.watchers.Watcher


        return new SummoningTrapAlternativeCost(this);
    }

    @Override
    public boolean isAvailable(Game game, Ability source) {
        Watcher watcher = game.getState().getWatchers().get("CreatureSpellCountered", source.getControllerId());
        if (watcher != null && watcher.conditionMet()) {
            return true;
        }
        return false;
    }
View Full Code Here


        return new ArchiveTrapAlternativeCost(this);
    }

    @Override
    public boolean isAvailable(Game game, Ability source) {
        Watcher watcher = game.getState().getWatchers().get("LibrarySearched", source.getControllerId());
        if (watcher != null && watcher.conditionMet())
            return true;
        return false;
    }
View Full Code Here

        return fInstance;
    }

    @Override
    public boolean apply(Game game, Ability source) {
        Watcher watcher = game.getState().getWatchers().get("Morbid");
        return watcher.conditionMet();
    }
View Full Code Here

        return fInstance;
    }

    @Override
    public boolean apply(Game game, Ability source) {
        Watcher watcher = game.getState().getWatchers().get("CreatureEnteredBattlefieldLastTurnWatcher", source.getSourceId());
        return watcher != null && watcher.conditionMet();
    }
View Full Code Here

    }

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == EventType.SPELL_CAST && event.getPlayerId().equals(controllerId)) {
            Watcher watcher = game.getState().getWatchers().get("CreatureCast", controllerId);
            if (watcher != null && watcher.conditionMet()) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

    }

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE) {
            Watcher watcher = game.getState().getWatchers().get("Morbid");
            return watcher.conditionMet();
        }
        return false;
    }
View Full Code Here

    }

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE && event.getPlayerId().equals(this.controllerId)) {
            Watcher watcher = game.getState().getWatchers().get("HomicidalBruteAttacked", sourceId);
            if (watcher == null || !watcher.conditionMet()) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

    }

    @Override
    public boolean apply(Game game, Ability source) {
        int damage = 3;
        Watcher watcher = game.getState().getWatchers().get("Morbid");
        if (watcher.conditionMet()) {
              damage = 5;
        }
        Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
        if (permanent != null) {
            permanent.damage(damage, source.getSourceId(), game, false, true);
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source));
            if (permanent != null) {
                Watcher watcher = game.getState().getWatchers().get("AttackedThisTurn");
                if (watcher != null && watcher instanceof AttackedThisTurnWatcher) {
                    if (((AttackedThisTurnWatcher)watcher).getAttackedThisTurnCreatures().contains(permanent.getId())) {
                        return permanent.destroy(source.getSourceId(), game, false);
                    }
                }
View Full Code Here

        return new RelentlessAssaultUntapEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        Watcher watcher = game.getState().getWatchers().get("AttackedThisTurn");
        if (watcher != null && watcher instanceof AttackedThisTurnWatcher) {
            Set<UUID> attackedThisTurn = ((AttackedThisTurnWatcher) watcher).getAttackedThisTurnCreatures();
            for (UUID uuid : attackedThisTurn) {
                Permanent permanent = game.getPermanent(uuid);
                if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) {
View Full Code Here

TOP

Related Classes of mage.watchers.Watcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.