Example #1
0
        public CardTemplate Dash(string cost)
        {
            return(Cast(p => p.Effect = () => new CastPermanent())
                   .Cast(p =>
            {
                p.Cost = new PayMana(cost.Parse());
                p.Text = "Cast {0} with dash.";

                p.Effect = () => new CompoundEffect(
                    new CastPermanent(),
                    new ApplyModifiersToSelf(
                        () => new AddSimpleAbility(Static.Haste),
                        () => new AddSimpleAbility(Static.Dash),
                        () =>
                {
                    var tp = new TriggeredAbility.Parameters
                    {
                        Text = "You may cast this spell for its dash cost. If you do, it gains haste, and it's returned from the battlefield to its owner's hand at the beginning of the next end step.",
                        Effect = () => new Effects.ReturnToHand(returnOwningCard: true)
                    };

                    tp.Trigger(new OnStepStart(step: Step.EndOfTurn));
                    return new AddTriggeredAbility(new TriggeredAbility(tp));
                }
                        ));

                p.TimingRule(new OnFirstMain());
            }));
        }
Example #2
0
 public CardTemplate TriggeredAbility(Action <TriggeredAbility.Parameters> set)
 {
     _init.Add(cp =>
     {
         var p = new TriggeredAbility.Parameters();
         set(p);
         cp.TriggeredAbilities.Add(new TriggeredAbility(p));
     });
     return(this);
 }
Example #3
0
 public CardTemplate TriggeredAbility(Action<TriggeredAbility.Parameters> set)
 {
     _init.Add(cp =>
     {
       var p = new TriggeredAbility.Parameters();
       set(p);
       cp.TriggeredAbilities.Add(new TriggeredAbility(p));
     });
       return this;
 }