コード例 #1
0
ファイル: Pyroblast.java プロジェクト: jmagicdev/jmagic
  public Pyroblast(GameState state) {
    super(state);

    {
      Target target = this.addTarget(1, Spells.instance(), "target spell");
      EventFactory counter =
          new EventFactory(EventType.IF_CONDITION_THEN_ELSE, "Counter target spell if it's blue.");
      counter.parameters.put(
          EventType.Parameter.IF,
          Intersect.instance(targetedBy(target), HasColor.instance(Color.BLUE)));
      counter.parameters.put(
          EventType.Parameter.THEN,
          Identity.instance(counter(targetedBy(target), "Counter target spell.")));
      this.addEffect(1, counter);
    }

    {
      Target target = this.addTarget(2, Permanents.instance(), "target permanent");
      EventFactory destroy =
          new EventFactory(
              EventType.IF_CONDITION_THEN_ELSE, "Destroy target permanent if it's blue.");
      destroy.parameters.put(
          EventType.Parameter.IF,
          Intersect.instance(targetedBy(target), HasColor.instance(Color.BLUE)));
      destroy.parameters.put(
          EventType.Parameter.THEN,
          Identity.instance(destroy(targetedBy(target), "Destroy target permanent.")));
      this.addEffect(2, destroy);
    }
  }
コード例 #2
0
ファイル: Bant.java プロジェクト: ranjan-rk/jmagic
    public IndestructibleChaos(GameState state) {
      super(
          state,
          "Whenever you roll (C), put a divinity counter on target green, white, or blue creature. That creature is indestructible as long as it has a divinity counter on it.");

      this.addPattern(Planechase.wheneverYouRollChaos());

      Target target =
          this.addTarget(
              Intersect.instance(
                  CreaturePermanents.instance(),
                  HasColor.instance(Color.GREEN, Color.WHITE, Color.BLUE)),
              "target green, white, or blue creature");
      this.addEffect(
          putCounters(
              1,
              Counter.CounterType.DIVINITY,
              targetedBy(target),
              "Put a divinity counter on target green, white, or blue creature."));
      this.addEffect(
          createFloatingEffect(
              CountersOn.instance(targetedBy(target), Counter.CounterType.DIVINITY),
              "That creature is indestructible as long as it has a divinity counter on it.",
              indestructible(targetedBy(target))));

      this.canTrigger = Planechase.triggeredAbilityCanTrigger;
    }
コード例 #3
0
ファイル: RuthlessRipper.java プロジェクト: jmagicdev/jmagic
  public RuthlessRipper(GameState state) {
    super(state);

    this.setPower(1);
    this.setToughness(1);

    // Deathtouch
    this.addAbility(new org.rnd.jmagic.abilities.keywords.Deathtouch(state));

    // Morph\u2014Reveal a black card in your hand. (You may cast this card
    // face down as a 2/2 creature for (3). Turn it face up any time for its
    // morph cost.)
    SetGenerator blueStuff =
        Intersect.instance(
            HasColor.instance(Color.BLACK), InZone.instance(HandOf.instance(You.instance())));
    EventFactory reveal =
        new EventFactory(EventType.REVEAL_CHOICE, "Reveal a black card in your hand");
    reveal.parameters.put(EventType.Parameter.CAUSE, This.instance());
    reveal.parameters.put(EventType.Parameter.OBJECT, blueStuff);
    reveal.parameters.put(EventType.Parameter.PLAYER, You.instance());

    CostCollection morphCost =
        new CostCollection(org.rnd.jmagic.abilities.keywords.Morph.COST_TYPE, reveal);
    this.addAbility(
        new org.rnd.jmagic.abilities.keywords.Morph(
            state, "Morph\u2014Reveal a black card in your hand.", morphCost));

    // When Ruthless Ripper is turned face up, target player loses 2 life.
    this.addAbility(new RuthlessRipperAbility2(state));
  }
コード例 #4
0
ファイル: DoomBlade.java プロジェクト: NorthFury/jmagic
  public DoomBlade(GameState state) {
    super(state);

    // Destroy target nonblack creature.
    SetGenerator nonblackCreatures =
        RelativeComplement.instance(CreaturePermanents.instance(), HasColor.instance(Color.BLACK));
    Target target = this.addTarget(nonblackCreatures, "target nonblack creature");
    this.addEffect(destroy(targetedBy(target), "Destroy target nonblack creature."));
  }
コード例 #5
0
    public BellowingTanglewurmAbility1(GameState state) {
      super(state, "Other green creatures you control have intimidate.");

      SetGenerator otherGreenCreaturesYouControl =
          RelativeComplement.instance(
              Intersect.instance(HasColor.instance(Color.GREEN), CREATURES_YOU_CONTROL),
              This.instance());

      this.addEffectPart(addAbilityToObject(otherGreenCreaturesYouControl, Intimidate.class));
    }
コード例 #6
0
    public Execute(GameState state) {
      super(
          state, "(1)(B), (T), Sacrifice Executioner's Capsule: Destroy target nonblack creature.");
      this.setManaCost(new ManaPool("1B"));
      this.costsTap = true;
      this.addCost(sacrificeThis("Executioner's Capsule"));

      Target target =
          this.addTarget(
              RelativeComplement.instance(
                  CreaturePermanents.instance(), HasColor.instance(Color.BLACK)),
              "target nonblack creature");
      this.addEffect(destroy(targetedBy(target), "Destroy target nonblack creature."));
    }
コード例 #7
0
ファイル: Vendetta.java プロジェクト: jmagicdev/jmagic
  public Vendetta(GameState state) {
    super(state);

    // Destroy target nonblack creature. It can't be regenerated.
    SetGenerator target =
        targetedBy(
            this.addTarget(
                RelativeComplement.instance(
                    CreaturePermanents.instance(), HasColor.instance(Color.BLACK)),
                "target nonblack creature"));
    this.addEffects(
        bury(this, target, "Destroy target nonblack creature. It can't be regenerated."));

    // You lose life equal to that creature's toughness.
    this.addEffect(
        loseLife(
            You.instance(),
            ToughnessOf.instance(target),
            "You lose life equal to that creature's toughness."));
  }
コード例 #8
0
    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."));
    }