Example #1
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Eternal Thirst")
                         .ManaCost("{1}{B}")
                         .Type("Enchantment — Aura")
                         .Text("Enchant creature{EOL}Enchanted creature has lifelink and \"Whenever a creature an opponent controls dies, put a +1/+1 counter on this creature.\" {I}(Damage dealt by a creature with lifelink also causes its controller to gain that much life.){/I}")
                         .Cast(p =>
            {
                p.Effect = () => new Attach(
                    () => new AddSimpleAbility(Static.Lifelink),
                    () =>
                {
                    var tp = new TriggeredAbility.Parameters()
                    {
                        Text = "Whenever a creature an opponent controls dies, put a +1/+1 counter on this creature.",
                        Effect = () => new ApplyModifiersToSelf(() => new AddCounters(
                                                                    () => new PowerToughness(1, 1), count: 1)).SetTags(EffectTag.IncreasePower, EffectTag.IncreaseToughness),
                    };

                    tp.Trigger(new OnZoneChanged(
                                   from: Zone.Battlefield, to: Zone.Graveyard,
                                   selector: (c, ctx) => c.Is().Creature&& c.Controller == ctx.Opponent));

                    return new AddTriggeredAbility(new TriggeredAbility(tp));
                });

                p.TargetSelector.AddEffect(trg => trg.Is.Creature().On.Battlefield());

                p.TimingRule(new OnFirstMain());
                p.TargetingRule(new EffectCombatEnchantment());
            }));
        }
Example #2
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Retaliation")
                         .ManaCost("{2}{G}")
                         .Type("Enchantment")
                         .Text(
                             "Creatures you control have 'Whenever this creature becomes blocked by a creature, this creature gets +1/+1 until end of turn.'")
                         .FlavorText("A foul, metallic stench clogged Urza's senses. It was then he knew his brother was no more.")
                         .Cast(p => p.TimingRule(new OnFirstMain()))
                         .ContinuousEffect(p =>
            {
                p.Modifier = () =>
                {
                    var tp = new TriggeredAbility.Parameters
                    {
                        Text =
                            "Whenever this creature becomes blocked by a creature, this creature gets +1/+1 until end of turn.",
                        Effect = () => new ApplyModifiersToSelf(
                            () => new AddPowerAndToughness(1, 1)
                        {
                            UntilEot = true
                        }),
                    };

                    tp.Trigger(new OnBlock(becomesBlocked: true, triggerForEveryCreature: true));

                    return new AddTriggeredAbility(new TriggeredAbility(tp));
                };

                p.CardFilter = (card, effect) => card.Controller == effect.Source.Controller && card.Is().Creature;
            }));
        }
Example #3
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Aura Flux")
                         .ManaCost("{2}{U}")
                         .Type("Enchantment")
                         .Text("Other enchantments have 'At the beginning of your upkeep, sacrifice this enchantment unless you pay {2}.'")
                         .FlavorText("To some, the Tolarian sunrise was a blinding flash; to others, a lingering glow.")
                         .Cast(p => p.TimingRule(new OnSecondMain()))
                         .ContinuousEffect(p =>
            {
                p.Modifier = () =>
                {
                    var tp = new TriggeredAbility.Parameters
                    {
                        Text =
                            "At the beginning of your upkeep, sacrifice this enchantment unless you pay {2}.",
                        Effect = () => new PayManaThen(2.Colorless(),
                                                       effect: new SacrificeOwner(),
                                                       parameters: new PayThen.Parameters()
                        {
                            ExecuteIfPaid = false,
                            Message = "Pay upkeep?",
                        })
                    };

                    tp.Trigger(new OnStepStart(Step.Upkeep));

                    return new AddTriggeredAbility(new TriggeredAbility(tp));
                };

                p.Selector = (card, ctx) => card.Is().Enchantment&& card != ctx.Source;
            }));
        }
Example #4
0
    public override IEnumerable<CardTemplate> GetCards()
    {
      yield return Card
        .Named("Pendrell Flux")
        .ManaCost("{1}{U}")
        .Type("Enchantment Aura")
        .Text(
          "Enchanted creature has 'At the beginning of your upkeep, sacrifice this creature unless you pay its mana cost'")
        .FlavorText("Devoured by the mists, Tolaria was stuck in time, trapped between two eternal heartbeats.")
        .Cast(p =>
          {
            p.Effect = () => new Attach(() =>
              {
                var tp = new TriggeredAbility.Parameters
                  {
                    Text = "At the beginning of your upkeep, sacrifice this creature unless you pay its mana cost",
                    Effect =
                      () => new PayManaOrSacrifice(P(e => e.Source.OwningCard.ManaCost), "Pay creatures mana cost?"),                    
                  };

                tp.Trigger(new OnStepStart(Step.Upkeep));

                return new AddTriggeredAbility(new TriggeredAbility(tp));
              });

            p.TimingRule(new OnSecondMain());
            p.TargetSelector.AddEffect(trg => trg.Is.Creature().On.Battlefield());
            p.TargetingRule(new EffectRankBy(c => -c.Score, ControlledBy.Opponent));
          });
    }
