コード例 #1
0
ファイル: TrigonOfThought.java プロジェクト: kholdfuzion/mage
  public TrigonOfThought(UUID ownerId) {
    super(
        ownerId,
        217,
        "Trigon of Thought",
        Rarity.UNCOMMON,
        new CardType[] {CardType.ARTIFACT},
        "{5}");
    this.expansionSetCode = "SOM";

    this.addAbility(
        new EntersBattlefieldAbility(new AddCountersSourceEffect(new ChargeCounter(3)), ""));

    Costs costs = new CostsImpl();
    costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance()));
    costs.add(new TapSourceCost());
    Ability ability =
        new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardControllerEffect(1), costs);
    ability.addManaCost(new GenericManaCost(2));
    this.addAbility(ability);

    Ability ability2 =
        new SimpleActivatedAbility(
            Zone.BATTLEFIELD,
            new AddCountersSourceEffect(CounterType.CHARGE.createInstance()),
            new TapSourceCost());
    ability2.addManaCost(new ManaCostsImpl("{U}{U}"));
    this.addAbility(ability2);
  }
コード例 #2
0
ファイル: ManaBloom.java プロジェクト: Nick456/mage
  public ManaBloom(UUID ownerId) {
    super(ownerId, 130, "Mana Bloom", Rarity.RARE, new CardType[] {CardType.ENCHANTMENT}, "{X}{G}");
    this.expansionSetCode = "RTR";

    this.color.setGreen(true);

    // Mana Bloom enters the battlefield with X charge counters on it.
    this.addAbility(new EntersBattlefieldAbility(new ManaBloomEffect(), rule));

    // Remove a charge counter from Mana Bloom: Add one mana of any color to your mana pool.
    // Activate this ability only once each turn.
    Ability ability =
        new ActivateOncePerTurnManaAbility(
            Zone.BATTLEFIELD,
            new AddManaOfAnyColorEffect(),
            new RemoveCountersSourceCost(CounterType.CHARGE.createInstance()));
    ability.addChoice(new ChoiceColor());
    this.addAbility(ability);

    // At the beginning of your upkeep, if Mana Bloom has no charge counters on it, return it to its
    // owner's hand.
    TriggeredAbility triggeredAbility =
        new BeginningOfUpkeepTriggeredAbility(
            new ReturnToHandSourceEffect(), TargetController.YOU, false);
    this.addAbility(
        new ConditionalTriggeredAbility(
            triggeredAbility,
            new HasCounterCondition(CounterType.CHARGE, 0, 0),
            "At the beginning of your upkeep, if Mana Bloom has no charge counters on it, return it to its owner's hand."));
  }
コード例 #3
0
ファイル: VividCreek.java プロジェクト: xdaft/mage
 public VividCreek(UUID ownerId) {
   super(ownerId, 276, "Vivid Creek", Rarity.UNCOMMON, new CardType[] {CardType.LAND}, "");
   this.expansionSetCode = "LRW";
   // Vivid Creek enters the battlefield tapped with two charge counters on it.
   EntersBattlefieldEffect effect =
       new EntersBattlefieldEffect(
           new TapSourceEffect(true), "tapped with two charge counters on it");
   effect.addEffect(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(2)));
   this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect));
   // {tap}: Add {U} to your mana pool.
   this.addAbility(new BlueManaAbility());
   // {tap}, Remove a charge counter from Vivid Creek: Add one mana of any color to your mana pool.
   Ability ability = new AnyColorManaAbility();
   ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance(1)));
   this.addAbility(ability);
 }
コード例 #4
0
ファイル: ChimericMass.java プロジェクト: xdaft/mage
 @Override
 public boolean apply(Game game, Ability source) {
   Permanent permanent = game.getPermanent(source.getSourceId());
   if (permanent != null) {
     Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
     if (obj != null && obj instanceof SpellAbility) {
       int amount = ((SpellAbility) obj).getManaCostsToPay().getX();
       if (amount > 0) {
         permanent.addCounters(CounterType.CHARGE.createInstance(amount), game);
       }
     }
   }
   return true;
 }
コード例 #5
0
ファイル: OtherworldAtlas.java プロジェクト: xdaft/mage
  public OtherworldAtlas(UUID ownerId) {
    super(ownerId, 219, "Otherworld Atlas", Rarity.RARE, new CardType[] {CardType.ARTIFACT}, "{4}");
    this.expansionSetCode = "AVR";

    // {tap}: Put a charge counter on Otherworld Atlas.
    this.addAbility(
        new SimpleActivatedAbility(
            Constants.Zone.BATTLEFIELD,
            new AddCountersSourceEffect(CounterType.CHARGE.createInstance()),
            new TapSourceCost()));

    // {tap}: Each player draws a card for each charge counter on Otherworld Atlas.
    this.addAbility(
        new SimpleActivatedAbility(
            Constants.Zone.BATTLEFIELD, new OtherworldAtlasDrawEffect(), new TapSourceCost()));
  }