Example #1
0
  public SurgicalExtraction(GameState state) {
    super(state);

    // Choose target card in a graveyard other than a basic land card.
    SetGenerator inGraveyards = InZone.instance(GraveyardOf.instance(Players.instance()));
    SetGenerator basicLands =
        Intersect.instance(HasSuperType.instance(SuperType.BASIC), HasType.instance(Type.LAND));
    SetGenerator legalTargets = RelativeComplement.instance(inGraveyards, basicLands);
    Target t =
        this.addTarget(legalTargets, "target card in a graveyard other than a basic land card");

    // Search its owner's graveyard, hand, and library for all cards with
    // the same name as that card and exile them.
    SetGenerator itsOwner = OwnerOf.instance(targetedBy(t));
    SetGenerator graveyard = GraveyardOf.instance(itsOwner);
    SetGenerator hand = HandOf.instance(itsOwner);
    SetGenerator library = LibraryOf.instance(itsOwner);
    SetGenerator zones = Union.instance(graveyard, hand, library);

    EventFactory effect =
        new EventFactory(
            EventType.SEARCH_FOR_ALL_AND_PUT_INTO,
            "Choose target card in a graveyard other than a basic land card. Search its owner's graveyard, hand, and library for all cards with the same name as that card and exile them.");
    effect.parameters.put(EventType.Parameter.CAUSE, This.instance());
    effect.parameters.put(EventType.Parameter.PLAYER, You.instance());
    effect.parameters.put(EventType.Parameter.ZONE, zones);
    effect.parameters.put(
        EventType.Parameter.TYPE,
        Identity.instance(HasName.instance(NameOf.instance(targetedBy(t)))));
    effect.parameters.put(EventType.Parameter.TO, ExileZone.instance());
    this.addEffect(effect);

    // Then that player shuffles his or her library.
    this.addEffect(shuffleLibrary(targetedBy(t), "Then that player shuffles his or her library."));
  }
  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());
  }
Example #3
0
    public AgadeemOccultistAbility0(GameState state) {
      super(
          state,
          "(T): Put target creature card from an opponent's graveyard onto the battlefield under your control if its converted mana cost is less than or equal to the number of Allies you control.");
      this.costsTap = true;

      SetGenerator creatureCards = HasType.instance(Type.CREATURE);
      SetGenerator inOpponentsYard =
          InZone.instance(GraveyardOf.instance(OpponentsOf.instance(You.instance())));
      Target t =
          this.addTarget(
              Intersect.instance(creatureCards, inOpponentsYard),
              "target creature card from an opponent's graveyard");

      EventFactory move =
          new EventFactory(
              EventType.PUT_ONTO_BATTLEFIELD,
              "Put target creature card from an opponent's graveyard onto the battlefield under your control");
      move.parameters.put(EventType.Parameter.CAUSE, This.instance());
      move.parameters.put(EventType.Parameter.CONTROLLER, You.instance());
      move.parameters.put(EventType.Parameter.OBJECT, targetedBy(t));

      SetGenerator lessThanOrEqualNumAllies =
          Between.instance(null, Count.instance(ALLIES_YOU_CONTROL));
      SetGenerator condition =
          Intersect.instance(ConvertedManaCostOf.instance(targetedBy(t)), lessThanOrEqualNumAllies);

      EventFactory effect =
          new EventFactory(
              EventType.IF_CONDITION_THEN_ELSE,
              "Put target creature card from an opponent's graveyard onto the battlefield under your control if its converted mana cost is less than or equal to the number of Allies you control.");
      effect.parameters.put(EventType.Parameter.IF, condition);
      effect.parameters.put(EventType.Parameter.THEN, Identity.instance(move));
      this.addEffect(effect);
    }
Example #4
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."));
    }
