예제 #1
0
  public ChildhoodHorror(UUID ownerId, CardSetInfo setInfo) {
    super(ownerId, setInfo, new CardType[] {CardType.CREATURE}, "{3}{B}");
    this.subtype.add("Horror");

    this.power = new MageInt(2);
    this.toughness = new MageInt(2);

    // Flying
    this.addAbility(FlyingAbility.getInstance());
    // Threshold - As long as seven or more cards are in your graveyard, Childhood Horror gets +2/+2
    // and can't block.
    Ability thresholdAbility =
        new SimpleStaticAbility(
            Zone.BATTLEFIELD,
            new ConditionalContinuousEffect(
                new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield),
                new CardsInControllerGraveCondition(7),
                "If seven or more cards are in your graveyard, Childhood Horror gets +2/+2"));

    Effect effect =
        new ConditionalRestrictionEffect(
            new CantBlockSourceEffect(Duration.WhileOnBattlefield),
            new CardsInControllerGraveCondition(7));
    effect.setText("and can't block");
    thresholdAbility.addEffect(effect);
    thresholdAbility.setAbilityWord(AbilityWord.THRESHOLD);
    this.addAbility(thresholdAbility);
  }
예제 #2
0
 @Override
 public boolean apply(Game game, Ability source) {
   Player player = getPayingPlayer(game, source);
   MageObject mageObject = game.getObject(source.getSourceId());
   if (player != null && mageObject != null) {
     String message;
     if (chooseUseText == null) {
       message =
           new StringBuilder(getCostText())
               .append(" and ")
               .append(executingEffect.getText(source.getModes().getMode()))
               .append("?")
               .toString();
     } else {
       message = chooseUseText;
     }
     message = CardUtil.replaceSourceName(message, mageObject.getName());
     if (cost.canPay(source, source.getSourceId(), player.getId(), game)
         && player.chooseUse(executingEffect.getOutcome(), message, game)) {
       cost.clearPaid();
       if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
         executingEffect.setTargetPointer(this.targetPointer);
         if (executingEffect instanceof OneShotEffect) {
           if (!(executingEffect instanceof PostResolveEffect)) {
             return executingEffect.apply(game, source);
           }
         } else {
           game.addEffect((ContinuousEffect) executingEffect, source);
         }
       }
     }
     return true;
   }
   return false;
 }
예제 #3
0
  public JaceTheLivingGuildpact(UUID ownerId, CardSetInfo setInfo) {
    super(ownerId, setInfo, new CardType[] {CardType.PLANESWALKER}, "{2}{U}{U}");
    this.subtype.add("Jace");

    this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));

    // +1: Look at the top two cards of your library. Put one of them into your graveyard.
    Effect effect =
        new LookLibraryAndPickControllerEffect(
            new StaticValue(2),
            false,
            new StaticValue(1),
            new FilterCard(),
            Zone.LIBRARY,
            true,
            false,
            false,
            Zone.GRAVEYARD,
            false);
    effect.setText(
        "Look at the top two cards of your library. Put one of them into your graveyard");
    this.addAbility(new LoyaltyAbility(effect, 1));

    // -3: Return another target nonland permanent to its owner's hand.
    LoyaltyAbility ability = new LoyaltyAbility(new ReturnToHandTargetEffect(), -3);
    ability.addTarget(new TargetPermanent(filter));
    this.addAbility(ability);

    // -8: Each player shuffles his or her hand and graveyard into his or her library. You draw
    // seven cards.
    this.addAbility(new LoyaltyAbility(new JaceTheLivingGuildpactEffect(), -8));
  }
 @Override
 public boolean checkTrigger(GameEvent event, Game game) {
   if (!event.getTargetId().equals(getSourceId())) {
     MageObject sourceObj = this.getSourceObject(game);
     if (sourceObj != null) {
       if (sourceObj instanceof Card && ((Card) sourceObj).isFaceDown(game)) {
         // if face down and it's not itself that is turned face up, it does not trigger
         return false;
       }
     } else {
       // Permanent is and was not on the battlefield
       return false;
     }
   }
   Permanent permanent = game.getPermanent(event.getTargetId());
   if (filter.match(permanent, getSourceId(), getControllerId(), game)) {
     if (setTargetPointer) {
       for (Effect effect : getEffects()) {
         effect.setTargetPointer(new FixedTarget(event.getTargetId()));
       }
     }
     return true;
   }
   return false;
 }
