Package mage.choices

Examples of mage.choices.ChoiceColor


            return false;
        }

        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()) {
                mana = Mana.RedMana(1);
            } else if (choice.getColor().isGreen()) {
                mana = Mana.GreenMana(1);
            } else if (choice.getColor().isWhite()) {
                mana = Mana.WhiteMana(1);
            }

            if (mana != null) {
                player.getManaPool().addMana(mana, game, source);
View Full Code Here


        // Target spell or permanent becomes the color of your choice until end of turn.
        getLeftHalfCard().getColor().setBlue(true);
        getLeftHalfCard().getSpellAbility().addEffect(new SetCardColorTargetEffect(Duration.EndOfTurn));
        Target target = new TargetSpellOrPermanent();
        getLeftHalfCard().getSpellAbility().addTarget(target);
        getLeftHalfCard().getSpellAbility().addChoice(new ChoiceColor());

        // Reality
        // Destroy target artifact.
        getRightHalfCard().getColor().setGreen(true);
        getRightHalfCard().getSpellAbility().addTarget(new TargetArtifactPermanent());
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.Neutral, colorChoice, game)) {
                game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + colorChoice.getChoice());
                game.getState().setValue(permanent.getId() + "_color", colorChoice.getColor());
                permanent.addInfo("chosen color", "<font color = 'blue'>Chosen color: " + colorChoice.getColor().getDescription() + "</font>");
            }
        }
        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

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent wildMongrel = game.getPermanent(source.getSourceId());
        if (player != null && wildMongrel != null) {
            ChoiceColor colorChoice = new ChoiceColor();
            if (player.choose(Outcome.Neutral, colorChoice, game)) {
                game.informPlayers(wildMongrel.getName() + ": " + player.getName() + " has chosen " + colorChoice.getChoice());
                ContinuousEffect effect = new SetCardColorTargetEffect(colorChoice.getColor(), Duration.EndOfTurn, "is " + colorChoice.getChoice());
                effect.setTargetPointer(new FixedTarget(source.getSourceId()));
                game.addEffect(effect, source);
                return true;
            }
        }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            if (FatefulHourCondition.getInstance().apply(game, source)) {
                ChoiceColor choice = new ChoiceColor();
                while (!choice.isChosen()) {
                    controller.choose(Outcome.Protect, choice, game);
                    if (!controller.isInGame()) {
                        return false;
                    }
                }
                FilterCard filter = new FilterCard();
                filter.add(new ColorPredicate(choice.getColor()));
                filter.setMessage(choice.getChoice());

                Ability ability = new ProtectionAbility(filter) ;
                game.addEffect(new GainAbilityControlledEffect(ability, Duration.EndOfTurn), source);
                game.addEffect(new GainAbilityControllerEffect(ability, Duration.EndOfTurn), source);
            }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            ChoiceColor choice = new ChoiceColor();
            controller.choose(outcome, choice, game);
            if (choice.getColor() != null) {
                final int damage = source.getManaCostsToPay().getX();
                FilterPermanent filter = new FilterCreaturePermanent();
                filter.add(new ColorPredicate(choice.getColor()));
                for (Permanent permanent:game.getBattlefield().getActivePermanents(filter, source.getControllerId(), id, game)) {
                    permanent.damage(damage, source.getSourceId(), game, false, true);
                }
                return true;
            }
View Full Code Here

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

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if(player != null){
            Mana mana = new Mana();
            for(int i = 0; i < amountOfMana; i++){
                ChoiceColor choiceColor = new ChoiceColor();
                while (!player.choose(Outcome.Benefit, choiceColor, game)) {
                    if (!player.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();
                }
            }

            player.getManaPool().addMana(mana, game, source);
View Full Code Here

    }
   
    private class PetalmaneBakuManaAbility extends BasicManaAbility {
        PetalmaneBakuManaAbility() {
            super(new PetalmaneBakuManaEffect());
            this.addChoice(new ChoiceColor());
        }
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.