Example #5
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Untamed Kavu")
                         .ManaCost("{1}{G}")
                         .Type("Creature Kavu")
                         .Text("{Kicker} {3}{EOL}{Vigilance}, {trample}{EOL}If Untamed Kavu was kicked, it enters the battlefield with three +1/+1 counters on it.")
                         .Power(2)
                         .Toughness(2)
                         .SimpleAbilities(Static.Trample, Static.Vigilance)
                         .Cast(p => p.Effect = () => new CastPermanent())
                         .Cast(p =>

            {
                p.Cost = new PayMana("{4}{G}".Parse());
                p.Text = p.KickerDescription;

                p.Effect = () => new CompoundEffect(
                    new CastPermanent(),
                    new ApplyModifiersToSelf(
                        () =>
                {
                    var tp = new TriggeredAbility.Parameters()
                    {
                        Text = "If Untamed Kavu was kicked, it enters the battlefield with three +1/+1 counters on it.",
                        Effect = () => new ApplyModifiersToSelf(() => new AddCounters(() => new PowerToughness(1, 1), 3))
                    };

                    tp.Trigger(new OnZoneChanged(to: Zone.Battlefield));
                    return new AddTriggeredAbility(new TriggeredAbility(tp));
                }
                        ));
            }));
        }
Example #6
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Pendrell Flux")
                         .ManaCost("{1}{U}")
                         .Type("Enchantment Aura")
                         .Text(
                             "Enchanted creature has 'At the beginning of your upkeep, sacrifice this creature unless you pay its mana cost'")
                         .FlavorText("Devoured by the mists, Tolaria was stuck in time, trapped between two eternal heartbeats.")
                         .Cast(p =>
            {
                p.Effect = () => new Attach(() =>
                {
                    var tp = new TriggeredAbility.Parameters
                    {
                        Text = "At the beginning of your upkeep, sacrifice this creature unless you pay its mana cost",
                        Effect =
                            () => new PayManaOrSacrifice(P(e => e.Source.OwningCard.ManaCost), "Pay creatures mana cost?"),
                    };

                    tp.Trigger(new OnStepStart(Step.Upkeep));

                    return new AddTriggeredAbility(new TriggeredAbility(tp));
                });

                p.TimingRule(new OnSecondMain());
                p.TargetSelector.AddEffect(trg => trg.Is.Creature().On.Battlefield());
                p.TargetingRule(new EffectRankBy(c => - c.Score, ControlledBy.Opponent));
            }));
        }
Example #7
0
        protected override void ResolveEffect()
        {
            foreach (Card target in ValidEffectTargets)
            {
                // exile first, otherwise modifier
                // will be removed when moving to exile
                target.Exile();

                if (!target.Is().Token)
                {
                    var tp = new TriggeredAbility.Parameters
                    {
                        Text = string.Format("When {0} leaves play, return exiled creature to battlefield.",
                                             Source.OwningCard.Name),
                        Effect = () => new PutOwnerToBattlefield(Zone.Exile),
                    };

                    tp.Trigger(new WhenPermanentLeavesPlay(Source.OwningCard));

                    var mp = new ModifierParameters
                    {
                        SourceCard   = Source.OwningCard,
                        SourceEffect = this
                    };

                    target.AddModifier(new AddTriggeredAbility(new TriggeredAbility(tp)), mp);
                }
            }
        }
Example #8
0
    public override IEnumerable<CardTemplate> GetCards()
    {
      yield return Card
        .Named("Retaliation")
        .ManaCost("{2}{G}")
        .Type("Enchantment")
        .Text(
          "Creatures you control have 'Whenever this creature becomes blocked by a creature, this creature gets +1/+1 until end of turn.'")
        .FlavorText("A foul, metallic stench clogged Urza's senses. It was then he knew his brother was no more.")
        .Cast(p => p.TimingRule(new OnFirstMain()))
        .ContinuousEffect(p =>
          {
            p.Modifier = () =>
              {
                var tp = new TriggeredAbility.Parameters
                  {
                    Text =
                      "Whenever this creature becomes blocked by a creature, this creature gets +1/+1 until end of turn.",
                    Effect = () => new ApplyModifiersToSelf(
                      () => new AddPowerAndToughness(1, 1) {UntilEot = true}),                    
                  };

                tp.Trigger(new OnBlock(becomesBlocked: true, triggerForEveryCreature: true));

                return new AddTriggeredAbility(new TriggeredAbility(tp));
              };

            p.CardFilter = (card, effect) => card.Controller == effect.Source.Controller && card.Is().Creature;
          });
    }
