public P_ManTiienKuoHai() : base(CardName)
 {
     Point = 1;
     Index = 1;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 170,
                 Condition = PTrigger.Initiative(Player),
                 AICondition = (PGame Game) => {
                     if (Player.General is P_WuZhao && Player.RemainLimit(PSkillInfo.女权.Name))
                     {
                         return false;
                     }
                     return AIEmitTargets(Game, Player)[0] != null && !Player.OutOfGame && P_PanYue.XianJuTest(Game, Player);
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets,
                                           PTrigger.Except(Player),
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     Game.Injure(User, Target, Game.Judge(User, 6) * 200, Card);
                 })
             });
         });
     }
 }
Exemple #2
0
 public P_TiaoHuLiShan() : base(CardName)
 {
     Point = 3;
     Index = 15;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 170,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime());
                 },
                 AICondition = (PGame Game) => {
                     return AIEmitTargets(Game, Player)[0] != null;
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets,
                                           PTrigger.Except(Player),
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     Target.Tags.CreateTag(PTag.OutOfGameTag);
                 })
             });
         });
     }
 }
Exemple #3
0
        private string GenerateCallback(PTrigger trigger)
        {
            var callbackBuilder = new IndentStringBuilder();

            string declareName = trigger.EventInfo.DeclaringType.GetAttribute <WPFAttribute>().Name;

            ParameterInfo[] infos = trigger.EventInfo.GetParameters();

            callbackBuilder.Append($"private async void {CallbackContainer[trigger]}(");

            for (int i = 0; i < infos.Length; i++)
            {
                string paramName = infos[i].Name;

                if (paramName == "sender")
                {
                    paramName = "oSender";
                }

                callbackBuilder.Append(infos[i].ParameterType.Name);
                callbackBuilder.Append(" ");
                callbackBuilder.Append(paramName);

                if (i < infos.Length - 1)
                {
                    callbackBuilder.Append(", ");
                }
            }

            callbackBuilder.AppendLine(")");

            // Ex: private void Button_Click(object oSender, EventArgs)

            callbackBuilder.AppendLine("{");
            //callbackBuilder.AppendLine("try", 1);
            //callbackBuilder.AppendLine("{", 1);

            callbackBuilder.AppendLine($"var sender = oSender as {declareName};", 1);
            callbackBuilder.AppendLine();
            callbackBuilder.AppendLine("{Code}");

            //callbackBuilder.AppendLine("}", 1);
            //callbackBuilder.AppendLine("catch (Exception ex)", 1);
            //callbackBuilder.AppendLine("{", 1);
            //callbackBuilder.AppendLine("MessageBox.Show(ex.ToString());", 1);
            //callbackBuilder.AppendLine("}", 1);
            callbackBuilder.Append("}");

            /*
             * Ex: private void Button_Click(object oSender, EventArgs)
             *  {
             *      var sender = oSender as {SenderType};
             *  {Code:1}
             *  }
             */

            return(callbackBuilder.ToString());
        }
 public P_HsiaoLiTsaangTao() : base(CardName)
 {
     Point = 2;
     Index = 10;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 145,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Player.Area.HandCardArea.CardList.Exists((PCard _Card) => _Card.Type.IsEquipment());
                 },
                 AICondition = (PGame Game) => {
                     if (Player.General is P_WuZhao && Player.RemainLimit(PSkillInfo.女权.Name))
                     {
                         return false;
                     }
                     return AIEmitTargets(Game, Player)[0] != null && P_PanYue.XianJuTest(Game, Player);
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, PTrigger.Except(Player),
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     PCard TargetCard = null;
                     if (User.IsAI)
                     {
                         if (User.TeamIndex == Target.TeamIndex)
                         {
                             TargetCard = TeammateValueCard(Game, User, Target).Key;
                         }
                         else
                         {
                             TargetCard = EnemyValueCard(Game, User, Target).Key;
                         }
                     }
                     else
                     {
                         do
                         {
                             TargetCard = PNetworkManager.NetworkServer.ChooseManager.AskToChooseOwnCard(User, CardName + "[选择一张手牌中的装备牌]", true, false);
                         } while (!TargetCard.Type.IsEquipment());
                     }
                     if (TargetCard != null)
                     {
                         Game.CardManager.MoveCard(TargetCard, User.Area.HandCardArea, Target.Area.EquipmentCardArea);
                         Game.Injure(User, Target, 500 * Target.Area.EquipmentCardArea.CardNumber, Card);
                     }
                 })
             });
         });
     }
 }
Exemple #5
0
    //what to do when trigger triggered xD
    public IEnumerator Talk(bool isPlayer, PTrigger pTrigger)
    {
        var phrases = isPlayer ? this.phrases.phrasesToPlayer : this.phrases.phrasesPatrol;

        soliderAnswer[0].text = soliderAnswer[1].text = GetPhrase(phrases);

        yield return(pTrigger()); //wait

        ClearText();
    }
Exemple #6
0
 public P_KevAnKuanHuo() : base(CardName)
 {
     Point = 2;
     Index = 9;
     foreach (PTime Time in new PTime[] {
         PTime.Card.AfterBecomeTargetTime
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 100,
                 Condition = (PGame Game) => {
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     return UseCardTag.TargetList.Count >= 2 && UseCardTag.TargetList.Contains(Player) && UseCardTag.Card.Type.Equals(PCardType.SchemeCard);
                 },
                 Effect = (PGame Game) => {
                     List <PPlayer> Targets = new List <PPlayer>();
                     Game.Monitor.CallTime(PTime.Card.AfterEmitTargetTime, new PUseCardTag(Card, Player, Targets));
                     Game.CardManager.MoveCard(Card, Player.Area.HandCardArea, Game.CardManager.SettlingArea);
                     Game.Monitor.CallTime(PTime.Card.AfterBecomeTargetTime, new PUseCardTag(Card, Player, Targets));
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     #region 成就:不辞劳苦
                     if (UseCardTag.Card.Model is P_IITaiLao)
                     {
                         PArch.Announce(Game, Player, "不辞劳苦");
                     }
                     #endregion
                     UseCardTag.TargetList.Remove(Player);
                     PTrigger GetMoneyTrigger = null;
                     GetMoneyTrigger = new PTrigger(CardName + "[摸500]")
                     {
                         IsLocked = true,
                         Player = Player,
                         Time = PTime.Card.EndSettleTime,
                         Condition = (PGame _Game) => {
                             PUseCardTag _UseCardTag = _Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                             return _UseCardTag.Card.Equals(UseCardTag.Card);
                         },
                         Effect = (PGame _Game) => {
                             _Game.GetMoney(Player, 500);
                             Game.Monitor.RemoveTrigger(GetMoneyTrigger);
                         }
                     };
                     Game.Monitor.AddTrigger(GetMoneyTrigger);
                     Game.CardManager.MoveCard(Card, Game.CardManager.SettlingArea, Game.CardManager.ThrownCardHeap);
                     Game.Monitor.CallTime(PTime.Card.EndSettleTime, new PUseCardTag(Card, Player, Targets));
                 }
             });
         });
     }
 }
Exemple #7
0
 public P_ShangWuChoouTii() : base(CardName)
 {
     Point = 5;
     Index = 28;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 105,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Game.PlayerList.Exists((PPlayer _Player) => !_Player.Equals(Player) && _Player.Distance(Player) <= 3);
                 },
                 AICondition = (PGame Game) => {
                     return AIEmitTargets(Game, Player)[0] != null;
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, (PGame Game, PPlayer _Player) => !_Player.Equals(Player) && _Player.Distance(Player) <= 3,
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     Target.Tags.CreateTag(PTag.NoLadderTag);
                     PTrigger StepZero = null;
                     StepZero = new PTrigger(CardName + "[步数变为0]")
                     {
                         IsLocked = true,
                         Player = null,
                         Time = PPeriod.WalkingStage.Start,
                         Condition = (PGame _Game) => {
                             return Target.Equals(_Game.NowPlayer);
                         },
                         Effect = (PGame _Game) => {
                             Target.Tags.PopTag <PTag>(PTag.NoLadderTag.Name);
                             PNetworkManager.NetworkServer.TellClients(new PPushTextOrder(Target.Index.ToString(), CardName + "效果触发", PPushType.Information.Name));
                             _Game.TagManager.FindPeekTag <PStepCountTag>(PStepCountTag.TagName).StepCount = 0;
                             _Game.Monitor.RemoveTrigger(StepZero);
                         }
                     };
                     Game.Monitor.AddTrigger(StepZero);
                     #region 成就:留客
                     if (User.Equals(Target.Position.Lord) && Target.Position.BusinessType.Equals(PBusinessType.ShoppingCenter))
                     {
                         PArch.Announce(Game, User, "留客");
                     }
                     #endregion
                 })
             });
         });
     }
 }
Exemple #8
0
    public P_Temujin() : base("铁木真")
    {
        Sex   = PSex.Male;
        Age   = PAge.Renaissance;
        Index = 11;
        Cost  = 20;
        Tips  = "定位:控制\n" +
                "难度:简单\n" +
                "史实:大蒙古国可汗,杰出的军事家、政治家,统一了蒙古诸部,开疆拓土,远至东欧,被尊为“成吉思汗”。\n" +
                "攻略:\n铁木真是一个新手推荐武将,基本上使用没有任何难度。";

        PSkill QiangLve = new PSkill("抢掠")
        {
            SoftLockOpen = true
        };

        SkillList.Add(QiangLve
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(QiangLve.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = PTime.Injure.EmitInjure,
                AIPriority = 15,
                Condition = (PGame Game) => {
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    return InjureTag.Injure > 0 && InjureTag.ToPlayer != null && Player.Equals(InjureTag.FromPlayer) &&
                    InjureTag.InjureSource is PBlock && !Player.Equals(InjureTag.ToPlayer) && InjureTag.ToPlayer.Area.HandCardArea.CardNumber + InjureTag.ToPlayer.Area.EquipmentCardArea.CardNumber > 0;
                },
                AICondition = (PGame Game) => {
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    return InjureTag.ToPlayer.TeamIndex != Player.TeamIndex;
                },
                Effect = (PGame Game) => {
                    QiangLve.AnnouceUseSkill(Player);
                    int Result = Game.Judge(Player, 6);
                    if (Result % 2 == 0)
                    {
                        PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                        PCard Card = new P_CheevnHuoTaChieh().Instantiate();
                        Card.Point = 0;
                        PTrigger Trigger = Card.Model.MoveInHandTriggerList.Find((Func <PPlayer, PCard, PTrigger> TriggerGenerator) => TriggerGenerator(Player, Card).Time.Equals(PTime.Injure.AcceptInjure))?.Invoke(Player, Card);
                        if (Trigger != null)
                        {
                            Game.Logic.StartSettle(new PSettle("抢掠[趁火打劫]", Trigger.Effect));
                        }
                    }
                }
            });
        }));
    }
