Пример #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, ctx) => c.Is().Aura));

                p.Effect = () => new ApplyModifiersToSelf(() =>
                {
                    var modifier = new AddSimpleAbility(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 p = new ModifierParameters
            {
                SourceEffect = this,
                SourceCard   = Source.OwningCard,
                X            = X
            };

            var ability = Static.Vigilance;

            if (results.Options[0].Equals(EffectOption.Haste))
            {
                ability = Static.Haste;
            }

            if (results.Options[0].Equals(EffectOption.Lifelink))
            {
                ability = Static.Lifelink;
            }

            var modifier = new AddSimpleAbility(ability)
            {
                UntilEot = true
            };

            Source.OwningCard.AddModifier(modifier, p);
        }
Пример #3
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 AddSimpleAbility(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());
            }));
        }
Пример #4
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Crippling Chill")
                         .ManaCost("{2}{U}")
                         .Type("Instant")
                         .Text("Tap target creature. It doesn't untap during its controller's next untap step.{EOL}Draw a card.")
                         .FlavorText("In the silence of the ice, even dreams become still.")
                         .Cast(p =>
            {
                p.Effect = () => new CompoundEffect(
                    new TapTargets(),
                    new ApplyModifiersToTargets(() =>
                {
                    var modifier = new AddSimpleAbility(Static.DoesNotUntap);

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

                    return modifier;
                }),
                    new DrawCards(1));

                p.TargetSelector.AddEffect(
                    trg => trg.Is.Creature().On.Battlefield(),
                    trg => trg.Message = "Select a creature to tap.");

                p.TargetingRule(new EffectGiveDoesNotUntap());
                p.TimingRule(new OnStep(Step.BeginningOfCombat));
            }));
        }
Пример #5
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, ctx) => c.Is().Aura));

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

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

                    return modifier;
                });

                p.UsesStack = false;
            }));
        }
Пример #6
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Wall of Frost")
                         .ManaCost("{1}{U}{U}")
                         .Type("Creature — Wall")
                         .Text(
                             "{Defender}{I}(This creature can't attack.){/I}{EOL}Whenever Wall of Frost blocks a creature, that creature doesn't untap during its controller's next untap step.")
                         .FlavorText(
                             "\"I have seen countless petty warmongers gaze on it for a time before turning away.\"{EOL}—Sarlena, paladin of the Northern Verge")
                         .Power(0)
                         .Toughness(7)
                         .SimpleAbilities(Static.Defender)
                         .TriggeredAbility(p =>
            {
                p.Text =
                    "Whenever Wall of Frost blocks a creature, that creature doesn't untap during its controller's next untap step.";
                p.Trigger(new WhenThisBlocks());

                p.Effect = () => new ApplyModifiersToCard(
                    card: P(e => e.TriggerMessage <BlockerJoinedCombatEvent>().Attacker.Card),
                    modifiers: () =>
                {
                    var modifier = new AddSimpleAbility(Static.DoesNotUntap);

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

                    return modifier;
                });
            }));
        }
Пример #7
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Aegis Angel")
                         .ManaCost("{4}{W}{W}")
                         .Type("Creature - Angel")
                         .Text("{Flying}{EOL}When Aegis Angel enters the battlefield, another target permanent gains indestructible for as long as you control Aegis Angel.{I}(Effects that say \"destroy\" don't destroy it. A creature with indestructible can't be destroyed by damage.){/I}")
                         .Power(5)
                         .Toughness(5)
                         .SimpleAbilities(Static.Flying)
                         .TriggeredAbility(p =>
            {
                p.Text = "When Aegis Angel enters the battlefield, another target permanent gains indestructible for as long as you control Aegis Angel.";
                p.Trigger(new OnZoneChanged(to: Zone.Battlefield));

                p.Effect = () => new ApplyModifiersToTargets(() =>
                {
                    var modifier = new AddSimpleAbility(Static.Indestructible);
                    modifier.AddLifetime(new PermanentLeavesBattlefieldLifetime(l => l.Modifier.SourceCard));
                    return modifier;
                }).SetTags(EffectTag.Indestructible);

                p.TargetSelector.AddEffect(trg =>
                                           trg
                                           .Is.Card(canTargetSelf: false)
                                           .On.Battlefield());

                p.TargetingRule(new EffectOrCostRankBy(c => c.Is().Land ? 0 : -c.Score, forceRank: c => c.Score));
            }));
        }