Example #5
0
  public TimeReversal(GameState state) {
    super(state);

    // Each player shuffles his or her hand and graveyard into his or her
    // library,
    SetGenerator handsAndGraveyards =
        InZone.instance(
            Union.instance(
                HandOf.instance(Players.instance()), GraveyardOf.instance(Players.instance())));

    EventFactory shuffle =
        new EventFactory(
            EventType.SHUFFLE_INTO_LIBRARY,
            "Each player shuffles his or her hand and graveyard into his or her library,");
    shuffle.parameters.put(EventType.Parameter.CAUSE, This.instance());
    shuffle.parameters.put(
        EventType.Parameter.OBJECT, Union.instance(handsAndGraveyards, Players.instance()));
    this.addEffect(shuffle);

    // then draws seven cards.
    this.addEffect(drawCards(Players.instance(), 7, "then draws seven cards."));

    // Exile Time Reversal.
    this.addEffect(exile(This.instance(), "Exile Time Reversal."));
  }
Example #6
0
    public MnemonicWallAbility1(GameState state) {
      super(
          state,
          "When Mnemonic Wall enters the battlefield, you may return target instant or sorcery card from your graveyard to your hand.");
      this.addPattern(whenThisEntersTheBattlefield());

      SetGenerator yourGraveyard = GraveyardOf.instance(You.instance());
      SetGenerator spellsInYard =
          Intersect.instance(
              HasType.instance(Type.INSTANT, Type.SORCERY), InZone.instance(yourGraveyard));
      SetGenerator target =
          targetedBy(
              this.addTarget(spellsInYard, "target instant or sorcery card from your graveyard"));

      EventFactory move =
          new EventFactory(
              EventType.MOVE_OBJECTS,
              "Return target instant or sorcery card from your graveyard to your hand");
      move.parameters.put(EventType.Parameter.CAUSE, This.instance());
      move.parameters.put(EventType.Parameter.TO, HandOf.instance(You.instance()));
      move.parameters.put(EventType.Parameter.OBJECT, target);
      this.addEffect(
          youMay(
              move,
              "You may return target instant or sorcery card from your graveyard to your hand."));
    }
Example #7
0
    public SnapcasterMageAbility1(GameState state) {
      super(
          state,
          "When Snapcaster Mage enters the battlefield, target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost.");
      this.addPattern(whenThisEntersTheBattlefield());

      SetGenerator target =
          targetedBy(
              this.addTarget(
                  Intersect.instance(
                      HasType.instance(Type.INSTANT, Type.SORCERY),
                      InZone.instance(GraveyardOf.instance(You.instance()))),
                  "target instant or sorcery card in your graveyard"));

      ContinuousEffect.Part part =
          new ContinuousEffect.Part(ContinuousEffectType.GRANT_COSTED_KEYWORD);
      part.parameters.put(
          ContinuousEffectType.Parameter.ABILITY,
          Identity.instance(org.rnd.jmagic.abilities.keywords.Flashback.class));
      part.parameters.put(ContinuousEffectType.Parameter.OBJECT, target);
      this.addEffect(
          createFloatingEffect(
              "Target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost.",
              part));
    }
Example #8
0
  public IncreasingSavagery(GameState state) {
    super(state);

    // Put five +1/+1 counters on target creature. If Increasing Savagery
    // was cast from a graveyard, put ten +1/+1 counters on that creature
    // instead.
    SetGenerator target =
        targetedBy(this.addTarget(CreaturePermanents.instance(), "target creature"));
    SetGenerator number =
        IfThenElse.instance(
            Intersect.instance(
                ZoneCastFrom.instance(This.instance()), GraveyardOf.instance(Players.instance())),
            numberGenerator(10),
            numberGenerator(5));

    this.addEffect(
        putCounters(
            number,
            Counter.CounterType.PLUS_ONE_PLUS_ONE,
            target,
            "Put five +1/+1 counters on target creature. If Increasing Savagery was cast from a graveyard, put ten +1/+1 counters on that creature instead."));

    // Flashback (5)(G)(G) (You may cast this card from your graveyard for
    // its flashback cost. Then exile it.)
    this.addAbility(new Flashback(state, "(5)(G)(G)"));
  }
