Exemple #1
0
        /// <summary>
        /// 日付変更時(昼の開始時)の処理
        /// </summary>
        private void DayStart(GameInfo gameInfo)
        {
            // 死体で発見されたエージェントが人狼のパターンを削除する
            foreach (Agent agent in gameInfo.LastDeadAgentList)
            {
                ICondition condition = RoleCondition.GetCondition(agent, Role.WEREWOLF);
                AllViewSystemInfo.RemoveMatchPattern(condition);
            }

            //TODO 飽和が早い配役対応 (15人村→4日目から)(5人村→1狼のため必要無し)
            // 人狼生存人数がおかしいパターンを削除する
            int maxWolfNum = (gameInfo.AliveAgentList.Count - 1) / 2;

            maxWolfNum = Math.Min(maxWolfNum, GameSetting.RoleNumMap[Role.WEREWOLF]);
            if (gameInfo.Day > GameSetting.RoleNumMap[Role.WEREWOLF])
            {
                MatchNumCondition condition = new MatchNumCondition()
                {
                    MinNum = 1, MaxNum = maxWolfNum,
                };
                foreach (Agent agent in gameInfo.AliveAgentList)
                {
                    condition.AddCondition(RoleCondition.GetCondition(agent, Role.WEREWOLF));
                }
                AllViewSystemInfo.RemoveNotMatchPattern(condition);
            }

            talkOffset = 0;

            // debug

            /*
             * Console.Write(gameInfo.Day + "日目 : ");
             * Console.Write(SelfViewSystemInfo.MonsterSidePattern.Count);
             * Console.Write(" / ");
             * Console.Write(AllViewSystemInfo.MonsterSidePattern.Count);
             * Console.WriteLine("");
             */
        }
Exemple #2
0
        /// <summary>
        /// 日付変更時(昼の開始時)の処理
        /// </summary>
        private void DayStart(GameInfo gameInfo)
        {
            // 昨日の情報を更新
            YesterdayInfo = TodayInfo;
            if (YesterdayInfo != null && YesterdayInfo.Day != 0 && YesterdayInfo.Day + 1 == gameInfo.Day)
            {
                TodayInfo.UpdateFromTomorrow(gameInfo);
            }

            // 日の情報を作成
            TodayInfo = new DayInfo(gameInfo);
            DayInfo.Add(gameInfo.Day, TodayInfo);

            // 死体で発見されたエージェントが人狼のパターンを削除する
            foreach (Agent agent in gameInfo.LastDeadAgentList)
            {
                ICondition condition = RoleCondition.GetCondition(agent, Role.WEREWOLF);
                AllViewSystemInfo.RemoveMatchPattern(condition);
            }

            //TODO 飽和が早い配役対応 (15人村→4日目から)(5人村→1狼のため必要無し)
            // 人狼生存人数がおかしいパターンを削除する
            int maxWolfNum = (gameInfo.AliveAgentList.Count - 1) / 2;

            maxWolfNum = Math.Min(maxWolfNum, GameSetting.RoleNumMap[Role.WEREWOLF]);
            if (gameInfo.Day > GameSetting.RoleNumMap[Role.WEREWOLF])
            {
                BitMatchNumCondition condition = new BitMatchNumCondition()
                {
                    MinNum = 1, MaxNum = maxWolfNum,
                };
                foreach (Agent agent in gameInfo.AliveAgentList)
                {
                    condition.AddWerewolf(agent);
                }
                AllViewSystemInfo.RemoveNotMatchPattern(condition);
            }

            // 自分の占い判定の追加
            if (gameInfo.DivineResult != null)
            {
                MySeerJudge.Add(gameInfo.DivineResult);
            }

            // 自分の霊媒判定の追加
            if (gameInfo.MediumResult != null)
            {
                MyMediumJudge.Add(gameInfo.MediumResult);
            }

            // 自分の護衛履歴の追加
            if (gameInfo.GuardedAgent != null)
            {
                MyGuardHistory.Add(gameInfo.Day - 1, gameInfo.GuardedAgent);
            }

            // 護衛成功からのパターン削除
            if (gameInfo.GuardedAgent != null && gameInfo.LastDeadAgentList.Count <= 0)
            {
                BitCondition condition = new BitCondition();
                condition.AddWerewolf(gameInfo.GuardedAgent);

                AllViewSystemInfo.RemoveMatchPattern(condition);
            }


            talkOffset = 0;

            // debug

            /*
             * Console.Write(gameInfo.Day + "日目 : ");
             * Console.Write(SelfViewSystemInfo.MonsterSidePattern.Count);
             * Console.Write(" / ");
             * Console.Write(AllViewSystemInfo.MonsterSidePattern.Count);
             * Console.WriteLine("");
             */
        }