コード例 #1
0
ファイル: Exhaustion.cs プロジェクト: leloulight/magicgrove
    public override IEnumerable<CardTemplate> GetCards()
    {
      yield return Card
        .Named("Exhaustion")
        .ManaCost("{2}{U}")
        .Type("Sorcery")
        .Text("Creatures and lands target opponent controls don't untap during his or her next untap step.")
        .FlavorText(
          "The mage felt as though he'd been in the stasis suit for days. Upon his return, he found it was months.")
        .Cast(p =>
          {
            p.Effect = () => new ApplyModifiersToPlayer(
              selector: e => e.Controller.Opponent,
              modifiers: () =>
                {
                  var cp = new ContinuousEffectParameters
                    {
                      Modifier = () => new AddStaticAbility(Static.DoesNotUntap),
                      CardFilter = (card, effect) =>
                        card.Controller == effect.SourceEffect.Controller.Opponent &&
                          (card.Is().Creature || card.Is().Land)
                    };

                  var modifier = new AddContiniousEffect(new ContinuousEffect(cp));

                  modifier.AddLifetime(new EndOfStep(
                    Step.Untap, 
                    l => l.Modifier.SourceCard.Controller.IsActive));
                  
                  return modifier;
                });

            p.TimingRule(new OnSecondMain());
          });
    }
コード例 #2
0
    public override IEnumerable<CardTemplate> GetCards()
    {
      yield return Card
        .Named("Thran Weaponry")
        .ManaCost("{4}")
        .Type("Artifact")
        .Text(
          "{Echo} {4}{EOL}You may choose not to untap Thran Weaponry during your untap step.{EOL}{2},{T}: All creatures get +2/+2 for as long as Thran Weaponry remains tapped.")
        .MayChooseToUntap()
        .Echo("{4}")
        .ActivatedAbility(p =>
          {
            p.Text = "{2},{T}: All creatures get +2/+2 for as long as Thran Weaponry remains tapped.";
            p.Cost = new AggregateCost(
              new PayMana(2.Colorless(), ManaUsage.Abilities),
              new Tap());

            p.Effect = () => new ApplyModifiersToPlayer(
              selector: e => e.Controller,
              modifiers: () =>
                {
                  var cp = new ContinuousEffectParameters
                    {
                      Modifier = () => new AddPowerAndToughness(2, 2),
                      CardFilter = (card, _) => card.Is().Creature
                    };
                  
                  var effect = new ContinuousEffect(cp);

                  var modifier = new AddContiniousEffect(effect);
                  modifier.AddLifetime(new ModifierSourceGetsUntapedLifetime());
                  
                  return modifier;
                });
            
            p.TimingRule(new OnYourTurn(Step.DeclareBlockers));
          });
    }