Skip to content

Commit

Permalink
handle new format - battle log, night-to-day air support
Browse files Browse the repository at this point in the history
  • Loading branch information
fourinone41 committed Dec 5, 2017
1 parent 546f72c commit 7c37669
Show file tree
Hide file tree
Showing 6 changed files with 193 additions and 90 deletions.
15 changes: 9 additions & 6 deletions js/battleText/battleText.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var player = new FLEET();
var world = API.world;
var map = API.mapnum;
var combined = API.combined;
var startData = (API.battles[0].data.api_nowhps) ? API.battles[0].data : API.battles[0].yasen;
var startData = (API.battles[0].data.api_nowhps || API.battles[0].data.api_f_nowhps) ? API.battles[0].data : API.battles[0].yasen;

var isPvP = (world == 0);
var tabs = $('#tabNodes');
Expand Down Expand Up @@ -47,11 +47,14 @@ processSortie = function(battles) {
};

processText = function() {

if (combined)
player.addCombinedFleet(API.fleet1, API.fleet2, startData.api_nowhps.slice(1, 7), startData.api_nowhps_combined.slice(1, 7), API.combined);
else
player.addFleet(API['fleet' + API.fleetnum], startData.api_nowhps.slice(1, 7));

var hpsMain = startData.api_f_nowhps || startData.api_nowhps.slice(1, 7);
if (combined) {
var hpsEscort = startData.api_f_nowhps_combined || startData.api_nowhps_combined.slice(1, 7);
player.addCombinedFleet(API.fleet1, API.fleet2, hpsMain, hpsEscort, API.combined);
} else {
player.addFleet(API['fleet' + API.fleetnum], hpsMain);
}
if (API.support1 && API.support1 > 0)
player.addSupport(API['fleet' + API.support1]);
if (API.support2 && API.support2 > 0)
Expand Down
1 change: 1 addition & 0 deletions js/data/kcTEXTDATA_CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var TEXTDATA_CN = {
3: "轮型阵",
4: "梯形阵",
5: "单横阵",
6: "警戒陣",
11: "第一警戒航行序列(反潜阵型)",
12: "第二警戒航行序列(复纵阵型)",
13: "第三警戒航行序列(轮型阵)",
Expand Down
1 change: 1 addition & 0 deletions js/data/kcTEXTDATA_EN.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var TEXTDATA_EN = {
3: "Diamond",
4: "Echelon",
5: "Line Abreast",
6: "Vanguard",
11: "Cruising Formation 1",
12: "Cruising Formation 2",
13: "Cruising Formation 3",
Expand Down
1 change: 1 addition & 0 deletions js/data/kcTEXTDATA_JP.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var TEXTDATA_JP = {
3: "輪形陣",
4: "梯形陣",
5: "単横陣",
6: "警戒陣",
11: "第一警戒航行序列(対潜警戒)",
12: "第二警戒航行序列(前方警戒)",
13: "第三警戒航行序列(輪形陣) ",
Expand Down
Loading

0 comments on commit 7c37669

Please sign in to comment.