当前位置: 首页>>代码示例>>C#>>正文


C# AutoNotifyPassiveSkillTrigger类代码示例

本文整理汇总了C#中AutoNotifyPassiveSkillTrigger的典型用法代码示例。如果您正苦于以下问题:C# AutoNotifyPassiveSkillTrigger类的具体用法?C# AutoNotifyPassiveSkillTrigger怎么用?C# AutoNotifyPassiveSkillTrigger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AutoNotifyPassiveSkillTrigger类属于命名空间,在下文中一共展示了AutoNotifyPassiveSkillTrigger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: KuangFeng

 public KuangFeng()
 {
     kuangfengTarget = null;
     var trigger = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) => { kuangfengTarget = null; },
         TriggerCondition.OwnerIsSource
     ) { AskForConfirmation = false, IsAutoNotify = false };
     var trigger2 = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) => { return Game.CurrentGame.Decks[Owner, QiXing.QiXingDeck].Count > 0; },
         Run,
         TriggerCondition.OwnerIsSource
     ) { IsAutoNotify = false };
     var trigger3 = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) =>
         {
             var args = a as DamageEventArgs;
             return (DamageElement)args.Element == DamageElement.Fire && kuangfengTarget == args.Targets[0];
         },
         (p, e, a) =>
         {
             var args = a as DamageEventArgs;
             args.Magnitude++;
         },
         TriggerCondition.Global
     ) { AskForConfirmation = false };
     Triggers.Add(GameEvent.PhaseBeginEvents[TurnPhase.Start], trigger);
     Triggers.Add(GameEvent.PhaseBeginEvents[TurnPhase.End], trigger2);
     Triggers.Add(GameEvent.DamageInflicted, trigger3);
     IsAutoInvoked = false;
 }
开发者ID:maplegh,项目名称:sgs,代码行数:33,代码来源:KuangFeng.cs

示例2: DaWu

 public DaWu()
 {
     dawuTargets = new List<Player>();
     var trigger = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) => { foreach (var mark in dawuTargets) { mark[DaWuMark] = 0; } dawuTargets.Clear(); },
         TriggerCondition.OwnerIsSource
     ) { AskForConfirmation = false, IsAutoNotify = false };
     var trigger2 = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) => { return Game.CurrentGame.Decks[Owner, QiXing.QiXingDeck].Count > 0; },
         Run,
         TriggerCondition.OwnerIsSource
     ) { IsAutoNotify = false };
     var trigger3 = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) =>
         {
             var args = a as DamageEventArgs;
             return (DamageElement)args.Element != DamageElement.Lightning && dawuTargets.Contains(args.Targets[0]);
         },
         (p, e, a) =>
         {
             throw new TriggerResultException(TriggerResult.End);
         },
         TriggerCondition.Global
     ) { AskForConfirmation = false };
     Triggers.Add(GameEvent.PhaseBeginEvents[TurnPhase.Start], trigger);
     Triggers.Add(GameEvent.PhaseBeginEvents[TurnPhase.End], trigger2);
     Triggers.Add(GameEvent.DamageInflicted, trigger3);
     IsAutoInvoked = false;
 }
开发者ID:pxoylngx,项目名称:sgs,代码行数:32,代码来源:DaWu.cs

示例3: ZuiXiang

 public ZuiXiang()
 {
     var trigger = new AutoNotifyPassiveSkillTrigger(
         this,
         Run,
         TriggerCondition.OwnerIsSource
     ) { AskForConfirmation = false, IsAutoNotify = false };
     var trigger2 = new AutoNotifyPassiveSkillTrigger(
         this,
         CardUseStopper,
         TriggerCondition.OwnerIsSource
     ) { AskForConfirmation = false, IsAutoNotify = false };
     var trigger3 = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) => { return a.ReadonlyCard != null; },
         CardEffectStopper,
         TriggerCondition.OwnerIsTarget
     ) { AskForConfirmation = false, IsAutoNotify = false };
     Triggers.Add(GameEvent.PhaseBeginEvents[TurnPhase.Start], trigger);
     Triggers.Add(GameEvent.PlayerCanUseCard, trigger2);
     Triggers.Add(GameEvent.PlayerCanPlayCard, trigger2);
     Triggers.Add(GameEvent.CardUsageTargetValidating, trigger3);
     IsSingleUse = true;
     DeckCleanup.Add(zxDeck);
 }
