Package mage.choices

Examples of mage.choices.ChoiceColor


        // Whenever Jareth, Leonine Titan blocks, it gets +7/+7 until end of turn.
        this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(7,7,Duration.EndOfTurn), false));
        // {W}: Jareth gains protection from the color of your choice until end of turn.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new JarethsGainProtectionFromColorSourceEffect(), new ManaCostsImpl("{W}"));
        ability.addChoice(new ChoiceColor());
        this.addAbility(ability);

    }
View Full Code Here


    @Override
    public boolean apply(Game game, Ability source) {
        Permanent creature = game.getPermanent(source.getSourceId());
        if (creature != null) {
            ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
            protectionFilter.add(new ColorPredicate(choice.getColor()));
            protectionFilter.setMessage(choice.getChoice());
            ProtectionAbility ability = new ProtectionAbility(protectionFilter);
            creature.addAbility(ability, source.getSourceId(), game);
            return true;
        }
        return false;
View Full Code Here

        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);
View Full Code Here

}

class HarabazDruidManaAbility extends BasicManaAbility {
    HarabazDruidManaAbility() {
        super(new HarabazDruidManaEffect());
        this.addChoice(new ChoiceColor());
    }
View Full Code Here

        super(effect);
    }

    @Override
    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

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (player != null && permanent != null) {
            ChoiceColor colorChoice = new ChoiceColor();
            if (player.choose(Outcome.BoostCreature, colorChoice, game)) {
                game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + colorChoice.getChoice());
                game.getState().setValue(permanent.getId() + "_color", colorChoice.getColor());
                permanent.addInfo("chosen color", CardUtil.addToolTipMarkTags("Chosen color: " + colorChoice.getColor().getDescription()));
            }
        }
        return false;
    }
View Full Code Here

        if (you != null && target != null) {
            for (int i = 0; i < 5; i++) {
                if (!you.chooseUse(Outcome.Neutral, "Do you wish to choose another color?", game)) {
                    break;
                }
                ChoiceColor choiceColor = new ChoiceColor();
                you.choose(Outcome.Benefit, choiceColor, game);
                if (!you.isInGame()) {
                    return false;
                }
                game.informPlayers(target.getName() + ": " + you.getName() + " has chosen " + choiceColor.getChoice());
                if (choiceColor.getColor().isBlack()) {
                    chosenColors.add(ObjectColor.BLACK);
                } else if (choiceColor.getColor().isBlue()) {
                    chosenColors.add(ObjectColor.BLUE);
                } else if (choiceColor.getColor().isRed()) {
                    chosenColors.add(ObjectColor.RED);
                } else if (choiceColor.getColor().isGreen()) {
                    chosenColors.add(ObjectColor.GREEN);
                } else if (choiceColor.getColor().isWhite()) {
                    chosenColors.add(ObjectColor.WHITE);
                }
            }
            for (ObjectColor color : chosenColors) {
                ContinuousEffect effect = new SetCardColorTargetEffect(color, Duration.EndOfTurn, "is " + color);
View Full Code Here

        if(enchantment != null){
            Permanent land = game.getPermanent(enchantment.getAttachedTo());
            if(land != null){
                Player player = game.getPlayer(land.getControllerId());
                if (player != null) {
                    ChoiceColor choice = new ChoiceColor();
                    while (!player.choose(outcome, choice, game)) {
                        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()) {
                        mana = Mana.RedMana(amount);
                    } else if (choice.getColor().isGreen()) {
                        mana = Mana.GreenMana(amount);
                    } else if (choice.getColor().isWhite()) {
                        mana = Mana.WhiteMana(amount);
                    }
                    if (player != null && mana != null) {
                        player.getManaPool().addMana(mana, game, source);
                        return true;
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (player != null && permanent != null) {
            ChoiceColor colorChoice = new ChoiceColor();
            colorChoice.setMessage("Choose color");
            while (!player.choose(Outcome.BoostCreature, colorChoice, game)) {
                if (!player.isInGame()) {
                    return false;
                }
            }
            if (colorChoice.getChoice() != null) {
                game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + colorChoice.getChoice());
                game.getState().setValue(permanent.getId() + "_color", colorChoice.getChoice());
                permanent.addInfo("chosen color", "<font color = 'blue'>Chosen color: " + colorChoice.getColor().getDescription() + "</font>");
            }
        }
        return false;
    }
View Full Code Here

        this.color.setGreen(true);

        // Exile a creature you control: Add X mana of any one color to your mana pool, where X is the exiled creature's converted mana cost plus one. Spend this mana only to cast creature spells.
        Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new FoodChainManaEffect(), new ExileTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature you control"), true)));
        ability.addChoice(new ChoiceColor());
        this.addAbility(ability);
    }
View Full Code Here

TOP

Related Classes of mage.choices.ChoiceColor

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.