Example #9
0
  public EvolutionCharm(GameState state) {
    super(state);

    // Choose one

    // Search your library for a basic land card, reveal it, put it into
    // your hand, then shuffle your library
    {
      EventType.ParameterMap searchParameters = new EventType.ParameterMap();
      searchParameters.put(EventType.Parameter.CAUSE, This.instance());
      searchParameters.put(EventType.Parameter.PLAYER, You.instance());
      searchParameters.put(EventType.Parameter.NUMBER, numberGenerator(1));
      searchParameters.put(
          EventType.Parameter.TYPE,
          Identity.instance(
              Intersect.instance(
                  HasSuperType.instance(SuperType.BASIC), HasType.instance(Type.LAND))));
      searchParameters.put(EventType.Parameter.TO, HandOf.instance(You.instance()));
      this.addEffect(
          1,
          new EventFactory(
              EventType.SEARCH_LIBRARY_AND_PUT_INTO,
              searchParameters,
              "Search your library for a basic land card, reveal it, put it into your hand, then shuffle your library."));
    }

    // Return target creature card from your graveyard to your hand
    {
      SetGenerator graveyard = GraveyardOf.instance(You.instance());
      Target target =
          this.addTarget(
              2,
              Intersect.instance(HasType.instance(Type.CREATURE), InZone.instance(graveyard)),
              "target creature from your graveyard");

      EventType.ParameterMap moveParameters = new EventType.ParameterMap();
      moveParameters.put(EventType.Parameter.CAUSE, This.instance());
      moveParameters.put(EventType.Parameter.TO, HandOf.instance(You.instance()));
      moveParameters.put(EventType.Parameter.OBJECT, targetedBy(target));
      this.addEffect(
          2,
          new EventFactory(
              EventType.MOVE_OBJECTS,
              moveParameters,
              "Return target creature card from your graveyard to your hand."));
    }

    // Target creature gains flying until end of turn.
    {
      Target target = this.addTarget(3, CreaturePermanents.instance(), "target creature");
      this.addEffect(
          3,
          addAbilityUntilEndOfTurn(
              targetedBy(target),
              org.rnd.jmagic.abilities.keywords.Flying.class,
              "Target creature gains flying until end of turn."));
    }
  }
Example #10
0
    public EntomberExarchAbility0(GameState state) {
      super(
          state,
          "When Entomber Exarch enters the battlefield, choose one \u2014\n\u2022 Return target creature card from your graveyard to your hand.\n\u2022 Target opponent reveals his or her hand, you choose a noncreature card from it, then that player discards that card.");
      this.addPattern(whenThisEntersTheBattlefield());

      // Return target creature card from your graveyard to your hand
      {
        SetGenerator yourYard = GraveyardOf.instance(You.instance());
        SetGenerator target =
            targetedBy(
                this.addTarget(
                    1,
                    Intersect.instance(HasType.instance(Type.CREATURE), InZone.instance(yourYard)),
                    "target creature card in your graveyard"));

        EventFactory move =
            new EventFactory(
                EventType.MOVE_OBJECTS,
                "Return target creature card from your graveyard to your hand");
        move.parameters.put(EventType.Parameter.CAUSE, This.instance());
        move.parameters.put(EventType.Parameter.TO, HandOf.instance(You.instance()));
        move.parameters.put(EventType.Parameter.OBJECT, target);
        this.addEffect(1, move);
      }

      // target opponent reveals his or her hand, you choose a noncreature
      // card from it, then that player discards that card
      {
        SetGenerator target =
            targetedBy(this.addTarget(2, OpponentsOf.instance(You.instance()), "target opponent"));

        SetGenerator cards = InZone.instance(HandOf.instance(target));
        EventType.ParameterMap revealParameters = new EventType.ParameterMap();
        revealParameters.put(EventType.Parameter.CAUSE, This.instance());
        revealParameters.put(EventType.Parameter.OBJECT, cards);
        this.addEffect(
            2,
            new EventFactory(
                EventType.REVEAL, revealParameters, "Target opponent reveals his or her hand."));

        SetGenerator choices = RelativeComplement.instance(cards, HasType.instance(Type.CREATURE));

        EventType.ParameterMap parameters = new EventType.ParameterMap();
        parameters.put(EventType.Parameter.CAUSE, This.instance());
        parameters.put(EventType.Parameter.PLAYER, You.instance());
        parameters.put(EventType.Parameter.TARGET, target);
        parameters.put(EventType.Parameter.CHOICE, Identity.instance(choices));
        this.addEffect(
            2,
            new EventFactory(
                EventType.DISCARD_FORCE,
                parameters,
                "You choose a noncreature card from it, then that player discards that card."));
      }
    }
