Package mage.choices

Examples of mage.choices.ChoiceColorOrArtifact


    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            FilterCard protectionFilter = new FilterCard();
            ChoiceColorOrArtifact choice = new ChoiceColorOrArtifact();
            if (controller.choose(outcome, choice, game)) {
                if (choice.isArtifactSelected()) {
                    protectionFilter.add(new CardTypePredicate(CardType.ARTIFACT));
                } else {
                    protectionFilter.add(new ColorPredicate(choice.getColor()));
                }

                protectionFilter.setMessage(choice.getChoice());
                ((ProtectionAbility) ability).setFilter(protectionFilter);
                Permanent creature = game.getPermanent(source.getFirstTarget());
                if (creature != null) {
                    creature.addAbility(ability, source.getSourceId(), game);
                    return true;
View Full Code Here


        super(ownerId, 2, "Apostle's Blessing", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{WP}");
        this.expansionSetCode = "NPH";
        this.color.setWhite(true);
        this.getSpellAbility().addEffect(new ApostlesBlessingEffect(Duration.EndOfTurn));
        this.getSpellAbility().addTarget(new TargetControlledPermanent(filter));
        this.getSpellAbility().addChoice(new ChoiceColorOrArtifact());
    }
View Full Code Here

    }

    @Override
    public boolean apply(Game game, Ability source) {
        FilterCard protectionFilter = new FilterCard();
        ChoiceColorOrArtifact choice = (ChoiceColorOrArtifact) source.getChoices().get(0);
        if (choice.isArtifactSelected()) {
            protectionFilter.add(new CardTypePredicate(CardType.ARTIFACT));
        } else {
            protectionFilter.add(new ColorPredicate(choice.getColor()));
        }

        protectionFilter.setMessage(choice.getChoice());
        ((ProtectionAbility) ability).setFilter(protectionFilter);
        Permanent creature = game.getPermanent(source.getFirstTarget());
        if (creature != null) {
            creature.addAbility(ability, game);
            return true;
View Full Code Here

TOP

Related Classes of mage.choices.ChoiceColorOrArtifact

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.