Example #9
0
    public override IEnumerable<CardTemplate> GetCards()
    {
      yield return Card
        .Named("Aura Flux")
        .ManaCost("{2}{U}")
        .Type("Enchantment")
        .Text("Other enchantments have 'At the beginning of your upkeep, sacrifice this enchantment unless you pay {2}.'")
        .FlavorText("To some, the Tolarian sunrise was a blinding flash; to others, a lingering glow.")
        .Cast(p => p.TimingRule(new OnSecondMain()))        
        .ContinuousEffect(p =>
          {
            p.Modifier = () =>
              {
                var tp = new TriggeredAbility.Parameters
                  {
                    Text =
                      "At the beginning of your upkeep, sacrifice this enchantment unless you pay {2}.",
                    Effect =() => new PayManaOrSacrifice(2.Colorless(), "Pay upkeep?")
                  };

                tp.Trigger(new OnStepStart(Step.Upkeep));

                return new AddTriggeredAbility(new TriggeredAbility(tp));
              };

            p.CardFilter = (card, effect) => card.Is().Enchantment && card != effect.Source;
          });
    }
Example #10
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Raging Ravine")
                         .Type("Land")
                         .Text(
                             "Raging Ravine enters the battlefield tapped.{EOL}{T}: Add {R} or {G} to your mana pool.{EOL}{2}{R}{G}: Until end of turn, Raging Ravine becomes a 3/3 red and green Elemental creature with Whenever this creature attacks, put a +1/+1 counter on it. It's still a land.")
                         .Cast(p => p.Effect = () => new CastPermanent(tap: true))
                         .ManaAbility(p =>
            {
                p.Text = "{T}: Add {R} or {G} to your mana pool.";
                p.ManaAmount(Mana.Colored(isRed: true, isGreen: true));
                p.Priority = ManaSourcePriorities.OnlyIfNecessary;
            })
                         .ActivatedAbility(p =>
            {
                p.Text =
                    "{2}{R}{G}: Until end of turn, Raging Ravine becomes a 3/3 red and green Elemental creature with Whenever this creature attacks, put a +1/+1 counter on it. It's still a land.";

                p.Cost = new PayMana("{2}{R}{G}".Parse());

                p.Effect = () => new ApplyModifiersToSelf(
                    () => new ChangeToCreature(
                        power: 3,
                        toughness: 3,
                        colors: L(CardColor.Red, CardColor.Green),
                        type: t => t.Add(baseTypes: "creature", subTypes: "elemental"))
                {
                    UntilEot = true
                },
                    () =>
                {
                    var tp = new TriggeredAbility.Parameters
                    {
                        Text = "Whenever this creature attacks, put a +1/+1 counter on it.",
                        Effect = () => new ApplyModifiersToSelf(() => new AddCounters(() => new PowerToughness(1, 1), 1))
                    };

                    tp.Trigger(new WhenThisAttacks());
                    return new AddTriggeredAbility(new TriggeredAbility(tp))
                    {
                        UntilEot = true
                    };
                });

                p.TimingRule(new WhenStackIsEmpty());
                p.TimingRule(new WhenCardHas(c => !c.Is().Creature));
                p.TimingRule(new WhenYouHaveMana(5));
                p.TimingRule(new Any(new BeforeYouDeclareAttackers(), new AfterOpponentDeclaresAttackers()));
            }));
        }
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Apprentice Necromancer")
                         .ManaCost("{1}{B}")
                         .Type("Creature Zombie Wizard")
                         .Text(
                             "{B},{T}, Sacrifice Apprentice Necromancer: Return target creature card from your graveyard to the battlefield. That creature gains haste. At the beginning of the next end step, sacrifice it.")
                         .Power(1)
                         .Toughness(1)
                         .ActivatedAbility(p =>
            {
                p.Text =
                    "{B},{T},Sacrifice Apprentice Necromancer: Return target creature card from your graveyard to the battlefield. That creature gains haste. At the beginning of the next end step, sacrifice it.";

                p.Cost = new AggregateCost(
                    new PayMana(Mana.Black),
                    new Tap(),
                    new Sacrifice());

                p.Effect = () => new PutSelectedCardsToBattlefield(
                    fromZone: Zone.Graveyard,
                    text: "Select a creature card in your graveyard.",
                    validator: c => c.Is().Creature,
                    modifiers: L(
                        () => new AddSimpleAbility(Static.Haste)
                {
                    UntilEot = true
                },
                        () =>
                {
                    var tp = new TriggeredAbility.Parameters
                    {
                        Text = "Sacrifice the creature at the beginning of the next end step.",
                        Effect = () => new SacrificeOwner(),
                    };

                    tp.Trigger(new OnStepStart(
                                   step: Step.EndOfTurn,
                                   passiveTurn: true,
                                   activeTurn: true));

                    tp.UsesStack = false;
                    return new AddTriggeredAbility(new TriggeredAbility(tp));
                }));

                p.TimingRule(new OnYourTurn(Step.BeginningOfCombat));
                p.TimingRule(new WhenYourGraveyardCountIs(minCount: 1, selector: c => c.Is().Creature));
            }));
        }
    public override IEnumerable<CardTemplate> GetCards()
    {
      yield return Card
        .Named("Apprentice Necromancer")
        .ManaCost("{1}{B}")
        .Type("Creature Zombie Wizard")
        .Text(
          "{B},{T}, Sacrifice Apprentice Necromancer: Return target creature card from your graveyard to the battlefield. That creature gains haste. At the beginning of the next end step, sacrifice it.")        
        .Power(1)
        .Toughness(1)        
        .ActivatedAbility(p =>
          {
            p.Text =
              "{B},{T},Sacrifice Apprentice Necromancer: Return target creature card from your graveyard to the battlefield. That creature gains haste. At the beginning of the next end step, sacrifice it.";
            
            p.Cost = new AggregateCost(
              new PayMana(Mana.Black, ManaUsage.Abilities),
              new Tap(),
              new Sacrifice());

            p.Effect = () => new PutSelectedCardToBattlefield(
              "Select a creature card in your graveyard.",
              c => c.Is().Creature,
              Zone.Graveyard,
              () => new AddStaticAbility(Static.Haste) {UntilEot = true},
              () =>
                {
                  var tp = new TriggeredAbility.Parameters
                    {
                      Text = "Sacrifice the creature at the beginning of the next end step.",
                      Effect = () => new SacrificeOwner(),                      
                    };

                  tp.Trigger(new OnStepStart(
                    step: Step.EndOfTurn,
                    passiveTurn: true,
                    activeTurn: true));

                  tp.UsesStack = false;
                  return new AddTriggeredAbility(new TriggeredAbility(tp));
                });

            p.TimingRule(new OnYourTurn(Step.BeginningOfCombat));
            p.TimingRule(new WhenYourGraveyardCountIs(minCount: 1, selector: c => c.Is().Creature));
          });
    }