Exemple #9
0
        public string GetEventCallbackName(PTrigger trigger)
        {
            string eventName   = this.GetEventName(trigger);
            string declareName = trigger.EventInfo.DeclaringType.GetAttribute <WPFAttribute>().Name;

            var    paramterBuilder = new StringBuilder();
            string callbackName    = CallbackContainer.GetName(trigger, $"{declareName}_{eventName}");

            // 콜백 이름 등록
            CallbackContainer[callbackName] = trigger;

            return(callbackName);
        }
Exemple #10
0
    public static int ComparePriority(PGame Game, PTrigger x, PTrigger y)
    {
        int SettleIndex(PPlayer Player)
        {
            if (Player == null)
            {
                return(-1);
            }
            return(Player.Index + (Player.Index < Game.NowPlayerIndex ? Game.PlayerNumber : 0));
        }

        int XPlayerIndex = SettleIndex(x.Player);
        int YPlayerIndex = SettleIndex(y.Player);

        if (XPlayerIndex < YPlayerIndex)
        {
            return(-1);
        }
        else if (XPlayerIndex > YPlayerIndex)
        {
            return(1);
        }
        else if (x.Player != null)
        {
            if (x.Player.IsAI)
            {
                if (x.AIPriority > y.AIPriority)
                {
                    return(-1);
                }
                else if (x.AIPriority < y.AIPriority)
                {
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
            else
            {
                return(0);
            }
        }
        else
        {
            return(0);
        }
    }
    public List <PPlayer> AIEmitTargets(PGame Game, PPlayer Player)
    {
        int ExpectedMoney = 700;

        if (Player.General is P_LiuJi)
        {
            ExpectedMoney = 1200;
        }
        PPlayer Target = PAiTargetChooser.InjureTarget(Game, Player, Player, PTrigger.Except(Player), ExpectedMoney, Instantiate());

        return(new List <PPlayer>()
        {
            Target
        });
    }
 public PClickOnSkillOrder() : base("click_on_skill",
                                    (string[] args, string IPAddress) => {
     int SkillIndex = Convert.ToInt32(args[1]);
     PGame Game     = PNetworkManager.Game;
     PPlayer Player = Game.PlayerList.Find((PPlayer _Player) => _Player.IPAddress.Equals(IPAddress));
     if (Player != null && Player.IsAlive && SkillIndex < Player.General.SkillList.Count)
     {
         PSkill Skill = Player.General.SkillList[SkillIndex];
         if (Skill != null)
         {
             bool UseSkill = false;
             if (Game.Logic.WaitingForEndFreeTime() && Game.NowPlayer.Equals(Player) && Game.TagManager.ExistTag(PTag.FreeTimeOperationTag.Name))
             {
                 PTrigger Trigger = Skill.TriggerList.Find((Func <PPlayer, PSkill, PTrigger> TriggerGenerator) => TriggerGenerator(Player, Skill).Time.Equals(Game.NowPeriod.During))?.Invoke(Player, Skill);
                 if (Trigger != null)
                 {
                     if (Trigger.Condition(Game))
                     {
                         PThread.Async(() => {
                             Game.Logic.StartSettle(new PSettle("发动技能[" + Trigger.Name + "]", Trigger.Effect));
                         });
                         UseSkill = true;
                     }
                 }
             }
             if (Skill.SoftLockOpen && !UseSkill)
             {
                 Skill.Lock = !Skill.Lock;
                 Game.Monitor.FindTriggers(Skill.Name).ForEach((PTrigger Trigger) => {
                     Trigger.IsLocked = Skill.Lock;
                 });
                 PNetworkManager.NetworkServer.TellClient(Player, new PRefreshGeneralOrder(Player));
             }
         }
     }
 },
                                    null) {
 }
Exemple #13
0
 public PClickOnCardOrder() : base("click_on_card",
                                   (string[] args, string IPAddress) => {
     int CardIndex = Convert.ToInt32(args[1]);
     PGame Game    = PNetworkManager.Game;
     PChooseCardTag ChooseCardTag = Game.TagManager.FindPeekTag <PChooseCardTag>(PChooseCardTag.TagName);
     if (ChooseCardTag != null && ChooseCardTag.Player.IPAddress.Equals(IPAddress))
     {
         ChooseCardTag.Card = ChooseCardTag.Player.Area.GetCard(CardIndex, ChooseCardTag.AllowHandCards, ChooseCardTag.AllowEquipment, ChooseCardTag.AllowJudge);
     }
     else if (Game.Logic.WaitingForEndFreeTime() && Game.NowPlayer.IPAddress.Equals(IPAddress) && Game.TagManager.ExistTag(PTag.FreeTimeOperationTag.Name) && Game.NowPlayer.IsAlive)
     {
         PCard Card = Game.NowPlayer.Area.GetCard(CardIndex);
         if (Card != null)
         {
             PTrigger Trigger = null;
             if (Game.NowPlayer.Area.HandCardArea.CardList.Contains(Card))
             {
                 Trigger = Card.FindTrigger(Game.NowPeriod.During);
             }
             else if (Game.NowPlayer.Area.EquipmentCardArea.CardList.Contains(Card))
             {
                 Trigger = Card.FindEquipmentTrigger(Game.NowPeriod.During);
             }
             if (Trigger != null)
             {
                 if (Trigger.Condition(Game))
                 {
                     PThread.Async(() => {
                         Game.Logic.StartSettle(new PSettle("主动触发" + Trigger.Name, Trigger.Effect));
                     });
                 }
             }
         }
     }
 },
                                   null) {
 }
Exemple #14
0
 public string GetEventName(PTrigger trigger)
 {
     throw new NotImplementedException();
 }
 public P_ShevngTungChiHsi() : base(CardName)
 {
     Point = 1;
     Index = 6;
     foreach (PTime Time in new PTime[] {
         PTime.Card.AfterEmitTargetTime
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 100,
                 Condition = (PGame Game) => {
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     return UseCardTag.TargetList.Count == 1 && UseCardTag.Card.Type.Equals(PCardType.SchemeCard) && !UseCardTag.Card.Name.Equals(P_ChinChaanToowChiiao.CardName);
                 },
                 AICondition = (PGame Game) => {
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     if (UseCardTag.Card.Model.Name.Equals(P_ManTiienKuoHai.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_WeiWeiChiuChao.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_CheevnHuoTaChieh.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_LiTaiTaaoChiang.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_ShunShouChiienYang.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_TaTsaaoChingShev.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_KuanMevnChoTsev.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_ChihSangMaHuai.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_FanChienChi.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_ChiehTaoShaJevn.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_PaaoChuanYinYoo.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_ChiaTaoFaKuo.CardName))
                     {
                         return UseCardTag.TargetList[0].TeamIndex == Player.TeamIndex && UseCardTag.User.TeamIndex != Player.TeamIndex;
                     }
                     else if (UseCardTag.Card.Name.Equals(P_WuChungShevngYou.CardName) ||
                              UseCardTag.Card.Model.Name.Equals(P_AnTuCheevnTsaang.CardName) ||
                              UseCardTag.Card.Model.Name.Equals(P_ChiehShihHuanHun.CardName) ||
                              UseCardTag.Card.Model.Name.Equals(P_YooenChiaoChinKung.CardName) ||
                              UseCardTag.Card.Model.Name.Equals(P_TsouWeiShangChi.CardName))
                     {
                         return UseCardTag.TargetList[0].TeamIndex != Player.TeamIndex;
                     }
                     else if (UseCardTag.Card.Model.Name.Equals(P_YooChiinKuTsung.CardName))
                     {
                         return UseCardTag.TargetList[0].TeamIndex == Player.TeamIndex && Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure <= 3000;
                     }
                     else if (UseCardTag.Card.Model.Name.Equals(P_ChiinTsevChiinWang.CardName))
                     {
                         return UseCardTag.User.TeamIndex != Player.TeamIndex && PMath.Max(Game.PlayerList, (PPlayer _Player) => {
                             if (Player.TeamIndex == _Player.TeamIndex)
                             {
                                 return PAiMapAnalyzer.ChangeFaceExpect(Game, _Player);
                             }
                             else
                             {
                                 return -PAiMapAnalyzer.ChangeFaceExpect(Game, _Player);
                             }
                         }).Value - PAiMapAnalyzer.ChangeFaceExpect(Game, UseCardTag.TargetList[0]) * (UseCardTag.TargetList[0].TeamIndex == Player.TeamIndex ? 1 : -1) >= 3000;
                     }
                     else if (UseCardTag.Card.Model.Name.Equals(P_ShangWuChoouTii.CardName))
                     {
                         int NowValue = PAiMapAnalyzer.Expect(Game, UseCardTag.TargetList[0], UseCardTag.TargetList[0].Position) * (UseCardTag.TargetList[0].TeamIndex == Player.TeamIndex ? 1 : -1);
                         int MaxValue = PMath.Max(Game.PlayerList, (PPlayer _Player) => {
                             if (_Player.TeamIndex == Player.TeamIndex)
                             {
                                 return PAiMapAnalyzer.Expect(Game, _Player, _Player.Position);
                             }
                             else
                             {
                                 return -PAiMapAnalyzer.Expect(Game, _Player, _Player.Position);
                             }
                         }, true).Value;
                         return MaxValue - NowValue >= 3000;
                     }
                     else if (UseCardTag.Card.Model.Name.Equals(P_KuungCheevngChi.CardName))
                     {
                         KeyValuePair <PPlayer, int> Target = PMath.Max(Game.Enemies(Player), (PPlayer _Player) => _Player.Area.HandCardArea.CardNumber);
                         return Target.Value >= 3 && !UseCardTag.TargetList[0].Equals(Target.Key);
                     }
                     else if (UseCardTag.Card.Model.Name.Equals(P_HsiaoLiTsaangTao.CardName))
                     {
                         return UseCardTag.User.TeamIndex != Player.TeamIndex && (UseCardTag.TargetList[0].TeamIndex != Player.TeamIndex || UseCardTag.TargetList[0].Area.EquipmentCardArea.CardNumber > 0 || UseCardTag.TargetList[0].Money <= 500);
                     }
                     return false;
                 },
                 Effect = (PGame Game) => {
                     List <PPlayer> Targets = new List <PPlayer>();
                     Game.Monitor.CallTime(PTime.Card.AfterEmitTargetTime, new PUseCardTag(Card, Player, Targets));
                     Game.CardManager.MoveCard(Card, Player.Area.HandCardArea, Game.CardManager.SettlingArea);
                     Game.Monitor.CallTime(PTime.Card.AfterBecomeTargetTime, new PUseCardTag(Card, Player, Targets));
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     PPlayer Target = null;
                     if (Player.IsUser)
                     {
                         List <PPlayer> TargetList = new List <PPlayer>()
                         {
                             null
                         };
                         TargetList.AddRange(Game.PlayerList.FindAll((PPlayer _Player) => !_Player.Equals(UseCardTag.TargetList[0]) && _Player.IsAlive));
                         List <string> TargetNameList = TargetList.ConvertAll((PPlayer _Player) => {
                             if (_Player == null)
                             {
                                 return "令该计策牌无效";
                             }
                             else
                             {
                                 return "转移给:" + _Player.Name;
                             }
                         });
                         Target = TargetList[PNetworkManager.NetworkServer.ChooseManager.Ask(Player, "选择一项", TargetNameList.ToArray())];
                     }
                     else
                     {
                         if (UseCardTag.Card.Model.Name.Equals(P_ManTiienKuoHai.CardName))
                         {
                             Target = PAiTargetChooser.InjureTarget(Game, UseCardTag.User, Player, PTrigger.Except(UseCardTag.TargetList[0]), 700, UseCardTag.Card, true);
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_KuanMevnChoTsev.CardName) ||
                                  UseCardTag.Card.Model.Name.Equals(P_ChiaTaoFaKuo.CardName))
                         {
                             Target = PAiTargetChooser.InjureTarget(Game, UseCardTag.User, Player, PTrigger.Except(UseCardTag.TargetList[0]), 1000, UseCardTag.Card, true);
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_ChihSangMaHuai.CardName))
                         {
                             Target = PAiTargetChooser.InjureTarget(Game, Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).FromPlayer, Player, null, Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure, Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).InjureSource, true);
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_ChiinTsevChiinWang.CardName))
                         {
                             Target = PMath.Max(Game.PlayerList, (PPlayer _Player) => {
                                 if (Player.TeamIndex == _Player.TeamIndex)
                                 {
                                     return PAiMapAnalyzer.ChangeFaceExpect(Game, _Player);
                                 }
                                 else
                                 {
                                     return -PAiMapAnalyzer.ChangeFaceExpect(Game, _Player);
                                 }
                             }).Key;
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_TaTsaaoChingShev.CardName))
                         {
                             List <PPlayer> PossibleEnemies = Game.Enemies(Player).FindAll((PPlayer _Player) => Player.HasHouse);
                             if (PossibleEnemies.Count > 0)
                             {
                                 Target = PossibleEnemies[PMath.RandInt(0, PossibleEnemies.Count - 1)];
                             }
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_ChiehShihHuanHun.CardName))
                         {
                             int MaxMoney = PMath.Max(Game.PlayerList, (PPlayer _Player) => {
                                 return _Player.Money;
                             }).Value;
                             Target = PMath.Max(Game.PlayerList, (PPlayer _Player) => {
                                 int Delta = Math.Min(10000, MaxMoney - _Player.Money) - 2000 * _Player.Area.HandCardArea.CardNumber - (int)PMath.Sum(_Player.Area.EquipmentCardArea.CardList.ConvertAll((PCard _Card) => (double)_Card.Model.AIInEquipExpectation(Game, _Player)));
                                 if (_Player.TeamIndex == Player.TeamIndex)
                                 {
                                     return Delta;
                                 }
                                 else
                                 {
                                     return -Delta;
                                 }
                             }).Key;
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_WuChungShevngYou.CardName) ||
                                  UseCardTag.Card.Name.Equals(P_AnTuCheevnTsaang.CardName))
                         {
                             Target = PAiCardExpectation.MostValuableCardUser(Game, Game.Teammates(Player));
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_ShangWuChoouTii.CardName))
                         {
                             Target = PMath.Max(Game.AlivePlayers(), (PPlayer _Player) => {
                                 if (_Player.TeamIndex == Player.TeamIndex)
                                 {
                                     return PAiMapAnalyzer.Expect(Game, _Player, _Player.Position);
                                 }
                                 else
                                 {
                                     return -PAiMapAnalyzer.Expect(Game, _Player, _Player.Position);
                                 }
                             }, true).Key;
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_KuungCheevngChi.CardName))
                         {
                             Target = PMath.Max(Game.Enemies(Player), (PPlayer _Player) => _Player.Area.HandCardArea.CardNumber).Key;
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_TsouWeiShangChi.CardName))
                         {
                             Target = PMath.Max(Game.Teammates(Player), (PPlayer _Player) => PAiMapAnalyzer.OutOfGameExpect(Game, Player)).Key;
                         }
                     }
                     if (Target == null || Target == UseCardTag.TargetList[0])
                     {
                         PNetworkManager.NetworkServer.TellClients(new PShowInformationOrder("声东击西:无效"));
                         #region 成就:地府的公正
                         if (UseCardTag.Card.Model is P_ChiehShihHuanHun)
                         {
                             PArch.Announce(Game, Player, "地府的公正");
                         }
                         #endregion
                         UseCardTag.TargetList.Clear();
                     }
                     else
                     {
                         PNetworkManager.NetworkServer.TellClients(new PShowInformationOrder("声东击西:转移给" + Target.Name));
                         UseCardTag.TargetList[0] = Target;
                     }
                     Game.CardManager.MoveCard(Card, Game.CardManager.SettlingArea, Game.CardManager.ThrownCardHeap);
                     Game.Monitor.CallTime(PTime.Card.EndSettleTime, new PUseCardTag(Card, Player, Targets));
                 }
             });
         });
     }
 }