예제 #5
0
  public GempalmPolluter(UUID ownerId) {
    super(
        ownerId,
        70,
        "Gempalm Polluter",
        Rarity.COMMON,
        new CardType[] {CardType.CREATURE},
        "{5}{B}");
    this.expansionSetCode = "LGN";
    this.subtype.add("Zombie");
    this.power = new MageInt(4);
    this.toughness = new MageInt(3);

    // Cycling {B}{B}
    this.addAbility(new CyclingAbility(new ManaCostsImpl("{B}{B}")));

    // When you cycle Gempalm Polluter, you may have target player lose life equal to the number of
    // Zombies on the battlefield.
    Effect effect = new LoseLifeTargetEffect(new PermanentsOnBattlefieldCount(filter));
    effect.setText(
        "you may have target player lose life equal to the number of Zombies on the battlefield");
    Ability ability = new CycleTriggeredAbility(effect, true);
    ability.addTarget(new TargetPlayer());
    this.addAbility(ability);
  }
예제 #6
0
  public GnarledScarhide(UUID ownerId) {
    super(
        ownerId,
        72,
        "Gnarled Scarhide",
        Rarity.UNCOMMON,
        new CardType[] {CardType.ENCHANTMENT, CardType.CREATURE},
        "{B}");
    this.expansionSetCode = "JOU";
    this.subtype.add("Minotaur");

    this.power = new MageInt(2);
    this.toughness = new MageInt(1);

    // Bestow {3}{B}
    this.addAbility(new BestowAbility(this, "{3}{B}"));
    // Gnarled Scarhide can't block.
    this.addAbility(new CantBlockAbility());
    // Enchanted creature gets +2/+1 and can't block.
    Ability ability =
        new SimpleStaticAbility(
            Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 1, Duration.WhileOnBattlefield));
    Effect effect = new CantBlockAttachedEffect(AttachmentType.AURA);
    effect.setText("and can't block");
    ability.addEffect(effect);
    this.addAbility(ability);
  }
예제 #7
0
  public GeralfsMasterpiece(UUID ownerId) {
    super(
        ownerId,
        65,
        "Geralf's Masterpiece",
        Rarity.MYTHIC,
        new CardType[] {CardType.CREATURE},
        "{3}{U}{U}");
    this.expansionSetCode = "SOI";
    this.subtype.add("Zombie");
    this.subtype.add("Horror");
    this.power = new MageInt(7);
    this.toughness = new MageInt(7);

    // Flying
    this.addAbility(FlyingAbility.getInstance());

    // Geralf's Masterpiece gets -1/-1 for each card in your hand.
    DynamicValue count = new SignInversionDynamicValue(new CardsInControllerHandCount());
    Effect effect = new BoostSourceEffect(count, count, Duration.WhileOnBattlefield);
    effect.setText("{this} gets -1/-1 for each card in your hand");
    this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));

    // {3}{U}, Discard three cards: Return Geralf's Masterpiece from your graveyard to the
    // battlefield tapped.
    Ability ability =
        new SimpleActivatedAbility(
            Zone.GRAVEYARD,
            new ReturnSourceFromGraveyardToBattlefieldEffect(true),
            new ManaCostsImpl("{3}{U}"));
    ability.addCost(new DiscardTargetCost(new TargetCardInHand(3, new FilterCard("three cards"))));
    this.addAbility(ability);
  }
