Beispiel #1
0
            public TianYiPassiveSkill()
            {
                TianYiResult = false;
                var winTrigger = new AutoNotifyPassiveSkillTrigger(
                    this,
                    (p, e, a) => { return(p[TianYiUsed] == 1 && TianYiResult); },
                    (p, e, a) =>
                {
                    ShaEventArgs args = (ShaEventArgs)a;
                    Trace.Assert(args != null);
                    if (args.TargetApproval[0])
                    {
                        for (int i = 1; i < args.TargetApproval.Count; i++)
                        {
                            if (!args.TargetApproval[i])
                            {
                                args.TargetApproval[i] = true;
                                break;
                            }
                        }
                    }
                    for (int i = 0; i < args.RangeApproval.Count; i++)
                    {
                        args.RangeApproval[i] = true;
                    }
                },
                    TriggerCondition.OwnerIsSource
                    )
                {
                    AskForConfirmation = false, IsAutoNotify = false
                };

                Triggers.Add(Sha.PlayerShaTargetValidation, winTrigger);
            }
Beispiel #2
0
        public XueHen()
        {
            var trigger = new AutoNotifyPassiveSkillTrigger(
                this,
                (p, e, a) => { return(Owner[FenYong.FenYongStatus] == 1); },
                Run,
                TriggerCondition.Global
                )
            {
                IsAutoNotify = false
            };

            Triggers.Add(GameEvent.PhaseBeginEvents[TurnPhase.End], trigger);

            var trigger2 = new AutoNotifyPassiveSkillTrigger(
                this,
                (p, e, a) => { return(a.Card[XueHenSha] != 0); },
                (p, e, a) =>
            {
                ShaEventArgs args     = a as ShaEventArgs;
                args.RangeApproval[0] = true;
            },
                TriggerCondition.OwnerIsSource
                )
            {
                AskForConfirmation = false, IsAutoNotify = false
            };

            Triggers.Add(Sha.PlayerShaTargetValidation, trigger2);

            IsEnforced = true;
        }
Beispiel #3
0
            public LiHuoPassive()
            {
                var trigger = new AutoNotifyPassiveSkillTrigger(
                    this,
                    (p, e, a) => { return(a.Card.Type is HuoSha); },
                    (p, e, a) =>
                {
                    ShaEventArgs args = (ShaEventArgs)a;
                    Trace.Assert(args != null);
                    if (args.Source != Owner)
                    {
                        return;
                    }
                    if (args.TargetApproval[0])
                    {
                        for (int i = 1; i < args.TargetApproval.Count; i++)
                        {
                            if (!args.TargetApproval[i])
                            {
                                args.TargetApproval[i] = true;
                                break;
                            }
                        }
                    }
                },
                    TriggerCondition.OwnerIsSource
                    )
                {
                    AskForConfirmation = false, IsAutoNotify = false, Priority = SkillPriority.LiHuo
                };

                Triggers.Add(Sha.PlayerShaTargetValidation, trigger);
            }
Beispiel #4
0
        public ShenJi()
        {
            var trigger = new AutoNotifyPassiveSkillTrigger(
                this,
                (p, e, a) => { return(p.Weapon() == null); },
                (p, e, a) =>
            {
                ShaEventArgs args = (ShaEventArgs)a;
                if (args.TargetApproval[0] == false)
                {
                    return;
                }
                int moreTargetsToApprove = 2;
                int i = 1;
                while (moreTargetsToApprove > 0 && i < args.TargetApproval.Count)
                {
                    if (args.TargetApproval[i] == true)
                    {
                        i++;
                        continue;
                    }
                    args.TargetApproval[i] = true;
                    i++;
                    moreTargetsToApprove--;
                }
            },
                TriggerCondition.OwnerIsSource
                )
            {
                IsAutoNotify = false, AskForConfirmation = false, Priority = SkillPriority.ShenJi
            };

            Triggers.Add(Sha.PlayerShaTargetValidation, trigger);
            IsAutoInvoked = null;
        }
