示例#1
0
    public LensofClarityAbility0(GameState state) {
      super(
          state,
          "You may look at the top card of your library and at face-down creatures you don't control.");

      SetGenerator top = TopCards.instance(1, LibraryOf.instance(You.instance()));
      SetGenerator morphs = Intersect.instance(FaceDown.instance(), CreaturePermanents.instance());
      SetGenerator otherPlayersMorphs =
          RelativeComplement.instance(morphs, ControlledBy.instance(You.instance()));

      ContinuousEffect.Part lookAtMorphs = new ContinuousEffect.Part(ContinuousEffectType.LOOK);
      lookAtMorphs.parameters.put(ContinuousEffectType.Parameter.PLAYER, You.instance());
      lookAtMorphs.parameters.put(
          ContinuousEffectType.Parameter.OBJECT, Union.instance(top, otherPlayersMorphs));
      this.addEffectPart(lookAtMorphs);
    }
  public DarkConfidantAbility(GameState state) {
    super(
        state,
        "At the beginning of your upkeep, reveal the top card of your library and put that card into your hand. You lose life equal to its converted mana cost.");
    this.addPattern(atTheBeginningOfYourUpkeep());

    SetGenerator library = LibraryOf.instance(You.instance());
    SetGenerator topCard = TopCards.instance(numberGenerator(1), library);

    EventFactory reveal = reveal(topCard, "Reveal the top card of your library");
    this.addEffect(reveal);
    this.addEffect(
        putIntoHand(topCard, OwnerOf.instance(topCard), "and put that card into your hand."));
    this.addEffect(
        loseLife(
            You.instance(),
            ConvertedManaCostOf.instance(EffectResult.instance(reveal)),
            "You lose life equal to its converted mana cost."));
  }