Example #11
0
    public GroundSealAbility1(GameState state) {
      super(state, "Cards in graveyards can't be the targets of spells or abilities.");

      SetGenerator inYards = InZone.instance(GraveyardOf.instance(Players.instance()));

      ContinuousEffect.Part part =
          new ContinuousEffect.Part(ContinuousEffectType.CANT_BE_THE_TARGET_OF);
      part.parameters.put(ContinuousEffectType.Parameter.OBJECT, inYards);
      part.parameters.put(
          ContinuousEffectType.Parameter.RESTRICTION, Identity.instance(SetPattern.EVERYTHING));
      this.addEffectPart(part);
    }
Example #12
0
    public ConsumingAberrationAbility0(GameState state) {
      super(
          state,
          "Consuming Aberration's power and toughness are each equal to the number of cards in your opponents' graveyards.",
          Characteristics.Characteristic.POWER,
          Characteristics.Characteristic.TOUGHNESS);

      SetGenerator number =
          Count.instance(
              InZone.instance(GraveyardOf.instance(OpponentsOf.instance(You.instance()))));
      this.addEffectPart(setPowerAndToughness(This.instance(), number, number));
    }
Example #13
0
    public CountrysideCrusherAbility1(GameState state) {
      super(
          state,
          "Whenever a land card is put into your graveyard from anywhere, put a +1/+1 counter on Countryside Crusher.");

      ZoneChangePattern pitchedLand =
          new SimpleZoneChangePattern(
              null, GraveyardOf.instance(You.instance()), HasType.instance(Type.LAND), false);
      this.addPattern(pitchedLand);

      this.addEffect(
          putCountersOnThis(1, Counter.CounterType.PLUS_ONE_PLUS_ONE, "Countryside Crusher"));
    }
Example #14
0
    public DeathriteShamanAbility2(GameState state) {
      super(state, "(G), (T): Exile target creature card from a graveyard. You gain 2 life.");
      this.setManaCost(new ManaPool("(G)"));
      this.costsTap = true;

      SetGenerator target =
          targetedBy(
              this.addTarget(
                  Intersect.instance(
                      HasType.instance(Type.CREATURE),
                      InZone.instance(GraveyardOf.instance(Players.instance()))),
                  "target creature card in a graveyard"));
      this.addEffect(exile(target, "Exile target creature card from a graveyard."));
      this.addEffect(gainLife(You.instance(), 2, "You gain 2 life."));
    }
Example #15
0
  public ScrapyardSalvo(GameState state) {
    super(state);

    // Scrapyard Salvo deals damage to target player equal to the number of
    // artifact cards in your graveyard.
    SetGenerator artifacts = HasType.instance(Type.ARTIFACT);
    SetGenerator inYourYard = InZone.instance(GraveyardOf.instance(You.instance()));
    SetGenerator amount = Count.instance(Intersect.instance(artifacts, inYourYard));
    SetGenerator target = targetedBy(this.addTarget(Players.instance(), "target player"));
    this.addEffect(
        spellDealDamage(
            amount,
            target,
            "Scrapyard Salvo deals damage to target player equal to the number of artifact cards in your graveyard."));
  }