Пример #8
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Icy Blast")
                         .ManaCost("{U}").HasXInCost()
                         .Type("Instant")
                         .Text("Tap X target creatures.{EOL}{I}Ferocious{/I} — If you control a creature with power 4 or greater, those creatures don't untap during their controllers' next untap steps.")
                         .FlavorText("\"Do not think the sand or the sun will hold back the breath of winter.\"")
                         .Cast(p =>
            {
                p.Effect = () => new FerociousEffect(
                    L(new TapTargets()),
                    L(new ApplyModifiersToTargets(() =>
                {
                    var modifier = new AddSimpleAbility(Static.DoesNotUntap);

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

                    return modifier;
                })));

                p.TargetSelector.AddEffect(
                    trg => trg.Is.Creature().On.Battlefield(),
                    trg => {
                    trg.MinCount = Value.PlusX;
                    trg.MaxCount = Value.PlusX;
                });

                p.TimingRule(new OnStep(Step.BeginningOfCombat));
                p.CostRule(new XIsOpponentsCreatureCount());
                p.TargetingRule(new EffectTapCreature());
            }));
        }
Пример #9
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, ctx) => c.Is().Aura)
                {
                    Condition = ctx => ctx.OwningCard.Attachments.Count() == 1
                });

                p.Effect = () =>
                {
                    return new ApplyModifiersToSelf(
                        () =>
                    {
                        var modifier = new AddPowerAndToughness(2, 2);
                        modifier.AddLifetime(UntilAttached());
                        return modifier;
                    },
                        () =>
                    {
                        var modifier = new AddSimpleAbility(Static.Flying);
                        modifier.AddLifetime(UntilAttached());
                        return modifier;
                    },
                        () =>
                    {
                        var modifier = new AddSimpleAbility(Static.FirstStrike);
                        modifier.AddLifetime(UntilAttached());
                        return modifier;
                    },
                        () =>
                    {
                        var modifier = new AddSimpleAbility(Static.Trample);
                        modifier.AddLifetime(UntilAttached());
                        return modifier;
                    });
                };

                p.UsesStack = false;
            }));
        }
Пример #10
0
        protected override void ResolveEffect()
        {
            if (Source.OwningCard.Has().Monstrosity)
            {
                return;
            }

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

            var modifier1 = new AddCounters(() => new PowerToughness(1, 1), count: _counterCount);
            var modifier2 = new AddSimpleAbility(Static.Monstrosity);

            Source.OwningCard.AddModifier(modifier1, p);
            Source.OwningCard.AddModifier(modifier2, p);
        }
Пример #11
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());
                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 AddSimpleAbility(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);
        }
Пример #12
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(dmg =>
                                            dmg.IsDealtByOwningCard &&
                                            dmg.IsDealtToPlayer));

                p.Effect = () => new CompoundEffect(
                    new TapTargets(),
                    new ApplyModifiersToTargets(() =>
                {
                    var modifier = new AddSimpleAbility(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 => trg.Message = "Select a creature to tap.");

                p.TargetingRule(new EffectGiveDoesNotUntap());
            }
                                           ));
        }
Пример #13
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Quiet Contemplation")
                         .ManaCost("{2}{U}")
                         .Type("Enchantment")
                         .Text(
                             "Whenever you cast a noncreature spell, you may pay {1}. If you do, tap target creature an opponent controls and it doesn't untap during its controller's next untap step.")
                         .FlavorText("Goblins, like snowflakes, are only dangerous in numbers.")
                         .Cast(p => p.TimingRule(new OnFirstMain()))
                         .TriggeredAbility(p =>
            {
                p.Text =
                    "Whenever you cast a noncreature spell, you may pay {1}. If you do, tap target creature an opponent controls and it doesn't untap during its controller's next untap step.";
                p.Trigger(new OnCastedSpell((c, ctx) =>
                                            c.Controller == ctx.You && !c.Is().Creature));

                p.Effect = () => new PayManaThen(1.Colorless(), new CompoundEffect(
                                                     new TapTargets(),
                                                     new ApplyModifiersToTargets(() =>
                {
                    var modifier = new AddSimpleAbility(Static.DoesNotUntap);

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

                    return modifier;
                })));

                p.TargetSelector.AddEffect(
                    trg => trg.Is.Card(c => c.Is().Creature, ControlledBy.Opponent).On.Battlefield(),
                    trg => trg.Message = "Select a creature to tap.");

                p.TargetingRule(new EffectGiveDoesNotUntap());

                p.TriggerOnlyIfOwningCardIsInPlay = true;
            }));
        }