Exemple #16
0
 public P_YooenChiaoChinKung() : base(CardName)
 {
     Point = 4;
     Index = 23;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 75,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime());
                 },
                 AICondition = (PGame Game) => {
                     return AIEmitTargets(Game, Player)[0] != null;
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, PTrigger.Except(Player),
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     Game.GetCard(Target);
                     PPlayer Another = null;
                     if (User.IsAI)
                     {
                         if (Game.Enemies(User).Exists((PPlayer _Player) => _Player.Money <= 1000) || User.Money > 15000)
                         {
                             Another = PMath.Min(Game.Enemies(User), (PPlayer _Player) => _Player.Money).Key;
                         }
                         else
                         {
                             Another = User;
                         }
                     }
                     else
                     {
                         Another = PNetworkManager.NetworkServer.ChooseManager.AskForTargetPlayer(User, PTrigger.Except(Target), "远交近攻[第二目标]");
                     }
                     if (Another != null)
                     {
                         if (Another.Equals(User))
                         {
                             Game.GetMoney(Another, 1000);
                         }
                         else
                         {
                             Game.LoseMoney(Another, 1000);
                             #region 成就:翻云覆雨
                             if (!Another.IsAlive)
                             {
                                 PArch.Announce(Game, User, "翻云覆雨");
                             }
                             #endregion
                         }
                     }
                 })
             });
         });
     }
 }
