Ejemplo n.º 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;
            }));
        }
Ejemplo n.º 2
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());
            }));
        }
Ejemplo n.º 3
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));
            }));
        }
Ejemplo n.º 4
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;
            }));
        }
Ejemplo n.º 5
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;
                });
            }));
        }
Ejemplo n.º 6
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));
            }));
        }
Ejemplo n.º 7
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());
            }));
        }
Ejemplo n.º 8
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;
            }));
        }
Ejemplo n.º 9
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);
        }
Ejemplo n.º 10
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());
            }
                                           ));
        }
Ejemplo n.º 11
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;
            }));
        }
Ejemplo n.º 12
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());
            }));
        }