开发者ID:shonwang,项目名称:sgs,代码行数:25,代码来源:ZuiXiang.cs

示例4: TengJiaSkill

 public TengJiaSkill()
 {
     var trigger = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) => { return a.ReadonlyCard != null && ((a.ReadonlyCard.Type is Aoe) || (a.ReadonlyCard.Type is RegularSha)) && a.ReadonlyCard[Armor.IgnoreAllArmor] == 0 && a.ReadonlyCard[Armor.IgnorePlayerArmor] != Owner.Id + 1; },
         (p, e, a) => { throw new TriggerResultException(TriggerResult.End); },
         TriggerCondition.OwnerIsTarget
     );
     var trigger2 = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) =>
         {
             var args = a as DamageEventArgs;
             return (DamageElement)args.Element == DamageElement.Fire && a.ReadonlyCard[Armor.IgnoreAllArmor] == 0 && a.ReadonlyCard[Armor.IgnorePlayerArmor] != Owner.Id + 1;
         },
         (p, e, a) =>
         {
             var args = a as DamageEventArgs;
             args.Magnitude++;
         },
         TriggerCondition.OwnerIsTarget
     );
     Triggers.Add(GameEvent.CardUsageTargetValidating, trigger);
     Triggers.Add(GameEvent.DamageInflicted, trigger2);
 }
开发者ID:kissgoodbye,项目名称:sgs,代码行数:25,代码来源:TengJia.cs

示例5: RulerGivenSkillContainerSkill

 public RulerGivenSkillContainerSkill(IRulerGivenSkill InnerSkill, Allegiance al)
 {
     innerSkillType = InnerSkill.GetType();
     Allegiance = al;
     masterList = new Dictionary<Player, IRulerGivenSkill>();
     var trigger = new AutoNotifyPassiveSkillTrigger(
         this,
         DistributeSkills,
         TriggerCondition.OwnerIsSource
     ) { IsAutoNotify = false, AskForConfirmation = false };
     var trigger2 = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) =>
         {
             if (a.Source.Allegiance == Allegiance && !masterList.ContainsKey(a.Source))
             {
                 DistributeSkills(Owner, null, null);
             }
             if (a.Source.Allegiance != Allegiance && masterList.ContainsKey(a.Source))
             {
                 ISkill skill = masterList[a.Source];
                 masterList.Remove(a.Source);
                 Game.CurrentGame.PlayerLoseAdditionalSkill(a.Source, skill, true);
             }
         },
         TriggerCondition.Global
     ) { IsAutoNotify = false, AskForConfirmation = false };
     Triggers.Add(GameEvent.PlayerGameStartAction, trigger);
     Triggers.Add(GameEvent.PlayerChangedAllegiance, trigger2);
     IsAutoInvoked = null;
     IsRulerOnly = true;
 }
开发者ID:kingling,项目名称:sgs,代码行数:32,代码来源:RulerGivenSkillContainerSkill.cs

