示例#1
0
    public MysticRemoraAbility1(GameState state) {
      super(
          state,
          "Whenever an opponent casts a noncreature spell, you may draw a card unless that player pays (4).");

      SimpleEventPattern pattern = new SimpleEventPattern(EventType.BECOMES_PLAYED);
      pattern.put(EventType.Parameter.PLAYER, OpponentsOf.instance(You.instance()));
      pattern.put(
          EventType.Parameter.OBJECT,
          RelativeComplement.instance(Spells.instance(), HasType.instance(Type.CREATURE)));
      this.addPattern(pattern);

      SetGenerator thatPlayer =
          EventParameter.instance(
              TriggerEvent.instance(This.instance()), EventType.Parameter.PLAYER);

      EventFactory mayDraw =
          youMay(drawCards(You.instance(), 1, "Draw a card"), "You may draw a card");

      EventFactory pay = new EventFactory(EventType.PAY_MANA, "Pay (4)");
      pay.parameters.put(EventType.Parameter.CAUSE, This.instance());
      pay.parameters.put(EventType.Parameter.PLAYER, thatPlayer);
      pay.parameters.put(EventType.Parameter.MANA, Identity.instance(new ManaPool("4")));
      this.addEffect(
          unless(thatPlayer, mayDraw, pay, "You may draw a card unless that player pays (4)."));
    }
示例#2
0
    public FathomMageAbility1(GameState state) {
      super(state, "Whenever a +1/+1 counter is placed on Fathom Mage, you may draw a card.");

      SimpleEventPattern pattern = new SimpleEventPattern(EventType.PUT_ONE_COUNTER);
      pattern.put(EventType.Parameter.OBJECT, ABILITY_SOURCE_OF_THIS);
      pattern.put(
          EventType.Parameter.COUNTER, Identity.instance(Counter.CounterType.PLUS_ONE_PLUS_ONE));
      this.addPattern(pattern);

      this.addEffect(youMay(drawACard()));
    }
示例#3
0
    public LunarMysticAbility0(GameState state) {
      super(state, "Whenever you cast an instant spell, you may pay (1). If you do, draw a card.");

      SimpleEventPattern whenYouCastASpell = new SimpleEventPattern(EventType.BECOMES_PLAYED);
      whenYouCastASpell.put(EventType.Parameter.PLAYER, You.instance());
      whenYouCastASpell.put(EventType.Parameter.OBJECT, HasType.instance(Type.INSTANT));
      this.addPattern(whenYouCastASpell);

      this.addEffect(
          ifThen(youMayPay("(1)"), drawACard(), "You may pay (1). If you do, draw a card."));
    }
示例#4
0
    public PsychosisCrawlerAbility1(GameState state) {
      super(state, "Whenever you draw a card, each opponent loses 1 life.");

      SimpleEventPattern pattern = new SimpleEventPattern(EventType.DRAW_ONE_CARD);
      pattern.put(EventType.Parameter.PLAYER, You.instance());
      this.addPattern(pattern);

      this.addEffect(
          loseLife(OpponentsOf.instance(You.instance()), 1, "Each opponent loses 1 life."));
    }
    public ShrineofBoundlessGrowthAbility0(GameState state) {
      super(
          state,
          "At the beginning of your upkeep or whenever you cast a green spell, put a charge counter on Shrine of Boundless Growth.");
      this.addPattern(atTheBeginningOfYourUpkeep());

      SimpleEventPattern castABlueSpell = new SimpleEventPattern(EventType.BECOMES_PLAYED);
      castABlueSpell.put(EventType.Parameter.PLAYER, You.instance());
      castABlueSpell.put(
          EventType.Parameter.OBJECT,
          Intersect.instance(Spells.instance(), HasColor.instance(Color.GREEN)));
      this.addPattern(castABlueSpell);

      this.addEffect(
          putCounters(
              1,
              Counter.CounterType.CHARGE,
              ABILITY_SOURCE_OF_THIS,
              "Put a charge counter on Shrine of Boundless Growth."));
    }
示例#6
0
    public SlateStreetRuffianAbility0(GameState state) {
      super(
          state,
          "Whenever Slate Street Ruffian becomes blocked, defending player discards a card.");

      SimpleEventPattern pattern = new SimpleEventPattern(EventType.DECLARE_ONE_BLOCKER);
      pattern.put(EventType.Parameter.ATTACKER, ABILITY_SOURCE_OF_THIS);
      this.addPattern(pattern);

      this.addEffect(
          discardCards(
              DefendingPlayer.instance(ABILITY_SOURCE_OF_THIS),
              1,
              "Defending player discards a card."));
    }
    public Glass(GameState state) {
      super(
          state,
          "Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.");

      SimpleEventPattern pattern = new SimpleEventPattern(EventType.BECOMES_TARGET);
      pattern.put(
          EventType.Parameter.TARGET,
          RelativeComplement.instance(ABILITY_SOURCE_OF_THIS, TargetedThisTurn.instance()));
      state.ensureTracker(new TargetedThisTurn.Tracker());

      SetGenerator thatSpell =
          EventParameter.instance(
              TriggerEvent.instance(This.instance()), EventType.Parameter.OBJECT);
      this.addEffect(counter(thatSpell, "Counter that spell or ability."));
    }
示例#8
0
    public Vampiricism(GameState state) {
      super(state, "Whenever you gain life, target opponent loses that much life.");

      SimpleEventPattern pattern = new SimpleEventPattern(EventType.GAIN_LIFE);
      pattern.put(EventType.Parameter.PLAYER, You.instance());
      this.addPattern(pattern);

      Target target = this.addTarget(OpponentsOf.instance(You.instance()), "target opponent");

      this.addEffect(
          loseLife(
              targetedBy(target),
              EventParameter.instance(
                  TriggerEvent.instance(This.instance()), EventType.Parameter.NUMBER),
              "Target opponent loses that much life."));
    }
示例#9
0
    public GolemFoundryAbility0(GameState state) {
      super(
          state,
          "Whenever you cast an artifact spell, you may put a charge counter on Golem Foundry.");

      SimpleEventPattern pattern = new SimpleEventPattern(EventType.BECOMES_PLAYED);
      pattern.put(EventType.Parameter.PLAYER, You.instance());
      pattern.withResult(HasType.instance(Type.ARTIFACT));
      this.addPattern(pattern);

      this.addEffect(
          youMay(
              putCounters(
                  1,
                  Counter.CounterType.CHARGE,
                  ABILITY_SOURCE_OF_THIS,
                  "Put a charge counter on Golem Foundry."),
              "You may put a charge counter on Golem Foundry."));
    }
示例#10
0
    public Blind(GameState state) {
      super(
          state,
          "Whenever Blinding Angel deals combat damage to a player, that player skips his or her next combat phase.");

      this.addPattern(whenDealsCombatDamageToAPlayer(ABILITY_SOURCE_OF_THIS));

      SetGenerator thatPlayer = TakerOfDamage.instance(TriggerDamage.instance(This.instance()));
      SetGenerator combat = CombatPhaseOf.instance(thatPlayer);

      SimpleEventPattern nextCombatPhase = new SimpleEventPattern(EventType.BEGIN_PHASE);
      nextCombatPhase.put(EventType.Parameter.PHASE, combat);

      EventReplacementEffect skip =
          new EventReplacementEffect(
              state.game, "That player skips his or her next combat phase", nextCombatPhase);
      // skip.addEffect(nothing)

      this.addEffect(
          createFloatingReplacement(skip, "That player skips his or her next combat phase."));
    }