Examples of PlayerGainedLifeWatcher


Examples of mage.watchers.common.PlayerGainedLifeWatcher

    private Object readResolve() throws ObjectStreamException {
        return fINSTANCE;
    }

    public static ControllerGotLifeCount getInstance(Card card) {
        card.addWatcher(new PlayerGainedLifeWatcher());
        return fINSTANCE;
    }
View Full Code Here

Examples of mage.watchers.common.PlayerGainedLifeWatcher

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

    public int calculate(Game game, UUID controllerId) {
        PlayerGainedLifeWatcher watcher = (PlayerGainedLifeWatcher) game.getState().getWatchers().get("PlayerGainedLifeWatcher");
        if (watcher != null) {
            return watcher.getLiveGained(controllerId);
        }
        return 0;
    }
View Full Code Here

Examples of mage.watchers.common.PlayerGainedLifeWatcher

        this.color.setBlack(true);

        // If an opponent gained life this turn, you may pay {B} rather than pay Needlebite Trap's mana cost.
        this.getSpellAbility().addAlternativeCost(
                new NeedlebiteTrapAlternativeCost());
        this.addWatcher(new PlayerGainedLifeWatcher());

        // Target player loses 5 life and you gain 5 life.
        this.getSpellAbility().addEffect(new LoseLifeTargetEffect(5));
        this.getSpellAbility().addEffect(new GainLifeEffect(5));
        this.getSpellAbility().addTarget(new TargetPlayer());
View Full Code Here

Examples of mage.watchers.common.PlayerGainedLifeWatcher

        return new NeedlebiteTrapAlternativeCost(this);
    }

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

Examples of mage.watchers.common.PlayerGainedLifeWatcher

        this.color.setWhite(true);

        // At the beginning of each end step, if you gained 4 or more life this turn, put a 4/4 white Angel creature token with flying onto the battlefield.
        this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new AngelToken()), TargetController.ANY, new YouGainedLifeCondition(Condition.ComparisonType.GreaterThan, 3), false));
        this.addWatcher(new PlayerGainedLifeWatcher());
    }
View Full Code Here

Examples of mage.watchers.common.PlayerGainedLifeWatcher

    }

    @Override
    protected int getInputValue(Game game, Ability source) {
        int gainedLife = 0;
        PlayerGainedLifeWatcher watcher = (PlayerGainedLifeWatcher) game.getState().getWatchers().get("PlayerGainedLifeWatcher");
        if (watcher != null) {
            gainedLife = watcher.getLiveGained(source.getControllerId());
        }
        return gainedLife;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.