Example #16
0
    public ZombiePT(GameState state) {
      super(
          state,
          "Soulless One's power and toughness are each equal to the number of Zombies on the battlefield plus the number of Zombie cards in all graveyards.",
          Characteristics.Characteristic.POWER,
          Characteristics.Characteristic.TOUGHNESS);

      SetGenerator aliveAndDead =
          InZone.instance(
              Union.instance(Battlefield.instance(), GraveyardOf.instance(Players.instance())));
      SetGenerator zombiesAndDeadZombies =
          Intersect.instance(HasSubType.instance(SubType.ZOMBIE), aliveAndDead);
      SetGenerator number = Count.instance(zombiesAndDeadZombies);

      this.addEffectPart(setPowerAndToughness(This.instance(), number, number));
    }
Example #17
0
    public DeathriteShamanAbility1(GameState state) {
      super(
          state,
          "(B), (T): Exile target instant or sorcery card from a graveyard. Each opponent loses 2 life.");
      this.setManaCost(new ManaPool("(B)"));
      this.costsTap = true;

      SetGenerator target =
          targetedBy(
              this.addTarget(
                  Intersect.instance(
                      HasType.instance(Type.INSTANT, Type.SORCERY),
                      InZone.instance(GraveyardOf.instance(Players.instance()))),
                  "target instant or sorcery card in a graveyard"));
      this.addEffect(exile(target, "Exile target instant or sorcery card from a graveyard."));
      this.addEffect(
          loseLife(OpponentsOf.instance(You.instance()), 2, "Each opponent loses 2 life."));
    }
Example #18
0
    public FinishHim(GameState state) {
      super(
          state,
          "At the beginning of your upkeep, if twenty or more creature cards are in your graveyard, you win the game.");

      SetGenerator numCreatures =
          Count.instance(
              Intersect.instance(
                  HasType.instance(Type.CREATURE),
                  InZone.instance(
                      GraveyardOf.instance(ControllerOf.instance(ABILITY_SOURCE_OF_THIS)))));

      this.addPattern(atTheBeginningOfYourUpkeep());

      this.interveningIf = Intersect.instance(numCreatures, Between.instance(20, null));

      this.addEffect(youWinTheGame());
    }
Example #19
0
    public DeathriteShamanAbility0(GameState state) {
      super(
          state,
          "(T): Exile target land card from a graveyard. Add one mana of any color to your mana pool.");
      this.costsTap = true;

      SetGenerator target =
          targetedBy(
              this.addTarget(
                  Intersect.instance(
                      HasType.instance(Type.LAND),
                      InZone.instance(GraveyardOf.instance(Players.instance()))),
                  "target land card in a graveyard"));
      this.addEffect(exile(target, "Exile target land card from a graveyard."));
      this.addEffect(
          addManaToYourManaPoolFromAbility(
              "(WUBRG)", "Add one mana of any color to your mana pool."));
    }
Example #20
0
  public OpentheVaults(GameState state) {
    super(state);

    // Return all artifact and enchantment cards from all graveyards

    SetGenerator cardTypes = HasType.instance(Type.ARTIFACT, Type.ENCHANTMENT);
    SetGenerator inGraveyards = InZone.instance(GraveyardOf.instance(Players.instance()));
    SetGenerator toReturn = Intersect.instance(cardTypes, inGraveyards);

    // to the battlefield under their owners' control.
    EventType.ParameterMap parameters = new EventType.ParameterMap();
    parameters.put(EventType.Parameter.CAUSE, This.instance());
    parameters.put(EventType.Parameter.OBJECT, toReturn);
    this.addEffect(
        new EventFactory(
            EventType.PUT_ONTO_BATTLEFIELD_UNDER_OWNER_CONTROL,
            parameters,
            "Return all artifact and enchantment cards from all graveyards to the battlefield under their owner's control."));
  }