Example #13
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Sneak Attack")
                         .ManaCost("{3}{R}")
                         .Type("Enchantment")
                         .Text(
                             "{R}: You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice the creature at the beginning of the next end step.")
                         .FlavorText("Nothin' beat surprise—'cept rock.")
                         .Cast(p => p.TimingRule(new OnFirstMain()))
                         .ActivatedAbility(p =>
            {
                p.Text =
                    "{R}: You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice the creature at the beginning of the next end step.";
                p.Cost = new PayMana(Mana.Red);

                p.Effect = () => new PutSelectedCardsToBattlefield(
                    text: "Select a creature card in your hand.",
                    validator: c => c.Is().Creature,
                    fromZone: Zone.Hand,
                    modifiers: L(
                        () => new AddSimpleAbility(Static.Haste)
                {
                    UntilEot = true
                },
                        () =>
                {
                    var tp = new TriggeredAbility.Parameters
                    {
                        Text = "Sacrifice the creature at the beginning of the next end step.",
                        Effect = () => new SacrificeOwner(),
                    };

                    tp.Trigger(new OnStepStart(
                                   step: Step.EndOfTurn,
                                   passiveTurn: true,
                                   activeTurn: true));

                    tp.UsesStack = false;
                    return new AddTriggeredAbility(new TriggeredAbility(tp));
                }));

                p.TimingRule(new OnYourTurn(Step.BeginningOfCombat));
                p.TimingRule(new WhenYourHandCountIs(minCount: 1, selector: c => c.Is().Creature));
            }));
        }
Example #14
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Avarice Amulet")
                         .ManaCost("{4}")
                         .Type("Artifact — Equipment")
                         .Text("Equipped creature gets +2/+0 and has vigilance and \"At the beginning of your upkeep, draw a card.\"{EOL}When equipped creature dies, target opponent gains control of Avarice Amulet.{EOL}Equip {2} ({2}: Attach to target creature you control. Equip only as a sorcery.)")
                         .FlavorText("")
                         .ActivatedAbility(p =>
            {
                p.Text = "Equip {2} ({2}: Attach to target creature you control. Equip only as a sorcery.)";

                p.Cost = new PayMana(2.Colorless());

                p.Effect = () => new Attach(
                    () => new AddPowerAndToughness(2, 0),
                    () => new AddSimpleAbility(Static.Vigilance),
                    () =>
                {
                    var tp = new TriggeredAbility.Parameters();

                    tp.Text = "At the beginning of your upkeep, draw a card.";
                    tp.Trigger(new OnStepStart(Step.Upkeep));
                    tp.Effect = () => new DrawCards(1);

                    return new AddTriggeredAbility(new TriggeredAbility(tp));
                });

                p.TargetSelector.AddEffect(trg => trg.Is.ValidEquipmentTarget().On.Battlefield());

                p.TimingRule(new OnFirstDetachedOnSecondAttached());
                p.TargetingRule(new EffectCombatEquipment());

                p.ActivateAsSorcery = true;
            })
                         .TriggeredAbility(p =>
            {
                p.Text = "When equipped creature dies, target opponent gains control of Avarice Amulet.";

                p.Trigger(new OnZoneChanged(from: Zone.Battlefield, to: Zone.Graveyard,
                                            selector: (c, ctx) => c == ctx.OwningCard.AttachedTo));

                p.Effect = () => new SwitchController();
            }));
        }
