Examples of calculate()


Examples of mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount.calculate()

        Permanent permanent = game.getPermanent(source.getSourceId());
        if (permanent != null) {
            Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
            if (obj != null && obj instanceof SpellAbility) {
                CardsInAllGraveyardsCount instantsAndSorceries = new CardsInAllGraveyardsCount(new FilterInstantOrSorceryCard("instant or sorcery cards"));
                int instantsAndSorceriesCount = instantsAndSorceries.calculate(game, source, this);
                if (instantsAndSorceriesCount > 0) {
                    permanent.addCounters(CounterType.P1P1.createInstance(instantsAndSorceriesCount), game);
                }
            }
        }
View Full Code Here

Examples of mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount.calculate()

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        DynamicValue value = new CardsInControllerGraveyardCount();
        if (player != null) {
            player.gainLife(value.calculate(game, source, this) * 2, game);
            player.getLibrary().addAll(player.getGraveyard().getCards(game), game);
            player.getGraveyard().clear();
            player.shuffleLibrary(game);
            return true;
        }
View Full Code Here

Examples of mage.abilities.dynamicvalue.common.CountersCount.calculate()

    public boolean apply(Game game, Ability source) {
        DynamicValue amount = new CountersCount(CounterType.CHARGE);
        for (UUID playerId : game.getOpponents(source.getControllerId())) {
            Player player = game.getPlayer(playerId);
            if (player != null) {
                player.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, true);
            }
        }
        return true;
    }
View Full Code Here

Examples of mage.abilities.dynamicvalue.common.ExileFromHandCostCardConvertedMana.calculate()

    @Override
    public boolean apply(Game game, Ability source) {
        DynamicValue amount = new ExileFromHandCostCardConvertedMana();
        Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source));
        if (spell != null && spell.getConvertedManaCost() == amount.calculate(game, source, this)) {
            return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game);
        }
        return false;
    }
View Full Code Here

Examples of mage.abilities.dynamicvalue.common.MultikickerCount.calculate()

    }

    @Override
    public boolean apply(Game game, Ability source) {
        DynamicValue value = new MultikickerCount();
        int damage = value.calculate(game, source, this) * 2;

        Player player = game.getPlayer(source.getFirstTarget());
        if (player != null) {
            player.damage(damage, id, game, false, true);
            return true;
View Full Code Here

Examples of mage.abilities.dynamicvalue.common.OpponentsLostLifeCount.calculate()

    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (permanent != null) {
            OpponentsLostLifeCount dynamicValue = new OpponentsLostLifeCount();
            if (dynamicValue != null) {
                int oll = dynamicValue.calculate(game, source, this);
                if (oll > 0) {
                    permanent.addCounters(CounterType.P1P1.createInstance(oll), game);
                }
                return true;
            }
View Full Code Here

Examples of mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount.calculate()

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (player != null && permanent != null) {
            PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(filter, 1);
            int count = amount.calculate(game, source, this);
            if (count == 0) {
                return true;
            }
            if (player.chooseUse(Outcome.Benefit, "Pay " + count + "?", game)) {
                GenericManaCost cost = new GenericManaCost(count);
View Full Code Here

Examples of net.sf.cram.stats.CompressionHeaderFactory.HuffmanParamsCalculator.calculate()

      cal.add(ReadTag.nameType3BytesToInt("OC", 'Z'));
      cal.add(ReadTag.nameType3BytesToInt("BQ", 'Z'));
      cal.add(ReadTag.nameType3BytesToInt("AM", 'c'));
    }

    cal.calculate();

    CanonicalHuffmanIntegerCodec c = new CanonicalHuffmanIntegerCodec(
        cal.values(), cal.bitLens());
    long time6 = System.nanoTime() ;
View Full Code Here

Examples of org.boris.expr.engine.SimpleGraphEngine.calculate()

        e.setValue("y", 5.);
        e.setFormula("z", "x+y+2");
        e.setFormula("a", "z/2");
        e.setFormula("b", "a^2");
        e.setFormula("y", "13+5");
        e.calculate();
        assertEquals(e.get("a"), 5.);
    }
}
View Full Code Here

Examples of org.criticalfailure.torchlight.core.domain.calculator.IObjectPropertyCalculator.calculate()

            IObjectPropertyCalculator calculator = objectPropertyCalculatorListener.getCalculator(calculatorType);
            logger.trace("calculator: " + calculator);

            if(calculator != null) {
                logger.debug("invoking calculator: " + calculator);
                calculator.calculate(property, datum);

                calculated = true;
            }
        }
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.