Package mage

Examples of mage.Mana


    public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
        for (Permanent land : game.getState().getBattlefield().getAllActivePermanents(new FilterLandPermanent(), source.getControllerId(), game)) {
            if (land != null) {
                switch (layer) {
                    case AbilityAddingRemovingEffects_6:
                        Mana mana = new Mana();
                        for (Ability ability : land.getAbilities()){
                            if (ability instanceof BasicManaAbility) {
                                mana.add(((BasicManaAbility)ability ).getNetMana(game));
                            }
                        }
                        if (mana.getGreen() == 0 && landTypes.contains("Forest")) {
                            land.addAbility(new GreenManaAbility(), source.getSourceId(), game);
                        }
                        if (mana.getRed() == 0 && landTypes.contains("Mountain")) {
                            land.addAbility(new RedManaAbility(), source.getSourceId(), game);
                        }
                        if (mana.getBlue() == 0 && landTypes.contains("Island")) {
                            land.addAbility(new BlueManaAbility(), source.getSourceId(), game);
                        }
                        if (mana.getWhite() == 0 && landTypes.contains("Plains")) {
                            land.addAbility(new WhiteManaAbility(), source.getSourceId(), game);
                        }
                        if (mana.getBlack() == 0 && landTypes.contains("Swamp")) {
                            land.addAbility(new BlackManaAbility(), source.getSourceId(), game);
                        }
                        break;
                    case TypeChangingEffects_4:
                        for (String subtype : landTypes) {
View Full Code Here


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

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

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

        // {UB}, {tap}: Add {U}{U}, {U}{B}, or {B}{B} to your mana pool.
        SimpleManaAbility ability = new SimpleManaAbility(Zone.BATTLEFIELD, Mana.BlueMana(2), new ManaCostsImpl("{U/B}"));
        ability.addCost(new TapSourceCost());
        this.addAbility(ability);

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

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

        Player controller = game.getPlayer(source.getControllerId());
        MageObject sourceObject = game.getObject(source.getSourceId());
        if(controller != null && sourceObject != null){
                int x = 2;

            Mana mana = new Mana();
            for(int i = 0; i < x; i++){
                ChoiceColor choiceColor = new ChoiceColor();
                if (i == 0) {
                    choiceColor.setMessage("First mana color for " + sourceObject.getLogName());
                } else {
                    choiceColor.setMessage("Second mana color for " + sourceObject.getLogName());
                }
                while (!controller.choose(Outcome.Benefit, choiceColor, game)) {
                    if (!controller.isInGame()) {
                        return false;
                    }
                }

                if (choiceColor.getColor().isBlack()) {
                    mana.addBlack();
                } else if (choiceColor.getColor().isBlue()) {
                    mana.addBlue();
                } else if (choiceColor.getColor().isRed()) {
                    mana.addRed();
                } else if (choiceColor.getColor().isGreen()) {
                    mana.addGreen();
                } else if (choiceColor.getColor().isWhite()) {
                    mana.addWhite();
                }
            }

            controller.getManaPool().addMana(mana, game, source);
            return true;
View Full Code Here

    public boolean apply(Game game, Ability source) {
        ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
        Player player = game.getPlayer(source.getControllerId());
        int count = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);
        if (choice.getColor().isBlack()) {
            player.getManaPool().addMana(new Mana(0, 0, 0, 0, count, 0, 0), game, source);
            return true;
        } else if (choice.getColor().isBlue()) {
            player.getManaPool().addMana(new Mana(0, 0, count, 0, 0, 0, 0), game, source);
            return true;
        } else if (choice.getColor().isRed()) {
            player.getManaPool().addMana(new Mana(count, 0, 0, 0, 0, 0, 0), game, source);
            return true;
        } else if (choice.getColor().isGreen()) {
            player.getManaPool().addMana(new Mana(0, count, 0, 0, 0, 0, 0), game, source);
            return true;
        } else if (choice.getColor().isWhite()) {
            player.getManaPool().addMana(new Mana(0, 0, 0, count, 0, 0, 0), game, source);
            return true;
        }
        return false;
    }
View Full Code Here

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

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

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

}

class UrGolemsEyeAbility extends BasicManaAbility {

    public UrGolemsEyeAbility() {
        super(new BasicManaEffect(new Mana(0, 0, 0, 0, 0, 2, 0)));
        this.netMana.setColorless(2);
    }
View Full Code Here

                        if (!player.isInGame()) {
                            return false;
                        }
                    }
                    int amount = 1;
                    Mana mana = null;
                    if (choice.getColor().isBlack()) {
                        mana = Mana.BlackMana(amount);
                    } else if (choice.getColor().isBlue()) {
                        mana = Mana.BlueMana(amount);
                    } else if (choice.getColor().isRed()) {
View Full Code Here

    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
            if (((DamagedPlayerEvent) event).isCombatDamage()) {
                if (event.getSourceId().equals(getSourceId())) {
                    this.getEffects().clear();
                    Effect effect = new AddManaToManaPoolEffect(new Mana(0,event.getAmount(),0,0,0,0,0), "that player", true);
                    effect.setTargetPointer(new FixedTarget(getControllerId()));
                    effect.setText("add that much {G} to your mana pool. Until end of turn, this mana doesn't empty from your mana pool as steps and phases end");       
                    this.addEffect(effect);
                    return true;
                }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent land = game.getPermanentOrLKIBattlefield(this.targetPointer.getFirst(game, source));
        Abilities<ManaAbility> mana = land.getAbilities().getManaAbilities(Zone.BATTLEFIELD);
        Mana types = new Mana();
        for (ManaAbility ability: mana) {
            types.add(ability.getNetMana(game));
        }
        Choice choice = new ChoiceImpl(true);
        choice.setMessage("Pick a mana color");
        if (types.getBlack() > 0) {
            choice.getChoices().add("Black");
        }
        if (types.getRed() > 0) {
            choice.getChoices().add("Red");
        }
        if (types.getBlue() > 0) {
            choice.getChoices().add("Blue");
        }
        if (types.getGreen() > 0) {
            choice.getChoices().add("Green");
        }
        if (types.getWhite() > 0) {
            choice.getChoices().add("White");
        }
        if (types.getColorless() > 0) {
            choice.getChoices().add("Colorless");
        }
        if (choice.getChoices().size() > 0) {
            Player player = game.getPlayer(source.getControllerId());
            if (choice.getChoices().size() == 1) {
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.