Exemple #1
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Fledgling Osprey")
                         .ManaCost("{U}")
                         .Type("Creature Bird")
                         .Text("Fledgling Osprey has flying as long as it's enchanted.")
                         .FlavorText("It isn't truly born until its first flight.")
                         .Power(1)
                         .Toughness(1)
                         .TriggeredAbility(p =>
            {
                p.Trigger(new OnAttachmentAttached(c => c.Is().Aura));

                p.Effect = () => new ApplyModifiersToSelf(() =>
                {
                    var modifier = new AddStaticAbility(Static.Flying);

                    modifier.AddLifetime(new AttachmentLifetime(self =>
                                                                self.Modifier.SourceEffect.TriggerMessage <AttachmentAttachedEvent>().Attachment));

                    return modifier;
                });

                p.UsesStack = false;
            }));
        }
        public override void ProcessResults(ChosenOptions results)
        {
            var chosenType = (string)results.Options[0];

            var sp = new StaticAbilityParameters();

            sp.Modifier(() =>
            {
                var cp = new ContinuousEffectParameters
                {
                    Modifier = () => new AddPowerAndToughness(_power, _toughness),
                    Selector = (card, effect) => card.Is().Creature&& card.Is(chosenType) && IsValidController(card)
                };

                return(new AddContiniousEffect(new ContinuousEffect(cp)));
            });

            var modifier = new AddStaticAbility(new StaticAbility(sp));

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

            Source.OwningCard.AddModifier(modifier, mp);
        }
Exemple #3
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Metathran Elite")
                         .ManaCost("{1}{U}{U}")
                         .Type("Creature Metathran Soldier")
                         .Text("Metathran Elite can't be blocked as long as it's enchanted.")
                         .FlavorText("If the eyes are windows to the soul, their souls are not of this world.")
                         .Power(2)
                         .Toughness(3)
                         .TriggeredAbility(p =>
            {
                p.Trigger(new OnAttachmentAttached(c => c.Is().Aura));

                p.Effect = () => new ApplyModifiersToSelf(() =>
                {
                    var modifier = new AddStaticAbility(Static.Unblockable);

                    modifier.AddLifetime(new AttachmentLifetime(self =>
                                                                self.Modifier.SourceEffect.TriggerMessage <AttachmentAttachedEvent>().Attachment));

                    return modifier;
                });

                p.UsesStack = false;
            }));
        }
Exemple #4
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Mana Leech")
                         .ManaCost("{2}{B}")
                         .Type("Creature Leech")
                         .Text(
                             "You may choose not to untap Mana Leech during your untap step.{EOL}{T}: Tap target land. It doesn't untap during its controller's untap step for as long as Mana Leech remains tapped.")
                         .Power(1)
                         .Toughness(1)
                         .MayChooseToUntap()
                         .ActivatedAbility(p =>
            {
                p.Text =
                    "{T}: Tap target land. It doesn't untap during its controller's untap step for as long as Mana Leech remains tapped.";
                p.Cost = new Tap();

                p.Effect = () => new CompoundEffect(
                    new TapTargets(),
                    new ApplyModifiersToTargets(() =>
                {
                    var modifier = new AddStaticAbility(Static.DoesNotUntap);
                    modifier.AddLifetime(new ModifierSourceGetsUntapedLifetime());
                    return modifier;
                }));

                p.TargetSelector.AddEffect(trg => trg.Is.Card(c => c.Is().Land).On.Battlefield());
                p.TimingRule(new OnOpponentsTurn(Step.Upkeep));
                p.TargetingRule(new EffectTapLand());
            }));
        }
    public override IEnumerable<CardTemplate> GetCards()
    {
      yield return Card
        .Named("Metathran Elite")
        .ManaCost("{1}{U}{U}")
        .Type("Creature Metathran Soldier")
        .Text("Metathran Elite can't be blocked as long as it's enchanted.")
        .FlavorText("If the eyes are windows to the soul, their souls are not of this world.")
        .Power(2)
        .Toughness(3)
        .TriggeredAbility(p =>
          {
            p.Trigger(new OnAttachmentAttached(c => c.Is().Aura));

            p.Effect = () => new ApplyModifiersToSelf(() =>
              {
                var modifier = new AddStaticAbility(Static.Unblockable);

                modifier.AddLifetime(new AttachmentLifetime(self =>
                  self.Modifier.SourceEffect.TriggerMessage<AttachmentAttachedEvent>().Attachment));

                return modifier;
              });

            p.UsesStack = false;
          });
    }
Exemple #6
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Thran Golem")
                         .ManaCost("{5}")
                         .Type("Artifact Creature Golem")
                         .Text("As long as Thran Golem is enchanted, it gets +2/+2 and has flying, first strike, and trample.")
                         .FlavorText("Karn felt more secure about his value to Urza when he realized he didn't need regular trimming.")
                         .Power(3)
                         .Toughness(3)
                         .TriggeredAbility(p =>
            {
                p.Trigger(new OnAttachmentAttached(c => c.Is().Aura));
                p.Effect = () =>
                {
                    return new ApplyModifiersToSelf(
                        () =>
                    {
                        var modifier = new AddPowerAndToughness(2, 2);
                        modifier.AddLifetime(UntilAttached());
                        return modifier;
                    },
                        () =>
                    {
                        var modifier = new AddStaticAbility(Static.Flying);
                        modifier.AddLifetime(UntilAttached());
                        return modifier;
                    },
                        () =>
                    {
                        var modifier = new AddStaticAbility(Static.FirstStrike);
                        modifier.AddLifetime(UntilAttached());
                        return modifier;
                    },
                        () =>
                    {
                        var modifier = new AddStaticAbility(Static.Trample);
                        modifier.AddLifetime(UntilAttached());
                        return modifier;
                    });
                };

                p.UsesStack = false;
            }));
        }