예제 #8
0
  public DemonOfDarkSchemes(UUID ownerId, CardSetInfo setInfo) {
    super(ownerId, setInfo, new CardType[] {CardType.CREATURE}, "{3}{B}{B}{B}");
    this.subtype.add("Demon");
    this.power = new MageInt(5);
    this.toughness = new MageInt(5);

    // Flying
    this.addAbility(FlyingAbility.getInstance());

    // When Demon of Dark Schemes enters the battlefield, all other creatures get -2/-2 until end of
    // turn.
    Effect effect = new BoostAllEffect(-2, -2, Duration.EndOfTurn, true);
    effect.setText("all other creatures get -2/-2 until end of turn");
    this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false));

    // Whenever another creature dies, you get {E}.
    this.addAbility(
        new DiesCreatureTriggeredAbility(new GetEnergyCountersControllerEffect(1), false, true));

    // {2}{B}, Pay {E}{E}{E}{E}: Put target creature card from a graveyard onto the battlefield
    // under your control tapped.
    effect = new ReturnFromGraveyardToBattlefieldTargetEffect(true);
    effect.setText(
        "Put target creature card from a graveyard onto the battlefield under your control tapped");
    Ability ability =
        new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{B}"));
    ability.addCost(new PayEnergyCost(4));
    ability.addTarget(
        new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard")));
    this.addAbility(ability);
  }
예제 #9
0
  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent =
        game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
    Permanent sourceObject = game.getPermanent(source.getSourceId());
    if (permanent != null && sourceObject != null) {

      PutTokenOntoBattlefieldCopyTargetEffect effect =
          new PutTokenOntoBattlefieldCopyTargetEffect();
      effect.setTargetPointer(new FixedTarget(permanent, game));
      effect.apply(game, source);
      game.getState().setValue(source.getSourceId() + "_token", effect.getAddedPermanent());
      for (Permanent addedToken : effect.getAddedPermanent()) {
        Effect sacrificeEffect = new SacrificeTargetEffect("sacrifice Dance of Many");
        sacrificeEffect.setTargetPointer(new FixedTarget(sourceObject, game));
        LeavesBattlefieldTriggeredAbility triggerAbility =
            new LeavesBattlefieldTriggeredAbility(sacrificeEffect, false);
        ContinuousEffect continuousEffect =
            new GainAbilityTargetEffect(triggerAbility, Duration.WhileOnBattlefield);
        continuousEffect.setTargetPointer(new FixedTarget(addedToken, game));
        game.addEffect(continuousEffect, source);
      }
      return true;
    }
    return false;
  }
예제 #10
0
  public AvatarOfSlaughter(UUID ownerId) {
    super(
        ownerId,
        111,
        "Avatar of Slaughter",
        Rarity.RARE,
        new CardType[] {CardType.CREATURE},
        "{6}{R}{R}");
    this.expansionSetCode = "CMD";
    this.subtype.add("Avatar");
    this.power = new MageInt(8);
    this.toughness = new MageInt(8);

    // All creatures have double strike and attack each turn if able.
    Effect effect =
        new GainAbilityAllEffect(
            DoubleStrikeAbility.getInstance(),
            Duration.WhileOnBattlefield,
            new FilterCreaturePermanent("creatures"));
    effect.setText("All creatures have double strike");
    Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
    effect = new AttacksIfAbleAllEffect(new FilterCreaturePermanent("creatures"));
    effect.setText("and attack each turn if able");
    ability.addEffect(effect);
    this.addAbility(ability, new AttackedThisTurnWatcher());
  }
예제 #11
0
  public GorillaWarCry(UUID ownerId) {
    super(
        ownerId,
        124,
        "Gorilla War Cry",
        Rarity.COMMON,
        new CardType[] {CardType.INSTANT},
        "{1}{R}");
    this.expansionSetCode = "ME4";

    // Cast Gorilla War Cry only during combat before blockers are declared.
    Ability ability = new SimpleStaticAbility(Zone.ALL, new GorillaWarCryRuleModifyingEffect());
    ability.setRuleAtTheTop(true);
    this.addAbility(ability);

    // All creatures gain menace until end of turn. <i>(They can't be blocked except by two or more
    // creatures.)</i>
    Effect effect =
        new GainAbilityAllEffect(
            new MenaceAbility(), Duration.EndOfTurn, new FilterCreaturePermanent());
    effect.setText(
        "All creatures gain menace until end of turn. <i>(They can't be blocked except by two or more creatures.)</i>");
    this.getSpellAbility().addEffect(effect);

    // Draw a card at the beginning of the next turn's upkeep.
    this.getSpellAbility()
        .addEffect(
            new CreateDelayedTriggeredAbilityEffect(
                new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(
                    new DrawCardSourceControllerEffect(1)),
                false));
  }