Beispiel #5
0
        public XiaoXi()
        {
            verifier = new Basic.Cards.DummyShaVerifier(null, new RegularSha(), XiaoXiSha);
            var trigger = new AutoNotifyPassiveSkillTrigger(
                this,
                (p, e, a) =>
            {
                return(true);
            },
                Run,
                TriggerCondition.OwnerIsSource
                )
            {
                AskForConfirmation = false, IsAutoNotify = false
            };

            var trigger2 = new AutoNotifyPassiveSkillTrigger(
                this,
                (p, e, a) => { return(a.Card[XiaoXiSha] != 0); },
                (p, e, a) =>
            {
                ShaEventArgs args     = a as ShaEventArgs;
                args.RangeApproval[0] = true;
            },
                TriggerCondition.OwnerIsSource
                )
            {
                AskForConfirmation = false, IsAutoNotify = false
            };

            Triggers.Add(GameEvent.HeroDebut, trigger);
            Triggers.Add(Sha.PlayerShaTargetValidation, trigger2);
            IsAutoInvoked = null;
        }
Beispiel #6
0
            public override void Run(GameEvent gameEvent, GameEventArgs eventArgs)
            {
                ShaEventArgs args = (ShaEventArgs)eventArgs;

                Trace.Assert(args != null);
                if (args.Source != Owner)
                {
                    return;
                }
                args.TargetApproval[0] = true;
            }
Beispiel #7
0
            public override void Run(GameEvent gameEvent, GameEventArgs eventArgs)
            {
                ShaEventArgs args = (ShaEventArgs)eventArgs;

                Trace.Assert(args != null);
                if (args.Source != Owner)
                {
                    return;
                }
                for (int i = 0; i < args.RangeApproval.Count; i++)
                {
                    args.RangeApproval[i] = true;
                }
            }
Beispiel #8
0
            public MiZhaoPassiveSkill()
            {
                var trigger = new AutoNotifyPassiveSkillTrigger(
                    this,
                    (p, e, a) => { return(a.Card[MiZhaoSha] != 0); },
                    (p, e, a) =>
                {
                    ShaEventArgs args     = a as ShaEventArgs;
                    args.RangeApproval[0] = true;
                },
                    TriggerCondition.Global
                    )
                {
                    AskForConfirmation = false, IsAutoNotify = false
                };

                Triggers.Add(Sha.PlayerShaTargetValidation, trigger);
            }
Beispiel #9
0
        public ShenSu()
        {
            verifier = new Basic.Cards.DummyShaVerifier(null, new RegularSha(), ShenSuSha);
            var trigger = new AutoNotifyPassiveSkillTrigger(
                this,
                (p, e, a) =>
            {
                if (e == GameEvent.PhaseOutEvents[TurnPhase.Start])
                {
                    return(!Game.CurrentGame.PhasesSkipped.Contains(TurnPhase.Judge) || !Game.CurrentGame.PhasesSkipped.Contains(TurnPhase.Draw));
                }
                else
                {
                    return(!Game.CurrentGame.PhasesSkipped.Contains(TurnPhase.Play));
                }
            },
                Run,
                TriggerCondition.OwnerIsSource
                )
            {
                AskForConfirmation = false, IsAutoNotify = false
            };

            var trigger2 = new AutoNotifyPassiveSkillTrigger(
                this,
                (p, e, a) => { return(a.Card[ShenSuSha] != 0); },
                (p, e, a) =>
            {
                ShaEventArgs args     = a as ShaEventArgs;
                args.RangeApproval[0] = true;
            },
                TriggerCondition.OwnerIsSource
                )
            {
                AskForConfirmation = false, IsAutoNotify = false
            };

            Triggers.Add(GameEvent.PhaseOutEvents[TurnPhase.Start], trigger);
            Triggers.Add(GameEvent.PhaseOutEvents[TurnPhase.Draw], trigger);
            Triggers.Add(Sha.PlayerShaTargetValidation, trigger2);
            IsAutoInvoked = null;
        }