Package mage.watchers.common

Examples of mage.watchers.common.BlockedAttackerWatcher


    @Override
    public boolean applies(Permanent permanent, Ability source, Game game) {       
        Permanent attackingCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
        if (attackingCreature != null && attackingCreature.isAttacking()) {
            if (!source.getAbilityType().equals(AbilityType.STATIC)) {
                BlockedAttackerWatcher blockedAttackerWatcher = (BlockedAttackerWatcher) game.getState().getWatchers().get("BlockedAttackerWatcher");
                if (blockedAttackerWatcher != null && blockedAttackerWatcher.creatureHasBlockedAttacker(attackingCreature, permanent)) {
                    // has already blocked this turn, so no need to do again
                    return false;
                }
            }
            return permanent.canBlock(this.getTargetPointer().getFirst(game, source), game);
View Full Code Here


        if (permanent.getId().equals(source.getFirstTarget())) {
            Permanent blocker = game.getPermanent(source.getFirstTarget());
            if (blocker != null && blocker.canBlock(source.getSourceId(), game)) {             
                Permanent attacker = game.getPermanent(source.getSourceId());
                if (attacker != null) {
                    BlockedAttackerWatcher blockedAttackerWatcher = (BlockedAttackerWatcher) game.getState().getWatchers().get("BlockedAttackerWatcher");
                    if (blockedAttackerWatcher != null && blockedAttackerWatcher.creatureHasBlockedAttacker(attacker, blocker)) {
                        // has already blocked this turn, so no need to do again
                        return false;
                    }               
                    return true;
                }
View Full Code Here

        }
        state.getWatchers().add(new MorbidWatcher());
        state.getWatchers().add(new CastSpellLastTurnWatcher());
        state.getWatchers().add(new SoulbondWatcher());
        state.getWatchers().add(new PlayerLostLifeWatcher());
        state.getWatchers().add(new BlockedAttackerWatcher());

        //20100716 - 103.5
        for (UUID playerId: state.getPlayerList(startingPlayerId)) {
            Player player = getPlayer(playerId);
            for (Card card: player.getHand().getCards(this)) {
View Full Code Here

TOP

Related Classes of mage.watchers.common.BlockedAttackerWatcher

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.