Example #15
0
    public override IEnumerable<CardTemplate> GetCards()
    {
      yield return Card
        .Named("Raging Ravine")
        .Type("Land")
        .Text(
          "Raging Ravine enters the battlefield tapped.{EOL}{T}: Add {R} or {G} to your mana pool.{EOL}{2}{R}{G}: Until end of turn, Raging Ravine becomes a 3/3 red and green Elemental creature with Whenever this creature attacks, put a +1/+1 counter on it. It's still a land.")
        .Cast(p => p.Effect = () => new PutIntoPlay(tap: true))
        .ManaAbility(p =>
          {
            p.Text = "{T}: Add {R} or {G} to your mana pool.";
            p.ManaAmount(Mana.Colored(isRed: true, isGreen: true));
            p.Priority = ManaSourcePriorities.OnlyIfNecessary;
          })
        .ActivatedAbility(p =>
          {
            p.Text =
              "{2}{R}{G}: Until end of turn, Raging Ravine becomes a 3/3 red and green Elemental creature with Whenever this creature attacks, put a +1/+1 counter on it. It's still a land.";

            p.Cost = new PayMana("{2}{R}{G}".Parse(), ManaUsage.Abilities);

            p.Effect = () => new ApplyModifiersToSelf(
              () => new ChangeToCreature(
                power: 3,
                toughness: 3,
                colors: L(CardColor.Red, CardColor.Green),
                type: "Land Creature Elemental") {UntilEot = true},
              () =>
                {
                  var tp = new TriggeredAbility.Parameters
                    {
                      Text = "Whenever this creature attacks, put a +1/+1 counter on it.",
                      Effect = () => new ApplyModifiersToSelf(() => new AddCounters(() => new PowerToughness(1, 1), 1))
                    };

                  tp.Trigger(new OnAttack());
                  return new AddTriggeredAbility(new TriggeredAbility(tp)) {UntilEot = true};
                });

            p.TimingRule(new WhenStackIsEmpty());
            p.TimingRule(new WhenCardHas(c => !c.Is().Creature));
            p.TimingRule(new WhenYouHaveMana(5));
            p.TimingRule(new Any(new BeforeYouDeclareAttackers(), new AfterOpponentDeclaresAttackers()));
          });
    }
Example #16
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Veiled Apparition")
                         .ManaCost("{1}{U}")
                         .Type("Enchantment")
                         .Text(
                             "When an opponent casts a spell, if Veiled Apparition is an enchantment, Veiled Apparition becomes a 3/3 Illusion creature with flying and 'At the beginning of your upkeep, sacrifice Veiled Apparition unless you pay {1}{U}.'")
                         .Cast(p => p.TimingRule(new OnFirstMain()))
                         .TriggeredAbility(p =>
            {
                p.Text =
                    "When an opponent casts a spell, if Veiled Apparition is an enchantment, Veiled Apparition becomes a 3/3 Illusion creature with flying and 'At the beginning of your upkeep, sacrifice Veiled Apparition unless you pay {1}{U}.'";
                p.Trigger(new OnCastedSpell((c, ctx) =>
                                            ctx.Opponent == c.Controller && ctx.OwningCard.Is().Enchantment));

                p.Effect = () => new ApplyModifiersToSelf(
                    () => new ChangeToCreature(
                        power: 3,
                        toughness: 3,
                        type: t => t.Change(baseTypes: "creature", subTypes: "illusion"),
                        colors: L(CardColor.Blue)),
                    () => new AddSimpleAbility(Static.Flying),
                    () =>
                {
                    var tp = new TriggeredAbility.Parameters();
                    tp.Text = "At the beginning of your upkeep, sacrifice Veiled Apparition unless you pay {1}{U}.";
                    tp.Trigger(new OnStepStart(Step.Upkeep));
                    tp.Effect =
                        () => new PayManaThen("{1}{U}".Parse(),
                                              effect: new SacrificeOwner(),
                                              parameters: new PayThen.Parameters()
                    {
                        ExecuteIfPaid = false,
                        Message = "Pay upkeep? (or sacrifice Veiled Apparition)",
                    });

                    return new AddTriggeredAbility(new TriggeredAbility(tp));
                });

                p.TriggerOnlyIfOwningCardIsInPlay = true;
            }));
        }
