예제 #1
0
        private void ResetEnemyInfo(kcsapi_midnight_battle battle)
        {
            if (EnableBattlePreview)
            {
                int i = battle.api_ship_ke.Count();
                DataLists.EnemyID = new int[i];
                DataLists.EnemyID = battle.api_ship_ke;
                i = battle.api_ship_lv.Count();
                DataLists.EnemyLv = new int[i];
                DataLists.EnemyLv = battle.api_ship_lv;

                this.DockId = battle.api_deck_id;
            }
        }
예제 #2
0
        /// <summary>
        /// battle의 야전버전. Battle과 구조는 동일. 다만 전투의 양상이 조금 다르기때문에 분리. 연합함대와 아닌경우의 구분을 한다.
        /// </summary>
        /// <param name="battle"></param>
        /// <param name="IsMidnight">주간전이 있었던 야전인경우 true</param>
        /// <param name="IsCombined">연합함대인지 아닌지 입력합니다.연합함대인경우 True입니다.</param>
        /// <param name="IsPractice">연습전인경우 채크합니다. 연습전이면 True</param>
        private void MidBattle(bool IsMidnight, bool IsPractice, kcsapi_midnight_battle battle, bool Combined)
        {
            this.PracticeStatus = IsPractice;
            if (!Combined) this.IsCritical = false;
            //this.Combined = IsCombined;
            List<listup> lists = new List<listup>();
            List<int> CurrentHPList = new List<int>();

            this.ResetEnemyInfo(battle);

            //포격전 리스트를 작성. 주간과 달리 1차 포격전밖에 없음.
            if (battle.api_hougeki != null)
            {
                ObjectListmake(battle.api_hougeki.api_df_list, battle.api_hougeki.api_damage, lists);

                if (Combined && battle.api_maxhps_combined != null && battle.api_nowhps_combined != null)
                {
                    try
                    {
                        //현재 이 부분은 API가 정확히 기억이 나지 않기때문에 일단은 이렇게 처리.
                        //적 HP계산을 위해 아군리스트와 적군 리스트를 병합.
                        int[] CombinePlusEnemyMaxHPs = new int[13];
                        int[] CombinePlusEnemyNowHPs = new int[13];
                        //최대 HP병합
                        for (int i = 0; i < battle.api_maxhps_combined.Length; i++)
                        {
                            CombinePlusEnemyMaxHPs[i] = battle.api_maxhps_combined[i];
                        }
                        for (int i = 7; i < battle.api_maxhps.Length; i++)
                        {
                            CombinePlusEnemyMaxHPs[i] = battle.api_maxhps[i];
                        }

                        //현재 HP병합
                        for (int i = 0; i < battle.api_nowhps_combined.Length; i++)
                        {
                            CombinePlusEnemyNowHPs[i] = battle.api_nowhps_combined[i];
                        }
                        for (int i = 7; i < battle.api_nowhps.Length; i++)
                        {
                            CombinePlusEnemyNowHPs[i] = battle.api_nowhps[i];
                        }

                        BattleCalc(lists, CurrentHPList, CombinePlusEnemyMaxHPs, CombinePlusEnemyNowHPs, true, IsMidnight, IsPractice, Combined);
                    }
                    catch (Exception e)
                    {
                        Debug.WriteLine(e);
                        KanColleClient.Current.CatchedErrorLogWriter.ReportException(e.Source, e);
                    }

                }
                else
                    BattleCalc(lists, CurrentHPList, battle.api_maxhps, battle.api_nowhps, false, IsMidnight, IsPractice, Combined);
            }
            if (EnableBattlePreview)
            {
                this.PreviewCriticalCondition();
                this.IsBattleCalculated = true;
            }
        }