Exemple #17
0
    public P_HuaMulan() : base("花木兰")
    {
        Sex   = PSex.Female;
        Age   = PAge.Renaissance;
        Index = 23;
        Cost  = 20;
        Tips  = "定位:爆发\n" +
                "难度:简单\n" +
                "史实:出自经典诗歌《木兰辞》。中国古代替父从军的女英雄。\n" +
                "攻略:\n花木兰是一名拥有不俗爆发能力的武将。【枭姬】的存在使得花木兰极度依赖装备牌,因此能够与唐寅、时迁等武将配合,同时也能够对这些武将形成强大的威慑力。【枭姬】往往能够提供绝地反杀的能力,或能使花木兰东山再起,因此在针对花木兰时必须注意其队伍的研究所或给牌武将,同时慎用【落凤弓】、【借刀杀人】等牌,从一定程度上来说提供了花木兰一定的防御力。【易装】是一个强大的爆发技能,不仅能与队友交换装备达成爆发,还能抢夺敌方的大量装备,形成局势逆转,因此可在一定程度上克制关羽。【易装】还可用来转换性别,从而使敌方的【百花裙】等装备失效。针对花木兰必须阻止其装备成形,因此吕蒙是一个不错的选择。";

        PSkill XiaoJi = new PSkill("枭姬")
        {
            SoftLockOpen = true
        };

        SkillList.Add(XiaoJi
                      .AddTrigger((PPlayer Player, PSkill Skill) => {
            return(new PTrigger(XiaoJi.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = PTime.Card.LeaveAreaTime,
                AIPriority = 200,
                Condition = (PGame Game) => {
                    PMoveCardTag MoveCardTag = Game.TagManager.FindPeekTag <PMoveCardTag>(PMoveCardTag.TagName);
                    return Player.Area.EquipmentCardArea.Equals(MoveCardTag.Source) && !Player.Equals(MoveCardTag.Destination.Owner);
                },
                Effect = (PGame Game) => {
                    XiaoJi.AnnouceUseSkill(Player);
                    Game.GetCard(Player);
                    Game.GetMoney(Player, 1500);
                }
            });
        }));

        PPlayer YiZhuangTarget(PGame Game, PPlayer Player)
        {
            return(PMath.Max(Game.AlivePlayers(Player), (PPlayer TargetPlayer) => {
                int Profit = 0;
                PSex OriginalSex = Player.Sex;
                Player.Sex = PSex.Male;
                foreach (PCardType CardType in new PCardType[] {
                    PCardType.WeaponCard, PCardType.DefensorCard, PCardType.TrafficCard
                })
                {
                    PCard Card = Player.GetEquipment(CardType);
                    PCard TargetCard = TargetPlayer.GetEquipment(CardType);
                    if (Card != null)
                    {
                        Profit += 2000;
                        Profit -= Card.Model.AIInEquipExpectation(Game, Player);
                        Profit += Card.Model.AIInEquipExpectation(Game, TargetPlayer) * (Player.TeamIndex == TargetPlayer.TeamIndex ? 1 : -1);
                    }
                    if (TargetCard != null)
                    {
                        Profit += TargetCard.Model.AIInEquipExpectation(Game, Player);
                        Profit -= TargetCard.Model.AIInEquipExpectation(Game, TargetPlayer) * (Player.TeamIndex == TargetPlayer.TeamIndex ? 1 : -1);
                    }
                }
                Player.Sex = OriginalSex;
                return Profit - 7500;
            }, true).Key);
        }

        PSkill YiZhuang = new PSkill("易装")
        {
            Initiative = true
        };

        SkillList.Add(YiZhuang
                      .AnnounceGameOnce()
                      .AddTimeTrigger(
                          new PTime[] {
            PPeriod.FirstFreeTime.During,
            PPeriod.SecondFreeTime.During
        },
                          (PTime Time, PPlayer Player, PSkill Skill) => {
            return(new PTrigger(YiZhuang.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = Time,
                AIPriority = 280,
                CanRepeat = true,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Player.RemainLimit(YiZhuang.Name);
                },
                AICondition = (PGame Game) => {
                    if (Game.Teammates(Player).Exists((PPlayer _Player) => _Player.General is P_WuZhao))
                    {
                        PPlayer _Player = Game.PlayerList.Find((PPlayer __Player) => __Player.General is P_WuZhao);
                        if (_Player.RemainLimit("女权"))
                        {
                            return false;
                        }
                        else if (Player.Tags.ExistTag(P_WuZhao.NvQuanTag.Name))
                        {
                            return false;
                        }
                    }
                    return YiZhuangTarget(Game, Player) != null;
                },
                Effect = (PGame Game) => {
                    YiZhuang.AnnouceUseSkill(Player);
                    PPlayer Target = null;
                    if (Player.IsAI)
                    {
                        Target = YiZhuangTarget(Game, Player);
                    }
                    else
                    {
                        Target = PNetworkManager.NetworkServer.ChooseManager.AskForTargetPlayer(Player, PTrigger.Except(Player), YiZhuang.Name);
                    }
                    if (Target != null)
                    {
                        List <PCard> MulanEquipments = new List <PCard>();
                        foreach (PCard Card in Player.Area.EquipmentCardArea.CardList)
                        {
                            MulanEquipments.Add(Card);
                        }
                        List <PCard> TargetEquipements = new List <PCard>();
                        foreach (PCard Card in Target.Area.EquipmentCardArea.CardList)
                        {
                            TargetEquipements.Add(Card);
                        }
                        foreach (PCard Card in MulanEquipments)
                        {
                            Game.CardManager.MoveCard(Card, Player.Area.EquipmentCardArea, Game.CardManager.SettlingArea);
                        }
                        foreach (PCard Card in TargetEquipements)
                        {
                            Game.CardManager.MoveCard(Card, Target.Area.EquipmentCardArea, Game.CardManager.SettlingArea);
                        }
                        foreach (PCard Card in MulanEquipments)
                        {
                            Game.CardManager.MoveCard(Card, Game.CardManager.SettlingArea, Target.Area.EquipmentCardArea);
                        }
                        foreach (PCard Card in TargetEquipements)
                        {
                            Game.CardManager.MoveCard(Card, Game.CardManager.SettlingArea, Player.Area.EquipmentCardArea);
                        }
                        Player.Sex = PSex.Male;
                        Player.Tags.CreateTag(new PTag(YiZhuang.Name));
                        YiZhuang.DeclareUse(Player);
                    }
                }
            });
        }));
    }
Exemple #18
0
 public P_FanChienChi() : base(CardName)
 {
     Point = 6;
     Index = 33;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 65,
                 Condition = PTrigger.Initiative(Player),
                 AICondition = (PGame Game) => {
                     if (Player.General is P_WuZhao && Player.RemainLimit(PSkillInfo.女权.Name))
                     {
                         return false;
                     }
                     return AIInHandExpectation(Game, Player) > 1000 && P_PanYue.XianJuTest(Game, Player);
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, AIEmitTargets,
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     int ChosenNumber = 1;
                     if (Target.IsAI)
                     {
                         if (Target.General is P_LiuJi)
                         {
                             ChosenNumber = 6;
                         }
                         else
                         {
                             ChosenNumber = PMath.RandInt(1, 6);
                         }
                     }
                     else
                     {
                         ChosenNumber = PNetworkManager.NetworkServer.ChooseManager
                                        .Ask1To6(Target, "反间计[选择1个数字]");
                     }
                     PNetworkManager.NetworkServer.TellClients(new
                                                               PShowInformationOrder(Target.Name + "选择了" + ChosenNumber));
                     int JudgeResult = Game.Judge(Target, 6);
                     if (JudgeResult != ChosenNumber)
                     {
                         // 故弄玄虚失效
                         User.Tags.PopTag <PTag>(Gunxx);
                         int Test = 0;
                         if (Target.IsAI)
                         {
                             int Choose1 = PAiMapAnalyzer.ChangeFaceExpect(Game, Target);
                             int Choose2 = Target.Money <= 1000 ? -30000 : -1000;
                             Test = (Choose1 > Choose2 ? 0 : 1);
                         }
                         else
                         {
                             Test = PNetworkManager.NetworkServer.ChooseManager
                                    .Ask(Target, "反间计[选择一项]", new string[] {
                                 "翻面", "弃1000"
                             });
                         }
                         if (Test == 0)
                         {
                             PNetworkManager.NetworkServer.TellClients(new
                                                                       PShowInformationOrder(Target.Name + "选择了翻面"));
                             Game.ChangeFace(Target);
                         }
                         else
                         {
                             PNetworkManager.NetworkServer.TellClients(new
                                                                       PShowInformationOrder(Target.Name + "选择了弃1000"));
                             Game.LoseMoney(Target, 1000);
                         }
                     }
                 }, (PGame Game, PPlayer User, List <PPlayer> Targets) => {
                     // 为了故弄玄虚成就做的初始化
                     if (Targets.Count > 0)
                     {
                         User.Tags.CreateTag(new PTag(Gunxx)
                         {
                             Visible = false
                         });
                     }
                 }, (PGame Game, PPlayer User, List <PPlayer> Targets) => {
                     // 判定故弄玄虚
                     if (User.Tags.PopTag <PTag>(Gunxx) != null)
                     {
                         PArch.Announce(Game, User, Gunxx);
                     }
                 })
             });
         });
     }
 }
Exemple #19
0
 public P_YinYooehChiiang() : base(CardName, PCardType.WeaponCard)
 {
     Point = 3;
     Index = 45;
     foreach (PTime Time in new PTime[] {
         PTime.Card.EndSettleTime
     })
     {
         MoveInEquipTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 Condition = (PGame Game) => {
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     return !Game.NowPlayer.Equals(Player) && UseCardTag.User.Equals(Player);
                 },
                 Effect = (PGame Game) => {
                     AnnouceUseEquipmentSkill(Player);
                     PPlayer TargetPlayer = null;
                     if (Player.IsAI)
                     {
                         TargetPlayer = PAiTargetChooser.InjureTarget(Game, Player, Player, PTrigger.Except(Player), 1000, Card);
                     }
                     else
                     {
                         TargetPlayer = PNetworkManager.NetworkServer.ChooseManager.AskForTargetPlayer(Player, PTrigger.Except(Player), CardName);
                     }
                     if (TargetPlayer != null)
                     {
                         Game.Injure(Player, TargetPlayer, 1000, Card);
                     }
                 }
             });
         });
     }
 }
 public P_ChiehShihHuanHun() : base(CardName)
 {
     Point = 3;
     Index = 14;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During,
         PTime.EnterDyingTime
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = Time.Equals(PTime.EnterDyingTime) ? 10 : 90,
                 Condition = (PGame Game) => {
                     return Time.Equals(PTime.EnterDyingTime) ? Game.TagManager.FindPeekTag <PDyingTag>(PDyingTag.TagName).Player.Equals(Player) : Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime());
                 },
                 AICondition = (PGame Game) => {
                     return Time.Equals(PTime.EnterDyingTime) || AIInHandExpectation(Game, Player) > 5000;
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, AIEmitTargets,
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     PPlayer Another = null;
                     if (Target.IsAI)
                     {
                         Another = PMath.Max(Game.PlayerList.FindAll((PPlayer _Player) => !_Player.Equals(Player)), (PPlayer _Player) => {
                             return _Player.Money;
                         }).Key;
                     }
                     else
                     {
                         Another = PNetworkManager.NetworkServer.ChooseManager.AskForTargetPlayer(Target, PTrigger.Except(Target), CardName + "[与其金钱相同]");
                     }
                     Game.CardManager.ThrowAll(Target.Area);
                     if (Another != null)
                     {
                         if (Another.Money > Target.Money)
                         {
                             Game.GetMoney(Target, Math.Min(10000, Another.Money - Target.Money));
                         }
                         else if (Another.Money < Target.Money)
                         {
                             Game.LoseMoney(Target, Target.Money - Another.Money);
                         }
                     }
                 })
             });
         });
     }
 }