示例6: ZiLi

 public ZiLi()
 {
     var trigger = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) => { return p[ZiLiAwakened] == 0 && Game.CurrentGame.Decks[p, QuanJi.QuanDeck].Count >= 3; },
         (p, e, a) =>
         {
             p[ZiLiAwakened] = 1;
             Game.CurrentGame.LoseMaxHealth(p, 1);
             int answer = 0;
             Owner.AskForMultipleChoice(
                     new MultipleChoicePrompt("ZiLi"),
                     new List<OptionPrompt>() { new OptionPrompt("ZiLiRecover"), new OptionPrompt("ZiLiDraw") },
                     out answer);
             if (answer == 0)
             {
                 Game.CurrentGame.RecoverHealth(Owner, Owner, 1);
             }
             else
             {
                 Game.CurrentGame.DrawCards(Owner, 2);
             }
             Game.CurrentGame.PlayerAcquireAdditionalSkill(Owner, new PaiYi(), HeroTag);
         },
         TriggerCondition.OwnerIsSource
     );
     Triggers.Add(GameEvent.PhaseBeginEvents[TurnPhase.Start], trigger);
     IsAwakening = true;
 }
开发者ID:kingling,项目名称:sgs,代码行数:29,代码来源:ZiLi.cs

示例7: BengHuai

 public BengHuai()
 {
     var trigger = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) =>
         {
             int minHp = int.MaxValue;
             foreach (Player pl in Game.CurrentGame.AlivePlayers)
             {
                 if (pl.Health < minHp) minHp = pl.Health;
             }
             return p.Health > minHp;
         },
         (p, e, a) =>
         {
             int answer = 0;
             Game.CurrentGame.UiProxies[p].AskForMultipleChoice(new MultipleChoicePrompt("BengHuai"), new List<string>() { "TiLiZhi", "TiLiShangXian" }, out answer);
             if (answer == 0)
             {
                 Game.CurrentGame.LoseHealth(p, 1);
             }
             else
             {
                 Game.CurrentGame.LoseMaxHealth(p, 1);
             }
         },
         TriggerCondition.OwnerIsSource
     );
     Triggers.Add(GameEvent.PhaseBeginEvents[TurnPhase.End], trigger);
     IsEnforced = true;
 }
开发者ID:maplegh,项目名称:sgs,代码行数:31,代码来源:BengHuai.cs

示例8: ZhuGeLianNuSkill

 public ZhuGeLianNuSkill()
 {
     var trigger = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) =>
         {
             return a.Source[Sha.NumberOfShaUsed] > 0 &&  a.Card.Type is Sha;
         },
         (p, e, a) => { },
         TriggerCondition.OwnerIsSource
     );
     var trigger2 = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) => { throw new TriggerResultException(TriggerResult.Success); },
         TriggerCondition.OwnerIsSource
     ) { IsAutoNotify = false };
     var trigger3 = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) =>
         {
             ShaEventArgs args = (ShaEventArgs)a;
             args.TargetApproval[0] = true;
         },
         TriggerCondition.OwnerIsSource
     ) { IsAutoNotify = false, Priority = int.MaxValue, Type = TriggerType.Skill };
     Triggers.Add(GameEvent.PlayerUsedCard, trigger);
     Triggers.Add(Sha.PlayerNumberOfShaCheck, trigger2);
     Triggers.Add(Sha.PlayerShaTargetValidation, trigger3);
     IsEnforced = true;
 }
开发者ID:maplegh,项目名称:sgs,代码行数:30,代码来源:ZhuGeLianNu.cs

示例9: WeiMu

        public WeiMu()
        {
            Triggers.Add(GameEvent.PlayerCanBeTargeted, new RelayTrigger(
                (p, e, a) =>
                {
                    return CardCategoryManager.IsCardCategory(a.Card.Type.Category, CardCategory.Tool) && a.Card.SuitColor == SuitColorType.Black;
                },
                (p, e, a) =>
                {
                    if (a.Card.Place.DeckType == DeckType.DelayedTools)
                    {
                        NotifySkillUse();
                    }
                    throw new TriggerResultException(TriggerResult.Fail);
                },
                TriggerCondition.OwnerIsTarget
                ));

            var notify = new AutoNotifyPassiveSkillTrigger(
                 this,
                 (p, e, a) => { return a.Source != p && a.ReadonlyCard.Type is Aoe && a.ReadonlyCard.SuitColor == SuitColorType.Black; },
                 (p, e, a) => { },
                 TriggerCondition.Global
             );
            Triggers.Add(GameEvent.PlayerUsedCard, notify);
            IsEnforced = true;
        }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:27,代码来源:WeiMu.cs

