Пример #1
0
  public RitualoftheReturned(GameState state) {
    super(state);

    // Exile target creature card from your graveyard.
    SetGenerator deadThings =
        Intersect.instance(
            HasType.instance(Type.CREATURE), InZone.instance(GraveyardOf.instance(You.instance())));
    SetGenerator target =
        targetedBy(
            this.addTarget(
                deadThings,
                "Put a black Zombie creature token onto the battlefield. Its power is equal to that card's power and its toughness is equal to that card's toughness."));
    EventFactory exile = exile(target, "Exile target creature card from your graveyard.");
    this.addEffect(exile);

    // Put a black Zombie creature token onto the battlefield. Its power is
    // equal to that card's power and its toughness is equal to that card's
    // toughness.
    SetGenerator thatCard = NewObjectOf.instance(EffectResult.instance(exile));
    SetGenerator power = PowerOf.instance(thatCard);
    SetGenerator toughness = ToughnessOf.instance(thatCard);
    CreateTokensFactory zombie =
        new CreateTokensFactory(
            numberGenerator(1),
            power,
            toughness,
            "Put a black Zombie creature token onto the battlefield. Its power is equal to that card's power and its toughness is equal to that card's toughness.");
    zombie.setColors(Color.BLACK);
    zombie.setSubTypes(SubType.ZOMBIE);
    this.addEffect(zombie.getEventFactory());
  }
Пример #2
0
    public CellarDoorAbility0(GameState state) {
      super(
          state,
          "(3), (T): Target player puts the bottom card of his or her library into his or her graveyard. If it's a creature card, you put a 2/2 black Zombie creature token onto the battlefield.");
      this.setManaCost(new ManaPool("(3)"));
      this.costsTap = true;

      SetGenerator target = targetedBy(this.addTarget(Players.instance(), "target player"));
      SetGenerator library = LibraryOf.instance(target);

      EventFactory putIntoGraveyard =
          new EventFactory(
              EventType.MOVE_OBJECTS,
              "Target player puts the bottom card of his or her library into his or her graveyard.");
      putIntoGraveyard.parameters.put(EventType.Parameter.CAUSE, This.instance());
      putIntoGraveyard.parameters.put(EventType.Parameter.TO, GraveyardOf.instance(target));
      putIntoGraveyard.parameters.put(EventType.Parameter.OBJECT, BottomCards.instance(1, library));
      this.addEffect(putIntoGraveyard);

      SetGenerator object = NewObjectOf.instance(EffectResult.instance(putIntoGraveyard));
      SetGenerator isCreature = Intersect.instance(object, HasType.instance(Type.CREATURE));

      CreateTokensFactory token =
          new CreateTokensFactory(
              1, 2, 2, "you put a 2/2 black Zombie creature token onto the battlefield.");
      token.setColors(Color.BLACK);
      token.setSubTypes(SubType.ZOMBIE);

      this.addEffect(
          ifThen(
              isCreature,
              token.getEventFactory(),
              "If it's a creature card, you put a 2/2 black Zombie creature token onto the battlefield."));
    }
Пример #3
0
    public InfernalGenesisAbility0(GameState state) {
      super(
          state,
          "At the beginning of each player's upkeep, that player puts the top card of his or her library into his or her graveyard. Then he or she puts X 1/1 black Minion creature tokens onto the battlefield, where X is that card's converted mana cost.");

      this.addPattern(atTheBeginningOfEachPlayersUpkeep());
      SetGenerator thatPlayer =
          OwnerOf.instance(
              EventParameter.instance(
                  TriggerEvent.instance(This.instance()), EventType.Parameter.STEP));

      EventFactory mill =
          millCards(
              thatPlayer,
              1,
              "That player puts the top card of his or her library into his or her graveyard.");
      this.addEffect(mill);

      SetGenerator thatCard = NewObjectOf.instance(EffectResult.instance(mill));
      SetGenerator X = ConvertedManaCostOf.instance(thatCard);
      CreateTokensFactory f =
          new CreateTokensFactory(
              X,
              numberGenerator(1),
              numberGenerator(1),
              "Then he or she puts X 1/1 black Minion creature tokens onto the battlefield, where X is that card's converted mana cost.");
      f.setController(thatPlayer);
      f.setColors(Color.BLACK);
      f.setSubTypes(SubType.MINION);
      this.addEffect(f.getEventFactory());
    }
