Ejemplo n.º 1
0
        public BattleResult(KanColleClient kanColleClient, kcsapi_combined_battle_battleresult br)
        {
            this.FleetType = (int)Enums.BattleType.Combined;
            this.QuestName = br.api_quest_name;
            this.QuestLevel = br.api_quest_level;
            if (br.api_enemy_info != null)
                this.DeckName = br.api_enemy_info.api_deck_name;
            this.WinRank = br.api_win_rank;
            this.GetExp = br.api_get_exp;
            this.GetBaseExp = br.api_get_base_exp;
            if (br.api_get_ship != null)
                this.GetShip = new SimpleShip(br.api_get_ship);

            this.AdmiralId = kanColleClient.Homeport.Admiral.MemberId;


            this.Mvp = br.api_mvp;
            this.MvpCombined = br.api_mvp_combined;

            this.LvUpShips = br.api_get_exp_lvup.Select(x => Math.Max(x.Length - 2, 0)).ToArray();
            this.LvUpShipsCombined = br.api_get_exp_lvup_combined.Select(x => Math.Max(x.Length - 2, 0)).ToArray();

            List<SimpleShip> fleet = new List<SimpleShip>();
            //既然是联合舰队肯定一二队都出击
            kanColleClient.Homeport.Organization.Fleets[0].Ships.ForEach(s => fleet.Add(new SimpleShip(s)));
            this.Fleet = fleet.ToArray();

            fleet.Clear();
            kanColleClient.Homeport.Organization.Fleets[1].Ships.ForEach(s => fleet.Add(new SimpleShip(s)));
            this.FleetCombined = fleet.ToArray();


            this.IsFirstBattle = false;
            this.CreateDate = DateTime.Now;
            this.Id = Guid.NewGuid().ToString();
        }
Ejemplo n.º 2
0
        private void BattleResult(kcsapi_combined_battle_battleresult data)
        {
            var arg = new BattleResultEventArgs
                      {
                          IsFirstCombat = isFirstCombat,
                          MapAreaId = mapId,
                          EnemyName = data.api_enemy_info.api_deck_name,
                          EnemyShips = enemyShips,
                          Rank = data.api_win_rank
                      };

            isFirstCombat = false;

            BattleResultEvent?.Invoke(this, arg);
        }
Ejemplo n.º 3
0
		public void UpdateSortieInfo(kcsapi_combined_battle_battleresult data)
		{
			SortieInfo.BattleRank = data.api_win_rank;
		}
Ejemplo n.º 4
0
 private void OnCombinedBattleEnd(KanColleClient kanColleClient, kcsapi_combined_battle_battleresult br, bool isFirstBattle)
 {
     if (CombinedBattleEnd != null)
         CombinedBattleEnd(this, new Modes.CombinedBattleEndEventArgs
         {
             KanColleClient = kanColleClient,
             BattleResult = br,
             IsFirstBattle = isFirstBattle
         });
 }
Ejemplo n.º 5
0
        private void AppendCombinedBattleResult(kcsapi_combined_battle_battleresult br)
        {
            AMing.Plugins.Core.GenericMessager.Current.SendToLogs(br == null ? string.Empty : br.ToStringContentAndType());

            if (br == null) return;

            OnCombinedBattleEnd(KanColleClient.Current, br, isFirstBattle);
            isFirstBattle = false;//重置
        }
Ejemplo n.º 6
0
        private void BattleResult(kcsapi_combined_battle_battleresult br)
        {
            try
            {
                if (br.api_get_ship == null)
                    return;

                this.Log(LogType.ShipDrop,
                         KanColleClient.Current.Translations.GetTranslation(br.api_get_ship.api_ship_name, TranslationType.Ships, br), //Result
                         KanColleClient.Current.Translations.GetTranslation(br.api_quest_name, TranslationType.OperationMaps, br), //Operation
                         KanColleClient.Current.Translations.GetTranslation(br.api_enemy_info.api_deck_name, TranslationType.OperationSortie, br), //Enemy Fleet
                         br.api_win_rank //Rank
                    );
            }
            catch (Exception)
            {
                // ignored
            }
        }
 // 情報更新(連合艦隊戦闘結果).
 public void Update(kcsapi_combined_battle_battleresult result)
 {
     #if DEBUG
     Trace.WriteLine(string.Format("Update {0} {1}", result.api_quest_name, result.api_get_ship == null ? "null" : result.api_get_ship.api_ship_name), Plugin.LOGTAG);
     #endif
     BattleResultData brd = new BattleResultData();
     brd.ResultDateTime = DateTime.Now;
     brd.MapAreaName = this.mapAreaName;
     brd.MapInfoName = this.mapInfoName;
     brd.MapCell = this.mapCell;
     //brd.QuestName = result.api_quest_name;
     //brd.QuestLevel = result.api_quest_level;
     brd.EnemyDeckName = result.api_enemy_info.api_deck_name;
     brd.WinRank = result.api_win_rank;
     if (result.api_get_ship != null)
     {
         //brd.GetShipId = result.api_get_ship.api_ship_id;
         brd.GetShipName = result.api_get_ship.api_ship_name;
     }
     else
     {
         //brd.GetShipId = -1;
         brd.GetShipName = "";
     }
     dataList.Add(brd);
     onBattleResultDataAdded(brd);
 }
Ejemplo n.º 8
0
 private void CombinedBattleResult(kcsapi_combined_battle_battleresult br)
 {
     try
     {
         this.Log(LogType.ShipDrop,
                  br.api_get_ship == null ? "N/A" : br.api_get_ship.api_ship_name, //Result
                  br.api_quest_name, //Operation
                  br.api_enemy_info.api_deck_name, //Enemy Fleet
                  br.api_win_rank //Rank
             );
     }
     catch (Exception)
     {
         // ignored
     }
 }
Ejemplo n.º 9
0
        private void DropShip(kcsapi_combined_battle_battleresult source)
        {
            if (source.api_get_ship == null) return;

            this.DroppedShips.Add(new DroppedShip(source.api_get_ship));
        }
Ejemplo n.º 10
0
 /// <summary>
 /// battleresult창이 떴을때 IsCritical이 True이면 CriticalCondition이벤트를 발생
 /// 추가로 조우하지않았던 함대와 조우한 경우 해당 함대의 정보를 기록
 /// </summary>
 /// <param name="result">기본값은 null. 연합함대인경우에만 값을 받아 호위 회항한 부분을 채크</param>
 private void Result(kcsapi_combined_battle_battleresult result = null)
 {
     if (this.IsNewEnemy && this.EnableBattlePreview)//새로운 적이고 전투 미리보기가 켜져있는 경우에만 기록
     {
         EnemyFleet.FleetName = result.api_enemy_info.api_deck_name;
         KanColleClient.Current.Translations.WriteFile(EnemyFleet);
     }
     if (this.IsCritical) this.CriticalCondition();
     this.ResultEnd();
     this.BattleEnd = true;
 }