示例10: LieGong

        public LieGong()
        {
            var trigger = new AutoNotifyPassiveSkillTrigger(
                this,
                (p, e, a) => { return (a.ReadonlyCard.Type is Sha) && Game.CurrentGame.CurrentPhase == TurnPhase.Play; },
                (p, e, a) =>
                {
                    Dictionary<Player, int> map = new Dictionary<Player, int>();
                    foreach (var target in a.Targets)
                    {
                        if (!map.Keys.Contains(target)) map.Add(target, 0);
                        if ((Game.CurrentGame.Decks[target, DeckType.Hand].Count >= a.Source.Health || Game.CurrentGame.Decks[target, DeckType.Hand].Count <= a.Source[Player.AttackRange] + 1)
                         && AskForSkillUse())
                        {
                            a.ReadonlyCard[ShaCancelling.CannotProvideShan[target]] |= (1 << map[target]);
                            NotifySkillUse(new List<Player>() { target });
                        }
                        map[target]++;
                    }
                },
                TriggerCondition.OwnerIsSource
            ) { IsAutoNotify = false, AskForConfirmation = false };

            Triggers.Add(GameEvent.CardUsageTargetConfirmed, trigger);
            IsAutoInvoked = true;
        }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:26,代码来源:LieGong.cs

示例11: FangQuan

 public FangQuan()
 {
     var trigger = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) =>
         {
             return !Game.CurrentGame.PhasesSkipped.Contains(TurnPhase.Play);
         },
         (p, e, a) =>
         {
             p[FangQuanUsed] = 1;
             Game.CurrentGame.PhasesSkipped.Add(TurnPhase.Play);
         },
         TriggerCondition.OwnerIsSource
     );
     var trigger2 = new AutoNotifyUsagePassiveSkillTrigger(
         this,
         (p, e, a) => { return p[FangQuanUsed] == 1; },
         (p, e, a, cards, players) =>
         {
             Game.CurrentGame.HandleCardDiscard(a.Source, cards);
             Game.CurrentGame.RegisterTrigger(GameEvent.PhasePostEnd, new FangQuanTrigger(Owner, players[0]));
         },
         TriggerCondition.OwnerIsSource,
         new FangQuanVerifier()
     ) { AskForConfirmation = false };
     Triggers.Add(GameEvent.PhaseOutEvents[TurnPhase.Draw], trigger);
     Triggers.Add(GameEvent.PhaseProceedEvents[TurnPhase.End], trigger2);
 }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:29,代码来源:FangQuan.cs

示例12: GuZheng

 public GuZheng()
 {
     GuZhengCards = new List<Card>();
     var trigger = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) => { return Game.CurrentGame.CurrentPlayer != p && Game.CurrentGame.CurrentPhase == TurnPhase.Discard; },
         (p, e, a) => { GuZhengCards.AddRange(a.Cards); },
         TriggerCondition.Global
     ) { IsAutoNotify = false, AskForConfirmation = false };
     var trigger2 = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) => { return GuZhengCards.Count > 0 && Game.CurrentGame.CurrentPlayer != p; },
         Run,
         TriggerCondition.Global
     ) { Priority = 1 };
     var trigger3 = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) => { GuZhengCards = new List<Card>(); },
         TriggerCondition.Global
     ) { Priority = 0, AskForConfirmation = false, IsAutoNotify = false };
     Triggers.Add(GameEvent.CardsEnteredDiscardDeck, trigger);
     Triggers.Add(GameEvent.PhaseEndEvents[TurnPhase.Discard], trigger2);
     Triggers.Add(GameEvent.PhasePostEnd, trigger3);
     IsAutoInvoked = null;
 }
开发者ID:maplegh,项目名称:sgs,代码行数:25,代码来源:GuZheng.cs