예제 #12
0
  public CavernLampad(UUID ownerId) {
    super(
        ownerId,
        81,
        "Cavern Lampad",
        Rarity.COMMON,
        new CardType[] {CardType.ENCHANTMENT, CardType.CREATURE},
        "{3}{B}");
    this.expansionSetCode = "THS";
    this.subtype.add("Nymph");

    this.color.setBlack(true);
    this.power = new MageInt(2);
    this.toughness = new MageInt(2);

    // Bestow {5}{B} (If you cast this card for its bestow cost, it's an Aura spell with enchant
    // creature. It becomes a creature again if it's not attached to a creature.)
    this.addAbility(new BestowAbility(this, "{5}{B}"));
    // Intimidate
    this.addAbility(IntimidateAbility.getInstance());
    // Enchanted creature gets +2/+2 and has intimidate.
    Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2));
    Effect effect =
        new GainAbilityAttachedEffect(IntimidateAbility.getInstance(), AttachmentType.AURA);
    effect.setText("and has intimidate");
    ability.addEffect(effect);
    this.addAbility(ability);
  }
예제 #13
0
  public RallyTheForces(UUID ownerId) {
    super(
        ownerId,
        73,
        "Rally the Forces",
        Rarity.COMMON,
        new CardType[] {CardType.INSTANT},
        "{2}{R}");
    this.expansionSetCode = "MBS";

    // Attacking creatures get +1/+0 and gain first strike until end of turn.
    Effect effect =
        new BoostAllEffect(
            1, 0, Duration.EndOfTurn, new FilterAttackingCreature("Attacking creatures"), false);
    effect.setText("Attacking creatures get +1/+0");
    this.getSpellAbility().addEffect(effect);
    effect =
        new GainAbilityAllEffect(
            FirstStrikeAbility.getInstance(),
            Duration.EndOfTurn,
            new FilterAttackingCreature("Attacking creatures"),
            false);
    effect.setText("and gain first strike until end of turn");
    this.getSpellAbility().addEffect(effect);
  }
예제 #14
0
  public HuntersProwess(UUID ownerId) {
    super(
        ownerId, 124, "Hunter's Prowess", Rarity.RARE, new CardType[] {CardType.SORCERY}, "{4}{G}");
    this.expansionSetCode = "BNG";

    this.color.setGreen(true);

    // Until end of turn, target creature gets +3/+3 and gains trample and "Whenever this creature
    // deals combat damage to a player, draw that many cards."
    Effect effect = new BoostTargetEffect(3, 3, Duration.EndOfTurn);
    effect.setText("Until end of turn, target creature gets +3/+3");
    this.getSpellAbility().addEffect(effect);
    effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn);
    effect.setText("and gains trample");
    this.getSpellAbility().addEffect(effect);
    Ability grantedAbility =
        new DealsCombatDamageToAPlayerTriggeredAbility(new HuntersProwessDrawEffect(), false, true);
    this.getSpellAbility()
        .addEffect(
            new GainAbilityTargetEffect(
                grantedAbility,
                Duration.EndOfTurn,
                "and \"Whenever this creature deals combat damage to a player, draw that many cards.\""));
    this.getSpellAbility().addTarget(new TargetCreaturePermanent(true));
  }
예제 #15
0
파일: Spirespine.java 프로젝트: poixen/mage
  public Spirespine(UUID ownerId) {
    super(
        ownerId,
        142,
        "Spirespine",
        Rarity.UNCOMMON,
        new CardType[] {CardType.ENCHANTMENT, CardType.CREATURE},
        "{2}{G}");
    this.expansionSetCode = "JOU";
    this.subtype.add("Beast");

    this.power = new MageInt(4);
    this.toughness = new MageInt(1);

    // Bestow 4G (If you cast this card for its bestow cost, it's an Aura spell with enchant
    // creature. It becomes a creature again if it's not attached to a creature.)
    this.addAbility(new BestowAbility(this, "{4}{G}"));
    // Spirespine blocks each turn if able.
    this.addAbility(
        new SimpleStaticAbility(
            Zone.BATTLEFIELD, new BlocksIfAbleSourceEffect(Duration.WhileOnBattlefield)));
    // Enchanted creature gets +4/+1 and blocks each turn if able.
    Effect effect = new BoostEnchantedEffect(4, 1, Duration.WhileOnBattlefield);
    effect.setText("Enchanted creature gets +4/+1");
    Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
    effect = new BlocksIfAbleAttachedEffect(Duration.WhileOnBattlefield, AttachmentType.AURA);
    effect.setText("and blocks each turn if able");
    ability.addEffect(effect);
    this.addAbility(ability);
  }