Example #17
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Slow Motion")
                         .ManaCost("{2}{U}")
                         .Type("Enchantment Aura")
                         .Text(
                             "At the beginning of the upkeep of enchanted creature's controller, that player sacrifices that creature unless he or she pays {2}.{EOL}When Slow Motion is put into a graveyard from the battlefield, return Slow Motion to its owner's hand.")
                         .Cast(p =>
            {
                p.Effect = () => new Attach(() =>
                {
                    var tp = new TriggeredAbility.Parameters
                    {
                        Text =
                            "At the beginning of the upkeep of enchanted creature's controller, that player sacrifices that creature unless he or she pays {2}.",
                        Effect =
                            () => new PayManaThen(2.Colorless(),
                                                  effect: new SacrificeOwner(),
                                                  parameters: new PayThen.Parameters()
                        {
                            ExecuteIfPaid = false,
                            Message = "Pay upkeep cost?",
                        }),
                    };

                    tp.Trigger(new OnStepStart(Step.Upkeep));

                    return new AddTriggeredAbility(new TriggeredAbility(tp));
                });

                p.TimingRule(new OnSecondMain());
                p.TargetSelector.AddEffect(trg => trg.Is.Creature().On.Battlefield());
                p.TargetingRule(new EffectOrCostRankBy(c => - c.Score, ControlledBy.Opponent));
            })
                         .TriggeredAbility(p =>
            {
                p.Text =
                    "When Slow Motion is put into a graveyard from the battlefield, return Slow Motion to its owner's hand.";
                p.Trigger(new OnZoneChanged(@from: Zone.Battlefield, to: Zone.Graveyard));
                p.Effect = () => new ReturnToHand(returnOwningCard: true);
            }));
        }
Example #18
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Phytotitan")
                         .ManaCost("{4}{G}{G}")
                         .Type("Creature —  Plant Elemental")
                         .Text(
                             "When Phytotitan dies, return it to the battlefield tapped under its owner's control at the beginning of his or her next upkeep.")
                         .FlavorText("Its root system spans the entire floor of the jungle, making eradication impossible.")
                         .Power(7)
                         .Toughness(2)
                         .TriggeredAbility(p =>
            {
                p.Text = "When Phytotitan dies, return it to the battlefield tapped under its " +
                         "owner's control at the beginning of his or her next upkeep.";

                p.Trigger(new OnZoneChanged(from: Zone.Battlefield, to: Zone.Graveyard));

                p.Effect = () => new ApplyModifiersToSelf(
                    () =>
                {
                    var tp = new TriggeredAbility.Parameters
                    {
                        Text = "When Phytotitan dies, return it to the battlefield tapped under " +
                               "its owner's control at the beginning of his or her next upkeep.",

                        Effect = () => new PutOwnerToBattlefield(from: Zone.Graveyard, tap: true),
                    };

                    tp.Trigger(new OnStepStart(
                                   step: Step.Upkeep,
                                   passiveTurn: false,
                                   activeTurn: true));

                    var modifier = new AddTriggeredAbility(new TriggeredAbility(tp));

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

                    return modifier;
                });
            }));
        }
Example #19
0
    public override IEnumerable<CardTemplate> GetCards()
    {
      yield return Card
        .Named("Sneak Attack")
        .ManaCost("{3}{R}")
        .Type("Enchantment")
        .Text(
          "{R}: You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice the creature at the beginning of the next end step.")
        .FlavorText("Nothin' beat surprise—'cept rock.")
        .Cast(p => p.TimingRule(new OnFirstMain()))
        .ActivatedAbility(p =>
          {
            p.Text =
              "{R}: You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice the creature at the beginning of the next end step.";
            p.Cost = new PayMana(Mana.Red, ManaUsage.Abilities);

            p.Effect = () => new PutSelectedCardToBattlefield(
              "Select a creature card in your hand.",
              c => c.Is().Creature,
              Zone.Hand,
              () => new AddStaticAbility(Static.Haste) {UntilEot = true},
              () =>
                {
                  var tp = new TriggeredAbility.Parameters
                    {
                      Text = "Sacrifice the creature at the beginning of the next end step.",
                      Effect = () => new SacrificeOwner(),                      
                    };

                  tp.Trigger(new OnStepStart(
                    step: Step.EndOfTurn,
                    passiveTurn: true,
                    activeTurn: true));

                  tp.UsesStack = false;
                  return new AddTriggeredAbility(new TriggeredAbility(tp));
                });

            p.TimingRule(new OnYourTurn(Step.BeginningOfCombat));
            p.TimingRule(new WhenYourHandCountIs(minCount: 1, selector: c => c.Is().Creature));
          });
    }
Example #20
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Constricting Sliver")
                         .ManaCost("{5}{W}")
                         .Type("Creature — Sliver")
                         .Text(
                             "Sliver creatures you control have \"When this creature enters the battlefield, you may exile target creature an opponent controls until this creature leaves the battlefield.\"")
                         .FlavorText(
                             "Slivers are often seen toying with enemies they capture, not out of cruelty, but to fully learn their physical capabilities.")
                         .Power(3)
                         .Toughness(3)
                         .ContinuousEffect(p =>
            {
                p.Selector = (c, ctx) => c.Controller == ctx.You && c.Is("sliver");

                p.Modifiers.Add(() =>
                {
                    var tp = new TriggeredAbility.Parameters
                    {
                        Text =
                            "When this creature enters the battlefield, you may exile target creature an opponent controls until this creature leaves the battlefield.",
                        Effect = () => new ExileTargetsUntilOwnerLeavesBattlefield()
                    };

                    tp.Trigger(new OnZoneChanged(to: Zone.Battlefield));

                    tp.TargetSelector.AddEffect(trg => trg
                                                .Is.Card(c => c.Is().Creature, ControlledBy.Opponent)
                                                .On.Battlefield());

                    tp.TargetingRule(new EffectExileBattlefield());

                    return new AddTriggeredAbility(new TriggeredAbility(tp));
                });

                p.ApplyOnlyToPermanents = false;
            }));
        }
