Exemple #1
0
  public StreetSpasm(GameState state) {
    super(state);

    // Street Spasm deals X damage to target creature without flying you
    // don't control.
    SetGenerator creature = CreaturePermanents.instance();
    SetGenerator creatureWithoutFlying =
        RelativeComplement.instance(creature, HasKeywordAbility.instance(Flying.class));
    SetGenerator creatureWithoutFlyingYouDontControl =
        RelativeComplement.instance(creatureWithoutFlying, ControlledBy.instance(You.instance()));
    SetGenerator target =
        targetedBy(
            this.addTarget(
                creatureWithoutFlyingYouDontControl,
                "target creature without flying you don't control"));
    this.addEffect(
        spellDealDamage(
            ValueOfX.instance(This.instance()),
            target,
            "Street Spasm deals X damage to target creature without flying you don't control."));

    // Overload (X)(X)(R)(R) (You may cast this spell for its overload cost.
    // If you do, change its text by replacing all instances of "target"
    // with "each.")
    this.addAbility(new Overload(state, "(X)(X)(R)(R)"));
  }
Exemple #2
0
  public Deluge(GameState state) {
    super(state);

    SetGenerator affectedCreatures =
        RelativeComplement.instance(
            CreaturePermanents.instance(), HasKeywordAbility.instance(Flying.class));
    this.addEffect(tap(affectedCreatures, "Tap all creatures without flying."));
  }
Exemple #3
0
 public AirServantAbility1(GameState state) {
   super(state, "(2)(U): Tap target creature with flying.");
   this.setManaCost(new ManaPool("(2)(U)"));
   SetGenerator target =
       targetedBy(
           this.addTarget(
               Intersect.instance(
                   CreaturePermanents.instance(),
                   HasKeywordAbility.instance(org.rnd.jmagic.abilities.keywords.Flying.class)),
               "target creature with flying"));
   this.addEffect(tap(target, "Tap target creature with flying."));
 }
Exemple #4
0
  public CorrosiveGale(GameState state) {
    super(state);

    // ((g/p) can be paid with either (G) or 2 life.)

    // Corrosive Gale deals X damage to each creature with flying.
    this.addEffect(
        spellDealDamage(
            ValueOfX.instance(This.instance()),
            Intersect.instance(
                CreaturePermanents.instance(),
                HasKeywordAbility.instance(org.rnd.jmagic.abilities.keywords.Flying.class)),
            "Corrosive Gale deals X damage to each creature with flying."));
  }
Exemple #5
0
    public VentSentinelAbility1(GameState state) {
      super(
          state,
          "(1)(R), (T): Vent Sentinel deals damage to target player equal to the number of creatures with defender you control.");
      this.setManaCost(new ManaPool("(1)(R)"));
      this.costsTap = true;

      SetGenerator amount =
          Count.instance(
              Intersect.instance(
                  CREATURES_YOU_CONTROL, HasKeywordAbility.instance(Defender.class)));
      SetGenerator target = targetedBy(this.addTarget(Players.instance(), "target player"));
      this.addEffect(
          permanentDealDamage(
              amount,
              target,
              "Vent Sentinel deals damage to target player equal to the number of creatures with defender you control."));
    }
    public DefenderMana(GameState state) {
      super(state, "(T): Add (G) to your mana pool for each creature with defender you control.");

      this.costsTap = true;

      SetGenerator hasDefender = HasKeywordAbility.instance(Defender.class);
      SetGenerator creaturesWithDefender =
          Intersect.instance(CreaturePermanents.instance(), hasDefender);
      SetGenerator youControl = ControlledBy.instance(You.instance());
      SetGenerator creaturesWithDefenderYouControl =
          Intersect.instance(creaturesWithDefender, youControl);

      EventFactory factory =
          new EventFactory(
              EventType.ADD_MANA,
              "Add (G) to your mana pool for each creature with defender you control");
      factory.parameters.put(EventType.Parameter.SOURCE, ABILITY_SOURCE_OF_THIS);
      factory.parameters.put(EventType.Parameter.MANA, Identity.instance(new ManaPool("G")));
      factory.parameters.put(
          EventType.Parameter.NUMBER, Count.instance(creaturesWithDefenderYouControl));
      factory.parameters.put(EventType.Parameter.PLAYER, You.instance());
      this.addEffect(factory);
    }