Пример #4
0
    public ElspethTirelAbility1(GameState state) {
      super(state, -2, "Put three 1/1 white Soldier creature tokens onto the battlefield.");

      CreateTokensFactory factory =
          new CreateTokensFactory(
              3, 1, 1, "Put three 1/1 white Soldier creature tokens onto the battlefield.");
      factory.setColors(Color.WHITE);
      factory.setSubTypes(SubType.SOLDIER);
      this.addEffect(factory.getEventFactory());
    }
Пример #5
0
    public BabyBoomers(GameState state) {
      super(
          state,
          "At the beginning of your upkeep, put a 1/1 white Human creature token onto the battlefield.");
      this.addPattern(atTheBeginningOfYourUpkeep());

      CreateTokensFactory factory =
          new CreateTokensFactory(
              1, 1, 1, "Put a 1/1 white Human creature token onto the battlefield.");
      factory.setColors(Color.WHITE);
      factory.setSubTypes(SubType.HUMAN);
      this.addEffect(factory.getEventFactory());
    }
Пример #6
0
 public GolemFoundryAbility1(GameState state) {
   super(
       state,
       "Remove three charge counters from Golem Foundry: Put a 3/3 colorless Golem artifact creature token onto the battlefield.");
   this.addCost(
       removeCounters(
           3,
           Counter.CounterType.CHARGE,
           ABILITY_SOURCE_OF_THIS,
           "Remove three charge counters from Golem Foundry"));
   CreateTokensFactory factory =
       new CreateTokensFactory(
           1, 3, 3, "Put a 3/3 colorless Golem artifact creature token onto the battlefield.");
   factory.setSubTypes(SubType.GOLEM);
   factory.setArtifact();
   this.addEffect(factory.getEventFactory());
 }
Пример #7
0
    public KnightlyValorAbility1(GameState state) {
      super(
          state,
          "When Knightly Valor enters the battlefield, put a 2/2 white Knight creature token with vigilance onto the battlefield.");
      this.addPattern(whenThisEntersTheBattlefield());

      CreateTokensFactory factory =
          new CreateTokensFactory(
              1,
              2,
              2,
              "Put a 2/2 white Knight creature token with vigilance onto the battlefield.");
      factory.setColors(Color.WHITE);
      factory.setSubTypes(SubType.KNIGHT);
      factory.addAbility(Vigilance.class);
      this.addEffect(factory.getEventFactory());
    }
Пример #8
0
  public CribSwap(GameState state) {
    super(state);

    // Changeling (This card is every creature type at all times.)
    this.addAbility(new org.rnd.jmagic.abilities.keywords.Changeling(state));

    // Exile target creature.
    SetGenerator target =
        targetedBy(this.addTarget(CreaturePermanents.instance(), "target creature"));
    this.addEffect(exile(target, "Exile target creature."));

    // Its controller puts a 1/1 colorless Shapeshifter creature token with
    // changeling onto the battlefield.
    CreateTokensFactory token =
        new CreateTokensFactory(
            1,
            1,
            1,
            "Its controller puts a 1/1 colorless Shapeshifter creature token with changeling onto the battlefield.");
    token.setController(ControllerOf.instance(target));
    token.setSubTypes(SubType.SHAPESHIFTER);
    token.addAbility(org.rnd.jmagic.abilities.keywords.Changeling.class);
    this.addEffect(token.getEventFactory());
  }