Beispiel #1
0
    public EntwineIncreaseModeChoices(GameState state) {
      super(state, "You may choose all modes of this spell instead of just one.");

      ContinuousEffect.Part part =
          new ContinuousEffect.Part(ContinuousEffectType.ADD_CHOOSABLE_NUMBER_OF_MODES);
      part.parameters.put(ContinuousEffectType.Parameter.OBJECT, This.instance());
      part.parameters.put(ContinuousEffectType.Parameter.NUMBER, Empty.instance());
      this.addEffectPart(part);

      // This always applies
      this.canApply = NonEmpty.instance();
    }
    public TezzeretAgentofBolasAbility1(GameState state) {
      super(
          state,
          -1,
          "Target artifact becomes an artifact creature with base power and toughness 5/5.");

      SetGenerator target =
          targetedBy(this.addTarget(ArtifactPermanents.instance(), "target artifact"));

      Animator animate = new Animator(target, 5, 5);
      animate.addType(Type.ARTIFACT);
      animate.removeOldTypes();
      this.addEffect(
          createFloatingEffect(
              Empty.instance(),
              "Target artifact becomes an artifact creature with base power and toughness 5/5.",
              animate.getParts()));
    }
Beispiel #3
0
    public EnsnaringBridgeAbility0(GameState state) {
      super(
          state,
          "Creatures with power greater than the number of cards in your hand can't attack.");

      SetGenerator numberOfCardsInYourHand =
          Count.instance(InZone.instance(HandOf.instance(You.instance())));
      SetGenerator hasPowerGreater =
          HasPower.instance(
              Between.instance(
                  Sum.instance(Union.instance(numberGenerator(1), numberOfCardsInYourHand)),
                  Empty.instance()));
      SetGenerator restriction = Intersect.instance(Attacking.instance(), hasPowerGreater);

      ContinuousEffect.Part part =
          new ContinuousEffect.Part(ContinuousEffectType.ATTACKING_RESTRICTION);
      part.parameters.put(
          ContinuousEffectType.Parameter.RESTRICTION, Identity.instance(restriction));
      this.addEffectPart(part);
    }
    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."));
    }
Beispiel #5
0
    public SylvanPrimordialAbility1(GameState state) {
      super(
          state,
          "When Sylvan Primordial enters the battlefield, for each opponent, destroy target noncreature permanent that player controls. For each permanent destroyed this way, search your library for a Forest card and put that card onto the battlefield tapped. Then shuffle your library.");
      this.addPattern(whenThisEntersTheBattlefield());

      SetGenerator noncreaturePermanents =
          RelativeComplement.instance(Permanents.instance(), HasType.instance(Type.CREATURE));
      SetGenerator legalTargets =
          Intersect.instance(
              noncreaturePermanents, ControlledBy.instance(OpponentsOf.instance(You.instance())));
      Target t =
          new SylvanTarget(legalTargets, "target noncreature permanent each oppenent controls");
      this.addTarget(t);

      EventFactory destroy =
          destroy(
              targetedBy(t),
              "For each opponent, destroy target noncreature permanent that player controls.");
      this.addEffect(destroy);

      SetGenerator X = Count.instance(NewObjectOf.instance(EffectResult.instance(destroy)));

      EventFactory search =
          new EventFactory(
              EventType.SEARCH_LIBRARY_AND_PUT_INTO,
              "For each permanent destroyed this way, search your library for a Forest card and put that card onto the battlefield tapped. Then shuffle your library.");
      search.parameters.put(EventType.Parameter.CAUSE, This.instance());
      search.parameters.put(EventType.Parameter.CONTROLLER, You.instance());
      search.parameters.put(EventType.Parameter.PLAYER, You.instance());
      search.parameters.put(EventType.Parameter.NUMBER, X);
      search.parameters.put(EventType.Parameter.TAPPED, Empty.instance());
      search.parameters.put(EventType.Parameter.TO, Battlefield.instance());
      search.parameters.put(
          EventType.Parameter.TYPE, Identity.instance(HasSubType.instance(SubType.FOREST)));
      this.addEffect(search);
    }