Example #21
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Veiled Apparition")
                         .ManaCost("{1}{U}")
                         .Type("Enchantment")
                         .Text(
                             "When an opponent casts a spell, if Veiled Apparition is an enchantment, Veiled Apparition becomes a 3/3 Illusion creature with flying and 'At the beginning of your upkeep, sacrifice Veiled Apparition unless you pay {1}{U}.'")
                         .Cast(p => p.TimingRule(new OnFirstMain()))
                         .TriggeredAbility(p =>
            {
                p.Text =
                    "When an opponent casts a spell, if Veiled Apparition is an enchantment, Veiled Apparition becomes a 3/3 Illusion creature with flying and 'At the beginning of your upkeep, sacrifice Veiled Apparition unless you pay {1}{U}.'";
                p.Trigger(new OnCastedSpell(
                              filter:
                              (ability, card) =>
                              ability.OwningCard.Controller != card.Controller && ability.OwningCard.Is().Enchantment));

                p.Effect = () => new ApplyModifiersToSelf(
                    () => new ChangeToCreature(
                        power: 3,
                        toughness: 3,
                        type: "Creature Illusion",
                        colors: L(CardColor.Blue)),
                    () => new AddStaticAbility(Static.Flying),
                    () =>
                {
                    var tp = new TriggeredAbility.Parameters();
                    tp.Text = "At the beginning of your upkeep, sacrifice Veiled Apparition unless you pay {1}{U}.";
                    tp.Trigger(new OnStepStart(Step.Upkeep));
                    tp.Effect =
                        () => new PayManaOrSacrifice("{1}{U}".Parse(), "Pay upkeep? (or sacrifice Veiled Apparition)");

                    return new AddTriggeredAbility(new TriggeredAbility(tp));
                });

                p.TriggerOnlyIfOwningCardIsInPlay = true;
            }));
        }
Example #22
0
    public override IEnumerable<CardTemplate> GetCards()
    {
      yield return Card
        .Named("Veiled Apparition")
        .ManaCost("{1}{U}")
        .Type("Enchantment")
        .Text(
          "When an opponent casts a spell, if Veiled Apparition is an enchantment, Veiled Apparition becomes a 3/3 Illusion creature with flying and 'At the beginning of your upkeep, sacrifice Veiled Apparition unless you pay {1}{U}.'")
        .Cast(p => p.TimingRule(new OnFirstMain()))
        .TriggeredAbility(p =>
          {
            p.Text =
              "When an opponent casts a spell, if Veiled Apparition is an enchantment, Veiled Apparition becomes a 3/3 Illusion creature with flying and 'At the beginning of your upkeep, sacrifice Veiled Apparition unless you pay {1}{U}.'";
            p.Trigger(new OnCastedSpell(
              filter:
                (ability, card) =>
                  ability.OwningCard.Controller != card.Controller && ability.OwningCard.Is().Enchantment));

            p.Effect = () => new ApplyModifiersToSelf(
              () => new ChangeToCreature(
                power: 3,
                toughness: 3,
                type: "Creature Illusion",
                colors: L(CardColor.Blue)),
              () => new AddStaticAbility(Static.Flying),
              () =>
                {
                  var tp = new TriggeredAbility.Parameters();
                  tp.Text = "At the beginning of your upkeep, sacrifice Veiled Apparition unless you pay {1}{U}.";
                  tp.Trigger(new OnStepStart(Step.Upkeep));
                  tp.Effect =
                    () => new PayManaOrSacrifice("{1}{U}".Parse(), "Pay upkeep? (or sacrifice Veiled Apparition)");

                  return new AddTriggeredAbility(new TriggeredAbility(tp));
                });

            p.TriggerOnlyIfOwningCardIsInPlay = true;
          });
    }