Exemple #7
0
        public CardTemplate Leveler(string cost, EffectTag tag,
                                    params LevelDefinition[] levels)
        {
            ActivatedAbility(p =>
            {
                p.Text   = String.Format("{0}: Put a level counter on this. Level up only as sorcery.", cost);
                p.Cost   = new PayMana(cost.Parse(), ManaUsage.Abilities);
                p.Effect = () => new ApplyModifiersToSelf(() => new IncreaseLevel()).SetTags(tag);
                p.TimingRule(new DefaultLevelUpTimingRule(cost.Parse(), levels));
                p.ActivateAsSorcery = true;
            });

            foreach (var level in levels)
            {
                var lvl = level;
                TriggeredAbility(p =>
                {
                    p.Trigger(new OnLevelChanged(lvl.Min));
                    p.Effect = () => new ApplyModifiersToSelf(
                        () =>
                    {
                        var modifier = new AddStaticAbility(lvl.StaticAbility);
                        modifier.AddLifetime(new LevelLifetime(lvl.Min, lvl.Max));
                        return(modifier);
                    },
                        () =>
                    {
                        var modifier = new SetPowerAndToughness(lvl.Power, lvl.Toughness);
                        modifier.AddLifetime(new LevelLifetime(lvl.Min, lvl.Max));
                        return(modifier);
                    }
                        );
                    p.UsesStack = false;
                    p.TriggerOnlyIfOwningCardIsInPlay = true;
                });
            }

            _init.Add(cp => { cp.IsLeveler = true; });

            return(this);
        }
Exemple #8
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Somnophore")
                         .ManaCost("{2}{U}{U}")
                         .Type("Creature - Illusion")
                         .Text(
                             "{Flying}{EOL}Whenever Somnophore deals damage to a player, tap target creature that player controls. That creature doesn't untap during its controller's untap step for as long as Somnophore remains on the battlefield.")
                         .Power(2)
                         .Toughness(2)
                         .SimpleAbilities(Static.Flying)
                         .TriggeredAbility(p =>
            {
                p.Text =
                    "Whenever Somnophore deals damage to a player, tap target creature that player controls. That creature doesn't untap during its controller's untap step for as long as Somnophore remains on the battlefield.";
                p.Trigger(new OnDamageDealt(playerFilter: delegate { return true; }));

                p.Effect = () => new CompoundEffect(
                    new TapTargets(),
                    new ApplyModifiersToTargets(() =>
                {
                    var modifier = new AddStaticAbility(Static.DoesNotUntap);
                    modifier.AddLifetime(new PermanentLeavesBattlefieldLifetime(l => l.Modifier.SourceCard));
                    return modifier;
                }));

                p.TargetSelector.AddEffect(trg =>
                {
                    trg
                    .Is.Card(tp => tp.Target.Card().Is().Creature&&
                             tp.TriggerMessage <DamageDealtEvent>().Receiver == tp.Target.Controller())
                    .On.Battlefield();

                    trg.Message = "Select a creature to tap.";
                });

                p.TargetingRule(new EffectGiveDoesNotUntap());
            }
                                           ));
        }
        public CardTemplate Leveler(string cost, EffectTag tag,
      params LevelDefinition[] levels)
        {
            ActivatedAbility(p =>
            {
              p.Text = String.Format("{0}: Put a level counter on this. Level up only as sorcery.", cost);
              p.Cost = new PayMana(cost.Parse(), ManaUsage.Abilities);
              p.Effect = () => new ApplyModifiersToSelf(() => new IncreaseLevel()).SetTags(tag);
              p.TimingRule(new DefaultLevelUpTimingRule(cost.Parse(), levels));
              p.ActivateAsSorcery = true;
            });

              foreach (var level in levels)
              {
            var lvl = level;
            TriggeredAbility(p =>
              {
            p.Trigger(new OnLevelChanged(lvl.Min));
            p.Effect = () => new ApplyModifiersToSelf(
              () =>
                {
                  var modifier = new AddStaticAbility(lvl.StaticAbility);
                  modifier.AddLifetime(new LevelLifetime(lvl.Min, lvl.Max));
                  return modifier;
                },
              () =>
                {
                  var modifier = new SetPowerAndToughness(lvl.Power, lvl.Toughness);
                  modifier.AddLifetime(new LevelLifetime(lvl.Min, lvl.Max));
                  return modifier;
                }
              );
            p.UsesStack = false;
            p.TriggerOnlyIfOwningCardIsInPlay = true;
              });
              }

              _init.Add(cp => { cp.IsLeveler = true; });

              return this;
        }