Exemple #21
0
    public P_ChenSheng() : base("陈胜")
    {
        Sex   = PSex.Male;
        Age   = PAge.Classic;
        Index = 21;
        Cost  = 20;
        Tips  = "定位:防御\n" +
                "难度:中等\n" +
                "史实:秦朝末年农民起义的领袖,建立了张楚政权。其名言“王侯将相宁有种乎”、“燕雀安知鸿鹄之志”等广为人知。\n" +
                "攻略:\n陈胜是一名拥有不俗控制能力和防御能力的武将。【起义】作为控制技能,能够在前期翻面敌人,从而迅速拉开己方团队与敌方团队的土地数量差距,同时能够在后期翻面自己或队友,从而减少敌人的伤害。在前期,使用【起义】控制敌人,可以帮助己方抢占地盘,同时使被翻面无法购买土地的敌人保持最高现金,制造连续控制的机会。【鸿鹄】大多数情况下配合【起义】使用,也可通过【金蝉脱壳】、【反间计】等卡牌发动。【鸿鹄】可以回避伤害的特性进一步增强了陈胜的防御,在后期,优势情况下的陈胜如果成为现金最多者,就可以连续【起义】自己形成滚雪球优势。陈胜的技能需要大量卡牌发动,因此可以通过大量建造研究所为陈胜创造条件。";

        PSkill QiYi = new PSkill("起义")
        {
            Initiative = true
        };

        SkillList.Add(QiYi
                      .AddTimeTrigger(
                          new PTime[] {
            PPeriod.FirstFreeTime.During,
            PPeriod.SecondFreeTime.During
        },
                          (PTime Time, PPlayer Player, PSkill Skill) => {
            return(new PTrigger(QiYi.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = Time,
                AIPriority = 200,
                CanRepeat = true,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer) &&
                    (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) &&
                    Player.Area.HandCardArea.CardList.Exists((PCard Card) => Card.Point % 2 == 1);
                },
                AICondition = (PGame Game) => {
                    int LeastValue = PAiCardExpectation.FindLeastValuable(Game, Player, Player, true, false, false, true, (PCard Card) => Card.Point % 2 == 1).Value;
                    return P_ChiinTsevChiinWang.AIEmitTargets(Game, Player, LeastValue)[0] != null;
                },
                Effect = (PGame Game) => {
                    QiYi.AnnouceUseSkill(Player);
                    PCard TargetCard = null;
                    if (Player.IsAI)
                    {
                        TargetCard = PAiCardExpectation.FindLeastValuable(Game, Player, Player, true, false, false, true, (PCard Card) => Card.Point % 2 == 1).Key;
                    }
                    else
                    {
                        List <PCard> Waiting = Player.Area.HandCardArea.CardList.FindAll((PCard Card) => Card.Point % 2 == 1);
                        int Result = PNetworkManager.NetworkServer.ChooseManager.Ask(Player, QiYi.Name, Waiting.ConvertAll((PCard Card) => Card.Name).Concat(new List <string> {
                            "取消"
                        }).ToArray());
                        if (Result >= 0 && Result < Waiting.Count)
                        {
                            TargetCard = Waiting[Result];
                        }
                    }
                    if (TargetCard != null)
                    {
                        TargetCard.Model = new P_ChiinTsevChiinWang();
                        PTrigger Trigger = TargetCard.Model.MoveInHandTriggerList.Find((Func <PPlayer, PCard, PTrigger> TriggerGenerator) => TriggerGenerator(Player, TargetCard).Time.Equals(PPeriod.FirstFreeTime.During))?.Invoke(Player, TargetCard);
                        if (Trigger != null)
                        {
                            Game.Logic.StartSettle(new PSettle("起义[擒贼擒王]", Trigger.Effect));
                        }
                    }
                }
            });
        }));
        PSkill HongHu = new PSkill("鸿鹄")
        {
            SoftLockOpen = true
        };

        SkillList.Add(HongHu
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(HongHu.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = PTime.ChangeFaceTime,
                AIPriority = 100,
                Condition = (PGame Game) => {
                    PChangeFaceTag ChangeFaceTag = Game.TagManager.FindPeekTag <PChangeFaceTag>(PChangeFaceTag.TagName);
                    return Player.Equals(ChangeFaceTag.Player);
                },
                Effect = (PGame Game) => {
                    HongHu.AnnouceUseSkill(Player);
                    Game.GetMoney(Player, 2000);
                    int Step = 1;
                    if (Player.IsAI)
                    {
                        Step = PMath.Max(new List <int> {
                            1, 2, 3, 4, 5, 6
                        }, (int StepNumber) => PAiMapAnalyzer.StartFromExpect(Game, Player, Game.Map.NextStepBlock(Player.Position, StepNumber), 0, false)).Key;
                    }
                    else
                    {
                        Step = PNetworkManager.NetworkServer.ChooseManager.Ask1To6(Player, QiYi.Name);
                    }
                    PNetworkManager.NetworkServer.TellClients(new PShowInformationOrder(Player.Name + "选择向前移动" + Step + "步"));
                    Game.MoveForward(Player, Step);
                }
            });
        }));
    }
Exemple #22
0
    public P_JeanneDarc() : base("贞德")
    {
        Sex   = PSex.Female;
        Age   = PAge.Medieval;
        Index = 30;
        Cost  = 40;
        Tips  = "定位:辅助\n" +
                "难度:简单\n" +
                "史实:法国民族英雄,天主教圣人,被称为“奥尔良的圣女”。在英法百年战争中,她带领法国军队对抗英军的入侵,屡战屡胜,扭转了战争的局势。\n" +
                "攻略:\n-";

        PSkill ShengNv = new PSkill("圣女");

        SkillList.Add(ShengNv
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(ShengNv.Name)
            {
                IsLocked = true,
                Player = Player,
                Time = PTime.EnterDyingTime,
                AIPriority = 5,
                Condition = (PGame Game) => {
                    PDyingTag DyingTag = Game.TagManager.FindPeekTag <PDyingTag>(PDyingTag.TagName);
                    return Player.Area.OwnerCardNumber > 0 && DyingTag.Source != null && DyingTag.Source is PBlock;
                },
                AICondition = (PGame Game) => {
                    PDyingTag DyingTag = Game.TagManager.FindPeekTag <PDyingTag>(PDyingTag.TagName);
                    if (DyingTag.Killer.General is P_LvZhi)
                    {
                        return false;
                    }
                    if (DyingTag.Player.TeamIndex == Player.TeamIndex)
                    {
                        if (Player.Equals(DyingTag.Player))
                        {
                            return true;
                        }
                        else
                        {
                            if (DyingTag.Player.Money <= -10000)
                            {
                                return false;
                            }
                            if (Player.Money > 5000)
                            {
                                return true;
                            }
                            else
                            {
                                return Player.Area.OwnerCardNumber <= 3;
                            }
                        }
                    }
                    else
                    {
                        return false;
                    }
                },
                Effect = (PGame Game) => {
                    ShengNv.AnnouceUseSkill(Player);
                    PDyingTag DyingTag = Game.TagManager.FindPeekTag <PDyingTag>(PDyingTag.TagName);
                    Game.CardManager.ThrowAll(Player.Area);
                    PCard Card = new P_ChiehTaoShaJevn().Instantiate();
                    Card.Point = 0;
                    PTrigger Trigger = Card.Model.MoveInHandTriggerList.Find((Func <PPlayer, PCard, PTrigger> TriggerGenerator) => TriggerGenerator(DyingTag.Player, Card).Time.Equals(PTime.EnterDyingTime))?.Invoke(DyingTag.Player, Card);
                    if (Trigger != null)
                    {
                        Game.Logic.StartSettle(new PSettle("圣女[借尸还魂]", Trigger.Effect));
                        Game.LoseMoney(Player, 5000);
                        if (!Player.Equals(DyingTag.Player))
                        {
                            Game.GetCard(DyingTag.Player);
                        }
                    }
                }
            });
        }));
    }
