Package mage.choices

Examples of mage.choices.ChoiceColor


   
    protected ChoiceColor choice;

    public GainProtectionFromColorTargetEffect(Duration duration) {
        super(new ProtectionAbility(new FilterCard()), duration);
        choice = new ChoiceColor();
    }
View Full Code Here


            return false;
        }

        boolean result = false;
        for (int i = 0; i < amount; i++) {
            ChoiceColor choice = (ChoiceColor) source.getChoices().get(i);

            Mana mana = null;
            if (choice.getColor().isBlack()) {
                mana = manaBuilder.setMana(Mana.BlackMana(1), source, game).build();
            } else if (choice.getColor().isBlue()) {
                mana = manaBuilder.setMana(Mana.BlueMana(1), source, game).build();
            } else if (choice.getColor().isRed()) {
                mana = manaBuilder.setMana(Mana.RedMana(1), source, game).build();
            } else if (choice.getColor().isGreen()) {
                mana = manaBuilder.setMana(Mana.GreenMana(1), source, game).build();
            } else if (choice.getColor().isWhite()) {
                mana = manaBuilder.setMana(Mana.WhiteMana(1), source, game).build();
            }

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

                this.addEffect(new AddConditionalManaOfAnyColorEffect(1 , manaBuilder));
            }
            choices = 1;
        }
        for (int i = 0; i < choices; i++) {
            this.addChoice(new ChoiceColor());
        }
        this.netMana.setAny(amount);
    }
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.Detriment, 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 true;
        }
        return false;
    }
View Full Code Here

    public BraveTheElements(UUID ownerId) {
        super(ownerId, 4, "Brave the Elements", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}");
        this.expansionSetCode = "ZEN";
        this.color.setWhite(true);
        this.getSpellAbility().addChoice(new ChoiceColor());
        this.getSpellAbility().addEffect(new BraveTheElementsEffect());
    }
View Full Code Here

        return new BraveTheElementsEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
        filter2.add(new ColorPredicate(choice.getColor()));
        filter2.setMessage(choice.getChoice());
        setAbility(new ProtectionAbility(new FilterCard(filter2)));
        return super.apply(game, source);
    }
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, colorChoice, game)) {
                game.informPlayers(new StringBuilder(permanent.getLogName()).append(": ").append(player.getName()).append(" has chosen ").append(colorChoice.getChoice()).toString());
                game.getState().setValue(source.getSourceId() + "_color", colorChoice.getColor());
                permanent.addInfo("chosen color", "<font color = 'blue'>Chosen color: " + colorChoice.getColor().getDescription() + "</font>");
            }
        }
        return false;
    }
View Full Code Here

        this.power = new MageInt(2);
        this.toughness = new MageInt(2);

        // {tap}: Add X mana of any one color to your mana pool, where X is the number of Elves on the battlefield.
        Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new WirewoodChannelerManaEffect(), new TapSourceCost());
        ability.addChoice(new ChoiceColor());
        this.addAbility(ability);
    }
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

        return new CartelAristocratEffect(this);
    }
   
    @Override
    public boolean apply(Game game, Ability source) {
        ChoiceColor choice = new ChoiceColor();
        choice.setMessage("Choose color to get protection from");
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null && controller.choose(outcome, choice, game)) {
            FilterCard protectionFilter = new FilterCard();
            protectionFilter.add(new ColorPredicate(choice.getColor()));
            protectionFilter.setMessage(choice.getChoice().toLowerCase());
            ContinuousEffect effect = new GainAbilitySourceEffect(new ProtectionAbility(protectionFilter), Duration.EndOfTurn);
            game.addEffect(effect, source);
            return true;
        }
        return false;
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.