Package mage

Examples of mage.Mana


    }

    @Override
    public boolean apply(Game game, Ability source, Ability abilityToModify) {
        SpellAbility spellAbility = (SpellAbility)abilityToModify;
        Mana mana = spellAbility.getManaCostsToPay().getMana();
        if (mana.getColorless() > 0) {
            int count = new DevotionCount(ColoredManaSymbol.B).calculate(game, source, this);
            int newCount = mana.getColorless() - count;
            if (newCount < 0) {
                newCount = 0;
            }
            mana.setColorless(newCount);
            spellAbility.getManaCostsToPay().load(mana.toString());
            return true;
        }
        return false;
    }
View Full Code Here


        return true;
    }

    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Mana mana = ((ManaEvent) event).getMana();
        if (mana.getBlack() > 0) {
            ((ManaEvent) event).getMana().set(ManaType.BLACK, mana.count() * 2);
        }
        if (mana.getBlue() > 0) {
            ((ManaEvent) event).getMana().set(ManaType.BLUE, mana.count() * 2);
        }
        if (mana.getWhite() > 0) {
            ((ManaEvent) event).getMana().set(ManaType.WHITE, mana.count() * 2);
        }
        if (mana.getGreen() > 0) {
            ((ManaEvent) event).getMana().set(ManaType.GREEN, mana.count() * 2);
        }
        if (mana.getRed() > 0) {
            ((ManaEvent) event).getMana().set(ManaType.RED, mana.count() * 2);
        }
        if (mana.getColorless() > 0) {
            ((ManaEvent) event).getMana().set(ManaType.COLORLESS, mana.count() * 2);
        }
        return false;
    }
View Full Code Here

        int whiteMana = pool.getWhite();
        int blueMana = pool.getBlue();
        int greenMana = pool.getGreen();
        int redMana = pool.getRed();
        int colorlessMana = pool.getColorless();       
        pool.addMana(new Mana(redMana, greenMana, blueMana, whiteMana, blackMana, colorlessMana, 0), game, source);
        return true;
    }
View Full Code Here

                }
            }
        }
       
        ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
        Mana mana = null;
        if (choice.getColor().isBlack()) {
            mana = new FoodChainManaBuilder().setMana(Mana.BlackMana(manaCostExiled + 1), source, game).build();
        }
        else if (choice.getColor().isBlue()) {
            mana = new FoodChainManaBuilder().setMana(Mana.BlueMana(manaCostExiled + 1), source, game).build();
View Full Code Here

        this.subtype.add("Golem");
        this.power = new MageInt(4);
        this.toughness = new MageInt(4);

        // Sacrifice Composite Golem: Add {W}{U}{B}{R}{G} to your mana pool.
        this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(1, 1, 1, 1, 1, 0, 0), new SacrificeSourceCost()));
    }
View Full Code Here

        }

        boolean result = false;
        for (int i = 0; i < 2; i++) {
            ChoiceColor choice = (ChoiceColor) source.getChoices().get(i);
            Mana mana = null;
            if (choice.getColor().isBlack()) {
                mana = Mana.BlackMana(1);
            } else if (choice.getColor().isBlue()) {
                mana = Mana.BlueMana(1);
            } else if (choice.getColor().isRed()) {
View Full Code Here

        this.expansionSetCode = "LEA";

        // Basalt Monolith doesn't untap during your untap step.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipUntapSourceEffect()));
        // {tap}: Add {3} to your mana pool.
        this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0,0,0,0,0,3,0),new TapSourceCost()));
        // {3}: Untap Basalt Monolith.
        this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), new GenericManaCost(3)));
    }
View Full Code Here

        // {GW}, {tap}: Add {G}{G}, {G}{W}, or {W}{W} to your mana pool.
        SimpleManaAbility ability = new SimpleManaAbility(Zone.BATTLEFIELD, Mana.GreenMana(2), new ManaCostsImpl("{G/W}"));
        ability.addCost(new TapSourceCost());
        this.addAbility(ability);

        ability = new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 1, 0, 1, 0, 0, 0), new ManaCostsImpl("{G/W}"));
        ability.addCost(new TapSourceCost());
        this.addAbility(ability);

        ability = new SimpleManaAbility(Zone.BATTLEFIELD, Mana.WhiteMana(2), new ManaCostsImpl("{G/W}"));
        ability.addCost(new TapSourceCost());
View Full Code Here

                for (Cost cost : source.getCosts()) {
                    if (cost instanceof RemoveVariableCountersSourceCost) {
                        numberOfMana = ((RemoveVariableCountersSourceCost)cost).getAmount();
                    }
                }            
                player.getManaPool().addMana(new Mana(0, 0, 0, 0, 0, numberOfMana + 1, 0), game, source);
                return true;
            }
            return false;
        }
View Full Code Here

            }
            cardNum++;
        }
        // add basic lands
        // TODO:  compensate for non basic lands
        Mana mana = new Mana();
        for (Card card: deck.getCards()) {
            mana.add(card.getManaCost().getMana());
        }
        double total = mana.getBlack() + mana.getBlue() + mana.getGreen() + mana.getRed() + mana.getWhite();
        int mostLand = 0;
        String mostLandName = "Forest";
        if (mana.getGreen() > 0) {
            int number = (int) Math.round(mana.getGreen() / total * 17);
            addBasicLands(deck, "Forest", number);
            mostLand = number;
        }
        if (mana.getBlack() > 0) {
            int number = (int) Math.round(mana.getBlack() / total * 17);
            addBasicLands(deck, "Swamp", number);
            if (number > mostLand) {
                mostLand = number;
                mostLandName = "Swamp";
            }
        }
        if (mana.getBlue() > 0) {
            int number = (int) Math.round(mana.getBlue() / total * 17);
            addBasicLands(deck, "Island", number);
            if (number > mostLand) {
                mostLand = number;
                mostLandName = "Island";
            }
        }
        if (mana.getWhite() > 0) {
            int number = (int) Math.round(mana.getWhite() / total * 17);
            addBasicLands(deck, "Plains", number);
            if (number > mostLand) {
                mostLand = number;
                mostLandName = "Plains";
            }
        }
        if (mana.getRed() > 0) {
            int number = (int) Math.round(mana.getRed() / total * 17);
            addBasicLands(deck, "Mountain", number);
            if (number > mostLand) {
                mostLandName = "Plains";
            }
        }
View Full Code Here

TOP

Related Classes of mage.Mana

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.