Package mage.watchers.common

Examples of mage.watchers.common.PlayerLostLifeWatcher


    public int calculate(Game game, Ability sourceAbility, Effect effect) {
        return this.calculate(game, sourceAbility.getControllerId());
    }

    public int calculate(Game game, UUID controllerId) {
        PlayerLostLifeWatcher watcher = (PlayerLostLifeWatcher) game.getState().getWatchers().get("PlayerLostLifeWatcher");
        if (watcher != null) {
            int amountLifeLost = 0;
            for(UUID opponent: game.getOpponents(controllerId)){
                amountLifeLost += watcher.getLiveLost(opponent);
            }
            return amountLifeLost;
        }
        return 0;
    }
View Full Code Here


        return fInstance;
    }

    @Override
    public boolean apply(Game game, Ability source) {
        PlayerLostLifeWatcher watcher = (PlayerLostLifeWatcher) game.getState().getWatchers().get("PlayerLostLifeWatcher");
        if (watcher != null) {
            return (watcher.getLiveLost(source.getControllerId()) == 0);
        }
        return false;
    }
View Full Code Here

    }

    @Override
    protected int getInputValue(Game game, Ability source) {
        int maxLostLive = 0;
        PlayerLostLifeWatcher watcher = (PlayerLostLifeWatcher) game.getState().getWatchers().get("PlayerLostLifeWatcher");
        if (watcher != null) {
            for (UUID opponentId: game.getOpponents(source.getControllerId())) {
                int lostLive = watcher.getLiveLost(opponentId);
                if (lostLive > maxLostLive) {
                    maxLostLive = lostLive;
                }
            }
        }
View Full Code Here

            state.getWatchers().add(new PlayerDamagedBySourceWatcher(playerId));
        }
        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);
View Full Code Here

        this.color.setWhite(true);

        // At the beginning of each upkeep, if you lost life last turn, put a 1/1 white Soldier creature token onto the battlefield.
        this.addAbility(new BeginningOfUpkeepTriggeredAbility(new FirstResponseEffect(), TargetController.ANY, false));

        this.addWatcher(new PlayerLostLifeWatcher());

    }
View Full Code Here

        return new FirstResponseEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        PlayerLostLifeWatcher watcher = (PlayerLostLifeWatcher) game.getState().getWatchers().get("PlayerLostLifeWatcher");
        if (watcher != null) {
            if (watcher.getLiveLostLastTurn(source.getControllerId()) > 0) {
                return new CreateTokenEffect(new SoldierToken("M15")).apply(game, source);
            }
            return true;
        }
        return false;
View Full Code Here

        return fInstance;
    }

    @Override
    public boolean apply(Game game, Ability source) {
        PlayerLostLifeWatcher watcher = (PlayerLostLifeWatcher) game.getState().getWatchers().get("PlayerLostLifeWatcher");
        if (watcher != null) {
            for (UUID opponentId : game.getOpponents(source.getControllerId())) {
                if (watcher.getLiveLostLastTurn(opponentId) > 0) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

    }
   
    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        PlayerLostLifeWatcher watcher = (PlayerLostLifeWatcher) game.getState().getWatchers().get("PlayerLostLifeWatcher");
        if (controller != null && watcher != null) {
            for (UUID playerId : game.getOpponents(controller.getId())) {
                Player opponent =  game.getPlayer(playerId);
                if (opponent != null) {
                    int lifeLost = watcher.getLiveLost(playerId);
                    if (lifeLost > 0) {
                        opponent.loseLife(lifeLost, game);
                    }
                }
            }
View Full Code Here

    public int calculate(Game game, Ability sourceAbility, Effect effect) {
        return this.calculate(game, sourceAbility.getControllerId());
    }

    public int calculate(Game game, UUID controllerId) {
        PlayerLostLifeWatcher watcher = (PlayerLostLifeWatcher) game.getState().getWatchers().get("PlayerLostLifeWatcher");
        if (watcher != null) {
            int amountLifeLost = 0;
            for (UUID playerId : game.getPlayerList()) {
                amountLifeLost += watcher.getLiveLost(playerId);
            }
            return amountLifeLost;
        }
        return 0;
    }
View Full Code Here

    }

    @Override
    public boolean apply(Player input, Game game) {
        PlayerLostLifeWatcher watcher = (PlayerLostLifeWatcher) game.getState().getWatchers().get("PlayerLostLifeWatcher");
        if (watcher != null) {
            return (0 < watcher.getLiveLost(input.getId()));
        }
        return false;
    }
View Full Code Here

TOP

Related Classes of mage.watchers.common.PlayerLostLifeWatcher

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.