Example #21
0
    public AngelofGlorysRiseAbility1(GameState state) {
      super(
          state,
          "When Angel of Glory's Rise enters the battlefield, exile all Zombies, then return all Human creature cards from your graveyard to the battlefield.");
      this.addPattern(whenThisEntersTheBattlefield());

      this.addEffect(
          exile(
              Intersect.instance(Permanents.instance(), HasSubType.instance(SubType.ZOMBIE)),
              "Exile all Zombies."));

      this.addEffect(
          putOntoBattlefield(
              Intersect.instance(
                  InZone.instance(GraveyardOf.instance(You.instance())),
                  HasSubType.instance(SubType.HUMAN),
                  HasType.instance(Type.CREATURE)),
              "Return all Human creature cards from your graveyard to the battlefield."));
    }
Example #22
0
  public IllGottenGains(GameState state) {
    super(state);

    // Exile Ill-Gotten Gains.
    this.addEffect(exile(This.instance(), "Exile Ill-Gotten Gains."));

    // Each player discards his or her hand,
    this.addEffect(discardHand(Players.instance(), "Each player discards his or her hand,"));

    // then returns up to three cards from his or her graveyard to his or
    // her hand.
    SetGenerator eachPlayer = DynamicEvaluation.instance();
    SetGenerator graveyard = GraveyardOf.instance(eachPlayer);
    EventFactory chooseCards =
        new EventFactory(EventType.PLAYER_CHOOSE, "Choose up to three cards in your graveyard");
    chooseCards.parameters.put(EventType.Parameter.PLAYER, eachPlayer);
    chooseCards.parameters.put(EventType.Parameter.NUMBER, Between.instance(0, 3));
    chooseCards.parameters.put(EventType.Parameter.CHOICE, InZone.instance(graveyard));
    chooseCards.parameters.put(
        EventType.Parameter.TYPE, Identity.instance(PlayerInterface.ChoiceType.OBJECTS, REASON));

    EventFactory eachPlayerChooses = new EventFactory(FOR_EACH_PLAYER, "");
    eachPlayerChooses.parameters.put(EventType.Parameter.TARGET, Identity.instance(eachPlayer));
    eachPlayerChooses.parameters.put(EventType.Parameter.EFFECT, Identity.instance(chooseCards));
    this.addEffect(eachPlayerChooses);

    SetGenerator chosenCards = ForEachResult.instance(eachPlayerChooses, eachPlayer);

    EventFactory returnCards =
        new EventFactory(EventType.MOVE_OBJECTS, "Return those cards to your hand");
    returnCards.parameters.put(EventType.Parameter.CAUSE, This.instance());
    returnCards.parameters.put(EventType.Parameter.TO, HandOf.instance(eachPlayer));
    returnCards.parameters.put(EventType.Parameter.OBJECT, chosenCards);

    EventFactory effect =
        new EventFactory(
            FOR_EACH_PLAYER,
            "then returns up to three cards from his or her graveyard to his or her hand.");
    effect.parameters.put(EventType.Parameter.TARGET, Identity.instance(eachPlayer));
    effect.parameters.put(EventType.Parameter.EFFECT, Identity.instance(returnCards));
    this.addEffect(effect);
  }