예제 #16
0
  public MasterOfWaves(UUID ownerId) {
    super(
        ownerId,
        53,
        "Master of Waves",
        Rarity.MYTHIC,
        new CardType[] {CardType.CREATURE},
        "{3}{U}");
    this.expansionSetCode = "THS";
    this.subtype.add("Merfolk");
    this.subtype.add("Wizard");

    this.power = new MageInt(2);
    this.toughness = new MageInt(1);

    // Protection from red
    this.addAbility(new ProtectionAbility(filterProtection));
    // Elemental creatures you control get +1/+1.
    this.addAbility(
        new SimpleStaticAbility(
            Zone.BATTLEFIELD,
            new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filterBoost, false)));
    // When Master of Waves enters the battlefield, put a number of 1/0 blue Elemental creature
    // tokens onto the battlefield equal to your devotion to blue.
    // <i>(Each {U} in the mana costs of permanents you control counts toward your devotion to
    // blue.)</i>
    Effect effect =
        new CreateTokenEffect(
            new MasterOfWavesElementalToken(), new DevotionCount(ColoredManaSymbol.U));
    effect.setText(
        "put a number of 1/0 blue Elemental creature tokens onto the battlefield equal to your devotion to blue. <i>(Each {U} in the mana costs of permanents you control counts toward your devotion to blue.)</i>");
    this.addAbility(new EntersBattlefieldTriggeredAbility(effect));
  }
예제 #17
0
  public KalemneDiscipleOfIroas(UUID ownerId) {
    super(
        ownerId,
        999,
        "Kalemne, Disciple of Iroas",
        Rarity.MYTHIC,
        new CardType[] {CardType.CREATURE},
        "{2}{R}{W}");
    this.expansionSetCode = "C15";
    this.supertype.add("Legendary");
    this.subtype.add("Giant");
    this.subtype.add("Soldier");
    this.power = new MageInt(3);
    this.toughness = new MageInt(3);

    // Double strike
    this.addAbility(DoubleStrikeAbility.getInstance());

    // Vigilance
    this.addAbility(VigilanceAbility.getInstance());

    // Whenever you cast a creature spell with converted mana cost 5 or greater, you get an
    // experience counter.
    Effect effect =
        new AddCountersControllerEffect(CounterType.EXPERIENCE.createInstance(1), false);
    effect.setText("you get an experience counter");
    Ability ability = new SpellCastControllerTriggeredAbility(effect, filterSpell, false);
    this.addAbility(ability);

    // Kalemne, Disciple of Iroas gets +1/+1 for each experience counter you have.
    DynamicValue value = new SourceControllerExperienceCountersCount();
    this.addAbility(
        new SimpleStaticAbility(
            Zone.BATTLEFIELD, new BoostSourceEffect(value, value, Duration.WhileOnBattlefield)));
  }
예제 #18
0
 @Override
 public boolean apply(Game game, Ability source) {
   Player controller = game.getPlayer(source.getControllerId());
   if (controller != null) {
     boolean lessCreatures = false;
     boolean lessLife = false;
     FilterPermanent filter = new FilterCreaturePermanent();
     int count = game.getBattlefield().countAll(filter, controller.getId(), game);
     for (UUID uuid : game.getOpponents(controller.getId())) {
       Player opponent = game.getPlayer(uuid);
       if (opponent != null) {
         if (opponent.getLife() > controller.getLife()) {
           lessLife = true;
         }
         if (game.getBattlefield().countAll(filter, uuid, game) > count) {
           lessCreatures = true;
         }
       }
       if (lessLife && lessCreatures) { // no need to search further
         break;
       }
     }
     if (lessLife) {
       controller.gainLife(6, game);
     }
     if (lessCreatures) {
       Effect effect = new CreateTokenEffect(new SoldierToken(), 3);
       effect.apply(game, source);
     }
     return true;
   }
   return false;
 }
