Beispiel #1
0
    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;
    }
Beispiel #2
0
    public ChaosImpsAbility2(GameState state) {
      super(state, "Chaos Imps has trample as long as it has a +1/+1 counter on it.");

      this.addEffectPart(
          addAbilityToObject(This.instance(), org.rnd.jmagic.abilities.keywords.Trample.class));

      this.canApply =
          Both.instance(
              this.canApply,
              CountersOn.instance(This.instance(), Counter.CounterType.PLUS_ONE_PLUS_ONE));
    }
Beispiel #3
0
    public GyreSageAbility1(GameState state) {
      super(state, "(T): Add (G) to your mana pool for each +1/+1 counter on Gyre Sage.");
      this.costsTap = true;

      SetGenerator count =
          Count.instance(
              CountersOn.instance(ABILITY_SOURCE_OF_THIS, Counter.CounterType.PLUS_ONE_PLUS_ONE));

      EventFactory addMana =
          new EventFactory(
              EventType.ADD_MANA, "Add (G) to your mana pool for each +1/+1 counter on Gyre Sage.");
      addMana.parameters.put(EventType.Parameter.SOURCE, ABILITY_SOURCE_OF_THIS);
      addMana.parameters.put(EventType.Parameter.MANA, Identity.instance(new ManaPool("(G)")));
      addMana.parameters.put(EventType.Parameter.MULTIPLY, count);
      addMana.parameters.put(EventType.Parameter.PLAYER, You.instance());
      this.addEffect(addMana);
    }
    public ShrineofBoundlessGrowthAbility1(GameState state) {
      super(
          state,
          "(T), Sacrifice Shrine of Boundless Growth: Add (1) to your mana pool for each charge counter on Shrine of Boundless Growth.");
      this.costsTap = true;
      this.addCost(sacrificeThis("Shrine of Boundless Growth"));

      SetGenerator counters =
          Count.instance(CountersOn.instance(ABILITY_SOURCE_OF_THIS, Counter.CounterType.CHARGE));

      EventFactory addMana =
          new EventFactory(
              EventType.ADD_MANA,
              "Add (1) to your mana pool for each charge counter on Shrine of Boundless Growth.");
      addMana.parameters.put(EventType.Parameter.SOURCE, ABILITY_SOURCE_OF_THIS);
      addMana.parameters.put(EventType.Parameter.MANA, Identity.instance(new ManaPool("(1)")));
      addMana.parameters.put(EventType.Parameter.NUMBER, counters);
      addMana.parameters.put(EventType.Parameter.PLAYER, You.instance());
      this.addEffect(addMana);
    }
Beispiel #5
0
    public CumulativeUpkeepAbility(GameState state, CumulativeUpkeep parent) {
      super(
          state,
          "At the beginning of your upkeep, if this permanent is on the battlefield, put an age counter on this permanent. Then you may pay its cumulative upkeep cost for each age counter on it. If you don't, sacrifice it.");
      this.parent = parent;

      SetGenerator thisCard = ABILITY_SOURCE_OF_THIS;

      EventFactory cost = parent.getFactory(This.instance());

      this.addPattern(atTheBeginningOfYourUpkeep());
      this.interveningIf = Intersect.instance(ABILITY_SOURCE_OF_THIS, Permanents.instance());
      this.addEffect(putCountersOnThis(1, Counter.CounterType.AGE, "this permanent"));

      EventFactory payFactory =
          new EventFactory(
              EventType.PAY_CUMULATIVE_UPKEEP, (cost.name + " for each age counter on it."));
      payFactory.parameters.put(EventType.Parameter.CAUSE, This.instance());
      payFactory.parameters.put(EventType.Parameter.EVENT, Identity.instance(cost));
      payFactory.parameters.put(
          EventType.Parameter.NUMBER,
          Count.instance(CountersOn.instance(thisCard, Counter.CounterType.AGE)));

      EventFactory mayFactory =
          youMay(payFactory, "You may " + cost.name + " for each age counter on it.");
      EventFactory sacFactory = sacrificeThis("it");

      EventFactory mainFactory =
          new EventFactory(
              EventType.IF_EVENT_THEN_ELSE,
              ("You may "
                  + cost.name
                  + " for each age counter on it.  If you don't, sacrifice it."));
      mainFactory.parameters.put(EventType.Parameter.IF, Identity.instance(mayFactory));
      mainFactory.parameters.put(EventType.Parameter.ELSE, Identity.instance(sacFactory));
      this.addEffect(mainFactory);
    }