コード例 #1
0
        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);
        }
コード例 #2
0
        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 void ProcessResults(ChosenOptions results)
        {
            var option = (EffectOption)results.Options[0];

            if (option == EffectOption.SacrificeACreature)
            {
                Enqueue(new SelectCards(
                            Controller.Opponent,
                            p =>
                {
                    p.SetValidator(card => card.Is().Creature);
                    p.Zone                   = Zone.Battlefield;
                    p.Text                   = "Select a creature to sacrifice.";
                    p.OwningCard             = Source.OwningCard;
                    p.ProcessDecisionResults = this;
                    p.ChooseDecisionResults  = this;
                    p.MinCount               = 1;
                    p.MaxCount               = 1;
                }));
                return;
            }

            if (option == EffectOption.OpponentDrawsACard)
            {
                Controller.DrawCard();
                return;
            }

            Controller.Opponent.Life -= _lifeAmount;
        }
コード例 #4
0
        public override void ProcessResults(ChosenOptions results)
        {
            var permanents = Target.Player().Battlefield.Where(Selectors[(EffectOption)results.Options[1]]);

            foreach (var permanent in permanents)
            {
                Actions[(EffectOption)results.Options[0]](permanent);
            }
        }
コード例 #5
0
        public override void ProcessResults(ChosenOptions results)
        {
            var color = ChoiceToColorMap.Single(x => x.Choice.Equals(results.Options[0])).Color;

            var cardsToDiscard = Target.Player().Hand.Where(
                x => x.HasColor(color)).ToList();

            foreach (var card in cardsToDiscard)
            {
                Target.Player().DiscardCard(card);
            }
        }
コード例 #6
0
        public override void ProcessResults(ChosenOptions results)
        {
            var color = ChoiceToColorMap.Single(x => x.Choice.Equals(results.Options[0])).Color;

            var modifier = new AddProtectionFromColors(color)
            {
                UntilEot = true
            };

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

            Target.Card().AddModifier(modifier, parameters);
        }
コード例 #7
0
ファイル: PayLifeAddCounters.cs プロジェクト: longde123/grove
        public override void ProcessResults(ChosenOptions results)
        {
            var lifeToPay = (int)results.Options[0];

            Controller.Life -= lifeToPay;

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

            var addCounters = new AddCounters(() => new SimpleCounter(_counterType), lifeToPay);

            Source.OwningCard.AddModifier(addCounters, p);
        }
コード例 #8
0
        public override void ProcessResults(ChosenOptions results)
        {
            var ability = (Static)Enum.Parse(
                typeof(Static),
                (string)results.Options[0]);

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

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

            Target.Card().AddModifier(modifier, mp);
        }
コード例 #9
0
        public override void ProcessResults(ChosenOptions results)
        {
            Func<Card, bool> filter;

              if (results.Options[0].Equals(EffectOption.Lands))
              {
            filter = c => c.Is().Land;
              }
              else
              {
            filter = c => c.Is().Creature;
              }

              var permanents = Players.Permanents().Where(filter).ToList();

              foreach (var permanent in permanents)
              {
            permanent.Destroy(allowToRegenerate: false);
              }
        }
コード例 #10
0
        public override void ProcessResults(ChosenOptions results)
        {
            var color = ChoiceToColorMap.Single(x => x.Choice.Equals(results.Options[0])).Color;

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

            foreach (var target in ValidEffectTargets)
            {
                var prevention = new PreventDamageToTarget(target, sourceSelector: (c, ctx) => c.HasColor(color));
                var modifier   = new AddDamagePrevention(prevention)
                {
                    UntilEot = true
                };
                Game.AddModifier(modifier, mp);
            }
        }
コード例 #11
0
        public override void ProcessResults(ChosenOptions results)
        {
            Func <Card, bool> filter;

            if (results.Options[0].Equals(EffectOption.Lands))
            {
                filter = c => c.Is().Land;
            }
            else
            {
                filter = c => c.Is().Creature;
            }

            var permanents = Players.Permanents().Where(filter).ToList();

            foreach (var permanent in permanents)
            {
                permanent.Destroy(allowToRegenerate: false);
            }
        }
コード例 #12
0
        public override void ProcessResults(ChosenOptions results)
        {
            var chosenType = (string)results.Options[0];

            var costModifier = new SpellCostModifier(_amount,
                                                     (card, self) => card.Is().Creature&& card.Is(chosenType));

            var addCostModifier = new AddCostModifier(costModifier);

            addCostModifier.AddLifetime(new PermanentLeavesBattlefieldLifetime(
                                            self => self.Modifier.SourceCard
                                            ));

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

            Game.AddModifier(addCostModifier, mp);
        }
コード例 #13
0
        public override void ProcessResults(ChosenOptions results)
        {
            var chosenType = (string)results.Options[0];

            var cp = new ContinuousEffectParameters
            {
                Modifier   = () => new AddPowerAndToughness(-1, -1),
                CardFilter = (card, effect) => card.Is().Creature&& card.Is(chosenType)
            };

            var modifier = new AddContiniousEffect(
                new ContinuousEffect(cp));


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

            Source.OwningCard.AddModifier(modifier, mp);
        }