예제 #19
0
  public WildBeastmaster(UUID ownerId) {
    super(
        ownerId,
        139,
        "Wild Beastmaster",
        Rarity.RARE,
        new CardType[] {CardType.CREATURE},
        "{2}{G}");
    this.expansionSetCode = "RTR";
    this.subtype.add("Human");
    this.subtype.add("Shaman");
    this.color.setGreen(true);
    this.power = new MageInt(1);
    this.toughness = new MageInt(1);

    // Whenever Wild Beastmaster attacks, each other creature you control gets +X/+X until end of
    // turn, where X is Wild Beastmaster's power.
    SourcePermanentPowerCount creaturePower = new SourcePermanentPowerCount();
    Effect effect =
        new BoostControlledEffect(
            creaturePower,
            creaturePower,
            Duration.EndOfTurn,
            new FilterCreaturePermanent(),
            true,
            true);
    effect.setText(EFFECT_TEXT);
    this.addAbility(new AttacksTriggeredAbility(effect, false));
  }
예제 #20
0
  public SakashimasStudent(UUID ownerId) {
    super(
        ownerId,
        24,
        "Sakashima's Student",
        Rarity.RARE,
        new CardType[] {CardType.CREATURE},
        "{2}{U}{U}");
    this.expansionSetCode = "PC2";
    this.subtype.add("Human");
    this.subtype.add("Ninja");

    this.power = new MageInt(0);
    this.toughness = new MageInt(0);

    // Ninjutsu {1}{U}
    this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{1}{U}")));

    // You may have Sakashima's Student enter the battlefield as a copy of any creature on the
    // battlefield, except it's still a Ninja in addition to its other creature types.
    Effect effect =
        new CopyPermanentEffect(new FilterCreaturePermanent(), new AddSubtypeApplier("Ninja"));
    effect.setText(
        "as a copy of any creature on the battlefield, except it's a Ninja in addition to its other creature types");
    this.addAbility(new EntersBattlefieldAbility(effect, true));
  }
예제 #21
0
  public DauntlessEscort(UUID ownerId) {
    super(
        ownerId,
        67,
        "Dauntless Escort",
        Rarity.RARE,
        new CardType[] {CardType.CREATURE},
        "{1}{G}{W}");
    this.expansionSetCode = "ARB";
    this.subtype.add("Rhino");
    this.subtype.add("Soldier");

    this.color.setGreen(true);
    this.color.setWhite(true);
    this.power = new MageInt(3);
    this.toughness = new MageInt(3);

    // Sacrifice Dauntless Escort: Creatures you control are indestructible this turn.
    FilterPermanent filter = new FilterControlledCreaturePermanent("Creatures you control");
    Effect effect =
        new GainAbilityAllEffect(
            IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, filter, false);
    effect.setText("Creatures you control are indestructible this turn");
    this.addAbility(
        new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new SacrificeSourceCost()));
  }
예제 #22
0
  public MythRealized(UUID ownerId, CardSetInfo setInfo) {
    super(ownerId, setInfo, new CardType[] {CardType.ENCHANTMENT}, "{W}");

    // Whenever you cast a noncreature spell, put a lore counter on Myth Realized.
    this.addAbility(
        new SpellCastControllerTriggeredAbility(
            new AddCountersSourceEffect(CounterType.LORE.createInstance()),
            filterNonCreature,
            false));

    // 2W: Put a lore counter on Myth Realized.
    this.addAbility(
        new SimpleActivatedAbility(
            Zone.BATTLEFIELD,
            new AddCountersSourceEffect(CounterType.LORE.createInstance()),
            new ManaCostsImpl("{2}{W}")));

    // W: Until end of turn, Myth Realized becomes a Monk Avatar creature in addition to its other
    // types and gains "This creature's power and toughness are each equal to the number of lore
    // counters on it."
    Effect effect =
        new BecomesCreatureSourceEffect(new MythRealizedToken(), null, Duration.EndOfTurn);
    effect.setText(
        "Until end of turn, {this} becomes a Monk Avatar creature in addition to its other types");
    Ability ability =
        new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{W}"));
    ability.addEffect(new MythRealizedSetPTEffect(Duration.EndOfTurn));
    this.addAbility(ability);
  }