Exemple #23
0
    public P_HuaXiong() : base("华雄")
    {
        Sex   = PSex.Male;
        Age   = PAge.Medieval;
        Index = 10;
        Cost  = 20;
        Tips  = "定位:辅助\n" +
                "难度:中等\n" +
                "史实:汉末董卓帐下都督,在《三国演义》中,华雄是一员猛将,曾击败孙坚,斩杀祖茂、俞涉、潘凤。\n" +
                "攻略:\n" +
                "1.华雄的资本是初始比其他人多出的15000资金,这让华雄成为了前期被擒贼擒王围堵的对象,降低了华雄的预期土地水平。因此耀武的实际收益小于15000。\n" +
                "2.耀武的收益是一次性的。和持续性收益的武将相比,节奏越快的战斗,华雄的优势越大。加快游戏节奏的诸葛连弩、草木皆兵,甚至闪电,都可以帮助扩大华雄的相对收益。\n" +
                "3.叫阵是一个期望收益为负的技能,除非有希望斩杀或者有不需要的装备,不应该随意发动叫阵。\n" +
                "4.叫阵是一个直击技能。如果存储一些装备牌,就可以在敌人现金较少的时候连续叫阵实现斩杀。因此,手牌数多的华雄可以限制敌人将现金转化成房屋等其他战斗资源的决策。\n" +
                "5.在团队里华雄主要充当一个奶妈角色,用其天然的高现金数,让队友收取过路费。同时华雄凭借叫阵也能承担一个直击斩杀手的功能。\n" +
                "6.到游戏后期,因为耀武的均回合收益已经下降到很低,华雄能为团队做出的贡献很少。";

        PSkill YaoWu = new PSkill("耀武")
        {
            Lock = true
        };

        SkillList.Add(YaoWu
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(YaoWu.Name)
            {
                IsLocked = true,
                Player = Player,
                Time = PTime.StartGameTime,
                AIPriority = 100,
                Effect = (PGame Game) => {
                    YaoWu.AnnouceUseSkill(Player);
                    Player.Money = PMath.Percent(Player.Money, 150);
                    PNetworkManager.NetworkServer.TellClients(new PRefreshMoneyOrder(Player));
                }
            });
        }));

        PSkill JiaoZhen = new PSkill("叫阵")
        {
            Initiative = true
        };

        SkillList.Add(JiaoZhen
                      .AddTimeTrigger(
                          new PTime[] {
            PPeriod.FirstFreeTime.During,
            PPeriod.SecondFreeTime.During
        },
                          (PTime Time, PPlayer Player, PSkill Skill) => {
            return(new PTrigger(JiaoZhen.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = Time,
                AIPriority = 200,
                CanRepeat = true,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Player.Area.EquipmentCardArea.CardNumber > 0;
                },
                AICondition = (PGame Game) => {
                    if (PAiTargetChooser.InjureTarget(Game, Player, Player, (PGame _Game, PPlayer _Player) => {
                        return _Player.IsAlive && !_Player.Equals(Player) && !(_Player.General is P_LiuJi);
                    }, 1000, JiaoZhen) == null || Player.Money <= 2000)
                    {
                        return false;
                    }
                    if (Game.Enemies(Player).Exists((PPlayer _Player) => _Player.Money <= 2000))
                    {
                        return true;
                    }
                    foreach (PCardType CardType in new PCardType[] {
                        PCardType.WeaponCard, PCardType.DefensorCard, PCardType.TrafficCard
                    })
                    {
                        KeyValuePair <PCard, int> MaxCard = PMath.Max(
                            Player.Area.HandCardArea.CardList.FindAll((PCard _Card) =>
                                                                      _Card.Type.Equals(CardType)),
                            (PCard _Card) => _Card.Model.AIInEquipExpectation(Game, Player));
                        PCard CurrentCard = Player.GetEquipment(CardType);
                        if (CurrentCard != null)
                        {
                            int Expect = CurrentCard.Model.AIInEquipExpectation(Game, Player);
                            if (MaxCard.Value > Expect)
                            {
                                return true;
                            }
                            if (Expect <= 1000)
                            {
                                return true;
                            }
                        }
                    }
                    return false;
                },
                Effect = (PGame Game) => {
                    JiaoZhen.AnnouceUseSkill(Player);
                    PPlayer Target = null;
                    if (Player.IsAI)
                    {
                        Target = PAiTargetChooser.InjureTarget(Game, Player, Player, (PGame _Game, PPlayer _Player) => {
                            return _Player.IsAlive && !_Player.Equals(Player) && !(_Player.General is P_LiuJi);
                        }, 1000, JiaoZhen);
                    }
                    else
                    {
                        Target = PNetworkManager.NetworkServer.ChooseManager.AskForTargetPlayer(Player, PTrigger.Except(Player), JiaoZhen.Name, true);
                    }
                    if (Target != null)
                    {
                        if (Game.PkPoint(Player, Target) > 0)
                        {
                            Game.Injure(Player, Target, 1000, JiaoZhen);
                        }
                        else
                        {
                            Game.ThrowCard(Player, Player, false);
                            Game.LoseMoney(Player, 1000);
                        }
                    }
                }
            });
        }));
    }
Exemple #24
0
 public P_MuNiuLiuMa() : base(CardName, PCardType.TrafficCard)
 {
     Point = 6;
     Index = 60;
     AnnouceOnce(CardName);
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInEquipTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = true,
                 Player = Player,
                 Time = Time,
                 AIPriority = 180,
                 CanRepeat = true,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Player.RemainLimit(CardName) && Player.Money > 2000;
                 },
                 AICondition = (PGame Game) => {
                     return Game.Teammates(Player, false).Count > 0 && (Player.Money >= 20000 || (Player.Money >= 10000 && PMath.RandTest(0.5)));
                 },
                 Effect = (PGame Game ) => {
                     AnnouceUseEquipmentSkill(Player);
                     Game.LoseMoney(Player, 2000);
                     PPlayer Target = null;
                     if (Player.IsAI)
                     {
                         Target = PMath.Max(Game.Teammates(Player, false), (PPlayer _Player) => _Player.AiCardExpectation).Key;
                     }
                     else
                     {
                         Target = PNetworkManager.NetworkServer.ChooseManager.AskForTargetPlayer(Player, PTrigger.Except(Player), CardName);
                     }
                     if (Target != null)
                     {
                         Game.GetCard(Target, 1);
                     }
                     Player.Tags.FindPeekTag <PUsedTag>(PUsedTag.TagNamePrefix + CardName).Count++;
                 }
             });
         });
     }
 }
Exemple #25
0
    public P_YangYuHuan() : base("杨玉环")
    {
        Sex   = PSex.Female;
        Age   = PAge.Renaissance;
        Index = 3;
        Tips  = "定位:控制\n" +
                "难度:简单\n" +
                "史实:唐代宫廷音乐家、舞蹈家,中国古代四大美女之一,唐玄宗宠妃。\n" +
                "攻略:\n杨玉环是新手推荐的武将,使用简单,强度稳定,并且不弱。\n杨玉环可以通过主动调整来增加【羞花】的发动频率,【羞花】的条件1和3、4往往是互斥的,而条件2又和【品荔】冲突,因此收益期望并不高。如果要主动调整,建议只进行小幅度买房、出牌决策上的调整,因为【羞花】的收益远没有到值得大幅调整战略的程度。\n因为【羞花】的发动条件是“最少”,所以如果杨玉环进入到人数较少的阶段,比如只有两个玩家存活时,【羞花】的收益就变得很高。因此,杨玉环的嘲讽也相对较高。";

        PSkill PinLi = new PSkill("品荔");

        SkillList.Add(PinLi
                      .AddTimeTrigger(
                          new PTime[] {
            PPeriod.SettleStage.Start
        },
                          (PTime Time, PPlayer Player, PSkill Skill) => {
            return(new PTrigger(PinLi.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = Time,
                AIPriority = 150,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer) && Player.Equals(Player.Position.Lord) && Player.Position.BusinessType.Equals(PBusinessType.Institute) && Game.PlayerList.Exists((PPlayer _Player) => _Player.Area.CardNumber > 0 && !_Player.Equals(Player) && _Player.IsAlive);
                },
                AICondition = (PGame Game) => {
                    return P_ShunShouChiienYang.AIBaseEmitTargets(Game, Player, 0)[0] != null;
                },
                Effect = (PGame Game) => {
                    PinLi.AnnouceUseSkill(Player);
                    PCard Card = new P_ShunShouChiienYang().Instantiate();
                    Card.Point = 0;
                    PTrigger Trigger = Card.Model.MoveInHandTriggerList.Find((Func <PPlayer, PCard, PTrigger> TriggerGenerator) => TriggerGenerator(Player, Card).Time.Equals(PPeriod.FirstFreeTime.During))?.Invoke(Player, Card);
                    if (Trigger != null)
                    {
                        Game.Logic.StartSettle(new PSettle("品荔[顺手牵羊]", Trigger.Effect));
                    }
                }
            });
        }));
        PSkill XiuHua = new PSkill("羞花")
        {
            SoftLockOpen = true
        };

        SkillList.Add(XiuHua
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(XiuHua.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = PPeriod.EndTurn.During,
                AIPriority = 120,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer);
                },
                Effect = (PGame Game) => {
                    XiuHua.AnnouceUseSkill(Player);
                    List <PPlayer> AlivePlayers = Game.AlivePlayers(Player);
                    int X = new List <bool>()
                    {
                        AlivePlayers.TrueForAll((PPlayer _Player) => _Player.Money > Player.Money),
                        AlivePlayers.TrueForAll((PPlayer _Player) => _Player.Area.HandCardArea.CardNumber > Player.Area.HandCardArea.CardNumber),
                        AlivePlayers.TrueForAll((PPlayer _Player) => _Player.LandNumber > Player.LandNumber),
                        AlivePlayers.TrueForAll((PPlayer _Player) => _Player.HouseNumber > Player.HouseNumber)
                    }.FindAll((bool x) => x).Count;
                    if (X > 0)
                    {
                        Game.GetMoney(Player, 200 * X);
                    }
                }
            });
        }));
    }
Exemple #26
0
 public bool RemoveTrigger(PTrigger Trigger)
 {
     return(TriggerList.Remove(Trigger));
 }