Example #23
0
  public Worldfire(GameState state) {
    super(state);

    // Exile all permanents. Exile all cards from all hands and graveyards.
    // Each player's life total becomes 1.
    this.addEffect(exile(Permanents.instance(), "Exile all permanents."));

    this.addEffect(
        exile(
            InZone.instance(
                Union.instance(
                    HandOf.instance(Players.instance()), GraveyardOf.instance(Players.instance()))),
            "Exile all cards from all hands and graveyards."));

    EventFactory life = new EventFactory(EventType.SET_LIFE, "Each player's life total becomes 1.");
    life.parameters.put(EventType.Parameter.CAUSE, This.instance());
    life.parameters.put(EventType.Parameter.NUMBER, numberGenerator(1));
    life.parameters.put(EventType.Parameter.PLAYER, Players.instance());
    this.addEffect(life);
  }
    public SheoldredWhisperingOneAbility1(GameState state) {
      super(
          state,
          "At the beginning of your upkeep, return target creature card from your graveyard to the battlefield.");
      this.addPattern(atTheBeginningOfYourUpkeep());

      SetGenerator creatureCards = HasType.instance(Type.CREATURE);
      SetGenerator inYourGraveyard = InZone.instance(GraveyardOf.instance(You.instance()));
      SetGenerator targeting = Intersect.instance(creatureCards, inYourGraveyard);

      SetGenerator target =
          targetedBy(this.addTarget(targeting, "target creature card from your graveyard"));
      EventFactory returnToBattlefield =
          new EventFactory(
              EventType.PUT_ONTO_BATTLEFIELD,
              "Return target creature card from your graveyard to the battlefield.");
      returnToBattlefield.parameters.put(EventType.Parameter.CAUSE, This.instance());
      returnToBattlefield.parameters.put(EventType.Parameter.CONTROLLER, You.instance());
      returnToBattlefield.parameters.put(EventType.Parameter.OBJECT, target);
      this.addEffect(returnToBattlefield);
    }
Example #25
0
    public UnholyGrottoAbility1(GameState state) {
      super(state, "(B), (T): Put target Zombie card from your graveyard on top of your library.");
      this.setManaCost(new ManaPool("(B)"));
      this.costsTap = true;

      Target target =
          this.addTarget(
              Intersect.instance(
                  HasSubType.instance(SubType.ZOMBIE),
                  InZone.instance(GraveyardOf.instance(You.instance()))),
              "target Zombie card from your graveyard");

      EventFactory move =
          new EventFactory(
              EventType.PUT_INTO_LIBRARY,
              "Put target Zombie card from your graveyard on top of your library.");
      move.parameters.put(EventType.Parameter.CAUSE, This.instance());
      move.parameters.put(EventType.Parameter.INDEX, numberGenerator(1));
      move.parameters.put(EventType.Parameter.OBJECT, targetedBy(target));
      this.addEffect(move);
    }
    public LazavDimirMastermindAbility1(GameState state) {
      super(
          state,
          "Whenever a creature card is put into an opponent's graveyard from anywhere, you may have Lazav, Dimir Mastermind become a copy of that card except its name is still Lazav, Dimir Mastermind, it's legendary in addition to its other types, and it gains hexproof and this ability.");

      this.addPattern(
          new SimpleZoneChangePattern(
              null,
              GraveyardOf.instance(OpponentsOf.instance(You.instance())),
              HasType.instance(Type.CREATURE),
              false));

      SetGenerator thatCard = NewObjectOf.instance(TriggerZoneChange.instance(This.instance()));

      ContinuousEffect.Part part = new ContinuousEffect.Part(ContinuousEffectType.COPY_OBJECT);
      part.parameters.put(
          ContinuousEffectType.Parameter.ABILITY,
          Identity.instance(
              new SimpleAbilityFactory(LazavDimirMastermindAbility1.class),
              new SimpleAbilityFactory(Hexproof.class)));
      part.parameters.put(ContinuousEffectType.Parameter.OBJECT, ABILITY_SOURCE_OF_THIS);
      part.parameters.put(ContinuousEffectType.Parameter.ORIGINAL, thatCard);
      part.parameters.put(
          ContinuousEffectType.Parameter.RETAIN,
          Identity.instance(Characteristics.Characteristic.NAME));
      part.parameters.put(
          ContinuousEffectType.Parameter.TYPE, Identity.instance(SuperType.LEGENDARY));

      EventFactory copy =
          createFloatingEffect(
              Empty.instance(),
              "Have Lazav, Dimir Mastermind become a copy of that card except its name is still Lazav, Dimir Mastermind, it's legendary in addition to its other types, and it gains hexproof and this ability.",
              part);
      this.addEffect(
          youMay(
              copy,
              "Have Lazav, Dimir Mastermind become a copy of that card except its name is still Lazav, Dimir Mastermind, it's legendary in addition to its other types, and it gains hexproof and this ability."));
    }