Example #1
0
        public BattleResult(KanColleClient kanColleClient, kcsapi_battleresult br)
        {
            this.FleetType = (int)Enums.BattleType.Normal;
            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.Mvp = br.api_mvp;
            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.LvUpShips = br.api_get_exp_lvup.Select(x => Math.Max(x.Length - 2, 0)).ToArray();

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

            List<SimpleShip> fleet = new List<SimpleShip>();
            kanColleClient.Homeport.Organization.Fleets.Where(f =>
                f.Value.State == Grabacr07.KanColleWrapper.Models.FleetState.Sortie).ForEach(item =>

                item.Value.Ships.ForEach(s => fleet.Add(new SimpleShip(s)))
            );
            this.Fleet = fleet.ToArray();

            this.IsFirstBattle = false;
            this.CreateDate = DateTime.Now;
            this.Id = Guid.NewGuid().ToString();
        }
Example #2
0
        private void BattleResult(kcsapi_battleresult br)
        {
            if (br.api_get_ship == null)
                return;

            this.Log(LogType.ShipDrop, "{0},{1},{2},{3},{4}", br.api_get_ship.api_ship_name, br.api_quest_name, br.api_enemy_info.api_deck_name, br.api_win_rank, DateTime.Now.ToString("M/d/yyyy H:mm"));
        }
Example #3
0
        private void BattleResult(kcsapi_battleresult br)
        {
            if (br.api_get_ship == null)
                return;

            Log(LogType.ShipDrop, "{0},{1},{2},{3},{4}", KanColleClient.Current.Translations.GetTranslation(br.api_get_ship.api_ship_name, TranslationType.Ships, br),
                KanColleClient.Current.Translations.GetTranslation(br.api_quest_name, TranslationType.OperationMaps, br),
                KanColleClient.Current.Translations.GetTranslation(br.api_enemy_info.api_deck_name, TranslationType.OperationSortie, br),
                br.api_win_rank, DateTime.Now.ToString("M/d/yyyy H:mm"));
        }
Example #4
0
        private void BattleResult(kcsapi_battleresult br)
        {
            string ShipName = "";
            string ShipType = "";
            if (br.api_get_ship != null)
            {
                ShipName = KanColleClient.Current.Translations.GetTranslation(br.api_get_ship.api_ship_name, TranslationType.Ships, false, br);
            }
            ShipType = KanColleClient.Current.Translations.GetTranslation(br.api_quest_name, TranslationType.OperationMaps, false, br);

            Log(LogType.ShipDrop, "{0},{1},{2},{3},{4}", DateTime.Now.ToString("yyyy/M/d H:mm"), ShipName, ShipType,
                KanColleClient.Current.Translations.GetTranslation(br.api_enemy_info.api_deck_name, TranslationType.OperationSortie, false, br, -1),
                br.api_win_rank);
        }
Example #5
0
 private void BattleResult(kcsapi_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
     }
 }
Example #6
0
        private void BattleResult(kcsapi_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);
        }
Example #7
0
        private void DropShip(kcsapi_battleresult source)
        {
            try
            {
                if (source.api_get_ship == null) return;

                var target = KanColleClient.Current.Master.Ships[source.api_get_ship.api_ship_id];
                if (target == null) return;

                this.droppedItemsCount += target.RawData.api_defeq.Count(x => x != -1);
                this.RaisePropertyChanged("SlotItemsCount");
            }
            catch (Exception ex)
            {
                // defeq が消えてるっぽい暫定対応 (雑)
                Debug.WriteLine(ex);
            }
        }
Example #8
0
		public void UpdateSortieInfo(kcsapi_battleresult data)
		{
			SortieInfo.BattleRank = data.api_win_rank;
		}
Example #9
0
		private void DropShip(kcsapi_battleresult source)
		{
			if (source.api_get_ship == null) return;

			var target = KanColleClient.Current.Master.Ships[source.api_get_ship.api_ship_id];
			if (target == null) return;

			this.droppedItemsCount += target.RawData.api_defeq.Count(x => x != -1);
			this.RaisePropertyChanged("SlotItemsCount");
		}
Example #10
0
 private void OnBattleEnd(KanColleClient kanColleClient, kcsapi_battleresult br, bool isFirstBattle)
 {
     if (BattleEnd != null)
         BattleEnd(this, new Modes.BattleEndEventArgs
         {
             KanColleClient = kanColleClient,
             BattleResult = br,
             IsFirstBattle = isFirstBattle
         });
 }
Example #11
0
        private void AppendBattleResult(kcsapi_battleresult br)
        {
            AMing.Plugins.Core.GenericMessager.Current.SendToLogs(br == null ? string.Empty : br.ToStringContentAndType());

            if (br == null) return;

            OnBattleEnd(KanColleClient.Current, br, isFirstBattle);
            isFirstBattle = false;//重置
        }
Example #12
0
        private void BattleResult(kcsapi_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_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);
 }
        private void BattleResult(kcsapi_battleresult br)
        {
            Rank rank = (Rank)Enum.Parse(Type.GetType("saga.kancolle.Rank"),br.api_win_rank);
            var questName = br.api_quest_name;
            var questLevel = br.api_quest_level;
            var deckName = br.api_enemy_info.api_deck_name;
            var dropShipName = br.api_get_ship == null ? null : br.api_get_ship.api_ship_name;

            var dispatcher = System.Windows.Application.Current.Dispatcher;
            if (dispatcher.CheckAccess())
            {
                counters.Add(questName,deckName,rank,dropShipName);
            }
            else
            {
                dispatcher.Invoke(() => counters.Add(questName, deckName, rank, dropShipName));
            }
        }
        private void DropShip(kcsapi_battleresult source)
        {
            if (source.api_get_ship == null) return;

            this.DroppedShips.Add(new DroppedShip(source.api_get_ship));
        }