Exemple #27
0
    public P_WangXu() : base("王诩")
    {
        Sex   = PSex.Male;
        Age   = PAge.Classic;
        Index = 5;
        Tips  = "定位:全能\n" +
                "难度:困难\n" +
                "史实:战国时期思想家、纵横家,号“鬼谷子”。\n" +
                "攻略:\n王诩具有两个技能,在免费武将里是一个较为难用的武将,建议对游戏有一定了解之后使用。\n【纵横】可以将牌转化成【远交近攻】,但3和6两个点数里有不少高价值的牌,如【借尸还魂】、【欲擒故纵】、【抛砖引玉】、【走为上计】等,是否将这些牌转化成显性1000收益、隐性收益视队友状况而定的【远交近攻】,需要结合场上形势进行把握。\n【隐居】提高了王诩的生存能力,但【隐居】本身是负收益技能,移出游戏的王诩失去了收取过路费的能力,还会亏一座房屋,如果每回合都使用,必定只能苟延残喘片刻。所以,【隐居】的目的地需要给自己留出几个回合较为安全的空间,让自己在【隐居】的间隙可以造成输出。\n对于新手而言,也可以选择无脑【纵横】给大神队友补牌,后期保持【隐居】牵制敌人的打法。";

        PSkill ZongHeng = new PSkill("纵横")
        {
            Initiative = true
        };

        SkillList.Add(ZongHeng
                      .AddTimeTrigger(
                          new PTime[] {
            PPeriod.FirstFreeTime.During,
            PPeriod.SecondFreeTime.During
        },
                          (PTime Time, PPlayer Player, PSkill Skill) => {
            return(new PTrigger(ZongHeng.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = Time,
                AIPriority = 200,
                CanRepeat = true,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer) &&
                    (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) &&
                    Player.Area.HandCardArea.CardList.Exists((PCard Card) => Card.Point % 3 == 0);
                },
                AICondition = (PGame Game) => {
                    return Player.Area.HandCardArea.CardList.Exists((PCard Card) => {
                        return Card.Point % 3 == 0 && Card.Model.AIInHandExpectation(Game, Player) < 3000;
                    }) && P_YooenChiaoChinKung.AIEmitTargets(Game, Player)[0] != null;
                },
                Effect = (PGame Game) => {
                    ZongHeng.AnnouceUseSkill(Player);
                    PCard TargetCard = null;
                    if (Player.IsAI)
                    {
                        TargetCard = PAiCardExpectation.FindLeastValuable(Game, Player, Player, true, false, false, true, (PCard Card) => Card.Point % 3 == 0).Key;
                    }
                    else
                    {
                        List <PCard> Waiting = Player.Area.HandCardArea.CardList.FindAll((PCard Card) => Card.Point % 3 == 0);
                        int Result = PNetworkManager.NetworkServer.ChooseManager.Ask(Player, ZongHeng.Name, Waiting.ConvertAll((PCard Card) => Card.Name).Concat(new List <string> {
                            "取消"
                        }).ToArray());
                        if (Result >= 0 && Result < Waiting.Count)
                        {
                            TargetCard = Waiting[Result];
                        }
                    }
                    if (TargetCard != null)
                    {
                        TargetCard.Model = new P_YooenChiaoChinKung();
                        PTrigger Trigger = TargetCard.Model.MoveInHandTriggerList.Find((Func <PPlayer, PCard, PTrigger> TriggerGenerator) => TriggerGenerator(Player, TargetCard).Time.Equals(PPeriod.FirstFreeTime.During))?.Invoke(Player, TargetCard);
                        if (Trigger != null)
                        {
                            Game.Logic.StartSettle(new PSettle("纵横[远交近攻]", Trigger.Effect));
                        }
                    }
                }
            });
        }));
        PSkill YinJu = new PSkill("隐居")
        {
            Initiative = true
        };

        SkillList.Add(YinJu
                      .AnnounceTurnOnce()
                      .AddTimeTrigger(
                          new PTime[] {
            PPeriod.FirstFreeTime.During,
            PPeriod.SecondFreeTime.During
        },
                          (PTime Time, PPlayer Player, PSkill Skill) => {
            return(new PTrigger(YinJu.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = Time,
                AIPriority = 10,
                CanRepeat = true,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Player.RemainLimit(YinJu.Name) && Player.HasHouse;
                },
                AICondition = (PGame Game) => {
                    if (!Player.CanBeInjured)
                    {
                        return false;
                    }
                    if (Game.NowPeriod.Equals(PPeriod.FirstFreeTime))
                    {
                        bool CanGo = false;
                        PAiMapAnalyzer.NextBlocks(Game, Player).ForEach((PBlock Block) => {
                            if (Block.Lord != null && Block.Lord.TeamIndex != Player.TeamIndex && Block.Toll >= Player.Money)
                            {
                                CanGo = true;
                            }
                            if (Block.GetMoneyStopSolid < 0 && -Block.GetMoneyStopSolid >= Player.Money)
                            {
                                CanGo = true;
                            }
                            if (Block.GetMoneyStopPercent < 0 && PMath.Percent(Player.Money, -Block.GetMoneyStopPercent) >= Player.Money)
                            {
                                CanGo = true;
                            }
                        });
                        return CanGo || PAiMapAnalyzer.OutOfGameExpect(Game, Player, true) - PAiMapAnalyzer.MinValueHouse(Game, Player).Value > 0;
                    }
                    else
                    {
                        return false;
                    }
                },
                Effect = (PGame Game) => {
                    YinJu.AnnouceUseSkill(Player);
                    PBlock Block = null;
                    if (Player.IsAI)
                    {
                        Block = PAiMapAnalyzer.MinValueHouse(Game, Player).Key;
                    }
                    else
                    {
                        Block = PNetworkManager.NetworkServer.ChooseManager.AskToChooseBlock(Player, YinJu.Name, (PBlock _Block) => {
                            return Player.Equals(_Block.Lord) && _Block.HouseNumber > 0;
                        });
                    }
                    if (Block != null)
                    {
                        Game.MovePosition(Player, Player.Position, Block);
                        PNetworkManager.NetworkServer.TellClients(new PHighlightBlockOrder(Block.Index.ToString()));
                        Game.LoseHouse(Block, 1);
                        Player.Tags.CreateTag(PTag.OutOfGameTag);
                        YinJu.DeclareUse(Player);
                    }
                }
            });
        }));
    }
Exemple #28
0
    public P_IzayoiMiku() : base("诱宵美九")
    {
        Sex   = PSex.Female;
        Age   = PAge.Industrial;
        Index = 28;
        Cost  = 50;
        Tips  = "定位:攻击\n" +
                "难度:简单\n" +
                "史实:轻小说《约会大作战》中女主角。龙胆寺女子学院学生,歌手,偶像。\n" +
                "攻略:\n【独奏】可以压制住全部的防御牌,既不能被闪避也不能被减伤,还无法通过【借尸还魂】、【走为上计】自救,一定程度上使得项羽、廉颇、屈原一类的自伤角色不敢铤而走险。贞德的【圣女】能够对【独奏】形成一定程度的克制。如果美九有【古锭刀】,则每一次过路费都触发【古锭刀】技能的效果,从而成为很强的火力点。新版美九的【独奏】无法触发花木兰的【枭姬】,但花木兰仍可以通过【易装】给她【古锭刀】来形成配合。\n美九的团队通常需要建一座城堡来发动【轮舞曲】。如果在未来大概率拿不到新的商业用地的情况下,即使是3级城堡,在【轮舞曲】之后也相当于免费升了2级的购物中心。";

        NewGeneral = true;

        PSkill Solo = new PSkill("独奏");

        SkillList.Add(Solo
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(Solo.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = PTime.Injure.BeforeEmitInjure,
                AIPriority = 200,
                Condition = (PGame Game) => {
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    return Player.Equals(InjureTag.FromPlayer) && InjureTag.Injure > 0 && InjureTag.ToPlayer != null && InjureTag.ToPlayer.Area.OwnerCardNumber > 0;
                },
                AICondition = (PGame Game) => {
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    PPlayer ToPlayer = InjureTag.ToPlayer;
                    return ToPlayer.TeamIndex != Player.TeamIndex || (ToPlayer.General is P_Gabriel);
                },
                Effect = (PGame Game) => {
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    PPlayerCardArea ToPlayerArea = InjureTag.ToPlayer.Area;
                    Solo.AnnouceUseSkill(Player);
                    Game.CardManager.MoveAll(ToPlayerArea.HandCardArea, ToPlayerArea.OutOfGameArea);
                    // Game.CardManager.MoveAll(ToPlayerArea.EquipmentCardArea, ToPlayerArea.OutOfGameArea);
                    Player.Tags.CreateTag(new PSoloTag());
                }
            });
        })
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(Solo.Name)
            {
                IsLocked = true,
                Player = Player,
                Time = PTime.Injure.EndSettle,
                AIPriority = 200,
                Condition = (PGame Game) => {
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    return Player.Equals(InjureTag.FromPlayer) && InjureTag.Injure > 0 && InjureTag.ToPlayer != null && Player.Tags.ExistTag(PSoloTag.TagName);
                },
                Effect = (PGame Game) => {
                    Solo.AnnouceUseSkill(Player);
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    PPlayer ToPlayer = InjureTag.ToPlayer;
                    Player.Tags.PopTag <PSoloTag>(PSoloTag.TagName);
                    if (ToPlayer.IsAlive)
                    {
                        Game.CardManager.MoveAll(ToPlayer.Area.OutOfGameArea, ToPlayer.Area.HandCardArea);
                    }
                    else
                    {
                        Game.CardManager.MoveAll(ToPlayer.Area.OutOfGameArea, Player.Area.HandCardArea);
                        PPlayer ExtraTarget = null;
                        int ExtraInjure = PMath.Percent(InjureTag.Injure, 50);
                        if (Player.IsAI)
                        {
                            ExtraTarget = PAiTargetChooser.InjureTarget(Game, Player, Player, PTrigger.Except(Player), ExtraInjure, Solo);
                        }
                        else
                        {
                            ExtraTarget = PNetworkManager.NetworkServer.ChooseManager.AskForTargetPlayer(Player, PTrigger.Except(Player), Solo.Name + "[造成" + ExtraInjure.ToString() + "点伤害]", true);
                        }
                        if (ExtraTarget != null)
                        {
                            Game.Injure(Player, ExtraTarget, ExtraInjure, Solo);
                        }
                    }
                }
            });
        }));

        PSkill Rando = new PSkill("轮舞曲")
        {
            Initiative = true
        };

        SkillList.Add(Rando
                      .AnnounceGameOnce()
                      .AddTimeTrigger(
                          new PTime[] {
            PPeriod.FirstFreeTime.During,
            PPeriod.SecondFreeTime.During
        },
                          (PTime Time, PPlayer Player, PSkill Skill) => {
            return(new PTrigger(Rando.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = Time,
                AIPriority = 280,
                CanRepeat = true,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Player.RemainLimit(Rando.Name) &&
                    Game.Map.BlockList.Exists((PBlock Block) => Block.Lord != null && Block.IsBusinessLand);
                },
                AICondition = (PGame Game) => {
                    PBlock MaxHouseBlock = PMath.Max(Game.Map.BlockList.FindAll((PBlock Block) => Block.Lord != null && Block.IsBusinessLand && Block.Lord.TeamIndex == Player.TeamIndex && !Block.BusinessType.Equals(PBusinessType.ShoppingCenter)), (PBlock Block) => Block.HouseNumber, true).Key;
                    if (MaxHouseBlock == null)
                    {
                        return false;
                    }
                    int ClubBonus = PMath.Percent(MaxHouseBlock.Price, 40) * Game.Enemies(Player).Count *MaxHouseBlock.HouseNumber;
                    if (MaxHouseBlock.BusinessType.Equals(PBusinessType.Institute))
                    {
                        ClubBonus -= 4000 * Game.Teammates(Player).Count;
                    }
                    int TeammateCardBonus = -2000 * PMath.Sum(Game.Teammates(Player, false).ConvertAll((PPlayer _Player) => Math.Min(2, _Player.Area.HandCardArea.CardNumber)));
                    int EnemyCardBonus = 2000 * PMath.Sum(Game.Enemies(Player).ConvertAll((PPlayer _Player) => Math.Min(2, _Player.Area.HandCardArea.CardNumber)));
                    int SumBonus = ClubBonus + TeammateCardBonus + EnemyCardBonus;
                    return SumBonus >= 8000 * (1 + Game.Map.BlockList.FindAll((PBlock _Block) => _Block.IsBusinessLand && _Block.Lord == null).Count);
                },
                Effect = (PGame Game) => {
                    Rando.AnnouceUseSkill(Player);
                    Game.Traverse((PPlayer _Player) => {
                        if (_Player != Player)
                        {
                            for (int i = 0; i < 2; ++i)
                            {
                                if (_Player.Area.HandCardArea.CardNumber > 0)
                                {
                                    Game.ThrowCard(_Player, _Player, true, false, false);
                                }
                            }
                        }
                    }, Player);
                    PBlock Target = null;
                    if (Player.IsAI)
                    {
                        PBlock MaxHouseBlock = PMath.Max(Game.Map.BlockList.FindAll((PBlock Block) => Block.Lord != null && Block.IsBusinessLand && Block.Lord.TeamIndex == Player.TeamIndex && !Block.BusinessType.Equals(PBusinessType.ShoppingCenter)), (PBlock Block) => Block.HouseNumber, true).Key;
                        Target = MaxHouseBlock;
                    }
                    else
                    {
                        Target = PNetworkManager.NetworkServer.ChooseManager.AskToChooseBlock(Player, Rando.Name + "-选择一处商业用地", (PBlock Block) => Block.IsBusinessLand && Block.Lord != null);
                    }
                    Target.BusinessType = PBusinessType.Club;
                    PNetworkManager.NetworkServer.TellClients(new PRefreshBlockBasicOrder(Target));
                    Rando.DeclareUse(Player);
                }
            });
        }));
    }