예제 #23
0
  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());

    // If no controller, exit out here and do not vote.
    if (controller == null) return false;

    this.vote("feather", "quill", controller, game, source);

    Permanent permanent = game.getPermanent(source.getSourceId());

    // Feathers Votes
    // If feathers received zero votes or the permanent is no longer on the battlefield, do not
    // attempt to put P1P1 counter on it.
    if (voteOneCount > 0 && permanent != null)
      permanent.addCounters(CounterType.P1P1.createInstance(voteOneCount), game);

    // Quill Votes
    // Only let the controller loot the appropriate amount of cards if it was voted for.
    if (voteTwoCount > 0) {
      Effect lootCardsEffect = new DrawDiscardControllerEffect(voteTwoCount, voteTwoCount);
      lootCardsEffect.apply(game, source);
    }

    return true;
  }
예제 #24
0
  public InfernalScarring(UUID ownerId) {
    super(
        ownerId,
        102,
        "Infernal Scarring",
        Rarity.COMMON,
        new CardType[] {CardType.ENCHANTMENT},
        "{1}{B}");
    this.expansionSetCode = "ORI";
    this.subtype.add("Aura");

    // Enchant creature
    TargetPermanent auraTarget = new TargetCreaturePermanent();
    this.getSpellAbility().addTarget(auraTarget);
    this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
    Ability ability = new EnchantAbility(auraTarget.getTargetName());
    this.addAbility(ability);

    // Enchanted creature gets +2/+0 and has "When this creature dies, draw a card."
    Effect effect = new BoostEnchantedEffect(2, 0, Duration.WhileOnBattlefield);
    effect.setText("Enchanted creature gets +2/+0");
    ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
    effect =
        new GainAbilityAttachedEffect(
            new DiesTriggeredAbility(new DrawCardSourceControllerEffect(1)),
            AttachmentType.AURA,
            Duration.WhileOnBattlefield);
    effect.setText("and has \"When this creature dies, draw a card.\"");
    ability.addEffect(effect);
    this.addAbility(ability);
  }
예제 #25
0
 @Override
 public boolean apply(Game game, Ability source) {
   Player controller = game.getPlayer(source.getControllerId());
   if (controller != null) {
     int xSum = 0;
     xSum += playerPaysXGenericMana(controller, source, game);
     for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
       if (playerId != controller.getId()) {
         Player player = game.getPlayer(playerId);
         if (player != null) {
           xSum += playerPaysXGenericMana(player, source, game);
         }
       }
     }
     if (xSum > 0) {
       for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
         Effect effect = new PutTopCardOfLibraryIntoGraveTargetEffect(xSum);
         effect.setTargetPointer(new FixedTarget(playerId));
         effect.apply(game, source);
       }
     }
     // prevent undo
     controller.resetStoredBookmark(game);
     return true;
   }
   return false;
 }
예제 #26
0
  public NimbusNaiad(UUID ownerId) {
    super(
        ownerId,
        56,
        "Nimbus Naiad",
        Rarity.COMMON,
        new CardType[] {CardType.ENCHANTMENT, CardType.CREATURE},
        "{2}{U}");
    this.expansionSetCode = "THS";
    this.subtype.add("Nymph");

    this.power = new MageInt(2);
    this.toughness = new MageInt(2);

    // Bestow {4}{U} (If you cast this card for its bestow cost, it's an Aura spell with enchant
    // creature. It becomes a creature again if it's not attached to a creature.)
    this.addAbility(new BestowAbility(this, "{4}{U}"));
    // Flying
    this.addAbility(FlyingAbility.getInstance());
    // Enchanted creature gets +2/+2 and has flying.
    Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2));
    Effect effect = new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA);
    effect.setText("and has flying");
    ability.addEffect(effect);
    this.addAbility(ability);
  }
