Example #1
0
    public MotherofRunesAbility0(GameState state) {
      super(
          state,
          "(T): Target creature you control gains protection from the color of your choice until end of turn.");
      this.costsTap = true;
      SetGenerator target =
          targetedBy(
              this.addTarget(
                  Intersect.instance(
                      CreaturePermanents.instance(), ControlledBy.instance(You.instance())),
                  "target creature you control"));

      EventFactory chooseColor =
          playerChoose(
              You.instance(),
              1,
              Identity.fromCollection(Color.allColors()),
              PlayerInterface.ChoiceType.COLOR,
              PlayerInterface.ChooseReason.CHOOSE_COLOR,
              "");
      this.addEffect(chooseColor);

      SetGenerator color = EffectResult.instance(chooseColor);
      this.addEffect(
          addProtectionUntilEndOfTurn(
              target,
              color,
              "Target creature gains protection from the color of your choice until end of turn."));
    }
Example #2
0
  public BravetheElements(GameState state) {
    super(state);

    EventFactory factory =
        new EventFactory(
            BRAVE_THE_ELEMENTS_EVENT,
            "Choose a color. White creatures you control gain protection from the chosen color until end of turn.");
    factory.parameters.put(EventType.Parameter.CAUSE, This.instance());
    factory.parameters.put(EventType.Parameter.CHOICE, Identity.instance(Color.allColors()));
    factory.parameters.put(EventType.Parameter.PLAYER, You.instance());
    this.addEffect(factory);
  }