Exemple #29
0
    public P_ShiQian() : base("时迁")
    {
        Sex   = PSex.Male;
        Age   = PAge.Renaissance;
        Index = 7;
        Tips  = "定位:控制\n" +
                "难度:简单\n" +
                "史实:《水浒传》中人物,地贼星,绰号“鼓上蚤”,擅长偷盗,多次利用专业技能为梁山立功。\n" +
                "攻略:\n时迁的使用方法非常简单,只要使用【顺手牵羊】即可。【顺手牵羊】的时机把握是比较重要的问题,手中存留一张【顺手牵羊】,将其用于关键的【乐不思蜀】、【草木皆兵】或者装备上,会比使用【顺手牵羊】直到没有【顺手牵羊】为止效果更好。";

        //PSkill FeiZei = new PSkill("飞贼") {
        //    Lock = true
        //};
        //SkillList.Add(FeiZei
        //    .AddTimeTrigger(
        //    new PTime[] {
        //        PTime.Card.AfterBecomeTargetTime
        //    },
        //    (PTime Time, PPlayer Player, PSkill Skill) => {
        //        return new PTrigger(FeiZei.Name) {
        //            IsLocked = true,
        //            Player = Player,
        //            Time = Time,
        //            AIPriority = 200,
        //            Condition = (PGame Game) => {
        //                PUseCardTag UseCardTag = Game.TagManager.FindPeekTag<PUseCardTag>(PUseCardTag.TagName);
        //                return UseCardTag.TargetList.Contains(Player) && UseCardTag.Card.Model is P_ShunShouChiienYang;
        //            },
        //            Effect = (PGame Game) => {
        //                FeiZei.AnnouceUseSkill(Player);
        //                Game.TagManager.FindPeekTag<PUseCardTag>(PUseCardTag.TagName).TargetList.Remove(Player);
        //            }
        //        };
        //    }));
        PSkill QingMin = new PSkill("轻敏")
        {
            Initiative = true
        };

        SkillList.Add(QingMin
                      .AddTimeTrigger(
                          new PTime[] {
            PPeriod.FirstFreeTime.During,
            PPeriod.SecondFreeTime.During
        },
                          (PTime Time, PPlayer Player, PSkill Skill) => {
            return(new PTrigger(QingMin.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = Time,
                AIPriority = 200,
                CanRepeat = true,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer) &&
                    (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) &&
                    Game.PlayerList.Exists((PPlayer _Player) => _Player.Area.CardNumber > 0 && !_Player.Equals(Player) && _Player.IsAlive) &&
                    Player.Area.HandCardArea.CardList.Exists((PCard Card) => Card.Point == 1);
                },
                AICondition = (PGame Game) => {
                    return Player.Area.HandCardArea.CardList.Exists((PCard Card) => {
                        return Card.Point == 1 && P_ShunShouChiienYang.AIBaseEmitTargets(Game, Player, Card.Model.AIInHandExpectation(Game, Player) + 100)[0] != null;
                    });
                },
                Effect = (PGame Game) => {
                    QingMin.AnnouceUseSkill(Player);
                    PCard TargetCard = null;
                    if (Player.IsAI)
                    {
                        TargetCard = PAiCardExpectation.FindLeastValuable(Game, Player, Player, true, false, false, true, (PCard Card) => Card.Point == 1).Key;
                    }
                    else
                    {
                        List <PCard> Waiting = Player.Area.HandCardArea.CardList.FindAll((PCard Card) => Card.Point == 1);
                        int Result = PNetworkManager.NetworkServer.ChooseManager.Ask(Player, QingMin.Name, Waiting.ConvertAll((PCard Card) => Card.Name).Concat(new List <string> {
                            "取消"
                        }).ToArray());
                        if (Result >= 0 && Result < Waiting.Count)
                        {
                            TargetCard = Waiting[Result];
                        }
                    }
                    if (TargetCard != null)
                    {
                        TargetCard.Model = new P_ShunShouChiienYang();
                        PTrigger Trigger = TargetCard.Model.MoveInHandTriggerList.Find((Func <PPlayer, PCard, PTrigger> TriggerGenerator) => TriggerGenerator(Player, TargetCard).Time.Equals(PPeriod.FirstFreeTime.During))?.Invoke(Player, TargetCard);
                        if (Trigger != null)
                        {
                            Game.Logic.StartSettle(new PSettle("轻敏[顺手牵羊]", Trigger.Effect));
                        }
                        Game.GetCard(Player);
                    }
                }
            });
        }));
    }
Exemple #30
0
    // 宣布一个时机的到来
    public void CallTime(PTime Time)
    {
        PLogger.Log("时机到来:" + Time.Name);
        if (Time.IsPeroidTime() && EndTurnDirectly)
        {
            PLogger.Log("阶段立刻结束");
            return;
        }
        List <PPlayer>  Sequence = SettleSequence();
        List <PTrigger> ValidTriggerList;
        List <PTrigger> AlreadyTriggerList = new List <PTrigger>();

        foreach (PPlayer Judger in Sequence)
        {
            AlreadyTriggerList.Clear();
            PLogger.Log("开始启动" + (Judger == null ? "null" : Judger.Name) + "的响应");
            while ((ValidTriggerList = TriggerList.FindAll((PTrigger Trigger) => {
                if (Trigger.Time.Equals(Time) && Trigger.Player == Judger && !AlreadyTriggerList.Contains(Trigger) && (Judger == null || Judger.IsAlive))
                {
                    PLogger.Log("    执行判定:" + Trigger.Name);
                    bool Condition = Trigger.Condition(Game);
                    bool AiCondition = Condition && (Judger == null || Judger.IsUser || Trigger.AICondition(Game));
                    return(AiCondition);
                }
                else
                {
                    return(false);
                }
            })).Count > 0)
            {
                PTrigger ChosenTrigger = null;
                if (Judger == null || Judger.IsAI)
                {
                    ChosenTrigger = PMath.Max(ValidTriggerList, (PTrigger Trigger) => Trigger.AIPriority).Key;
                }
                else
                {
                    if (ValidTriggerList.Count == 1 && ValidTriggerList[0].IsLocked)
                    {
                        ChosenTrigger = ValidTriggerList[0];
                    }
                    else
                    {
                        string[] TriggerNames = ValidTriggerList.ConvertAll((PTrigger Trigger) => Trigger.Name + (Trigger.IsLocked ? "(锁定)" : string.Empty)).ToArray();
                        if (ValidTriggerList.TrueForAll((PTrigger Trigger) => !Trigger.IsLocked))
                        {
                            TriggerNames = TriggerNames.Concat(new string[] { "取消" }).ToArray();
                        }
                        int ChosenResult = PNetworkManager.NetworkServer.ChooseManager.Ask(Judger, "选择以下效果发动", TriggerNames);
                        if (ChosenResult < ValidTriggerList.Count)
                        {
                            ChosenTrigger = ValidTriggerList[ChosenResult];
                        }
                    }
                }
                if (ChosenTrigger != null)
                {
                    Game.Logic.StartSettle(new PSettle("于[" + Time.Name + "]触发[" + ChosenTrigger.Name + "]", (PGame Game) => {
                        ChosenTrigger.Effect(Game);
                    }));
                    if (!ChosenTrigger.CanRepeat)
                    {
                        AlreadyTriggerList.Add(ChosenTrigger);
                    }
                    if (Time.IsPeroidTime() && EndTurnDirectly)
                    {
                        PLogger.Log("阶段立刻结束");
                        return;
                    }
                    if (Time.Equals(PTime.EnterDyingTime))
                    {
                        PDyingTag DyingTag = Game.TagManager.FindPeekTag <PDyingTag>(PDyingTag.TagName);
                        if (DyingTag.Player != null && DyingTag.Player.Money > 0)
                        {
                            PLogger.Log("脱离濒死状态");
                            return;
                        }
                    }
                }
                else
                {
                    break;
                }
            }
        }
        PLogger.Log("时机结束:" + Time.Name);
    }