var items = JsonParser.Parse("[[[],[],[],[],[43]]]");\r
dynamic battle = JsonParser.Parse(logs[2]);\r
_shipInfo.InjectShips(battle, items);\r
- _battleInfo.InspectBattle(battle, logs[0]);\r
+ _battleInfo.InspectBattle(logs[0], logs[1], battle);\r
dynamic result = JsonParser.Parse(logs[5]);\r
_battleInfo.InspectBattleResult(result);\r
PAssert.That(() => _shipInfo.GetShipStatuses(2)[4].NowHp == 31);\r
var logs = ReadAllLines("midnight_002");\r
var battle = JsonParser.Parse(logs[3]);\r
_shipInfo.InjectShips(battle, JsonParser.Parse(logs[0]));\r
- _battleInfo.InspectBattle(battle, logs[1]);\r
+ _battleInfo.InspectBattle(logs[1], logs[2], battle);\r
_battleInfo.InspectBattleResult(JsonParser.Parse(logs[6]));\r
PAssert.That(() => _shipInfo.GetShipStatuses(0)[3].NowHp == 12);\r
}\r
private int[] _enemyStartHp;\r
private int[] _enemyGuardStartHp;\r
private readonly List<int> _escapingShips = new List<int>();\r
- private int _flagshipRecoveryType;\r
private bool _lastCell;\r
\r
public BattleState BattleState { get; set; }\r
_itemInfo = itemInfo;\r
}\r
\r
- public void InspectBattle(dynamic json, string url)\r
+ public void InspectBattle(string url, string request, dynamic json)\r
{\r
Formation = FormationName(json);\r
AirControlLevel = CheckAirControlLevel(json);\r
ShowResult(false); // 昼戦の結果を夜戦のときに表示する\r
- SetupResult(json);\r
+ SetupResult(request, json);\r
EnemyFighterPower = CalcEnemyFighterPower(json);\r
BattleState = IsNightBattle(json) ? BattleState.Night : BattleState.Day;\r
CalcDamage(json);\r
_enemyGuardHp = _enemyGuardHp.Select(hp => hp < 0 ? 0 : hp).ToArray();\r
}\r
\r
- public void InspectMapNext(string request)\r
- {\r
- var type = HttpUtility.ParseQueryString(request)["api_recovery_type"];\r
- if (type == null)\r
- return;\r
- _flagshipRecoveryType = int.Parse(type);\r
- }\r
-\r
private bool IsNightBattle(dynamic json) => json.api_hougeki();\r
\r
public static int DeckId(dynamic json)\r
return "";\r
}\r
\r
- private void SetupResult(dynamic json)\r
+ private void SetupResult(string request, dynamic json)\r
{\r
if (_friend != null)\r
return;\r
_shipInfo.SaveBattleStartStatus();\r
_fleet = DeckId(json);\r
var fstats = _shipInfo.GetShipStatuses(_fleet);\r
- FlagshipRecovery(fstats[0]);\r
+ FlagshipRecovery(request, fstats[0]);\r
_friend = Record.Setup(fstats);\r
_enemyHp = (int[])json.api_e_nowhps;\r
_enemyStartHp = (int[])_enemyHp.Clone();\r
}\r
}\r
\r
- private void FlagshipRecovery(ShipStatus flagship)\r
+ private void FlagshipRecovery(string request, ShipStatus flagship)\r
{\r
- switch (_flagshipRecoveryType)\r
+ var type = int.Parse(HttpUtility.ParseQueryString(request)["api_recovery_type"] ?? "0");\r
+ switch (type)\r
{\r
case 0:\r
return;\r
ConsumeSlotItem(flagship, 43); // 女神\r
break;\r
}\r
- if (_flagshipRecoveryType != 0)\r
+ if (type != 0)\r
_shipInfo.SetBadlyDamagedShips();\r
- _flagshipRecoveryType = 0;\r
}\r
\r
private static void ConsumeSlotItem(ShipStatus ship, int id)\r
{\r
if (IsNormalBattleAPI(url) || IsCombinedBattleAPI(url))\r
{\r
- _battleInfo.InspectBattle(data, url);\r
+ _battleInfo.InspectBattle(url, request, data);\r
_logger.InspectBattle(data);\r
return Update.Ship | Update.Battle;\r
}\r
_conditionTimer.InvalidateCond();\r
_miscTextInfo.ClearFlag = true;\r
}\r
- _battleInfo.InspectBattle(data, url);\r
+ _battleInfo.InspectBattle(url, request, data);\r
return Update.Ship | Update.Battle | Update.Timer;\r
}\r
if (url.EndsWith("api_req_sortie/battleresult") || url.EndsWith("api_req_combined_battle/battleresult"))\r
}\r
if (url.EndsWith("api_req_map/next"))\r
{\r
- _battleInfo.InspectMapNext(request);\r
_exMapInfo.InspectMapNext(data);\r
_battleInfo.InspectMapNext(data);\r
_logger.InspectMapNext(data);\r