Examples of Cost


Examples of mage.abilities.costs.Cost

        int xValue = 0;
        boolean payed = false;
        while (!payed) {
            xValue = player.announceXMana(0, Integer.MAX_VALUE, "How much mana will you pay?", game, source);
            if (xValue > 0) {
                Cost cost = new GenericManaCost(xValue);
                payed = cost.pay(source, game, source.getSourceId(), player.getId(), false);
            } else {
                payed = true;
            }
        }
        game.informPlayers(new StringBuilder(player.getName()).append(" pays {").append(xValue).append("}.").toString());
View Full Code Here

Examples of mage.abilities.costs.Cost

    }

    @Override
    public boolean apply(Game game, Ability source) {
        Spell spell = game.getStack().getSpell(source.getFirstTarget());
        Cost cost = new GenericManaCost(2);
        if (spell != null) {
            Player player = game.getPlayer(spell.getControllerId());
            if (player != null) {
                cost.clearPaid();
                if (!cost.pay(source, game, spell.getControllerId(),
                        spell.getControllerId(), false)) {
                    return spell.chooseNewTargets(game, source.getControllerId(), true, true);
                }
            }
        }
View Full Code Here

Examples of mage.abilities.costs.Cost

        super(effect);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        Cost cost = new GenericManaCost(1);
        cost.clearPaid();
        if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
            Player player = game.getPlayer(source.getControllerId());
            if (player != null) {
                player.gainLife(3, game);
                return true;
            }
View Full Code Here

Examples of mage.abilities.costs.Cost

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(targetPointer.getFirst(game, source));
        if (player != null) {
            Cost cost = new GenericManaCost(2);
            if (!cost.pay(source, game, player.getId(), player.getId(), false)) {
                player.damage(2, source.getSourceId(), game, false, true);
            }
            return true;
        }
        return false;
View Full Code Here

Examples of mage.abilities.costs.Cost

        super(effect);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        Cost cost = new GenericManaCost(1);
        cost.clearPaid();
        if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
            Permanent permanent = game.getPermanent(source.getFirstTarget());
            if (permanent != null) {
                permanent.damage(1, source.getSourceId(), game, false, true);
                return true;
            }
View Full Code Here

Examples of mage.abilities.costs.Cost

            MageObject target = game.getPermanent(targetId);
            if (target == null) {
                target = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD);
            }
            if (target != null) {
                Cost cost = new ManaCostsImpl("{2}");
                if (player.chooseUse(outcome, new StringBuilder("Pay ").append(cost.getText()).append(" and put a token copy of ").append(target.getName()).append(" onto the battlefield").toString(), game)) {
                    cost.clearPaid();
                    if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
                        if (target instanceof Permanent) {
                            EmptyToken token = new EmptyToken();
                            CardUtil.copyTo(token).from((Permanent)target);
                            token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
                            return true;
View Full Code Here

Examples of mage.abilities.costs.Cost

                    affectedPlayer = game.getPlayer(permanent.getControllerId());
                }
            }
            if (affectedPlayer != null) {
                if (affectedPlayer.chooseUse(Outcome.Copy, "Pay {R}{R} to copy the spell?", game)) {
                    Cost cost = new ManaCostsImpl("{R}{R}");
                    if (cost.pay(source, game, source.getSourceId(), affectedPlayer.getId(), false)) {
                        Spell spell = game.getStack().getSpell(source.getSourceId());
                        if (spell != null) {
                            Spell copy = spell.copySpell();
                            copy.setControllerId(affectedPlayer.getId());
                            copy.setCopiedSpell(true);
View Full Code Here

Examples of mage.abilities.costs.Cost

        int xValue = 0;
        boolean payed = false;
        while (player.isInGame() && !payed) {
            xValue = player.announceXMana(0, Integer.MAX_VALUE, "How much mana will you pay?", game, source);
            if (xValue > 0) {
                Cost cost = new GenericManaCost(xValue);
                payed = cost.pay(source, game, source.getSourceId(), player.getId(), false);
            } else {
                payed = true;
            }
        }
        game.informPlayers(new StringBuilder(player.getName()).append(" pays {").append(xValue).append("}.").toString());
View Full Code Here

Examples of org.jclouds.glesys.domain.Cost

      assertEquals(actual.toString(), expectedServerDetails().toString());
   }

   public static ServerDetails expectedServerDetails() {
      Ip ip = Ip.builder().version4().ip("31.192.231.254").version4().cost(2.0).currency("EUR").build();
      Cost cost = Cost.builder().amount(10.22).currency("EUR").timePeriod("month").build();
      return ServerDetails.builder().id("vz1840356").transferGB(50).hostname("glesys-s").cpuCores(1).memorySizeMB(512)
            .diskSizeGB(5).datacenter("Falkenberg").description("glesys-s-6dd").platform("OpenVZ")
            .templateName("Ubuntu 10.04 LTS 32-bit").state(Server.State.RUNNING).cost(cost).ips(ip).build();
   }
View Full Code Here

Examples of org.jclouds.glesys.domain.Cost

                       .addFormParam("memorysize", "512")
                       .addFormParam("cpucores", "1")
                       .addFormParam("transfer", "50").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/server_noip.json")).build()).getServerApi();

      Cost cost = Cost.builder().amount(6.38).currency("EUR").timePeriod("month").build();
      ServerDetails expected = ServerDetails.builder().id("vz1541880").hostname("mammamia").datacenter("Falkenberg").platform("OpenVZ")
            .templateName("Ubuntu 11.04 64-bit").description("description").cpuCores(1).memorySizeMB(128).diskSizeGB(5).transferGB(50).cost(cost).build();

      assertEquals(
            api.createWithHostnameAndRootPassword(
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.