Пример #14
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Frost Lynx")
                         .ManaCost("{2}{U}")
                         .Type("Creature - Elemental Cat")
                         .Text(
                             "When Frost Lynx enters the battlefield, tap target creature an opponent controls. That creature doesn't untap during its controller's next untap step.")
                         .FlavorText("It readily attacks much larger prey, knowing retaliation is impossible.")
                         .Power(2)
                         .Toughness(2)
                         .TriggeredAbility(p =>
            {
                p.Text =
                    "When Frost Lynx enters the battlefield, tap target creature an opponent controls. That creature doesn't untap during its controller's next untap step.";

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

                p.Effect = () => new CompoundEffect(
                    new TapTargets(),
                    new ApplyModifiersToTargets(() =>
                {
                    var modifier = new AddSimpleAbility(Static.DoesNotUntap);

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

                    return modifier;
                }));

                p.TargetSelector.AddEffect(
                    trg => trg.Is.Card(c => c.Is().Creature, ControlledBy.Opponent).On.Battlefield(),
                    trg => trg.Message = "Select a creature to tap.");

                p.TargetingRule(new EffectGiveDoesNotUntap());
            }));
        }
Пример #15
0
        public override IEnumerable <CardTemplate> GetCards()
        {
            yield return(Card
                         .Named("Nissa, Worldwaker")
                         .ManaCost("{3}{G}{G}")
                         .Type("Planeswalker Nissa")
                         .Text("{+1}: Target land you control becomes a 4/4 Elemental creature with trample. It's still a land.{EOL}" +
                               "{+1}: Untap up to four target Forests.{EOL}" +
                               "{-7}: Search your library for any number of basic land cards, put them onto the battlefield, then shuffle your library. Those lands become 4/4 Elemental creatures with trample. They're still lands.")
                         .Loyality(3)
                         .ActivatedAbility(p =>
            {
                p.Text = "{+1}: Target land you control becomes a 4/4 Elemental creature with trample. It's still a land.";
                p.Cost = new AddCountersCost(CounterType.Loyality, 1);

                p.Effect = () => new ApplyModifiersToTargets(
                    () => new ChangeToCreature(
                        power: 4,
                        toughness: 4,
                        colors: L(CardColor.Colorless),
                        type: t => t.Add(baseTypes: "creature", subTypes: "elemental")),
                    () => new AddSimpleAbility(Static.Trample));

                p.TargetSelector.AddEffect(trg => trg.Is.Card(c => c.Is().Land, ControlledBy.SpellOwner).On.Battlefield());
                p.TargetingRule(new EffectOrCostRankBy(c => c.Is().Creature || c.IsTapped ? 0 : -c.Score));

                p.TimingRule(new OnFirstMain());
                p.ActivateAsSorcery = true;
            })
                         .ActivatedAbility(p =>
            {
                p.Text = "{+1}: Untap up to four target Forests.";
                p.Cost = new AddCountersCost(CounterType.Loyality, 1);

                p.Effect = () => new UntapTargetPermanents();

                p.TargetSelector.AddEffect(
                    trg => trg.Is.Card(c => c.Is("forest")).On.Battlefield(),
                    trg =>
                {
                    trg.MinCount = 0;
                    trg.MaxCount = 4;
                });

                p.TargetingRule(new EffectUntapLand());

                p.TimingRule(new OnFirstMain());
                p.ActivateAsSorcery = true;
            })
                         .ActivatedAbility(p =>
            {
                p.Text = "{-7}: Search your library for any number of basic land cards, put them onto the battlefield, then shuffle your library. Those lands become 4/4 Elemental creatures with trample. They're still lands.";
                p.Cost = new RemoveCounters(CounterType.Loyality, 7);

                p.Effect = () => new SearchLibraryPutToZone(
                    zone: Zone.Battlefield,
                    minCount: 0,
                    maxCount: 100,
                    validator: (c, ctx) => c.Is().BasicLand,
                    text: "Search your library for any number of basic land cards.",
                    afterPutToZone: (c, ctx) =>
                {
                    var mp = new ModifierParameters
                    {
                        SourceEffect = ctx.Effect,
                        SourceCard = ctx.Effect.Source.OwningCard
                    };

                    var mod1 = new ChangeToCreature(
                        power: 4,
                        toughness: 4,
                        colors: L(CardColor.Colorless),
                        type: t => t.Add(baseTypes: "creature", subTypes: "elemental"));

                    var mod2 = new AddSimpleAbility(Static.Trample);

                    c.AddModifier(mod1, mp);
                    c.AddModifier(mod2, mp);
                });

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