Package mage.choices

Examples of mage.choices.ChoiceColor


    return new AddManaOfAnyColorEffect(this);
  }

  @Override
  public boolean apply(Game game, Ability source) {
    ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
    Player player = game.getPlayer(source.getControllerId());
    if (choice.getColor().isBlack()) {
      player.getManaPool().changeMana(Mana.BlackMana);
      return true;
    }
    else if (choice.getColor().isBlue()) {
      player.getManaPool().changeMana(Mana.BlueMana);
      return true;
    }
    else if (choice.getColor().isRed()) {
      player.getManaPool().changeMana(Mana.RedMana);
      return true;
    }
    else if (choice.getColor().isGreen()) {
      player.getManaPool().changeMana(Mana.GreenMana);
      return true;
    }
    else if (choice.getColor().isWhite()) {
      player.getManaPool().changeMana(Mana.WhiteMana);
      return true;
    }
    return false;
  }
View Full Code Here


    return new GainProtectionFromColorTargetEffect(this);
  }

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

    super(ownerId, 142, "Sejiri Steppe", Rarity.COMMON, new CardType[]{CardType.LAND}, null);
    this.expansionSetCode = "WWK";
    this.addAbility(new EntersBattlefieldTappedAbility());
    EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainProtectionFromColorTargetEffect(Duration.EndOfTurn), false);
    ability.addTarget(new TargetControlledCreaturePermanent());
    ability.addChoice(new ChoiceColor());
    this.addAbility(ability);
    this.addAbility(new WhiteManaAbility());
  }
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.setColor(choice.getColor());
    filter2.setMessage(choice.getChoice());
    ability = new ProtectionAbility(new FilterCard(filter2));
    return super.apply(game, source);
  }
View Full Code Here

    this.color.setGreen(true);
    this.power = new MageInt(2);
    this.toughness = new MageInt(1);

    LandfallAbility ability = new LandfallAbility(new AddManaOfAnyColorEffect(1), false);
    ability.addChoice(new ChoiceColor());
    this.addAbility(ability);
  }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent perm = game.getPermanent(source.getSourceId());
        if (player != null && perm != null) {
            ChoiceColor colorChoice = new ChoiceColor();
            if (player.choose(Outcome.Benefit, colorChoice, game)) {
                game.informPlayers(perm.getName() + ": " + player.getName() + " has chosen " + colorChoice.getChoice());
                game.addEffect(new GainProtectionFromChosenColorEffect(colorChoice.getColor()), source);
            }
            return true;
        }
        return false;
    }
View Full Code Here

                computedMana.setAny(count);
            } else {
                Player controller = game.getPlayer(source.getControllerId());
                if (controller != null) {
                    for(int i = 0; i < count; i++){
                        ChoiceColor choiceColor = new ChoiceColor();
                        while (!controller.choose(Outcome.Benefit, choiceColor, game)) {
                            if (!controller.isInGame()) {
                                return computedMana;
                            }
                        }
                        if (choiceColor.getColor().isBlack()) {
                            computedMana.addBlack();
                        } else if (choiceColor.getColor().isBlue()) {
                            computedMana.addBlue();
                        } else if (choiceColor.getColor().isRed()) {
                            computedMana.addRed();
                        } else if (choiceColor.getColor().isGreen()) {
                            computedMana.addGreen();
                        } else if (choiceColor.getColor().isWhite()) {
                            computedMana.addWhite();
                        }
                    }
                }
            }           
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(false);

            if (controller.choose(outcome, choice, game)) {
                if (choice.getColor() == null) {
                    return false; // it happenes, don't know how
                }
                Mana createdMana = null;
                if (choice.getColor().isBlack()) {
                    createdMana = Mana.BlackMana(amount);
                } else if (choice.getColor().isBlue()) {
                    createdMana = Mana.BlueMana(amount);
                } else if (choice.getColor().isRed()) {
                    createdMana = Mana.RedMana(amount);
                } else if (choice.getColor().isGreen()) {
                    createdMana = Mana.GreenMana(amount);
                } else if (choice.getColor().isWhite()) {
                    createdMana = Mana.WhiteMana(amount);
                }
                if (createdMana != null) {
                    controller.getManaPool().addMana(createdMana, game, source);
                }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        boolean result = false;
        ObjectColor objectColor = null;
        if (setColor == null) {
            ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
            if (choice != null && choice.getColor() != null) {
                objectColor = choice.getColor();
            }           
        } else {
            objectColor = this.setColor;
        }
        if (objectColor != null) {
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.