Example #23
0
    public override IEnumerable<CardTemplate> GetCards()
    {
      yield return Card
        .Named("Slow Motion")
        .ManaCost("{2}{U}")
        .Type("Enchantment Aura")
        .Text(
          "At the beginning of the upkeep of enchanted creature's controller, that player sacrifices that creature unless he or she pays {2}.{EOL}When Slow Motion is put into a graveyard from the battlefield, return Slow Motion to its owner's hand.")
        .Cast(p =>
          {
            p.Effect = () => new Attach(() =>
              {
                var tp = new TriggeredAbility.Parameters
                  {
                    Text =
                      "At the beginning of the upkeep of enchanted creature's controller, that player sacrifices that creature unless he or she pays {2}.",
                    Effect =
                      () => new PayManaOrSacrifice(2.Colorless(), "Pay upkeep cost?"),
                  };

                tp.Trigger(new OnStepStart(Step.Upkeep));

                return new AddTriggeredAbility(new TriggeredAbility(tp));
              });

            p.TimingRule(new OnSecondMain());
            p.TargetSelector.AddEffect(trg => trg.Is.Creature().On.Battlefield());
            p.TargetingRule(new EffectRankBy(c => -c.Score, ControlledBy.Opponent));
          })
        .TriggeredAbility(p =>
          {
            p.Text =
              "When Slow Motion is put into a graveyard from the battlefield, return Slow Motion to its owner's hand.";
            p.Trigger(new OnZoneChanged(@from: Zone.Battlefield, to: Zone.Graveyard));
            p.Effect = () => new ReturnToHand(returnOwningCard: true);
          });
    }
Example #24
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Garruk, Apex Predator")
                         .ManaCost("{5}{B}{G}")
                         .Type("Planeswalker Garruk")
                         .Text("{+1}: Destroy another target planeswalker.{EOL}" +
                               "{+1}: Create a 3/3 black Beast creature token with deathtouch.{EOL}" +
                               "{-3}: Destroy target creature. You gain life equal to its toughness.{EOL}" +
                               "{-8}: Target opponent gets an emblem with 'Whenever a creature attacks you, it gets +5/+5 and gains trample until end of turn.'")
                         .Loyality(5)
                         .ActivatedAbility(p =>
            {
                p.Text = "{+1}: Destroy another target planeswalker.";

                p.Cost = new AddCountersCost(CounterType.Loyality, 1);
                p.Effect = () => new DestroyTargetPermanents();
                p.TargetSelector.AddEffect(trg => trg.Is.Card(c => c.Is().Planeswalker).On.Battlefield());
                p.TargetingRule(new EffectDestroy());
                p.TimingRule(new OnFirstMain());

                p.ActivateAsSorcery = true;
            })
                         .ActivatedAbility(p =>
            {
                p.Text = "{+1}: Create a 3/3 black Beast creature token with deathtouch.";
                p.Cost = new AddCountersCost(CounterType.Loyality, 1);

                p.Effect = () => new CreateTokens(
                    count: 1,
                    token: Card
                    .Named("Beast")
                    .Power(3)
                    .Toughness(3)
                    .Type("Token Creature - Beast")
                    .Colors(CardColor.Black)
                    .SimpleAbilities(Static.Deathtouch));

                p.TimingRule(new OnFirstMain());
                p.ActivateAsSorcery = true;
            })
                         .ActivatedAbility(p =>
            {
                p.Text = "{-3}: Destroy target creature. You gain life equal to its toughness.";

                p.Cost = new RemoveCounters(CounterType.Loyality, 3);
                p.Effect = () => new CompoundEffect(
                    new DestroyTargetPermanents(),
                    new ChangeLife(
                        amount: P(e => e.Target.Card().Toughness.GetValueOrDefault()),
                        whos: P(e => e.Controller)));

                p.TargetSelector.AddEffect(trg => trg.Is.Card(c => c.Is().Creature).On.Battlefield());
                p.TargetingRule(new EffectDestroy());
                p.TimingRule(new OnFirstMain());

                p.ActivateAsSorcery = true;
            })
                         .ActivatedAbility(p =>
            {
                p.Text =
                    "{-8}: Target opponent gets an emblem with 'Whenever a creature attacks you, it gets +5/+5 and gains trample until end of turn.'";

                p.Cost = new RemoveCounters(CounterType.Loyality, 8);

                p.Effect = () => new CreateEmblem(
                    text: "Whenever a creature attacks you, it gets +5/+5 and gains trample until end of turn.",
                    score: -600,
                    controller: P(e => e.Controller.Opponent),
                    modifiers: () =>
                {
                    var cp = new ContinuousEffectParameters
                    {
                        Modifier = () =>
                        {
                            var tp = new TriggeredAbility.Parameters
                            {
                                Text = "Whenever this creature attacks, it gets +5/+5 and gains trample until end of turn.",
                                Effect = () => new ApplyModifiersToSelf(
                                    () => new AddPowerAndToughness(5, 5)
                                {
                                    UntilEot = true
                                },
                                    () => new AddSimpleAbility(Static.Trample)
                                {
                                    UntilEot = true
                                })
                            };

                            tp.Trigger(new WhenThisAttacks(ap => ap.Attacker.Planeswalker == null));
                            return new AddTriggeredAbility(new TriggeredAbility(tp));
                        },

                        Selector = (card, ctx) => card.Controller != ctx.EffectOwner && card.Is().Creature
                    };

                    var effect = new ContinuousEffect(cp);
                    return new AddContiniousEffect(effect);
                });

                p.TimingRule(new OnFirstMain());
                p.ActivateAsSorcery = true;
            }));
        }