예제 #27
0
  public TransmogrifyingLicid(UUID ownerId) {
    super(
        ownerId,
        141,
        "Transmogrifying Licid",
        Rarity.UNCOMMON,
        new CardType[] {CardType.ARTIFACT, CardType.CREATURE},
        "{3}");
    this.expansionSetCode = "EXO";
    this.subtype.add("Licid");
    this.power = new MageInt(2);
    this.toughness = new MageInt(2);

    // {1}, {tap}: Transmogrifying Licid loses this ability and becomes an Aura enchantment with
    // enchant creature. Attach it to target creature. You may pay {1} to end this effect.
    this.addAbility(new LicidAbility(new GenericManaCost(1), new GenericManaCost(1)));

    // Enchanted creature gets +1/+1 and is an artifact in addition to its other types.
    Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1));
    Effect effect =
        new AddCardTypeAttachedEffect(
            CardType.ARTIFACT, Duration.WhileOnBattlefield, AttachmentType.AURA);
    effect.setText("and is an artifact in addition to its other types");
    ability.addEffect(effect);
    this.addAbility(ability);
  }
예제 #28
0
  public AkiriLineSlinger(UUID ownerId, CardSetInfo setInfo) {
    super(ownerId, setInfo, new CardType[] {CardType.CREATURE}, "{R}{W}");

    this.supertype.add("Legendary");
    this.subtype.add("Kor");
    this.subtype.add("Soldier");
    this.subtype.add("Ally");
    this.power = new MageInt(0);
    this.toughness = new MageInt(3);

    // First strike
    this.addAbility(FirstStrikeAbility.getInstance());

    // Vigilance
    this.addAbility(VigilanceAbility.getInstance());

    // Akiri, Line-Slinger gets +1/+0 for each artifact you control.
    Effect effect =
        new BoostSourceEffect(
            new PermanentsOnBattlefieldCount(filter),
            new StaticValue(0),
            Duration.WhileOnBattlefield);
    effect.setText("{this} gets +1/+0 for each artifact you control");
    this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));

    // Partner
    this.addAbility(PartnerAbility.getInstance());
  }
예제 #29
0
  public KarametraGodOfHarvests(UUID ownerId) {
    super(
        ownerId,
        148,
        "Karametra, God of Harvests",
        Rarity.MYTHIC,
        new CardType[] {CardType.ENCHANTMENT, CardType.CREATURE},
        "{3}{G}{W}");
    this.expansionSetCode = "BNG";
    this.supertype.add("Legendary");
    this.subtype.add("God");

    this.power = new MageInt(6);
    this.toughness = new MageInt(7);

    // Indestructible
    this.addAbility(IndestructibleAbility.getInstance());
    // As long as your devotion to green and white is less than seven, Karametra isn't a creature.
    Effect effect =
        new LoseCreatureTypeSourceEffect(
            new DevotionCount(ColoredManaSymbol.G, ColoredManaSymbol.W), 7);
    effect.setText(
        "As long as your devotion to green and white is less than seven, Karametra isn't a creature");
    this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
    // Whenever you cast a creature spell, you may search your library for a Forest or Plains card,
    // put it onto the battlefield tapped, then shuffle your library.
    this.addAbility(
        new SpellCastControllerTriggeredAbility(
            new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), true),
            new FilterCreatureSpell("a creature spell"),
            true));
  }
예제 #30
0
  public SpitefulMotives(UUID ownerId) {
    super(
        ownerId,
        183,
        "Spiteful Motives",
        Rarity.UNCOMMON,
        new CardType[] {CardType.ENCHANTMENT},
        "{3}{R}");
    this.expansionSetCode = "SOI";
    this.subtype.add("Aura");

    // Flash
    this.addAbility(FlashAbility.getInstance());
    // Enchant creature
    TargetPermanent auraTarget = new TargetCreaturePermanent();
    this.getSpellAbility().addTarget(auraTarget);
    this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
    Ability ability = new EnchantAbility(auraTarget.getTargetName());
    this.addAbility(ability);
    // Enchanted creature gets +3/+0 and has first strike.
    Effect effect = new BoostEnchantedEffect(3, 0, Duration.WhileOnBattlefield);
    effect.setText("Enchanted creature gets +3/+0");
    ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
    effect = new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.AURA);
    effect.setText("and has first strike");
    ability.addEffect(effect);
    this.addAbility(ability);
  }