示例13: WeiDi

        public WeiDi()
        {
            var trigger = new AutoNotifyPassiveSkillTrigger(
                this,
                (p, e, a) => { return a.Source == ruler; },
                (p, e, a) =>
                {
                    bool canInvoke = true;
                    if (e == GameEvent.PlayerSkillSetChanged)
                    {
                        SkillSetChangedEventArgs arg = a as SkillSetChangedEventArgs;
                        canInvoke = arg.Skills.Any(sk => sk.IsRulerOnly);
                    }
                    if (canInvoke)
                    {
                        UninstallSkills();
                        InstallSkills(p, ruler);
                    }
                },
                TriggerCondition.Global
            ) { AskForConfirmation = false, IsAutoNotify = false };
            Triggers.Add(GameEvent.PlayerSkillSetChanged, trigger);
            Triggers.Add(GameEvent.PlayerChangedHero, trigger);

            IsEnforced = true;
            ruler = null;
            theSkills = new Dictionary<ISkill, ISkill>();
        }
开发者ID:kingling,项目名称:sgs,代码行数:28,代码来源:WeiDi.cs

示例14: WuJi

        public WuJi()
        {
            var trigger1 = new AutoNotifyPassiveSkillTrigger(
                this,
                (p, e, a) => { return p[WuJiAwaken] == 0; },
                (p, e, a) => { p[WuJiCount] += (a as DamageEventArgs).Magnitude; },
                TriggerCondition.OwnerIsSource
            ) { IsAutoNotify = false };
            Triggers.Add(GameEvent.AfterDamageCaused, trigger1);

            var trigger2 = new AutoNotifyPassiveSkillTrigger(
                this,
                (p, e, a) => { return p[WuJiCount] >= 3 && p[WuJiAwaken] == 0; },
                (p, e, a) =>
                {
                    p[WuJiAwaken]++;
                    p.MaxHealth++;
                    Game.CurrentGame.RecoverHealth(p, p, 1);
                    ISkill huxiao = p.LoseHeroSkill("HuXiao", HeroTag);
                    Trace.Assert(huxiao != null);
                    Game.CurrentGame.NotificationProxy.NotifyLogEvent(new LogEvent("WuJi", Owner, huxiao), new List<Player>() { Owner });
                },
                TriggerCondition.OwnerIsSource
            );
            Triggers.Add(GameEvent.PhaseBeginEvents[TurnPhase.End], trigger2);
            IsAwakening = true;
        }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:27,代码来源:WuJi.cs

示例15: DuanChang

        public DuanChang()
        {
            var trigger = new AutoNotifyPassiveSkillTrigger(
                this,
                (p, e, a) => { return a.Source != null; },
                (p, e, a) =>
                {
                    var h = a.Source.Hero;
                    foreach (ISkill sk in new List<ISkill>(a.Source.AdditionalSkills))
                    {
                        Game.CurrentGame.PlayerLoseSkill(a.Source, sk);
                    }

                    SkillSetChangedEventArgs args = new SkillSetChangedEventArgs();
                    args.Source = a.Source;
                    args.IsLosingSkill = true;
                    foreach (var sk in a.Source.Hero.Skills)
                    {
                        sk.Owner = null;
                        args.Skills.Clear();
                        args.Skills.Add(sk);
                        Game.CurrentGame.Emit(GameEvent.PlayerSkillSetChanged, args);
                    }
                    a.Source.Hero = new Hero(h.Name, h.IsMale, h.Allegiance, h.MaxHealth, new List<ISkill>());
                    a.Source[DuanChangStatus] = 1;
                },
                TriggerCondition.OwnerIsTarget
            );

            Triggers.Add(GameEvent.PlayerIsDead, trigger);
            IsEnforced = true;
        }
开发者ID:h1398123,项目名称:sgs,代码行数:32,代码来源:DuanChang.cs


注:本文中的AutoNotifyPassiveSkillTrigger类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。