From ac19a36cfca291b0f7a7cf9003d11a0f88c28f15 Mon Sep 17 00:00:00 2001 From: X-20A <155217226+X-20A@users.noreply.github.com> Date: Fri, 6 Sep 2024 23:14:49 +0900 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0:=20E-2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compass/dist/main.js | 2 +- compass/src/js/main.js | 18 +++++++++++++----- data/branch.js | 6 +++--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/compass/dist/main.js b/compass/dist/main.js index 87020d2..396826a 100644 --- a/compass/dist/main.js +++ b/compass/dist/main.js @@ -409,7 +409,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var jquery_ui_ui_widgets_draggable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery-ui/ui/widgets/draggable */ \"./node_modules/jquery-ui/ui/widgets/draggable.js\");\n/* harmony import */ var jquery_ui_ui_widgets_draggable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery_ui_ui_widgets_draggable__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! decimal.js */ \"./node_modules/decimal.js/decimal.mjs\");\n/* harmony import */ var cytoscape_dist_cytoscape_min_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! cytoscape/dist/cytoscape.min.js */ \"./node_modules/cytoscape/dist/cytoscape.min.js\");\n/* harmony import */ var cytoscape_dist_cytoscape_min_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(cytoscape_dist_cytoscape_min_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var cytoscape_context_menus__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! cytoscape-context-menus */ \"./node_modules/cytoscape-context-menus/cytoscape-context-menus.js\");\n/* harmony import */ var cytoscape_context_menus__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(cytoscape_context_menus__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var gkcoi__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! gkcoi */ \"./node_modules/gkcoi/esm/index.js\");\n/*\r\n 更新手続き\r\n\r\n イベなど新海域\r\n 1.関数\r\n branch\r\n countUnits・・・搭載艦数で何か新しく数えたいのがあれば\r\n 他分岐条件に必要なもの\r\n 2.変数\r\n areas\r\n op_areas・・・何かしらオプションがあれば\r\n active\r\n 1が攻略段階\r\n 2が難易度 飽くまで慣例\r\n 3.データ\r\n data/map.js\r\n data/branch.js\r\n 4.表示系\r\n index.html\r\n #area-inner・・・海域\r\n #option-box・・・オプション\r\n\r\n このへん追加すれば動くはず、たぶん\r\n\r\n 新艦・新装備\r\n data/ship.js\r\n data/item.js\r\n*/\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\ncytoscape_dist_cytoscape_min_js__WEBPACK_IMPORTED_MODULE_3___default().use((cytoscape_context_menus__WEBPACK_IMPORTED_MODULE_4___default()));\r\n\r\njquery__WEBPACK_IMPORTED_MODULE_0___default()(function() {\r\n /*\r\n s_dataはship.js\r\n e_dataはitem.js\r\n map_infoはmap.jsより\r\n\r\n 制空シミュを基準にしたときの本家デッキビルダー差異・注意点\r\n 艦ID'のみ'文字列\r\n 改修値が0のとき、キーがそもそもない\r\n */\r\n // 艦隊諸元\r\n let com = {\r\n BB:0, // 戦艦\r\n BBV:0, // 航空戦艦&改装航空戦艦\r\n CV:0, // 正規空母\r\n CVB:0, // 装甲空母\r\n CVL:0, // 軽空母\r\n CA:0, // 重巡\r\n CAV:0, // 航巡\r\n CL:0, // 軽巡\r\n CLT:0, // 雷巡\r\n ATU:0, // 練習特務艦 欠番\r\n CT:0, // 練習巡洋艦\r\n DD:0, // 駆逐艦\r\n DE:0, // 海防艦\r\n SS:0, // 潜水艦\r\n SSV:0, // 潜水空母\r\n AV:0, // 水母\r\n AO:0, // 補給艦\r\n ASU:0, // 特務艦 欠番\r\n LHT:0, // 灯台補給船 欠番\r\n CVE:0, // 特設護衛空母 欠番\r\n LHA:0, // 揚陸艦\r\n LST:0, // 戦車揚陸艦 欠番\r\n AS:0, // 潜水母艦\r\n AR:0 // 工作艦\r\n };\r\n let i_json = null; // インポートしたjsonを格納\r\n // 艦隊諸元 分岐演算に使う\r\n let f_length = 0; // 構成艦数\r\n let f_ids = null;\r\n let f_names = null; // 構成艦艦名\r\n let f2_names = null; // 随伴艦隊構成艦名 表示の為だけ\r\n let f2_length = 0;\r\n let f_speed = null; // 速度\r\n let f_seek = null; // 索敵値\r\n // ドラム缶、大発系、電探搭載艦数\r\n let f_drum = 0;\r\n let f_radar = 0;\r\n let f_craft = 0;\r\n let f_kanko = 0;\r\n /*\r\n 読込モード\r\n 1:第一艦隊\r\n 2:第二艦隊\r\n 3:第三艦隊\r\n 4:第四艦隊\r\n 5:水上打撃部隊\r\n 6:空母機動部隊\r\n 7:輸送護衛部隊\r\n 判定も少しはするけど殆ど自己申告\r\n */\r\n let f_type = null;\r\n\r\n // 資源マス計算に使う(分岐判定には使わない)装備の累計\r\n let ft_drum = 0;\r\n let ft_craft = 0;\r\n\r\n // 消費資源計算に使う\r\n let f_lvs = [];\r\n\r\n // 読込時にあれこれしたやつを艦隊単位で入れる\r\n // あとで実際に反映する艦隊を艦隊番号を指定してfシリーズに移す\r\n let c_lengths = [];\r\n let c_ids = [];\r\n let c_names = [];\r\n let c_types = [];\r\n let c_seeks = [];\r\n let c_speeds = [];\r\n let c_drums = [];\r\n let c_radars = [];\r\n let c_crafts = [];\r\n let c_kanko = [];\r\n\r\n // 資源マス計算に使う(分岐判定には使わない)装備の累計\r\n /*\r\n 大発動艇\r\n 大発動艇(八九式中戦車&陸戦隊)\r\n 特に式内火艇\r\n 特大発動艇\r\n 装甲艇(AB艇)\r\n 武装大発\r\n 大発動艇(II号戦車/北アフリカ仕様)\r\n 特大発動艇+一式砲戦車\r\n 特四式内火艇\r\n 特四式内火艇改\r\n */\r\n const valid_crafts = [68,166,167,193,408,409,436,449,525,526];\r\n let ct_drums = [];\r\n let ct_crafts = [];\r\n\r\n // 消費資源計算に使う\r\n let c_lvs = [];\r\n\r\n /*\r\n 艦隊種別選択したやつ(数値)が入る\r\n 1:第一艦隊\r\n 2:第二艦隊\r\n 3:第三艦隊\r\n 4:第四艦隊\r\n 5:空母機動部隊\r\n 6:水上打撃部隊\r\n 7:輸送護衛部隊\r\n */\r\n let selected_type = null;\r\n\r\n // 受け付ける海域\r\n const areas = ['1-1','1-2','1-3','1-4','1-5','1-6','2-1','2-2','2-3','2-4','2-5','3-1','3-2','3-3','3-4','3-5','4-1','4-2','4-3','4-4','4-5','5-1','5-2','5-3','5-4','5-5','6-1','6-2','6-3','6-4','6-5','7-1','7-2','7-3','7-3-1','7-4','7-5','57-7','58-1','58-2','58-3','58-4','59-1','59-2','59-3','59-4','59-5'];\r\n // optionがある海域\r\n const op_areas = ['4-5','5-3','5-5','6-3','7-3','7-4','7-5','57-7','58-1','58-2','58-3','58-4','59-1','59-2','59-3','59-4','59-5'];\r\n\r\n // 1がキーの値はPhase\r\n let active = {'4-5':{'A':'D','C':'F','I':'J'},'5-3':{'O':'K'}, '5-5':{'F':'D'}, '6-3':{'A':'B'},'7-3':{'1':'0'},'7-4':{'F':'H'},'7-5':{'F':'G','H':'I','O':'P'}, '57-7':{'1':'1','A2':'A3','B':'B1','B2':'B3','C':'A3','J':'K'},'58-1':{'1':'1','A':'D','I':'N1','F':'G'},'58-2':{'1':'1','2':'1','B':'E'},'58-3':{'1':'1','2':'1','M':'P'},'58-4':{'1':'1','2':'1','B':'D'},'59-1':{'1':'1','C':'C1','E':'F'},'59-2':{'L':'M','N':'O','P':'Q'},'59-3':{'1':'1','C':'C1'},'59-4':{'1':'1','A2':'B','D':'E'},'59-5':{'1':'1','G':'H','O2':'P','W':'Z'}};\r\n\r\n let area = null; // 入力で切り替えるの\r\n let drew_area = null; // 表示中の海域\r\n\r\n // 演算開始の為のフラグ\r\n let a_flag = false;\r\n let f_flag = false;\r\n\r\n let rate = {}; // これにルート情報を詰め込んでいく\r\n let track = []; // 最後の軌跡\r\n let t_logs = {}; // trackを1周ごとに格納\r\n\r\n let cy = null;\r\n\r\n // 索敵無視フラグと退避用変数\r\n let is_ignore_seek = false;\r\n let fs_copy = null;\r\n\r\n let s_time = 0; // 区間計測用\r\n \r\n const isDev = location.hostname !== 'x-20a.github.io'; // 開発環境であるか\r\n \r\n const cdn = 'https://cdn.jsdelivr.net/gh/X-20A/X-20A.github.io@main';\r\n\r\n // 海域が入力されたら適正かチェックしてフラグ切替\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.areas').on('click', function() {\r\n setArea(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val());\r\n });\r\n // 海域入力で発火 オプション表示したり\r\n function setArea(text) {\r\n console.log(`area: ${text}`);\r\n if(areas.includes(text)) {\r\n a_flag = true;\r\n localStorage.setItem('area', text);\r\n if(op_areas.includes(text)) {\r\n // オプションが必要な海域は入力を表示\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#option-box').css('display','block');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#option-box .options').each(function () {\r\n const child = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);\r\n if (child.attr('id') === text) {\r\n child.css('display', 'block');\r\n } else {\r\n // 子要素が存在しない場合はdisplayをnoneに設定\r\n child.css('display', 'none');\r\n }\r\n });\r\n } else {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#option-box').css('display','none');\r\n }\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#area-container').click();\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#area-display').text(`海域: ${text}`);\r\n } else {\r\n a_flag = false;\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#option-box').css('display','none');\r\n }\r\n simController();\r\n }\r\n // オプションドラッグ\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#draggable-list').draggable({ containment: 'window', scroll: false });\r\n // オプションが変更されたら取得してlocalstorageへ保存\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.option-value').on('input', function() {\r\n const name = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('name');\r\n const namePattern = /^([\\dA-Z]+-[\\dA-Z]+)-([\\dA-Z]+)$/i;\r\n const match = name.match(namePattern);\r\n const key = match[1];\r\n const char = match[2];\r\n const value = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val();\r\n if(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('type') === 'radio') {\r\n updateActive(key, char, value);\r\n }\r\n simController();\r\n });\r\n // デッキビルダー読み込み\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').on('input', function() {\r\n const text = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val();\r\n try {\r\n i_json = JSON.parse(text);\r\n } catch(e) {\r\n console.log(e);\r\n f_flag = false;\r\n alert('処理中断: 形式不正');\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).blur();\r\n return;\r\n }\r\n /*\r\n 処理の流れ\r\n 1.貼り付けられた時点で第四艦隊まで読み込んで計算まで済ます\r\n 2.一艦隊しか情報が無ければそのまま演算開始\r\n 3.key:tに値があればその形式で演算開始\r\n 4.それ以外は艦隊形式の選択を待つ\r\n */\r\n // cシリーズ初期化\r\n inCs();\r\n // 1\r\n let zeroCount = 0;\r\n let tar = null;\r\n for(let i = 1;i < 5;i++) {\r\n const count = countShips(i);\r\n c_lengths.push(count);\r\n if(count === 0) {\r\n zeroCount++;\r\n } else {\r\n tar = i;\r\n }\r\n if(count) {\r\n c_ids.push(getIdsFromFleet(i));\r\n c_lvs.push(getLvs(i))\r\n c_names.push(getShipName(i));\r\n c_types.push(getType(i));\r\n try {\r\n c_seeks.push(calcSeek(i));\r\n } catch(e) {\r\n console.error(e);\r\n alert('処理中断:未対応の艦、装備が含まれるかも?');\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).blur();\r\n return;\r\n }\r\n c_speeds.push(calcSpeed(i));\r\n countUnits(i, false);\r\n countUnits(i, true);\r\n } else {\r\n // 第一・第二艦隊が空で第三艦隊だけあるみたいな場合\r\n // 空を入れてやる\r\n c_ids.push([]);\r\n c_lvs.push([]);\r\n c_names.push([]);\r\n c_types.push([]);\r\n c_seeks.push([]);\r\n c_speeds.push([]);\r\n c_drums.push(0);\r\n c_radars.push(0);\r\n c_crafts.push(0);\r\n c_kanko.push(0);\r\n\r\n ct_drums.push(0);\r\n ct_crafts.push(0);\r\n }\r\n }\r\n console.log(`c_lengths: ${c_lengths}`);\r\n console.log(`c_ids: ${c_ids}`);\r\n console.log(`c_lvs: ${c_lvs}`);\r\n console.log(`c_searchs: ${c_seeks}`);\r\n console.log(`c_speeds: ${c_speeds}`);\r\n console.log(`c_drums: ${c_drums}, c_radars: ${c_radars}, c_crafts: ${c_crafts}, c_kanko: ${c_kanko}`);\r\n if(zeroCount === 3) {\r\n // 2.情報の有る艦隊が一つだけの場合はそのまま読み込み\r\n setFleetInfo(tar);\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#type-select').css('display', 'none');\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).blur();\r\n return;\r\n } else if(zeroCount === 4) {\r\n alert('処理中断: 艦隊が空かも?');\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).blur();\r\n return;\r\n }\r\n // 3\r\n let t = null;\r\n if(i_json['f1']['t']) {\r\n t = Number(i_json['f1']['t']);\r\n switch(t) {\r\n case 1:\r\n selected_type = 5;\r\n break;\r\n case 2:\r\n selected_type = 6;\r\n break;\r\n case 3:\r\n selected_type = 7;\r\n break;\r\n }\r\n }\r\n console.log(`制空シミュからの艦隊種別指定: ${t}`);\r\n let view = '艦隊種別';\r\n console.log(`設定艦隊種別: ${selected_type}`);\r\n if(selected_type) {\r\n if(selected_type > 4) {\r\n if(c_lengths[0] && c_lengths[1]) { // 第一と第二に少なくとも1艦\r\n switch(selected_type) {\r\n case 5:\r\n view = '空母機動部隊';\r\n break;\r\n case 6:\r\n view = '水上打撃部隊';\r\n break;\r\n case 7:\r\n view = '輸送護衛部隊';\r\n break;\r\n }\r\n } else {\r\n alert('第一艦隊もしくは第二艦隊が空?');\r\n setBackSelect();\r\n }\r\n } else {\r\n switch(selected_type) {\r\n case 1:\r\n view = '第一艦隊';\r\n break;\r\n case 2:\r\n view = '第二艦隊';\r\n break;\r\n case 3:\r\n view = '第三艦隊';\r\n break;\r\n case 4:\r\n view = '第四艦隊';\r\n break;\r\n }\r\n }\r\n setFleetInfo(selected_type);\r\n }\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#type-select').css('display', 'block');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#type-select').text(view);\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).blur();\r\n });\r\n // 艦隊種別選択表示\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#type-select').on('mouseover', function() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-option-box').css('display', 'block');\r\n });\r\n // 艦隊種別選択非表示\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-option-box').on('mouseleave', function() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-option-box').css('display', 'none');\r\n });\r\n // 艦隊形式が選択されたら該当する計算データを変数反映して演算開始\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.fleet-type').on('click', function() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#type-select').text(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).text());\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-option-box').css('display', 'none');\r\n const type = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('type');\r\n setFleetInfo(type);\r\n });\r\n // セレクトの値を一つ前に戻す\r\n // 読込がまずったときに\r\n function setBackSelect() {\r\n console.log('setBackSelect');\r\n const options = jquery__WEBPACK_IMPORTED_MODULE_0___default()('.fleet-type');\r\n if(selected_type) {\r\n for (const option of options) {\r\n if(option.dataset.type === selected_type + '') { // 文字列化してから比較\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#type-select').text(option.textContent);\r\n }\r\n }\r\n } else {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#type-select').text('艦隊種別');\r\n localStorage.removeItem('selected_type');\r\n }\r\n }\r\n // 計算結果から抜き出して変数セット\r\n // 引数:艦隊種別\r\n function setFleetInfo(f) {\r\n f--; // 配列指定の為\r\n // 初期化してから\r\n for (const key in com) {\r\n com[key] = 0;\r\n }\r\n try {\r\n if(f < 4) {\r\n // 通常艦隊\r\n f_length = c_lengths[f];\r\n console.log(`f_length: ${f_length}`);\r\n if(!f_length) {\r\n alert('処理中断: 艦隊が空かも?');\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').blur();\r\n setBackSelect();\r\n return;\r\n }\r\n // 構成艦のid\r\n f_ids = c_ids[f];\r\n console.log(`f_ids: ${f_ids}`);\r\n // 構成艦のlv\r\n f_lvs = c_lvs[f];\r\n console.log(`f_lvs: ${f_lvs}`);\r\n // 構成艦の名前\r\n f_names = c_names[f];\r\n console.log(`f_names: ${f_names}`);\r\n const types = c_types[f];\r\n console.log(`types: ${types}`);\r\n // 変数反映\r\n reflectionCom(types);\r\n // 索敵値\r\n f_seek = c_seeks[f];\r\n console.log(`f_search: ${f_seek}`);\r\n // 速度\r\n f_speed = c_speeds[f];\r\n console.log(`f_speed: ${f_speed}`);\r\n // ドラム缶、大発、電探搭載艦数カウント 変数にセット\r\n f_drum = c_drums[f];\r\n f_radar = c_radars[f];\r\n f_craft = c_crafts[f];\r\n f_kanko = c_kanko[f];\r\n console.log('搭載艦数');\r\n console.log(`ドラム缶: ${f_drum}`);\r\n console.log(`電探: ${f_radar}`);\r\n console.log(`大発系: ${f_craft}`);\r\n console.log(`寒甲: ${f_kanko}`);\r\n\r\n ft_drum = ct_drums[f];\r\n ft_craft = ct_crafts[f];\r\n console.log(`ドラム缶累計: ${ft_drum}`);\r\n console.log(`大発系累計: ${ft_craft}`);\r\n if(f_length === 7) {\r\n f_type = '遊撃部隊';\r\n } else {\r\n f_type = '通常艦隊';\r\n }\r\n console.log(`f_type: ${f_type}`);\r\n } else {\r\n // 連合艦隊\r\n // 第一艦隊と第二艦隊を足したり\r\n f_length = c_lengths[0] + c_lengths[1];\r\n f2_length = c_lengths[1];\r\n console.log(`f_length: ${f_length}`);\r\n if(!c_lengths[0] || !c_lengths[1]) {\r\n alert('処理中断: 艦隊が空かも?');\r\n setBackSelect();\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').blur();\r\n return;\r\n }\r\n // 構成艦のid\r\n f_ids = c_ids[0].concat(c_ids[1]);\r\n console.log(`f_ids: ${f_ids}`);\r\n f_lvs = c_lvs[0].concat(c_lvs[1]);\r\n // 構成艦のlv\r\n console.log(`f_lvs: ${f_lvs}`);\r\n // 構成艦の名前\r\n f_names = c_names[0].concat(c_names[1]);\r\n f2_names = c_names[1];\r\n console.log(`f_names: ${f_names}`);\r\n const types = c_types[0].concat(c_types[1]);\r\n console.log(`types: ${types}`);\r\n // 変数反映\r\n reflectionCom(types);\r\n // 索敵値 各項足し合わせ\r\n f_seek = [];\r\n for (let i = 0; i < 4; i++) {\r\n f_seek.push(new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](c_seeks[0][i]).plus(new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](c_seeks[1][i])));\r\n }\r\n console.log(`f_search: ${f_seek}`);\r\n // 速度\r\n // 低い方から適用\r\n if(c_speeds[0] === '低速艦隊' || c_speeds[1] === '低速艦隊') {\r\n f_speed = '低速艦隊';\r\n } else if(c_speeds[0] === '高速艦隊' || c_speeds[1] === '高速艦隊') {\r\n f_speed = '高速艦隊';\r\n } else if(c_speeds[0] === '高速+艦隊' || c_speeds[1] === '高速+艦隊') {\r\n f_speed = '高速+艦隊';\r\n } else {\r\n f_speed = '最速艦隊';\r\n }\r\n console.log(`f_speed: ${f_speed}`);\r\n // ドラム缶、大発、電探搭載艦数カウント 変数にセット\r\n f_drum = c_drums[0] + c_drums[1];\r\n f_radar = c_radars[0] + c_radars[1];\r\n f_craft = c_crafts[0] + c_crafts[1];\r\n f_kanko = c_kanko[0] + c_kanko[1];\r\n console.log(`ドラム缶: ${f_drum}`);\r\n console.log(`電探: ${f_radar}`);\r\n console.log(`大発系: ${f_craft}`);\r\n\r\n ft_drum = ct_drums[0] + ct_drums[1];\r\n ft_craft = ct_crafts[0] + ct_crafts[1];\r\n // 艦隊種別\r\n if(f === 4) {\r\n f_type = '空母機動部隊';\r\n } else if(f === 5) {\r\n f_type = '水上打撃部隊';\r\n } else if(f === 6) {\r\n f_type = '輸送護衛部隊';\r\n }\r\n console.log(`f_type: ${f_type}`);\r\n }\r\n } catch(e) {\r\n console.log(`error: ${e}`);\r\n alert('処理中断: 艦隊情報の取得に失敗しました');\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').blur();\r\n setBackSelect();\r\n return;\r\n }\r\n // 気休めだけども保存前にチェック\r\n if(f_length && f_ids && f_names && f_seek && f_seek[0] && f_speed) {\r\n // 丸ごとlocalstorageへ\r\n localStorage.setItem('fleet', JSON.stringify(i_json));\r\n f_flag = true;\r\n selected_type = f + 1; // 配列指定の為に引いた分足しなおす\r\n localStorage.setItem('selected_type', selected_type);\r\n // 表示\r\n reloadImportDisplay();\r\n is_ignore_seek = false;\r\n simController();\r\n } else {\r\n alert('処理中断: 入力値に不備があるかも?');\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').blur();\r\n setBackSelect();\r\n }\r\n console.log('艦隊諸元読込完了');\r\n }\r\n // cシリーズ初期化\r\n function inCs() {\r\n c_lengths = [];\r\n c_ids = [];\r\n c_names = [];\r\n c_types = [];\r\n c_seeks = [];\r\n c_speeds = [];\r\n c_drums = [];\r\n c_radars = [];\r\n c_crafts = [];\r\n c_kanko = [];\r\n\r\n ct_drums = [];\r\n ct_crafts = [];\r\n\r\n c_lvs = [];\r\n }\r\n // ドラム缶、大発、電探搭載艦数, 寒甲カウント\r\n function countUnits(num, is_for_resource) {\r\n let drum = 0;\r\n let radar = 0;\r\n let craft = 0;\r\n let kanko = 0;\r\n if(is_for_resource) {\r\n for(let i = 0;i < c_lengths[num - 1];i++) {\r\n const e_ids = getEqIds(c_ids[num - 1][i], num);\r\n // 累計\r\n for(const e_id of e_ids) {\r\n if(e_id === 75) { // ドラム缶\r\n drum++;\r\n } else if(valid_crafts.includes(e_id)) { // 大発系\r\n craft++;\r\n }\r\n }\r\n }\r\n ct_drums.push(drum);\r\n ct_crafts.push(craft);\r\n } else {\r\n for(let i = 0;i < c_lengths[num - 1];i++) {\r\n const e_ids = getEqIds(c_ids[num - 1][i], num);\r\n // 一隻につき1回だけカウント\r\n let d = true;\r\n let r = true;\r\n let c = true;\r\n let k = true;\r\n for(const e_id of e_ids) {\r\n if(e_id === 75) { // ドラム缶\r\n if(d) {\r\n drum++;\r\n d = false;\r\n }\r\n }\r\n // typeを取得\r\n const t_id = getEqType(e_id);\r\n if(t_id === 5812 || t_id === 5813) {\r\n if(r) {\r\n // 小型電探\r\n // 大型電探\r\n radar++;\r\n r = false;\r\n }\r\n } else if(t_id === 81424 || t_id === 84724|| t_id === 203746) {\r\n // 特大発動艇+戦車第11連隊及びM4A1のみ除外 M4A1はtype:84524で含まれない\r\n if(e_id !== 230) {\r\n if(c) {\r\n craft++;\r\n c = false;\r\n }\r\n }\r\n } else if(e_id === 402) { // 寒甲\r\n if(k) {\r\n kanko++;\r\n k = false;\r\n }\r\n }\r\n }\r\n }\r\n c_drums.push(drum);\r\n c_radars.push(radar);\r\n c_crafts.push(craft);\r\n c_kanko.push(kanko);\r\n }\r\n\r\n }\r\n // typeの先頭3つを連結してidとして返す(数値型)\r\n function getEqType(e_id) {\r\n const entry = e_data.find(entry => entry.id === e_id);\r\n return Number(entry.type.slice(0, 3).join(''));\r\n }\r\n // 速度を取得 高速+艦隊etc\r\n function calcSpeed(num) {\r\n const arr = [];\r\n for(let i = 0;i < c_lengths[num - 1];i++) {\r\n const e_ids = getEqIds(c_ids[num - 1][i], num);\r\n const rf = getEqRfs(c_ids[num - 1][i], num);\r\n /*\r\n 33:タービン\r\n 34:強化缶\r\n 87:新型缶\r\n */\r\n let tur = 0; // タービン\r\n let kan = 0; // 強化缶\r\n let n_kan = 0; // 新型缶\r\n let pow = 0; // 新型缶☆7↑\r\n for(let q = 0;q < e_ids.length;q++) {\r\n if(e_ids[q] === 33) {\r\n tur++;\r\n } else if(e_ids[q] === 34) {\r\n kan++;\r\n } else if(e_ids[q] === 87) {\r\n n_kan++;\r\n if(rf[q] > 6) {\r\n pow++;\r\n }\r\n }\r\n }\r\n const kans = kan + n_kan;\r\n const ship = s_data.find(entry => entry.id === c_ids[num - 1][i]);\r\n const sg = ship.sg;\r\n let val = 0;\r\n switch(sg) {\r\n case 0: // 高速A\r\n val = 1;\r\n if(tur && n_kan || pow > 1) {\r\n val = 3;\r\n } else if(tur && kans || pow) {\r\n val = 2;\r\n }\r\n arr.push(val);\r\n break;\r\n case 1: // 高速B1\r\n val = 1;\r\n if(tur && n_kan && kans > 1) {\r\n val = 3;\r\n } else if(tur && kans) {\r\n val = 2;\r\n }\r\n arr.push(val);\r\n break;\r\n case 2:// 高速B2\r\n val = 1;\r\n if(tur &&(n_kan > 1 || kans > 2)) {\r\n val = 3;\r\n } else if(tur && kans) {\r\n val = 2;\r\n }\r\n arr.push(val);\r\n break;\r\n case 3: // 高速C\r\n val = 1;\r\n if(tur && kans) {\r\n val = 2;\r\n }\r\n arr.push(val);\r\n break;\r\n case 4: // 低速A群\r\n val = 0;\r\n if(tur && n_kan && kans > 2) {\r\n val = 3;\r\n } else if(tur && pow > 1) {\r\n val = 3;\r\n } else if(tur && n_kan && kans > 1) {\r\n val = 2;\r\n } else if(tur && pow) {\r\n val = 2;\r\n } else if(tur && kans) {\r\n val = 1;\r\n }\r\n arr.push(val);\r\n break;\r\n case 5: // 低速B\r\n val = 0;\r\n if(tur && (n_kan > 1 || kans > 2)) {\r\n val = 2;\r\n } else if(tur && kans) {\r\n val = 1;\r\n }\r\n arr.push(val);\r\n break;\r\n case 6: // 低速C\r\n val = 0;\r\n if(tur && kans) {\r\n val = 1;\r\n }\r\n arr.push(val);\r\n break;\r\n case 7: // 低速D\r\n val = 0;\r\n if(tur && n_kan) {\r\n val = 2;\r\n } else if(n_kan || tur && kans) {\r\n val = 1;\r\n }\r\n arr.push(val);\r\n break;\r\n case 8: // 低速E\r\n val = 0;\r\n if(tur && n_kan && kans > 1) {\r\n val = 3;\r\n } else if(tur && n_kan) {\r\n val = 2;\r\n } else if(tur && kans) {\r\n val = 1;\r\n } else if(n_kan) {\r\n val = 1;\r\n }\r\n arr.push(val);\r\n break;\r\n case 9: // サミュ/改&夕張改二特\r\n val = 0;\r\n if(tur && (n_kan > 1 || kans > 2)) {\r\n val = 2;\r\n } else if(tur) {\r\n val = 1;\r\n }\r\n arr.push(val);\r\n break;\r\n }\r\n }\r\n console.log(`艦隊各速度: ${arr}`);\r\n let res = '';\r\n if(arr.every(elem => elem === 3)) {\r\n res = '最速艦隊';\r\n } else if(arr.every(elem => elem > 1)) {\r\n res = '高速+艦隊';\r\n } else if(arr.every(elem => elem > 0)) {\r\n res = '高速艦隊';\r\n } else {\r\n res = '低速艦隊';\r\n }\r\n return res;\r\n }\r\n // 構成艦のidを取得 配列で返す\r\n function getIdsFromFleet(num) {\r\n const ids = [];\r\n const f = `f${num}`;\r\n for (let i = 1; i <= c_lengths[num - 1]; i++) {\r\n const key = 's' + i;\r\n if (i_json[f][key] && i_json[f][key].hasOwnProperty('id')) {\r\n ids.push(Number(i_json[f][key].id));\r\n }\r\n }\r\n return ids;\r\n }\r\n // jsonからlv取得 配列で返す\r\n function getLvs(num) {\r\n const lvs = [];\r\n const f = `f${num}`;\r\n for (let i = 1; i <= c_lengths[num - 1]; i++) {\r\n const key = 's' + i;\r\n if (i_json[f][key] && i_json[f][key].hasOwnProperty('lv')) {\r\n lvs.push(i_json[f][key].lv);\r\n }\r\n }\r\n return lvs;\r\n }\r\n // 構成艦数カウント\r\n function countShips(num) {\r\n // f1内のsキーの配下にあるオブジェクト数をカウント\r\n try {\r\n const count = Object.keys(i_json[`f${num}`]).filter(key => /^s\\d+$/.test(key)).length;\r\n return count;\r\n } catch(e) {\r\n console.log('多分艦隊が空');\r\n return 0;\r\n }\r\n }\r\n // 索敵計算\r\n function calcSeek(num) {\r\n let res = [];\r\n let sum_base = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](0); // 艦娘索敵値によるスコア\r\n const f_length_correct = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](2 * (6 - c_lengths[num - 1])); // 隻数補正\r\n let sum_eq = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](0); // 装備によるスコア\r\n let command = 120;\r\n if(i_json.hqlv) { // オリジナルのデッキビルダーには司令レベルが無いみたい\r\n command = i_json.hqlv;\r\n }\r\n command = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](command).times(0.4); // 司令部補正\r\n for (let i = 0; i < c_lengths[num - 1]; i++) {\r\n // 素の索敵値計算\r\n const key = 's' + (i + 1);\r\n const lv = i_json[`f${num}`][key]['lv'];\r\n // 索敵値の最大値と最小値を取得\r\n const ship = s_data.find(entry => entry.id === c_ids[num - 1][i]);\r\n const min_seek = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](ship.seek);\r\n const max_seek = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](ship.max_seek);\r\n const cur_seek = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](max_seek).minus(min_seek).times(lv).div(99).floor().plus(min_seek);\r\n console.log(`艦名: ${c_names[num - 1][i]}, 素索敵値: ${cur_seek}`);\r\n // 装備id取得\r\n const i_ids = getEqIds(c_ids[num - 1][i], num);\r\n console.log(`装備id: ${i_ids}`);\r\n // 装備ボーナス\r\n const bonus = getSeekBonus(ship, i_ids, num);\r\n console.log(`seek_bonus: ${bonus}`);\r\n // 素の索敵値の平方根を加算\r\n sum_base = sum_base.plus(decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sqrt(cur_seek.plus(bonus)));\r\n // 改修値取得\r\n const rfs = getEqRfs(c_ids[num - 1][i], num);\r\n for(let q = 0;q < i_ids.length;q++) {\r\n // 装備の索敵値が1以上だったらあれこれ\r\n const eq = e_data.find(entry => entry.id === i_ids[q]);\r\n const seek = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](eq.seek);\r\n if(seek > 0) {\r\n // 係数\r\n const coefficient = getEqCo(i_ids[q]);\r\n const eq_co = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](coefficient[0]); // 装備係数\r\n const rf_co = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](coefficient[1]); // 改修係数\r\n const rf = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](rfs[q]);\r\n console.log(`装備係数: ${coefficient[0]}, 改修係数: ${coefficient[1]}, 改修効果: ${rf_co.times(decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sqrt(rf))}`);\r\n sum_eq = sum_eq.plus(eq_co.times(seek.plus(rf_co.times(decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sqrt(rf)))));\r\n }\r\n }\r\n }\r\n const material = sum_base.plus(f_length_correct).minus(command);\r\n // 係数 四捨五入で小数第二位まで\r\n for(let j = 1;j < 5;j++) {\r\n const elem = material.plus(sum_eq.times(j));\r\n // 値の正負で丸めの挙動を揃える\r\n if(elem < 0) {\r\n res.push(elem.negated().toDecimalPlaces(2, decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ROUND_UP).negated());\r\n } else {\r\n res.push(elem.toDecimalPlaces(2, decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ROUND_DOWN));\r\n }\r\n }\r\n return res;\r\n }\r\n // 装備ボーナス取得 艦のjson, 装備id(配列)\r\n function getSeekBonus(ship, e_ids, num) {\r\n let res = 0;\r\n const id = ship.id;\r\n const name = ship.name;\r\n const na = ship.na;\r\n const type = ship.type;\r\n const dup = []; // 重複不可のがきたらこれに追加\r\n const e_length = e_ids.length;\r\n for(let i = 0;i < e_length;i++) {\r\n const e_id = e_ids[i];\r\n switch(e_id) {\r\n case 315: // SG初期\r\n if(name === '丹陽' || name === '雪風改二') {\r\n if(!dup.includes(e_id)) {\r\n res += 3;\r\n dup.push(e_id);\r\n }\r\n } else if(na === 1) { // USA\r\n res += 4;\r\n }\r\n break;\r\n case 456: // SG後期\r\n if(name === '丹陽' || name === '雪風改二') {\r\n if(!dup.includes(e_id)) {\r\n res += 3;\r\n dup.push(e_id);\r\n }\r\n } else if(na === 1) { // USA\r\n res += 4;\r\n } else if(na === 3) { // UK\r\n res += 2;\r\n }\r\n break;\r\n case 278: // SK\r\n if(na === 1) { // USA\r\n if(!dup.includes(e_id)) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n case 279: // SK+SG\r\n if(na === 1) { // USA\r\n if(!dup.includes(e_id)) {\r\n res += 2;\r\n dup.push(e_id);\r\n }\r\n } else if(na === 3) { // UK\r\n if(!dup.includes(e_id)) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n case 517: { // 清霜逆探\r\n const gifted = ['朝霜改二','清霜改二','初霜改二','潮改二','Верный','霞改二','時雨改三','雪風改二'];\r\n if(name === '清霜改二丁') {\r\n if(!dup.includes(e_id)) {\r\n res += 3;\r\n dup.push(e_id);\r\n }\r\n } else if(gifted.includes(name)) {\r\n if(!dup.includes(e_id)) {\r\n res += 2;\r\n dup.push(e_id);\r\n }\r\n } else if(na === 0 && type === '駆逐艦') {\r\n if(!dup.includes(e_id)) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n }\r\n case 30: // 21号対空電探\r\n case 410: { // 21号対空電探改二\r\n const akizuki = ['秋月','照月','初月','涼月','冬月'];\r\n const mogami = ['最上改','最上改二','最上改二特'];\r\n if(akizuki.some(item => name.startsWith(item)) || mogami.includes(name)) {\r\n if(!dup.includes(e_id)) {\r\n res += 2;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n }\r\n case 118: { // 紫雲\r\n if(name.includes('大淀')) {\r\n res += 2;\r\n const rf = getEqRfs(id, num)[i];\r\n if(rf === 10) { // 改修maxで更に+1\r\n res += 1;\r\n }\r\n }\r\n break;\r\n }\r\n case 414: { // SOC seagull\r\n if(na === 1) { // USA\r\n if(type === '軽巡洋艦' || type === '重巡洋艦') {\r\n const rf = getEqRfs(id, num)[i];\r\n if(!dup.includes(e_id)) {\r\n res += 2;\r\n // 改修でさらにボーナス\r\n if(rf > 3) {\r\n res += 1;\r\n }\r\n dup.push(e_id);\r\n }\r\n } else if(type === '戦艦' || type === '巡洋戦艦') {\r\n if(!dup.includes(e_id)) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n case 115: // Ar196改\r\n if(name.includes('Bismarck') || name.includes('Prinz Eugen')) {\r\n res += 2;\r\n }\r\n break;\r\n case 371: // Fairey Seafox改\r\n if(name.includes('Gotland')) {\r\n if(!dup.includes(e_id)) {\r\n res += 6;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('Nelson')) {\r\n if(!dup.includes(e_id)) {\r\n res += 5;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('Commandant Teste')) {\r\n if(!dup.includes(e_id)) {\r\n res += 4;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('Warspite') || name.includes('Richelieu') || name.includes('Jean Bart')) {\r\n if(!dup.includes(e_id)) {\r\n res += 3;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n case 370: // Swordfish Mk.II改(水偵型)\r\n if(name.includes('Warspite')) {\r\n if(!dup.includes(e_id)) {\r\n res += 3;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('Nelson') || name.includes('Sheffield') || name.includes('Gotland')) {\r\n if(!dup.includes(e_id)) {\r\n res += 2;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('Commandant Teste') || name.includes('瑞穂') || name.includes('神威')) {\r\n if(!dup.includes(e_id)) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n case 194: { // Laté 298B\r\n const gifted = ['Commandant Teste','Richelieu','Jean Bart','瑞穂','神威'];\r\n if(gifted.some(item => item.includes(name))) {\r\n res += 2;\r\n dup.push(e_id);\r\n }\r\n break;\r\n }\r\n case 415: // SO3C Seamew改\r\n if(na === 1) { // USA\r\n if(type === '軽巡洋艦' || type === '重巡洋艦') {\r\n if(!dup.includes(e_id)) {\r\n res += 2;\r\n dup.push(e_id);\r\n }\r\n } else if(type === '戦艦' || type === '巡洋戦艦') {\r\n if(!dup.includes(e_id)) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n }\r\n }\r\n break;\r\n case 369: // Swordfish Mk.III改(水上機型/熟練)\r\n if(name === 'Gotland andra') {\r\n if(dup.filter(item => item === e_id).length === 0) {\r\n res += 4;\r\n dup.push(e_id);\r\n } else if(dup.filter(item => item === e_id).length === 1) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('Gotland') || name.includes('Commandant Teste')) {\r\n if(!dup.includes(e_id)) {\r\n res += 3;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('瑞穂') || name.includes('神威')) {\r\n if(!dup.includes(e_id)) {\r\n res += 2;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n case 368: // Swordfish Mk.III改(水上機型)\r\n if(name === 'Gotland andra') {\r\n if(dup.filter(item => item === e_id).length === 0) {\r\n res += 4;\r\n dup.push(e_id);\r\n } else if(dup.filter(item => item === e_id).length < 5) {\r\n res += 3;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('Gotland')) {\r\n res += 3;\r\n } else if(name.includes('Commandant Teste') || name.includes('瑞穂') || name.includes('神威')) {\r\n res += 2;\r\n }\r\n break;\r\n case 367: // Swordfish(水上機型)\r\n if(name.includes('Gotland') || name.includes('Commandant Teste') || name.includes('瑞穂') || name.includes('神威')) {\r\n res += 1;\r\n }\r\n break;\r\n case 408: // 装甲艇(AB艇)\r\n if(name.includes('神州丸')) {\r\n res += 2;\r\n } else if(name.includes('あきつ丸') || type === '駆逐艦') {// 本来大発の乗る駆逐艦だが、駆逐に乗ってる時点でボーナスつけちゃう\r\n res += 1;\r\n }\r\n break;\r\n case 409: // 武装大発\r\n if(name.includes('神州丸')) {\r\n res += 2;\r\n } else if(name.includes('あきつ丸')) {// 本来大発の乗る駆逐艦だが、駆逐に乗ってる時点でボーナスつけちゃう\r\n res += 1;\r\n }\r\n break;\r\n case 412: // 水雷見張員\r\n if(na === 0) {\r\n if(type === '駆逐艦') {\r\n res += 1;\r\n } else if(type === '軽巡洋艦') {\r\n res += 3;\r\n } else if(type === '重巡洋艦') {\r\n res += 1;\r\n }\r\n }\r\n break;\r\n case 129: // 見張員\r\n if(na === 0) {\r\n if(type === '駆逐艦') {\r\n res += 1;\r\n } else if(type === '軽巡洋艦') {\r\n res += 3;\r\n } else if(type === '重巡洋艦') {\r\n res += 3;\r\n }\r\n }\r\n break;\r\n case 521: { // 紫雲(熟練)\r\n const rf = getEqRfs(id, num)[i];\r\n if(name.includes('大淀改')) {\r\n if(rf > 0) { // 改修1以上で+5\r\n res += 5;\r\n }\r\n if(rf > 3) { // ☆4以上で更に+1\r\n res += 1;\r\n }\r\n } else if(name.includes('三隈改二特')) {\r\n if(rf > 0) { // 改修1以上で+4\r\n res += 4;\r\n }\r\n }\r\n break;\r\n }\r\n case 522: // 零式小型水上機\r\n if(type === '潜水艦' || type === '潜水空母') {\r\n res += 3;\r\n }\r\n break;\r\n case 523: // 零式小型水上機(熟練)\r\n if(type === '潜水艦' || type === '潜水空母') {\r\n res += 4;\r\n }\r\n break;\r\n case 527: // Type281 レーダー\r\n if(na === 3) { // UK(大型)組\r\n res += 2;\r\n }\r\n break;\r\n case 273: { // 彩雲(偵四) ☆2のときのみ\r\n const rf = getEqRfs(id, num)[i];\r\n if(rf === 2) {\r\n if(!dup.includes(e_id)) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n return res;\r\n }\r\n // 装備係数&改修係数取得 配列[装備係数, 改修係数]を返す\r\n function getEqCo(id) {\r\n let res = [];\r\n // typeを取得\r\n const e_id = getEqType(id);\r\n // やや無駄になるが2回に分けた方が見やすくて良いと思う\r\n switch(e_id) {\r\n // 装備係数\r\n case 356: // 艦戦\r\n case 357: // 艦爆\r\n case 53645: // 水戦\r\n case 173341: // 大型飛行艇\r\n case 31626: // 対潜哨戒機\r\n case 31525: // 回転翼機\r\n case 34425: // S51J & S51J改\r\n case 34057: // 噴式戦闘爆撃機\r\n case 111: // 小口径主砲\r\n case 112: // 中口径主砲\r\n case 5812: // 小型電探\r\n case 5813: // 大型電探\r\n case 244251: // 潜水電探\r\n case 2332: // 潜水魚雷\r\n case 71014: // ソナー\r\n case 71040: // 大型ソナー\r\n case 81829: // 探照灯\r\n case 81842: // 大型探照灯\r\n case 132335: // 航空要員\r\n case 162739: // 見張員\r\n case 122234: // 司令部\r\n case 2422: // 甲標的\r\n case 84724: // AB艇\r\n res.push(0.6);\r\n break;\r\n case 358: // 艦攻\r\n res.push(0.8);\r\n break;\r\n case 579: // 艦偵\r\n res.push(1);\r\n break;\r\n case 54311: // 水爆\r\n res.push(1.1);\r\n break;\r\n case 5710: // 水偵\r\n res.push(1.2);\r\n break;\r\n }\r\n switch(e_id) {\r\n // 改修係数\r\n case 31525: // 回転翼機\r\n case 34425: // S51J & S51J改\r\n case 162739: // 見張員\r\n res.push(0);\r\n break;\r\n case 54311: // 水爆\r\n res.push(1.15);\r\n break;\r\n case 579: // 艦偵\r\n case 173341: // 大型飛行艇\r\n case 5710: // 水偵\r\n res.push(1.2);\r\n break;\r\n case 5812: // 小型電探\r\n res.push(1.25);\r\n break;\r\n case 5813: // 大型電探\r\n res.push(1.4);\r\n break;\r\n default:\r\n res.push(0);\r\n break;\r\n }\r\n return res;\r\n }\r\n // 艦idと艦隊番号から装備idを配列で得る ※同一の艦が含まれると不具合が出るかも\r\n function getEqIds(s_id, num) {\r\n let ids = [];\r\n for (const s_key in i_json[`f${num}`]) {\r\n const ship = i_json[`f${num}`][s_key];\r\n if (Number(ship.id) && Number(ship.id) === Number(s_id)) { // 本家デッキビルダーへの対応で艦IDは数値化\r\n const items = ship.items;\r\n for(const i_key in items) {\r\n if(items[i_key].id) {\r\n ids.push(items[i_key].id);\r\n }\r\n }\r\n }\r\n }\r\n return ids;\r\n }\r\n // 艦idから装備改修値を配列で得る\r\n function getEqRfs(s_id, num) {\r\n let rfs = [];\r\n for (const s_key in i_json[`f${num}`]) {\r\n const ship = i_json[`f${num}`][s_key];\r\n if (Number(ship.id) && Number(ship.id) === Number(s_id)) { // 本家デッキビルダーへの対応で艦IDは数値化\r\n const items = ship.items;\r\n for(const i_key in items) {\r\n if(items[i_key].rf) {\r\n rfs.push(items[i_key].rf);\r\n } else { // デッキビルダー本家は改修値ゼロはキーがない\r\n rfs.push(0);\r\n }\r\n }\r\n }\r\n }\r\n return rfs;\r\n }\r\n // 艦種を変数に反映\r\n function reflectionCom(types) {\r\n for(let i = 0;i < types.length;i++) {\r\n switch(types[i]) {\r\n case '戦艦':\r\n case '巡洋戦艦':\r\n com['BB']++;\r\n break;\r\n case '航空戦艦':\r\n com['BBV']++;\r\n break;\r\n case '正規空母':\r\n com['CV']++;\r\n break;\r\n case '装甲空母':\r\n com['CVB']++;\r\n break;\r\n case '軽空母':\r\n com['CVL']++;\r\n break;\r\n case '重巡洋艦':\r\n com['CA']++;\r\n break;\r\n case '航空巡洋艦':\r\n com['CAV']++;\r\n break;\r\n case '軽巡洋艦':\r\n com['CL']++;\r\n break;\r\n case '重雷装巡洋艦':\r\n com['CLT']++;\r\n break;\r\n case '練習巡洋艦':\r\n com['CT']++;\r\n break;\r\n case '駆逐艦':\r\n com['DD']++;\r\n break;\r\n case '海防艦':\r\n com['DE']++;\r\n break;\r\n case '潜水艦':\r\n com['SS']++;\r\n break;\r\n case '潜水空母':\r\n com['SSV']++;\r\n break;\r\n case '水上機母艦':\r\n com['AV']++;\r\n break;\r\n case '補給艦':\r\n com['AO']++;\r\n break;\r\n case '揚陸艦':\r\n com['LHA']++;\r\n break;\r\n case '潜水母艦':\r\n com['AS']++;\r\n break;\r\n case '工作艦':\r\n com['AR']++;\r\n break;\r\n }\r\n }\r\n }\r\n // 構成艦の名前を配列で返す\r\n // 引数:随伴であるか否か\r\n function getShipName(num) {\r\n let names = [];\r\n for (const id of c_ids[num - 1]) {\r\n const ship = s_data.find((item) => item.id === id);\r\n if (ship) {\r\n names.push(ship.name);\r\n }\r\n }\r\n return names;\r\n }\r\n // idから艦種取得 配列で渡す\r\n function getType(num) {\r\n let types = [];\r\n for (const id of c_ids[num - 1]) {\r\n const ship = s_data.find(entry => entry.id === id);\r\n if (ship) {\r\n types.push(ship.type);\r\n }\r\n }\r\n return types;\r\n }\r\n // 艦隊情報表示\r\n function reloadImportDisplay() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#import-display').empty();\r\n let part = '';\r\n if(f_type && f_type !== '遊撃部隊' && f_type !== '通常艦隊') {\r\n // 連合艦隊\r\n part += `主力: ${f_names[0]}`;\r\n for(let i = 1;i < f_length - f2_length;i++) {\r\n part += ` | ${f_names[i]}`;\r\n }\r\n part += `
随伴: ${f2_names[0]}`;\r\n for(let i = 1;i < f2_length;i++) {\r\n part += ` | ${f2_names[i]}`;\r\n }\r\n } else {\r\n // 通常艦隊\r\n part += `${f_names[0]}`;\r\n for(let i = 1;i < f_length;i++) {\r\n part += ` | ${f_names[i]}`;\r\n }\r\n }\r\n let u = '';\r\n if(f_type !== '通常艦隊') {\r\n u += `

${f_type}

`;\r\n }\r\n if(f_names && f_speed && f_seek) {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#import-display').append(`\r\n ${u}\r\n

\r\n ${f_speed} | 搭載艦数[ドラム缶:${f_drum},大発系:${f_craft},電探:${f_radar}]\r\n

\r\n

\r\n ${part}\r\n

\r\n

\r\n 索敵値:\r\n 1: ${f_seek[0]}\r\n 2: ${f_seek[1]}\r\n 3: ${f_seek[2]}\r\n 4: ${f_seek[3]}\r\n

\r\n `);\r\n }\r\n }\r\n // シミュレータが同期処理させたいので関数化\r\n // startSim以降を呼び出したいときはこれを叩く\r\n function simController() {\r\n Promise.resolve()\r\n .then(startSim)\r\n // .then(preInfo)\r\n .then(function() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.icon-on-map').css('display', 'block');\r\n }).catch(error => {\r\n console.error('エラーが発生しました:', error);\r\n return area;\r\n });\r\n }\r\n\r\n // 以下分岐判定に必要な関数\r\n\r\n // 特定の艦が含まれるかチェック\r\n // 改、改二等後に続く文字列は許容するが名前が変わる場合は都度呼び出すこと\r\n function isInclude(name) {\r\n return f_names.some(elem => elem.includes(name));\r\n }\r\n // isIncludeと同じ\r\n // カウントを返す\r\n function countShipsStartWith(name) {\r\n return f_names.filter(elem => elem.startsWith(name)).length;\r\n }\r\n // 高速+艦隊か最速艦隊であればtrue\r\n function isFaster() {\r\n if(f_speed === '高速+艦隊' || f_speed === '最速艦隊') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n // 旗艦が軽巡であればtrue\r\n function isFCL () {\r\n const name = f_names[0];\r\n // 先頭一致\r\n const clsName = ['矢矧','能代','Helena','Brooklyn','Honolulu','神通','Sheffield','L.d.S.D.d.Abruzzi','G.Garibaldi','Perth','大淀','球磨','De Ruyter','長良','名取','川内','那珂','阿賀野','酒匂','天龍','Atlanta','五十鈴','多摩','Gotland','鬼怒','由良','阿武隈','夕張','龍田'];\r\n // こちらは完全一致\r\n const exCL = ['北上','大井','木曾','木曾改'];\r\n if(clsName.some(item => name.startsWith(item))) {\r\n return true;\r\n } else if(exCL.includes(name)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n // 低速戦艦をカウント\r\n function countSBB() {\r\n const slowBBs = ['扶桑','山城','伊勢','日向','長門','長門改','長門改二','陸奥','陸奥改','陸奥改二','大和','大和改','武蔵','武蔵改','武蔵改二','Conte di Cavour','Nevada','Nevada改','Nevada改 Mod.2','Colorado','Colorado改','Maryland','Marylan改','Warspite','Warspite改','Nelson','Nelson改','Rodney','Rodney改','Гангут','Октябрьская революция','Гангут два'];\r\n // 配列arr1の要素をセットに変換\r\n const set = new Set(f_names);\r\n // 配列arr2の要素を1つずつ調べて、重複があるか確認\r\n let count = 0;\r\n for (const element of slowBBs) {\r\n if (set.has(element)) {\r\n count++;\r\n }\r\n }\r\n return count;\r\n }\r\n // 大鷹型カウント\r\n function countTaiyo() {\r\n const taiyos = ['春日丸', '大鷹', '八幡丸', '雲鷹', '神鷹'];\r\n let count = 0;\r\n for (const element of f_names) {\r\n for (const name of taiyos) {\r\n if (element.startsWith(name)) {\r\n count++;\r\n break; // 一致した場合、内側のループを抜けます\r\n }\r\n }\r\n }\r\n return count;\r\n }\r\n // 大和型カウント\r\n function countYamato() {\r\n const yamatos = ['大和', '武蔵'];\r\n let count = 0;\r\n for (const element of f_names) {\r\n for (const name of yamatos) {\r\n if (element.startsWith(name)) {\r\n count++;\r\n break; // 一致した場合、内側のループを抜けます\r\n }\r\n }\r\n }\r\n return count;\r\n }\r\n // あきつ丸カウント\r\n function countAkitsuMaru() {\r\n return f_names.filter(str => str.startsWith('あきつ丸')).length;\r\n }\r\n // 特定艦カウントの汎用版\r\n // 前方一致でカウントするので呼び出し方に注意\r\n function countShipsByName(name) {\r\n return f_names.filter(str => str.startsWith(name)).length;\r\n }\r\n // 艦隊が連合艦隊であるか\r\n function isCom() {\r\n if(f_type === '空母機動部隊' || f_type === '水上打撃部隊' || f_type === '輸送護衛部隊') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n // rate(経路)をカウント\r\n // 同じものがあれば加算、無ければ追加\r\n function sum(route) {\r\n // 無ければ追加、あれば加算\r\n rate[route] ? rate[route] += 1:rate[route] = 1;\r\n // 追跡\r\n const parts = route.split('to');\r\n if(track.length) {\r\n track.push(parts[1]);\r\n } else {\r\n track.push(parts[0]);\r\n track.push(parts[1]);\r\n }\r\n }\r\n // track(1周ごとの経路)を重複チェックしてからt_logsに格納 既にあれば加算\r\n function pushLog() {\r\n const key = track.join('e');\r\n t_logs[key] ? t_logs[key] += 1:t_logs[key] = 1;\r\n }\r\n // 百分率で指定 小数第一位まで可\r\n // 指定した確率でtrue\r\n function sai(num) {\r\n // 0から100までの乱数を生成\r\n const randomValue = Math.random() * 100;\r\n // 引数で指定された小数以下第一位までの値に変換\r\n const roundedNum = Math.round(num * 10) / 10;\r\n // 1から100の間で指定された値以下であればtrueを返す\r\n return randomValue <= roundedNum;\r\n }\r\n \r\n /*\r\n 分岐関数\r\n マップをworld-map,マスをアルファベットで、スタート地点ならnull\r\n 再帰にするとスタックする\r\n 纏められそうなのもあるが実装優先で愚直に書く\r\n 但し条件から漏れると即無限ループなので必ずelse等で拾うこと\r\n */\r\n function branch(world, map, edge, is_once) {\r\n const BB = com['BB']; // 戦艦\r\n const BBV = com['BBV'];// 航空戦艦&改装航空戦艦\r\n const CV = com['CV']; // 正規空母\r\n const CVB = com['CVB']; // 装甲空母\r\n const CVL = com['CVL']; // 軽空母\r\n const CA = com['CA']; // 重巡\r\n const CAV = com['CAV']; // 航巡\r\n const CL = com['CL']; // 軽巡\r\n const CLT = com['CLT']; // 雷巡\r\n // const ATU = com['ATU']; // 練習特務艦\r\n const CT = com['CT']; // 練習巡洋艦\r\n const DD = com['DD']; // 駆逐艦\r\n const DE = com['DE']; // 海防艦\r\n const SS = com['SS']; // 潜水艦\r\n const SSV = com['SSV']; // 潜水空母\r\n const AV = com['AV']; // 水母\r\n const AO = com['AO']; // 補給艦\r\n // const ASU = com['ASU']; // 特務艦\r\n // const LHT = com['LHT']; // 灯台補給船\r\n // const CVE = com['CVE']; // 特設護衛空母\r\n const LHA = com['LHA']; // 揚陸艦\r\n // const LST = com['LST']; // 戦車揚陸艦\r\n const AS = com['AS']; // 潜水母艦\r\n const AR = com['AR']; // 工作艦\r\n\r\n const BBs = BB + BBV; // 戦艦級\r\n const CVs = CV + CVL + CVB; // 空母系\r\n const BBCVs = BBs + CVs; // 戦艦級+空母系\r\n const CAs = CA + CAV; // 重巡級\r\n const Ds = DD + DE; // 駆逐艦 + 海防艦\r\n const Ss = SS + SSV; // 潜水艦 + 潜水空母\r\n switch(world) {\r\n case 1:\r\n switch(map) {\r\n case 1: // @1-1\r\n switch(edge) {\r\n case null:\r\n sum('1toA');\r\n return 'A';\r\n break;\r\n case 'A':\r\n switch(f_length) {\r\n case 1:\r\n sai(80)?sum('AtoC'):sum('AtoB');\r\n break;\r\n case 2:\r\n sai(75)?sum('AtoC'):sum('AtoB');\r\n break;\r\n case 3:\r\n sai(70)?sum('AtoC'):sum('AtoB');\r\n break;\r\n case 4:\r\n sai(65)?sum('AtoC'):sum('AtoB');\r\n break;\r\n case 5:\r\n sai(60)?sum('AtoC'):sum('AtoB');\r\n break;\r\n case 6:\r\n sai(55)?sum('AtoC'):sum('AtoB');\r\n break;\r\n }\r\n return null;\r\n break;\r\n }\r\n break;\r\n case 2: // @1-2\r\n switch(edge) {\r\n case null:\r\n if(Ds === 4 && f_length < 6) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n switch(f_length) {\r\n case 6:\r\n if(sai(40)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n return null;\r\n }\r\n break;\r\n case 5:\r\n if(sai(50)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n return null;\r\n }\r\n break;\r\n case 4:\r\n if(sai(60)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n return null;\r\n }\r\n break;\r\n default:\r\n if(sai(70)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 'A':\r\n if(f_speed !== '低速艦隊') {\r\n sum('AtoE');\r\n } else if(Ds < 4) {\r\n sum('AtoD');\r\n sum('DtoE');\r\n } else if(Ds === 6) {\r\n sum('AtoE');\r\n } else if(CL + CT === 1 && Ds === 5) {\r\n sum('AtoE');\r\n } else if(CL === 1 && Ds > 3) {\r\n sum('AtoE');\r\n } else {\r\n if(sai(65)) {\r\n sum('AtoE');\r\n } else {\r\n sum('AtoD');\r\n sum('DtoE');\r\n }\r\n }\r\n return null;\r\n }\r\n break;\r\n case 3: // @1-3\r\n switch(edge) {\r\n case null:\r\n if(AO + AV > 0) {\r\n sum('1toA');\r\n return 'A';\r\n } else if(CVs > 0) {\r\n sum('1toC');\r\n sum('CtoF');\r\n return 'F';\r\n } else {\r\n if(sai(50)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toC');\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n }\r\n break;\r\n case 'A':\r\n if(AO > 0 || DE > 3) {\r\n sum('AtoD');\r\n sum('DtoB');\r\n sum('BtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(AV > 0 || Ds > 3) {\r\n if(sai(80)) {\r\n sum('AtoD');\r\n sum('DtoB');\r\n sum('BtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else {\r\n sum('AtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n } else if(Ss > 0) {\r\n sum('AtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else {\r\n if(sai(50)) {\r\n sum('AtoD');\r\n sum('DtoB');\r\n sum('BtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else {\r\n sum('AtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(CV + CVB > 0 || countSBB() > 0) {\r\n sum('FtoH');\r\n return 'H';\r\n } else if((CAV > 0 && DD > 1) || DD > 3 || ((CL + CT > 0) && Ds > 3)) {\r\n sum('FtoJ');\r\n return null;\r\n } else if(f_speed !== '低速艦隊') {\r\n if(sai(60)) {\r\n sum('FtoJ');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return 'H';\r\n }\r\n } else {\r\n if(sai(60)) {\r\n sum('FtoH');\r\n return 'H';\r\n } else {\r\n sum('FtoJ');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if(AO > 0) {\r\n sum('HtoG');\r\n return null;\r\n } else if(AV + CAV > 0 || (CL+ CT > 0 && DD > 1)) {\r\n sum('HtoJ');\r\n return null;\r\n } else if(DD > 1) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.4) {\r\n sum('HtoG');\r\n } else if(num <= 0.8) {\r\n sum('HtoJ');\r\n } else {\r\n sum('HtoI');\r\n }\r\n return null;\r\n } else {\r\n if(sai(60)) {\r\n sum('HtoI');\r\n } else {\r\n sum('HtoJ');\r\n }\r\n }\r\n return null;\r\n break;\r\n }\r\n break;\r\n case 4: // @1-4\r\n switch(edge) {\r\n case null:\r\n if(sai(50)) {\r\n sum('1toA');\r\n sum('AtoD');\r\n return 'D';\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'B':\r\n if((CVs > 2) || BBs > 2 || Ds === 0) {\r\n sum('BtoD');\r\n return 'D';\r\n } else if(Ds > 2) {\r\n sum('BtoC');\r\n return 'C';\r\n }else if(CL > 0) {\r\n if(sai(80)) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } else if(sai(60)) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 'D':\r\n if(AS > 0) {\r\n sum('DtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else if(AV > 0) {\r\n sum('DtoG');\r\n sum('GtoJ');\r\n return 'J';\r\n }else if(sai(50)) {\r\n sum('DtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else {\r\n sum('DtoG');\r\n sum('GtoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'F':\r\n if(Ds > 3) {\r\n sum('FtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else if(Ds > 1) {\r\n if(AV + AS + AO > 0 || BBV === 2) {\r\n sum('FtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else if(Ds === 3) {\r\n if(sai(80)) {\r\n sum('FtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n sum('HtoL');\r\n return null;\r\n }\r\n } else if(Ds === 2) {\r\n if(sai(60)) {\r\n sum('FtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n sum('HtoL');\r\n return null;\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('FtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n sum('HtoL');\r\n return null;\r\n }\r\n }\r\n }\r\n if(sai(50)) {\r\n sum('FtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n sum('HtoL');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if((CL > 0 && AV > 0 && Ds > 1) || DD > 3) {\r\n sum('JtoL');\r\n return null;\r\n } else if(DD > 1) {\r\n if(sai(75)) {\r\n sum('JtoL');\r\n return null;\r\n } else {\r\n sum('JtoK');\r\n return null;\r\n }\r\n } else {\r\n if(sai(65)) {\r\n sum('JtoL');\r\n return null;\r\n } else {\r\n sum('JtoK');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 5: // @1-5\r\n switch(edge) {\r\n case null:\r\n sum('1toA');\r\n sum('AtoD');\r\n return 'D';\r\n break;\r\n case 'D':\r\n if(f_length === 1 || f_length === DE || AO > 0) {\r\n sum('DtoE');\r\n return 'E';\r\n } else if(f_length > 4) {\r\n if(Ss > 0) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n if(sai(50)) {\r\n sum('DtoE');\r\n return 'E';\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n }\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'E':\r\n if(f_length > 4) {\r\n sum('EtoC');\r\n return 'C';\r\n } else if(f_length === DE) {\r\n sum('EtoJ');\r\n return null;\r\n } else {\r\n sum('EtoC');\r\n return 'C';\r\n }\r\n break;\r\n case 'C':\r\n if(f_length === DE || (CL > 0 && DE === 4)) {\r\n sum('CtoJ');\r\n return null;\r\n } else if(f_length < 5 && AO > 0) {\r\n if(sai(50)) {\r\n sum('CtoJ');\r\n return null;\r\n } else {\r\n sum('CtoB');\r\n return null;\r\n }\r\n } else {\r\n sum('CtoB');\r\n return null;\r\n }\r\n break;\r\n case 'F':\r\n if(BB + CV + CVB + Ss > 0 || CVL > 1 || CL > 2) {\r\n sum('FtoI');\r\n return null;\r\n } else {\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'G':\r\n if(f_length > 4) {\r\n sum('GtoH');\r\n return null;\r\n } else {\r\n sum('GtoJ');\r\n return null;\r\n }\r\n break;\r\n }\r\n break;\r\n case 6: // @1-6\r\n // ゴールはNマスとして扱う\r\n switch(edge) {\r\n case null:\r\n if(BBV + CVL + CA > 0 || CAV > 1 || Ds < 4) {\r\n sum('1toC');\r\n sum('CtoH');\r\n sum('HtoK');\r\n sum('KtoM');\r\n return 'M';\r\n } else {\r\n sum('1toA');\r\n sum('AtoE');\r\n sum('EtoG');\r\n return ('G');\r\n }\r\n break;\r\n case 'G':\r\n if(CL > 0 && Ds === 5) {\r\n sum('GtoF');\r\n sum('FtoB');\r\n sum('BtoN');\r\n return null;\r\n } else {\r\n if(sai(75)) {\r\n sum('GtoF');\r\n sum('FtoB');\r\n sum('BtoN');\r\n return null;\r\n } else {\r\n sum('GtoK');\r\n sum('KtoM');\r\n return 'M';\r\n }\r\n }\r\n break;\r\n case 'M':\r\n if(BBV + CA + CVL > 2 || BBV + CAs > 2 || Ds < 3 || f_seek[2] < 28) {\r\n sum('MtoL');\r\n sum('LtoI');\r\n sum('ItoD');\r\n sum('DtoN');\r\n return null;\r\n } else if(f_seek[2] < 30) {\r\n if(sai(50)) {\r\n sum('MtoL');\r\n sum('LtoI');\r\n sum('ItoD');\r\n sum('DtoN');\r\n return null;\r\n } else {\r\n sum('MtoJ');\r\n sum('JtoD');\r\n sum('DtoN');\r\n return null;\r\n }\r\n } else {\r\n sum('MtoJ');\r\n sum('JtoD');\r\n sum('DtoN');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 2:\r\n switch(map) {\r\n case 1: // @2-1\r\n switch(edge) {\r\n case null:\r\n sum('1toC');\r\n return 'C';\r\n break;\r\n case 'C':\r\n if(CVs > 2 || BBV > 1 || (AO > 0 && Ss === 0)) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else if(BBV > 0 && CV + AS > 0) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.7) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else if(num <= 0.85) {\r\n sum('CtoD');\r\n sum('DtoH');\r\n return null;\r\n } else {\r\n sum('CtoE');\r\n return 'E';\r\n }\r\n } else if(AV + AS > 0) {\r\n sum('CtoE');\r\n return 'E'; \r\n } else {\r\n if(sai(50)) {\r\n sum('CtoD');\r\n sum('DtoH');\r\n return null;\r\n } else {\r\n sum('CtoE');\r\n return 'E';\r\n }\r\n }\r\n break;\r\n case 'E':\r\n if(BBCVs > 4) {\r\n sum('EtoF');\r\n return 'F';\r\n } else if(f_length === 6) {\r\n if(BBCVs > 0) {\r\n sum('EtoD');\r\n sum('DtoH');\r\n return null;\r\n } else if(DD +DE === 6 || (CL === 1 && Ds === 5) || (f_speed !== '低速艦隊' && CL === 1 && DD === 4)) {\r\n sum('EtoH');\r\n return null;\r\n } else {\r\n sum('EtoD');\r\n sum('DtoH');\r\n return null;\r\n }\r\n } else {\r\n if(Ds === 5 || (CL === 1 && Ds === 4) || f_speed !== '低速艦隊' && CL === 1 && DD === 3) {\r\n sum('EtoH');\r\n return null;\r\n } else {\r\n if(sai(60)) {\r\n sum('EtoD');\r\n sum('DtoH');\r\n return null;\r\n } else {\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(BBCVs > 4) {\r\n sum('FtoG');\r\n return null;\r\n } else if(DD > 2 || (CL === 1 && DD > 1)) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n if(sai(60)) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoG');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 2: // @2-2\r\n switch(edge) {\r\n case null:\r\n sum('1toC');\r\n return 'C';\r\n break;\r\n case 'C':\r\n if(CVs > 2 || BBV > 1 || (AO > 0 && Ss === 0)) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else if(BBV > 0) {\r\n if(AV + AS > 0) {\r\n if(sai(70)) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else {\r\n sum('CtoE');\r\n return 'E';\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else {\r\n sum('CtoD');\r\n return null;\r\n }\r\n }\r\n } else if(AV +AS > 0) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n if(sai(50)) {\r\n sum('CtoD');\r\n return null;\r\n } else {\r\n sum('CtoE');\r\n return 'E';\r\n }\r\n }\r\n break;\r\n case 'E':\r\n if(BBCVs > 3) {\r\n sum('EtoG');\r\n return 'G';\r\n } else if(DE > 1) {\r\n sum('EtoF');\r\n sum('FtoH');\r\n return 'H';\r\n } else if(BBCVs === 3) {\r\n if(sai(70)) {\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('EtoK');\r\n return null;\r\n }\r\n } else if(BBCVs === 2) {\r\n if(sai(50)) {\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('EtoK');\r\n return null;\r\n }\r\n } else if(BBCVs === 1) {\r\n if(sai(70)) {\r\n sum('EtoK');\r\n return null;\r\n } else {\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n } else if(Ds > 2 && AS > 0) {\r\n sum('EtoF');\r\n sum('FtoH');\r\n return 'H';\r\n } else if(Ds > 1) {\r\n if(CL > 0 && f_speed !== '低速艦隊') {\r\n sum('EtoK');\r\n return null;\r\n } else {\r\n if(sai(70)) {\r\n sum('EtoK');\r\n return null;\r\n } else {\r\n sum('EtoF');\r\n sum('FtoH');\r\n return 'H';\r\n }\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('EtoK');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if(CVs > 0 || DD === 0) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n if(sai(50)) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('GtoK');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if(BBCVs > 3) {\r\n if(sai(70)) {\r\n sum('HtoI');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(CVs + CAV + AV > 0) {\r\n sum('HtoK');\r\n return null;\r\n } else if(Ss > 0) {\r\n if(sai(70)) {\r\n sum('HtoI');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(Ds > 1) {\r\n if(sai(50)) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(Ds === 1) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('HtoI');\r\n return null;\r\n } else if(num <= 0.66) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('HtoI');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 3: // @2-3\r\n switch(edge) {\r\n case null:\r\n if(Ss + AS === f_length) {\r\n sum('1toC');\r\n return 'C';\r\n } else {\r\n if(sai(50)) {\r\n sum('1toB');\r\n sum('BtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else {\r\n sum('1toA');\r\n sum('AtoD');\r\n return 'D';\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(sai(60)) {\r\n sum('CtoD');\r\n return 'D';\r\n } else {\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'D':\r\n if(AV + AO > 0 && Ds > 1 || (Ss > 1 && AS > 0)) {\r\n sum('DtoG');\r\n return 'G';\r\n } else if(Ss === f_length) {\r\n if(sai(65)) {\r\n sum('DtoG');\r\n return 'G';\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n } else if(Ss > 0 && BBCVs > 0) {\r\n if(sai(65)) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoG');\r\n return 'G';\r\n }\r\n } else {\r\n if(Ds > 3) {\r\n if(sai(75)) {\r\n sum('DtoG');\r\n return 'G';\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n } else if(Ds > 2) {\r\n if(sai(65)) {\r\n sum('DtoG');\r\n return 'G';\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n } else if(Ds > 1) {\r\n if(sai(50)) {\r\n sum('DtoG');\r\n return 'G';\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n } else {\r\n if(sai(35)) {\r\n sum('DtoG');\r\n return 'G';\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(CVs + CL + AV > 0) {\r\n if(sai(90)) {\r\n sum('FtoJ');\r\n return 'J';\r\n } else {\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n } else if(Ss > 1 && AS > 0) {\r\n if(sai(80)) {\r\n sum('FtoG');\r\n return 'G';\r\n } else {\r\n sum('FtoJ');\r\n return 'J';\r\n }\r\n } else {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.25) {\r\n sum('FtoG');\r\n return 'G';\r\n } else if(num <= 0.60) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoJ');\r\n return 'J';\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if(Ss > 1 && AS > 0){\r\n if(sai(60)) {\r\n sum('GtoI');\r\n sum('ItoK');\r\n sum('KtoN');\r\n return null;\r\n } else {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(Ss === f_length) {\r\n if(sai(55)) {\r\n sum('GtoI');\r\n sum('ItoK');\r\n sum('KtoN');\r\n return null;\r\n } else {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(CL + Ds < 2) {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return null;\r\n } else if(AV + AO > 0 && Ds > 1) {\r\n if(sai(65)) {\r\n sum('GtoI');\r\n sum('ItoK');\r\n sum('KtoN');\r\n return null;\r\n } else {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(Ds > 2) {\r\n if(sai(55)) {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return null;\r\n } else {\r\n sum('GtoI');\r\n sum('ItoK');\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(Ds > 0) {\r\n if(sai(65)) {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return null;\r\n } else {\r\n sum('GtoI');\r\n sum('ItoK');\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(Ds === 0) {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if(CL > 0 && DD > 3 || (CL === 1 && CA === 5)) {\r\n sum('JtoN');\r\n return null;\r\n } else if(Ss === f_length) {\r\n if(sai(90)) {\r\n sum('JtoN');\r\n return null;\r\n } else {\r\n sum('JtoM');\r\n return null;\r\n }\r\n } else if(Ss > 0) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.1) {\r\n sum('JtoM');\r\n return null;\r\n } else if(num <= 0.55) {\r\n sum('JtoL');\r\n return null;\r\n } else {\r\n sum('JtoN');\r\n return null;\r\n }\r\n } else if(BBCVs === 6) {\r\n sum('JtoL');\r\n return null;\r\n } else if(BBCVs === 5) {\r\n if(sai(85)) {\r\n sum('JtoL');\r\n return null;\r\n } else {\r\n sum('JtoN');\r\n return null;\r\n }\r\n } else if(BBCVs === 4) {\r\n if(sai(75)) {\r\n sum('JtoN');\r\n return null;\r\n } else {\r\n sum('JtoL');\r\n return null;\r\n }\r\n } else if(BBCVs === 3) {\r\n if(sai(80)) {\r\n sum('JtoN');\r\n return null;\r\n } else {\r\n sum('JtoL');\r\n return null;\r\n }\r\n } else if(BBCVs < 3) {\r\n if(sai(90)) {\r\n sum('JtoN');\r\n return null;\r\n } else {\r\n sum('JtoL');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 4: // @2-4\r\n switch(edge) {\r\n case null:\r\n sum('1toB');\r\n return 'B';\r\n break;\r\n case 'B':\r\n if(DD === 6) {\r\n sum('BtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else if(CL + CT === 1 && DD > 3 && (CAs === 1 || DD === 5 || DE === 1)) {\r\n sum('BtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else if(Ds < 3) {\r\n if(CVs > 2) {\r\n sum('BtoC');\r\n return 'C';\r\n } else if(BBs + CV + CVB > 2) {\r\n sum('BtoC');\r\n return 'C';\r\n } else if(BBs + CV + CVB === 2) {\r\n if(sai(80)) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n } else if(CV + CVB > 0) {\r\n if(sai(60)) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n } else if(Ss > 0) {\r\n if(sai(60)) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n } else {\r\n if(sai(60)) {\r\n sum('BtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n }\r\n } else {\r\n if(sai(60)) {\r\n sum('BtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(AS + AO > 0) {\r\n sum('CtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n if(sai(50)) {\r\n sum('CtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(CVL > 0 && Ds > 1) {\r\n if(sai(92.5)) {\r\n sum('FtoJ');\r\n return 'J';\r\n } else {\r\n sum('FtoA');\r\n return null;\r\n }\r\n } else if(CVL > 0) {\r\n if(sai(82.5)) {\r\n sum('FtoJ');\r\n return 'J';\r\n } else {\r\n sum('FtoA');\r\n return null;\r\n }\r\n } else if(DD > 1) {\r\n if(sai(75)) {\r\n sum('FtoJ');\r\n return 'J';\r\n } else {\r\n sum('FtoA');\r\n return null;\r\n }\r\n } else if(DD < 2) {\r\n sum('FtoA');\r\n return null;\r\n } // DDで例外なし確認\r\n break;\r\n case 'H':\r\n if(CL + CT > 0 && DD === 4 && (CA + CL + CT > 0 || DD === 5)) {\r\n sum('HtoL');\r\n return 'L';\r\n } else {\r\n sum('HtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'I':\r\n if(CVL > 0 && CL > 0) {\r\n if(sai(92.5)) {\r\n sum('ItoK');\r\n return 'K';\r\n } else {\r\n sum('ItoE');\r\n sum('EtoD');\r\n return null;\r\n }\r\n } else if(CVL > 0) {\r\n if(sai(82.5)) {\r\n sum('ItoK');\r\n return 'K';\r\n } else {\r\n sum('ItoE');\r\n sum('EtoD');\r\n return null;\r\n }\r\n } else if(CL > 0) {\r\n if(sai(75)) {\r\n sum('ItoK');\r\n return 'K';\r\n } else {\r\n sum('ItoE');\r\n sum('EtoD');\r\n return null;\r\n }\r\n } else {\r\n if(sai(70)) {\r\n sum('ItoE');\r\n sum('EtoD');\r\n return null;\r\n } else {\r\n sum('ItoK');\r\n return 'K';\r\n }\r\n }\r\n break;\r\n case 'J':\r\n if(BBCVs > 3) {\r\n sum('JtoL');\r\n return 'L';\r\n } else if(BBCVs === 3 || CV + CVB === 2) {\r\n sum('JtoM');\r\n sum('MtoP');\r\n return null;\r\n } else if(CV + CVB === 0) {\r\n sum('JtoL');\r\n return 'L';\r\n } else {\r\n if(sai(65)) {\r\n sum('JtoM');\r\n sum('MtoP');\r\n return null;\r\n } else {\r\n sum('JtoL');\r\n return 'L';\r\n }\r\n }\r\n break;\r\n case 'K':\r\n if(AS + AO > 1) {\r\n sum('KtoN');\r\n return null;\r\n } else if(AV + AS + AO > 0) {\r\n if(Ds > 1) {\r\n if(sai(70)) {\r\n sum('KtoL');\r\n return 'L';\r\n } else {\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(Ds === 1) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.4) {\r\n sum('KtoL');\r\n return 'L';\r\n } else if(num <= 0.8) {\r\n sum('KtoN');\r\n return null;\r\n } else {\r\n sum('KtoO');\r\n return null;\r\n }\r\n } else if(Ds === 0) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.25) {\r\n sum('KtoL');\r\n return 'L';\r\n } else if(num <= 0.6) {\r\n sum('KtoN');\r\n return null;\r\n } else {\r\n sum('KtoO');\r\n return null;\r\n }\r\n }\r\n } else if(Ds > 1) {\r\n sum('KtoL');\r\n return 'L';\r\n } else if(Ds === 1) {\r\n if(sai(65)) {\r\n sum('KtoL');\r\n return 'L';\r\n } else {\r\n sum('KtoO');\r\n return null;\r\n }\r\n } else if(CAV > 0) {\r\n if(BB > 0) {\r\n if(sai(65)) {\r\n sum('KtoO');\r\n return null;\r\n } else {\r\n sum('KtoL');\r\n return 'L';\r\n }\r\n } else {\r\n if(sai(65)) {\r\n sum('KtoL');\r\n return 'L';\r\n } else {\r\n sum('KtoO');\r\n return null;\r\n }\r\n }\r\n } else if(BB > 1) {\r\n if(sai(77)) {\r\n sum('KtoO');\r\n return null;\r\n } else {\r\n sum('KtoL');\r\n return 'L';\r\n }\r\n } else {\r\n if(sai(65)) {\r\n sum('KtoL');\r\n return 'L';\r\n } else {\r\n sum('KtoO');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'L':\r\n if(BBCVs === 4) {\r\n sum('LtoM');\r\n sum('MtoP');\r\n return null;\r\n } else if(CL > 0 && DD > 1) {\r\n sum('LtoP');\r\n return null;\r\n } else if(BBs + CV + CVB < 3) {\r\n sum('LtoP');\r\n return null;\r\n } else {\r\n if(sai(60)) {\r\n sum('LtoM');\r\n sum('MtoP');\r\n return null;\r\n } else {\r\n sum('LtoP');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 5: // @2-5\r\n switch(edge) {\r\n case null:\r\n if(Ss > 3) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(Ss > 0 && BBs < 4 && (CVs > 0 || AV > 1)) {\r\n if(sai(50)) {\r\n sum('1toB');\r\n return 'B';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n } else if(CVs > 0 || AV > 1) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(f_drum > 1 || Ds > 3 || (CL > 0 && Ds > 2)) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(BBs > 0 || (CL + CLT > 0 && CAV > 0 && CA + CL + CLT > 4)) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(f_length === 6) {\r\n if(sai(80)) {\r\n sum('1toB');\r\n return 'B';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n } else {\r\n if(sai(95)) {\r\n sum('1toC');\r\n return 'C';\r\n } else {\r\n sum('1toB');\r\n return 'B';\r\n }\r\n }\r\n break;\r\n case 'B':\r\n if(Ss > 2) {\r\n sum('BtoA');\r\n return null;\r\n } else {\r\n sum('BtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'C':\r\n if(CVs > 2 || BBs > 2) {\r\n sum('CtoD');\r\n return null;\r\n } else if(CL > 0 && DD > 1 || CAV > 1 && DD > 1) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n if(sai(70)) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('CtoD');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'E':\r\n if(BBs > 0) {\r\n sum('EtoG');\r\n return 'G';\r\n } else if(CL > 0 && Ds > 3) {\r\n sum('EtoI');\r\n return 'I';\r\n } else if(f_speed === '低速艦隊' || CV + CVB + CAs > 1) {\r\n sum('EtoG');\r\n return 'G';\r\n } else if(CL > 0 && DD > 2) {\r\n sum('EtoI');\r\n return 'I';\r\n } else {\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'F':\r\n if(f_speed === '低速艦隊') {\r\n sum('FtoJ');\r\n return 'J';\r\n } else if(DD > 2 || (CL > 0 && DD > 1)) {\r\n sum('FtoE');\r\n return 'E';\r\n } else {\r\n if(sai(65)) {\r\n sum('FtoJ');\r\n return 'J';\r\n } else {\r\n sum('FtoE');\r\n return 'E';\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if((BBCVs < 2 && Ds > 3) || (BBCVs === 0 && CL > 0 && DD > 2)) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(f_seek[0] < 37) {\r\n sum('GtoK');\r\n return null;\r\n } else if(f_seek[0] < 41 && f_seek[0] >= 37) {\r\n if(sai(50)) {\r\n sum('GtoI');\r\n return 'I';\r\n } else {\r\n sum('GtoK');\r\n return null;\r\n }\r\n } else {\r\n sum('GtoL');\r\n return 'L';\r\n }\r\n break;\r\n case 'I':\r\n if(f_seek[0] < 31) {\r\n sum('ItoH');\r\n return null;\r\n } else if(f_seek[0] < 34 && f_seek[0] >= 31) {\r\n if(sai(50)) {\r\n sum('ItoH');\r\n return null;\r\n } else {\r\n sum('ItoO');\r\n return null;\r\n }\r\n } else {\r\n sum('ItoO');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if(f_seek[0] < 42) {\r\n sum('JtoH');\r\n return null;\r\n } else if(f_seek[0] < 49 && f_seek[0] >= 42) {\r\n if(BBCVs > 3) {\r\n const num = Math.random().toFixed(3);\r\n if(num <= 0.333) {\r\n sum('JtoH');\r\n return null;\r\n } else if(num <= 0.666) {\r\n sum('JtoM');\r\n return null;\r\n } else {\r\n sum('JtoO');\r\n return null;\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('JtoH');\r\n return null;\r\n } else {\r\n sum('JtoO');\r\n return null;\r\n }\r\n }\r\n } else if(BBCVs > 3) {\r\n if(sai(50)) {\r\n sum('JtoM');\r\n return null;\r\n } else {\r\n sum('JtoO');\r\n return null;\r\n }\r\n } else if(f_seek[0] >= 49) {\r\n sum('JtoO');\r\n return null;\r\n }\r\n break;\r\n case 'L':\r\n if(CL > 0 && DD > 1) {\r\n sum('LtoO');\r\n return null;\r\n } else if(BBCVs === 0) {\r\n if(sai(60)) {\r\n sum('LtoO');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n } else {\r\n if(sai(60)) {\r\n sum('LtoN');\r\n return null;\r\n } else {\r\n sum('LtoO');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n }\r\n break;\r\n case 3:\r\n switch(map) {\r\n case 1: // @3-1\r\n switch(edge) {\r\n case null:\r\n sum('1toC');\r\n return 'C';\r\n break;\r\n case 'C':\r\n if(Ds < 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(BBV + CL + AV + AO > 2) {\r\n if(BBCVs > 2) {\r\n if(sai(50)) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else {\r\n sum('CtoF');\r\n sum('FtoG');\r\n return null;\r\n }\r\n }\r\n } else if(AV + AO > 0 && Ds > 2) {\r\n if(sai(50)) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else {\r\n sum('CtoF');\r\n sum('FtoG');\r\n return null;\r\n }\r\n } else if(Ss > 2) {\r\n if(sai(50)) {\r\n sum('CtoD');\r\n return 'D';\r\n } else {\r\n sum('CtoF');\r\n sum('FtoG');\r\n return null;\r\n }\r\n } else if(BBCVs > 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else {\r\n sum('CtoF');\r\n sum('FtoG');\r\n return null;\r\n }\r\n break;\r\n case 'D':\r\n if(BBCVs > 4 || Ss === 6) {\r\n sum('DtoE');\r\n return null;\r\n } else if(AS === 1 && Ss === 5) {\r\n sum('DtoG');\r\n return null;\r\n } else {\r\n sum('DtoF');\r\n sum('FtoG');\r\n return null;\r\n }\r\n break;\r\n }\r\n break;\r\n case 2: // @3-2\r\n switch(edge) {\r\n case null:\r\n if(BBCVs > 0 || (CL === 1 && DD > 3) || DD === 6) {\r\n sum('1toC');\r\n return 'C';\r\n } else {\r\n sum('1toA');\r\n sum('AtoB');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(DD < 4 || BBs + CV + CVB > 1) {\r\n sum('CtoA');\r\n sum('AtoB');\r\n return null;\r\n } else if(BB > 0) {\r\n if(sai(50)) {\r\n sum('CtoA');\r\n sum('AtoB');\r\n return null;\r\n } else {\r\n sum('CtoG');\r\n return 'G';\r\n }\r\n } else if(f_speed === '低速艦隊' || f_radar === 0 || CL + DD + AO < 6) {\r\n sum('CtoG');\r\n return 'G';\r\n } else if(f_speed === '最速艦隊' && f_radar > 3) {\r\n sum('CtoE');\r\n return 'E';\r\n } else if(f_speed === '高速+艦隊' || AO > 0) {\r\n if(sai(60)) {\r\n sum('CtoG');\r\n return 'G';\r\n } else {\r\n sum('CtoE');\r\n return 'E';\r\n }\r\n } else {\r\n sum('CtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'E':\r\n if(f_speed === '高速+艦隊') {\r\n sum('EtoF');\r\n sum('FtoL');\r\n return null;\r\n } else {\r\n if(sai(80)) {\r\n sum('EtoF');\r\n sum('FtoL');\r\n return null;\r\n } else {\r\n sum('EtoD');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if(Ss > 0 || CV + CVB > 0 || BBs + CVL === 2) {\r\n sum('GtoJ');\r\n sum('JtoK');\r\n return null;\r\n } else if(f_speed === '低速艦隊' || f_radar === 0 || CL + DD + AO < 6) {\r\n sum('GtoH');\r\n return 'H';\r\n } else if(isFaster()) {\r\n sum('GtoF');\r\n sum('FtoL');\r\n return null;\r\n } else if(AO > 0) {\r\n if(sai(55)) {\r\n sum('GtoF');\r\n sum('FtoL');\r\n return null;\r\n } else {\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n } else {\r\n if(sai(65)) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('GtoF');\r\n sum('FtoL');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if(CL + DD + AO === 6) {\r\n sum('HtoF');\r\n sum('FtoL');\r\n return null;\r\n } else {\r\n sum('HtoI');\r\n return null;\r\n }\r\n break;\r\n }\r\n break;\r\n case 3: // @3-3\r\n switch(edge) {\r\n case null:\r\n sum('1toA');\r\n return 'A';\r\n break;\r\n case 'A':\r\n if(CV + CVB > 0 || BBs + CVL > 3 || BBs + CVL === 1 && CL === 1 && DD === 4) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoB');\r\n return 'B';\r\n }\r\n break;\r\n case 'B':\r\n if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('BtoD');\r\n return null;\r\n } else {\r\n sum('BtoF');\r\n return 'F';\r\n }\r\n } else if(BBs + CVL < 2 || (BBs + CVL < 3 && DD > 1)) {\r\n sum('BtoF');\r\n return 'F';\r\n } else {\r\n if(sai(50)) {\r\n sum('BtoD');\r\n return null;\r\n } else {\r\n sum('BtoF');\r\n return 'F';\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(Ds < 2 || CV + CVB > 1 || BBCVs > 2) {\r\n sum('CtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else if(BBCVs === 2 || (BBCVs === 1 && CL === 1 && DD === 4)) {\r\n sum('CtoG');\r\n return 'G';\r\n } else {\r\n sum('CtoE');\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'F':\r\n if(DD < 2 || BBs > 2) {\r\n sum('FtoG');\r\n return 'G';\r\n } else if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoJ');\r\n return 'J';\r\n }\r\n } else if(CL + CAV + AV > 0) {\r\n sum('FtoJ');\r\n return 'J';\r\n } else {\r\n if(sai(50)) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoJ');\r\n return 'J';\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoM');\r\n return null;\r\n }\r\n } else if(BBCVs < 4) {\r\n sum('GtoM');\r\n return null;\r\n } else if(BBCVs === 4) {\r\n if(sai(50)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoM');\r\n return null;\r\n }\r\n } else if(BBCVs === 5) {\r\n if(sai(65)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoM');\r\n return null;\r\n }\r\n } else if(BBCVs === 6) {\r\n if(sai(85)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoM');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'J':\r\n if(DD > 4 || (CL === 1 && DD > 3)) {\r\n sum('JtoM');\r\n return null;\r\n } else {\r\n sum('JtoK');\r\n return 'K';\r\n }\r\n break;\r\n case 'K':\r\n if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('KtoL');\r\n return null;\r\n } else {\r\n sum('KtoM');\r\n return null;\r\n }\r\n } else if(BBs + CVL < 2) {\r\n sum('KtoM');\r\n return null;\r\n } else if(BBs + CVL === 2) {\r\n if(sai(75)) {\r\n sum('KtoM');\r\n return null;\r\n } else {\r\n sum('KtoL');\r\n return null;\r\n }\r\n } else if(BBs + CVL === 3) {\r\n if(sai(50)) {\r\n sum('KtoM');\r\n return null;\r\n } else {\r\n sum('KtoL');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 4: // @3-4\r\n switch(edge) {\r\n case null:\r\n if(CL + Ds === 0 || BBCVs > 2) {\r\n sum('1toA');\r\n sum('AtoC');\r\n return 'C';\r\n } else if(BBCVs === 2 || Ss > 0) {\r\n if(sai(65)) {\r\n sum('1toB');\r\n sum('BtoH');\r\n return 'H';\r\n } else {\r\n sum('1toA');\r\n sum('AtoC');\r\n return 'C';\r\n }\r\n } else if(BBCVs === 1) {\r\n sum('1toB');\r\n sum('BtoH');\r\n return 'H';\r\n } else if(BBCVs === 0) {\r\n if(DD < 3) {\r\n if(sai(65)) {\r\n sum('1toB');\r\n sum('BtoH');\r\n return 'H';\r\n } else {\r\n sum('1toD');\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n } else {\r\n sum('1toD');\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n } // 航空戦艦により例外なし\r\n break;\r\n case 'C':\r\n if(CV + CVB > 2 || CL + Ds === 0 || BBCVs > 4) {\r\n sum('CtoB');\r\n sum('BtoH');\r\n return 'H';\r\n } else if(BBCVs === 2) {\r\n sum('CtoF');\r\n return 'F';\r\n } else if(AV + AO > 0) {\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else if(AS > 0) {\r\n if(sai(50)) {\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n } else {\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(BBCVs + CAs > 4) {\r\n sum('FtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else if(BBs + CV + CVB < 3 && CL > 0 && Ds > 1) {\r\n if(isFaster()) {\r\n sum('FtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.1) {\r\n sum('FtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else if(num <= 0.55) {\r\n sum('FtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n sum('FtoM');\r\n return 'M';\r\n }\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('FtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n sum('FtoM');\r\n return 'M';\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if(DD < 3 || CL + DD < 4 || CV + CVB > 0 || BBs + CVL > 1) {\r\n sum('HtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else if(CL + DD > 4) {\r\n sum('HtoL');\r\n return 'L';\r\n } else if(CL === 0) {\r\n sum('HtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n if(sai(65)) {\r\n sum('HtoL');\r\n return 'L';\r\n } else {\r\n sum('HtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'L':\r\n if(CAs + CL + DD === 6) {\r\n sum('LtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else if(BBs + CVL === 0) {\r\n sum('LtoN');\r\n sum('NtoP');\r\n return null;\r\n } else {\r\n if(sai(50)) {\r\n sum('LtoN');\r\n sum('NtoP');\r\n return null;\r\n } else {\r\n sum('LtoO');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'M':\r\n if(CL > 0 && DD > 0) {\r\n sum('MtoP');\r\n return null;\r\n } else {\r\n if(sai(50)) {\r\n sum('MtoP');\r\n return null;\r\n } else {\r\n sum('MtoK');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 5: // @3-5\r\n switch(edge) {\r\n case null:\r\n if(Ss > 2 || BBs > 1 || BBs + CAs > 2 || CVs + CLT > 0) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(DD > 4) {\r\n sum('1toF');\r\n return 'F';\r\n } else if(DD === 4) {\r\n if(sai(75)) {\r\n sum('1toF');\r\n return 'F';\r\n } else {\r\n sum('1toB');\r\n return 'B';\r\n }\r\n } else if(DD < 4) {\r\n if(sai(50)) {\r\n sum('1toF');\r\n return 'F';\r\n } else {\r\n sum('1toB');\r\n return 'B';\r\n }\r\n } // DDより例外なし\r\n break;\r\n case 'B':\r\n if(Ss > 3 || CVs > 3 || BBCVs > 4) {\r\n sum('BtoA');\r\n return null;\r\n } else if(CLT > 1 || CVs > 1 || BBs > 2 || BBCVs + CAs > 4) {\r\n sum('BtoD');\r\n sum('DtoH');\r\n return 'H';\r\n } else if(CVs === 0 && CL === 1 && DD > 1) {\r\n sum('BtoE');\r\n sum('EtoH');\r\n return 'H';\r\n } else {\r\n sum('BtoC');\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(BBCVs + LHA > 0 || CL + CLT > 3 || CAs > 1) {\r\n sum('FtoE');\r\n sum('EtoH');\r\n return 'H';\r\n } else if(CAs === 1) {\r\n if(sai(75)) {\r\n sum('FtoG');\r\n return 'G';\r\n } else {\r\n sum('FtoE');\r\n sum('EtoH');\r\n return 'H';\r\n }\r\n } else if(CAs === 0) {\r\n if(CL === 3) {\r\n if(sai(85)) {\r\n sum('FtoG');\r\n return 'G';\r\n } else {\r\n sum('FtoE');\r\n sum('EtoH');\r\n return 'H';\r\n }\r\n } else if(CL < 3) {\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n } // CAsより例外なし\r\n break;\r\n case 'G':\r\n if(f_seek[3] < 23) {\r\n sum('GtoI');\r\n return null;\r\n } else if(f_seek[3] < 28 && f_seek[3] >= 23) {\r\n if(sai(50)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoK');\r\n return null;\r\n }\r\n } else if(f_seek[3] >= 28) {\r\n sum('GtoK');\r\n return null;\r\n } // 例外なし\r\n break;\r\n case 'H':\r\n if(BBCVs > 3 || (BBCVs > 1 && LHA > 0)) {\r\n sum('HtoJ');\r\n return null;\r\n } else if(f_seek[3] < 35) {\r\n sum('HtoJ');\r\n return null;\r\n } else if(f_seek[3] < 40 && f_seek[3] >= 35) {\r\n if(sai(50)) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(f_seek[3] >= 40) {\r\n sum('HtoK');\r\n return null;\r\n } // 例外なし\r\n break;\r\n }\r\n break;\r\n }\r\n break;\r\n case 4:\r\n switch(map) {\r\n case 1: // @4-1\r\n switch(edge) {\r\n case null:\r\n if(sai(50)) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoD');\r\n return 'D';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n break;\r\n case 'C':\r\n if(BBCVs > 4) {\r\n sum('CtoE');\r\n return null;\r\n } else if(BBCVs === 4) {\r\n if(sai(70)) {\r\n sum('CtoE');\r\n return null;\r\n } else {\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n } else if(BBCVs === 3) {\r\n if(sai(50)) {\r\n sum('CtoE');\r\n return null;\r\n } else {\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n } else if(BBCVs < 3) {\r\n sum('CtoF');\r\n return 'F';\r\n } // BBCVsより例外なし\r\n break;\r\n case 'D':\r\n if(BBCVs > 4) {\r\n sum('DtoH');\r\n return 'H';\r\n } else if(Ss < 0) {\r\n if(sai(70)) {\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n sum('DtoG');\r\n sum('GtoJ');\r\n return null;\r\n }\r\n } else if(BBCVs === 4 || Ds < 2) {\r\n sum('DtoG');\r\n sum('GtoJ');\r\n return null;\r\n } else if(BBCVs === 0 || Ds > 3) {\r\n sum('DtoH');\r\n return 'H';\r\n } else if(Ds === 3 || CL === 0) {\r\n sum('DtoG');\r\n sum('GtoJ');\r\n return null;\r\n } else if(CAs > 0 && CAs + CL + CT === 3) {\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n if(sai(50)) {\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n sum('DtoG');\r\n sum('GtoJ');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(BBCVs > 0 || Ds < 4) {\r\n sum('FtoD');\r\n return 'D';\r\n } else if(CL + CT > 0 || CAs === 0) {\r\n sum('FtoH');\r\n return 'H';\r\n } else {\r\n sum('FtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 'H':\r\n if(Ss === 1) {\r\n if(sai(50)) {\r\n sum('HtoI');\r\n return null;\r\n } else {\r\n sum('HtoJ');\r\n return null;\r\n }\r\n } else if(Ss > 1) {\r\n sum('HtoI');\r\n return null;\r\n } else if(BBCVs > 4) {\r\n sum('HtoI');\r\n return null;\r\n } else if(BBCVs < 2) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n if(sai(50)) {\r\n sum('HtoI');\r\n return null;\r\n } else {\r\n sum('HtoJ');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 2: // @4-2\r\n switch(edge) {\r\n case null:\r\n switch(Ds) {\r\n case 0:\r\n if(sai(90)) {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n } else {\r\n sum('1toA');\r\n return 'A';\r\n }\r\n break;\r\n case 1:\r\n if(sai(80)) {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n } else {\r\n sum('1toA');\r\n return 'A';\r\n }\r\n break;\r\n case 2:\r\n if(CV > 1) {\r\n if(sai(55)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } else if(CVs > 1) {\r\n if(sai(60)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } else if(CVs === 1) {\r\n if(sai(65)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } else if(CVs === 0) {\r\n if(sai(72.5)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } // CVsより例外なし\r\n break;\r\n case 3:\r\n if(CVs > 1) {\r\n if(sai(72.5)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } else if(CVs < 2) {\r\n if(sai(77.5)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } // CVsより例外なし\r\n break;\r\n case 4:\r\n if(sai(85)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 5:\r\n case 6:\r\n if(sai(90)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n break;\r\n }\r\n break;\r\n case 'A':\r\n if(Ds < 2) {\r\n sum('AtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoE');\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n } else if(Ds > 3 || (CL > 0 && Ds > 2)) {\r\n sum('AtoC');\r\n return 'C';\r\n } else if(Ds === 3) {\r\n if(sai(85)) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoE');\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n } else if(CL > 0 && Ds === 2) {\r\n if(sai(85)) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoE');\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n } else {\r\n if(sai(55)) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoE');\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(Ds < 2 || BBCVs > 3) {\r\n sum('CtoG');\r\n return 'G';\r\n } else if(BBCVs === 3) {\r\n if(CL === 0) {\r\n if(sai(85)) {\r\n sum('CtoG');\r\n return 'G';\r\n } else {\r\n sum('CtoL');\r\n return null;\r\n }\r\n } else {\r\n if(sai(65)) {\r\n sum('CtoG');\r\n return 'G';\r\n } else {\r\n sum('CtoL');\r\n return null;\r\n }\r\n }\r\n } else if(CL > 0 || Ds > 3) {\r\n sum('CtoL');\r\n return null;\r\n } else {\r\n if(sai(65)) {\r\n sum('CtoG');\r\n return 'G';\r\n } else {\r\n sum('CtoL');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'D':\r\n if(BBCVs === 6) {\r\n sum('DtoH');\r\n return 'H';\r\n } else if(BBCVs < 3) {\r\n if(Ds > 1) {\r\n sum('DtoC');\r\n return 'C';\r\n } else {\r\n if(sai(60)) {\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n sum('DtoC');\r\n return 'C';\r\n }\r\n }\r\n } else if(Ds < 2) {\r\n if(sai(85)) {\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n sum('DtoC');\r\n return 'C';\r\n }\r\n } else if(BBs === 4) {\r\n if(sai(70)) {\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n sum('DtoC');\r\n return 'C';\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n sum('DtoC');\r\n return 'C';\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if(Ds > 2) {\r\n sum('GtoL');\r\n return null;\r\n } else if(Ds < 3) {\r\n if(CL + CAV + AV > 0) {\r\n sum('GtoL');\r\n return null;\r\n } else {\r\n if(sai(65)) {\r\n sum('GtoL');\r\n return null;\r\n } else {\r\n sum('GtoF');\r\n sum('FtoJ');\r\n return null;\r\n }\r\n }\r\n } else if(Ss > 0) { // @\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.5) {\r\n sum('GtoF');\r\n sum('FtoJ');\r\n return null;\r\n } else if(num <= 0.75) {\r\n sum('GtoL');\r\n return null;\r\n } else {\r\n sum('GtoI');\r\n return null;\r\n }\r\n } else if(BBCVs > 4) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.5) {\r\n sum('GtoI');\r\n return null;\r\n } else if(num <= 0.75) {\r\n sum('GtoL');\r\n return null;\r\n } else {\r\n sum('GtoF');\r\n sum('FtoJ');\r\n return null;\r\n }\r\n } else if(BBCVs < 2) {\r\n if(sai(85)) {\r\n sum('GtoL');\r\n return null;\r\n } else {\r\n sum('GtoF');\r\n sum('FtoJ');\r\n return null;\r\n }\r\n } else {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('GtoF');\r\n sum('FtoJ');\r\n return null;\r\n } else if(num <= 0.66) {\r\n sum('GtoL');\r\n return null;\r\n } else {\r\n sum('GtoI');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if(DD > 1) {\r\n sum('HtoG');\r\n return 'G';\r\n } else if(Ds > 1) {\r\n if(sai(80)) {\r\n sum('HtoG');\r\n return 'G';\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(BBCVs > 4) {\r\n if(sai(80)) {\r\n sum('HtoK');\r\n return null;\r\n } else {\r\n sum('HtoG');\r\n return 'G';\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('HtoK');\r\n return null;\r\n } else {\r\n sum('HtoG');\r\n return 'G';\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 3: // @4-3 nullがヤな感じ 多分こういうことだろうという\r\n switch (edge) {\r\n case null:\r\n if(CV + CVB > 0) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(Ds > 3 && (f_speed !== '低速艦隊' || BBs + CVL === 0)) {\r\n sum('1toD');\r\n sum('DtoH');\r\n return 'H';\r\n } else if(Ds > 2 && CL > 0) {\r\n sum('1toD');\r\n sum('DtoH');\r\n return 'H';\r\n } else if(Ds > 1 && CL + AO > 0) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n if(sai(50)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n }\r\n break;\r\n case 'A':\r\n if(AV + AO + BBV > 0) {\r\n sum('AtoB');\r\n return 'B';\r\n } else if(AO > 1 && Ds > 1){\r\n sum('AtoD');\r\n sum('DtoH');\r\n return 'H';\r\n } else if(CVL > 0) {\r\n sum('AtoB');\r\n return 'B';\r\n } else {\r\n if(sai(50)) {\r\n sum('AtoB');\r\n return 'B';\r\n } else {\r\n sum('AtoD');\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n }\r\n break;\r\n case 'B':\r\n if(Ds < 2 || BBs + CVL > 2) {\r\n sum('BtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else if(f_speed !== '低速艦隊') {\r\n sum('BtoG');\r\n return 'G';\r\n } else {\r\n if(sai(65)) {\r\n sum('BtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('BtoG');\r\n return 'G';\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(BBCVs > 3) {\r\n sum('CtoF');\r\n return 'F';\r\n } else if(Ss === 0 && CL === 1 && Ds > 1) {\r\n sum('CtoD');\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n if(sai(80)) {\r\n sum('CtoF');\r\n return 'F';\r\n } else {\r\n sum('CtoD');\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(Ss > 0 || DD === 0 || CVs === 0) {\r\n sum('FtoK');\r\n return 'K';\r\n } else if(f_speed !== '低速艦隊' && BBCVs < 3 && DD > 1) {\r\n sum('FtoH');\r\n return 'H';\r\n } else {\r\n if(sai(70)) { // @\r\n sum('FtoK');\r\n return 'K';\r\n } else {\r\n sum('FtoH');\r\n return 'H';\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if(CVL === 0) {\r\n sum('GtoJ');\r\n return null;\r\n } else {\r\n if(sai(65)) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('GtoI');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if(CVs === 2) {\r\n if(sai(90)) {\r\n sum('HtoN');\r\n return null;\r\n } else {\r\n sum('HtoI');\r\n return null;\r\n }\r\n } else if(CVs === 0 && CA === 2) {\r\n if(sai(80)) { // @\r\n sum('HtoN');\r\n return null;\r\n } else {\r\n sum('HtoI');\r\n return null;\r\n }\r\n } else {\r\n if(sai(70)) {\r\n sum('HtoN');\r\n return null;\r\n } else {\r\n sum('HtoI');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'K':\r\n if(Ss > 0 || (CVs > 2 || CVs === 0) || Ds < 2) {\r\n sum('KtoL');\r\n return 'L';\r\n } else if(CV + CVB === 1 && AV + CVL === 1) {\r\n if(sai(55)) {\r\n sum('KtoL');\r\n return 'L';\r\n } else {\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(CVs === 2) {\r\n if(sai(67.5)) {\r\n sum('KtoL');\r\n return 'L';\r\n } else {\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(CVs === 1) {\r\n if(sai(85)) {\r\n sum('KtoL');\r\n return 'L';\r\n } else {\r\n sum('KtoN');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'L':\r\n if(CL + Ds === 0 || BBCVs > 4 || CVs === 0) {\r\n sum('LtoM');\r\n return null;\r\n } else if(CA === 2) {\r\n sum('LtoN');\r\n return null;\r\n } else if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('LtoM');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n } else if(BBCVs < 3) {\r\n sum('LtoN');\r\n return null;\r\n } else {\r\n if(sai(50)) {\r\n sum('LtoM');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 4: // @4-4\r\n switch(edge) {\r\n case null:\r\n if(Ds > 1) {\r\n sum('1toA');\r\n sum('AtoE');\r\n return 'E';\r\n } else {\r\n if(sai(50)) {\r\n sum('1toA');\r\n sum('AtoE');\r\n return 'E';\r\n } else {\r\n sum('1toB');\r\n return 'B';\r\n }\r\n }\r\n break;\r\n case 'B':\r\n if(BBCVs > 3) {\r\n sum('BtoA');\r\n sum('AtoE');\r\n return 'E';\r\n } else if(CA > 0) {\r\n if(sai(70)) {\r\n sum('BtoD');\r\n sum('DtoE');\r\n return 'E';\r\n } else {\r\n sum('BtoF');\r\n return 'F';\r\n }\r\n } else {\r\n sum('BtoD');\r\n sum('DtoE');\r\n return 'E';\r\n }\r\n break;\r\n case 'E':\r\n if(BBs + CV + CVB > 3) {\r\n sum('EtoG');\r\n return 'G';\r\n } else if(CAs + CL > 0 && Ds > 1) {\r\n sum('EtoI');\r\n return 'I';\r\n } else if(DE > 2 || (DE > 1 && AO + AS > 0)) {\r\n sum('EtoC');\r\n return null;\r\n } else if(Ds > 1) {\r\n if(BBCVs > 3) {\r\n if(sai(80)) {\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('EtoI');\r\n return 'I';\r\n }\r\n } else if(BBCVs < 4) {\r\n if(sai(65)) {\r\n sum('EtoI');\r\n return 'I';\r\n } else {\r\n sum('EtoG');\r\n return 'G';\r\n\r\n }\r\n } // BBCVsより例外なし\r\n } else if(Ss > 3) {\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n if(sai(50)) {\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('EtoI');\r\n return 'I';\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(BBCVs > 2) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'G': {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.25) {\r\n sum('GtoC');\r\n return null;\r\n } else if(num <= 0.75) {\r\n sum('GtoI');\r\n return 'I';\r\n } else {\r\n sum('GtoJ');\r\n return null;\r\n }\r\n break;\r\n }\r\n case 'I':\r\n if(Ds > 1) {\r\n if(CV + CVB === 2 || CAs === 2 || (CV + CVB === 0 && CL > 0)) {\r\n sum('ItoK');\r\n return null;\r\n } else {\r\n if(sai(75)) {\r\n sum('ItoK');\r\n return null;\r\n } else {\r\n sum('ItoH');\r\n return null;\r\n }\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('ItoK');\r\n return null;\r\n } else {\r\n sum('ItoH');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 5: // @4-5\r\n switch(edge) {\r\n case null:\r\n if(sai(50)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n break;\r\n case 'A':\r\n if(active['4-5']['A'] === 'B') {\r\n sum('AtoB');\r\n sum('BtoE');\r\n return 'E';\r\n } else {\r\n sum('AtoD');\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'C':\r\n if(active['4-5']['C'] === 'F') {\r\n sum('CtoF');\r\n sum('FtoI');\r\n return 'I';\r\n } else {\r\n sum('CtoD');\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'E':\r\n if(isFaster() || AO > 0 || BBCVs > 2 || (CL > 0 && Ds > 1)) {\r\n sum('EtoM');\r\n return 'M';\r\n } else {\r\n sum('EtoK');\r\n return 'K';\r\n }\r\n break;\r\n case 'G':\r\n if(CL > 0 && Ds > 1) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n if(sai(50)) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('GtoD');\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if((isFaster() && BBCVs < 5) || (CL === 1 && Ds > 2) || (!track.includes('D') && CL === 1 && Ds > 1)) {\r\n sum('HtoT');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return 'K';\r\n }\r\n break;\r\n case 'I':\r\n if(active['4-5']['I'] === 'G') {\r\n sum('ItoG');\r\n return 'G';\r\n } else {\r\n sum('ItoJ');\r\n sum('JtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'K':\r\n if(track.includes('E') || BBs + CV + CVB > 3 || BBCVs > 4 || AO > 0) {\r\n sum('KtoM');\r\n return 'M';\r\n } else if(f_seek[1] < 63) {\r\n sum('KtoL');\r\n return null;\r\n } else if(f_seek[1] < 70 && f_seek[1] >= 63) {\r\n if(Ss > 0) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('KtoM');\r\n return 'M';\r\n } else if(num <= 0.66) {\r\n sum('KtoL');\r\n return null;\r\n } else {\r\n sum('KtoT');\r\n return null;\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('KtoL');\r\n return null;\r\n } else {\r\n sum('KtoT');\r\n return null;\r\n }\r\n }\r\n } else if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('KtoM');\r\n return null;\r\n } else {\r\n sum('KtoT');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 70) {\r\n sum('KtoT');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n case 'M':\r\n if(f_speed === '最速艦隊') {\r\n sum('MtoN');\r\n sum('NtoT');\r\n return null;\r\n } else if(DD < 2) {\r\n sum('MtoR');\r\n return 'R';\r\n } else if(f_speed === '高速+艦隊') {\r\n sum('MtoN');\r\n sum('NtoT');\r\n return null;\r\n } else if(f_speed === '低速艦隊') {\r\n sum('MtoR');\r\n return 'R';\r\n } else if(BBs + CV + CVB < 2) {\r\n sum('MtoN');\r\n sum('NtoT');\r\n return null;\r\n } else {\r\n sum('MtoR');\r\n return 'R';\r\n }\r\n break;\r\n case 'O':\r\n if(BBCVs > 4) {\r\n sum('OtoN');\r\n sum('NtoT');\r\n return null;\r\n } else {\r\n if(sai(50)) {\r\n sum('OtoN');\r\n sum('NtoT');\r\n return null;\r\n } else {\r\n sum('OtoT');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'Q':\r\n if(f_seek[1] < 55) {\r\n sum('QtoP');\r\n return null;\r\n } else if(f_seek[1] < 59 && f_seek[1] >= 55) {\r\n if(BBCVs > 4) {\r\n if(sai(50)) {\r\n sum('QtoO');\r\n return 'O';\r\n } else {\r\n sum('QtoP');\r\n return null;\r\n }\r\n } else if(DD === 0) {\r\n if(sai(50)) {\r\n sum('QtoO');\r\n return 'O';\r\n } else {\r\n sum('QtoP');\r\n return null;\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('QtoN');\r\n sum('NtoT');\r\n return null;\r\n } else {\r\n sum('QtoP');\r\n return null;\r\n }\r\n }\r\n } else if(BBCVs > 4 || DD === 0) {\r\n sum('QtoO');\r\n return 'O';\r\n } else if(f_seek[1] >= 59) {\r\n sum('QtoN');\r\n sum('NtoT');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n case 'R':\r\n if(f_speed === '高速+艦隊' || (f_speed !== '低速艦隊' && CL + CAV > 0 && DD > 1)) {\r\n sum('RtoN');\r\n sum('NtoT');\r\n return null;\r\n } else {\r\n sum('RtoS');\r\n sum('StoQ');\r\n return 'Q';\r\n }\r\n break;\r\n }\r\n break;\r\n }\r\n break;\r\n case 5:\r\n switch(map) {\r\n case 1: // @5-1 Fが怪しげではある\r\n switch(edge) {\r\n case null:\r\n if(BBCVs > 4) {\r\n sum('1toA');\r\n sum('AtoD');\r\n sum('DtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else if((BBCVs < 3 && DD > 1) || (CAs > 3 && CL > 0) || (CAs > 1 && CL === 1)) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(BBs === 3 && CL === 1 && DD === 2) {\r\n if(sai(75)) {\r\n sum('1toB');\r\n return 'B';\r\n } else {\r\n sum('1toA');\r\n sum('AtoD');\r\n sum('DtoE');\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('1toB');\r\n return 'B';\r\n } else {\r\n sum('1toA');\r\n sum('AtoD');\r\n sum('DtoE');\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n }\r\n break;\r\n case 'B':\r\n if(CV + CVB > 0 || CVL > 1) {\r\n sum('BtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else if(BBs < 3) {\r\n sum('BtoC');\r\n sum('CtoF');\r\n return 'F';\r\n } else if(CL === 1) {\r\n sum('BtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else if(DD > 1) {\r\n sum('BtoC');\r\n sum('CtoF');\r\n return 'F';\r\n } else {\r\n if(sai(50)) {\r\n sum('BtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('BtoC');\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(CL + DD === 0 || BBs + CVL > 3) {\r\n sum('FtoH');\r\n return null;\r\n } else if(BBs + CVL === 3) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('FtoG');\r\n return 'G';\r\n } else if(num <= 0.66) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoJ');\r\n return null;\r\n }\r\n } else if(f_speed === '最速艦隊') {\r\n sum('FtoJ');\r\n return null;\r\n } else if(CL > 0) {\r\n if(DD > 1) {\r\n sum('FtoJ');\r\n return null;\r\n } else {\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n } else if(DD > 3) {\r\n sum('FtoJ');\r\n return null;\r\n } else if(DD === 3) {\r\n if(sai(70)) {\r\n sum('FtoJ');\r\n return null;\r\n } else {\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n } else if(DD === 2) {\r\n if(sai(70)) {\r\n sum('FtoG');\r\n return 'G';\r\n } else {\r\n sum('FtoJ');\r\n return null;\r\n }\r\n } else if(DD === 1) {\r\n sum('FtoG');\r\n return 'G';\r\n } // DDより例外なし 多分\r\n break;\r\n case 'G':\r\n if(BBCVs > 4) {\r\n sum('GtoI');\r\n return null;\r\n } else if(CVs > 0 && BBCVs > 2) {\r\n if(sai(50)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoJ');\r\n return null;\r\n }\r\n } else if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoJ');\r\n return null;\r\n }\r\n } else if(f_speed === '高速+艦隊') {\r\n sum('GtoJ');\r\n return null;\r\n } else if(CAs > 3) {\r\n if(BBCVs + CLT === 0) {\r\n sum('GtoJ');\r\n return null;\r\n } else {\r\n if(sai(70)) {\r\n sum('GtoJ');\r\n return null;\r\n } else {\r\n sum('GtoI');\r\n return null;\r\n }\r\n }\r\n } else if(CV + CVB > 0) {\r\n if(sai(70)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoJ');\r\n return null;\r\n }\r\n } else if(DD > 3 || (CAs > 1 && DD > 1) || (CL > 0 && DD > 1)) {\r\n sum('GtoJ');\r\n return null;\r\n } else if(BBs === 3 && CL === 1 && CAs === 2) {\r\n if(sai(85)) {\r\n sum('GtoJ');\r\n return null;\r\n } else {\r\n sum('GtoI');\r\n return null;\r\n }\r\n } else {\r\n if(sai(70)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoJ');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 2: // @5-2\r\n switch(edge) {\r\n case null:\r\n if(BBCVs > 4 || BBs > 3 || CV + CVB > 2 || Ss > 0) {\r\n if(sai(50)) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n break;\r\n case 'C':\r\n if((CVs === 2 && CAs === 2 && DD === 2) || (isInclude('夕張') && CVL + CAs + DD + AO === 5) || (isInclude('祥鳳') && CAs + CL + CT + DD + AO === 5)) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(f_speed === '低速艦隊') {\r\n sum('CtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(isInclude('翔鶴') && isInclude('瑞鶴') && DD > 1) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(BBs + CV + CVB > 0) {\r\n sum('CtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if((CVL === 2 && DD > 1) || (CVL === 1 && CAs > 0 && DD > 1)) {\r\n sum('CtoD');\r\n return 'D';\r\n } else {\r\n sum('CtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'D':\r\n if((isInclude('祥鳳') && DD === 3) && (((CA === 1 && (CL === 1 || AO === 1)) || AO === 2))) {\r\n sum('DtoG');\r\n return 'G';\r\n } else if(isInclude('夕張') && DD === 2) {\r\n if(DD === 3 || (AO === 1 && (DD === 2 || CA === 2)) || (AO == 2 && (DD === 1 || CA === 2)) || (isInclude('祥鳳') && (CA === 2 || AO === 2))) {\r\n sum('DtoG');\r\n return 'G';\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_seek[1] < 63) {\r\n sum('FtoH');\r\n return null;\r\n } else if(f_seek[1] < 70 && f_seek[1] >= 63) {\r\n if(BBs + CV + CVB > 4) {\r\n if(sai(50)) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoI');\r\n sum('ItoO');\r\n return null;\r\n }\r\n } else if(BBs > 2 || CVs > 2) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('FtoH');\r\n return null;\r\n } else if(num <= 0.66) {\r\n sum('FtoI');\r\n sum('ItoO');\r\n return null;\r\n } else {\r\n sum('FtoO');\r\n return null;\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoO');\r\n return null;\r\n }\r\n }\r\n } else if(BBs + CV + CVB > 4) {\r\n sum('FtoI');\r\n sum('ItoO');\r\n return null;\r\n } else if(BBs > 2 || CVs > 2) {\r\n if(sai(70)) {\r\n sum('FtoI');\r\n sum('ItoO');\r\n return null;\r\n } else {\r\n sum('FtoO');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 70) {\r\n sum('FtoO');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n case 'G':\r\n if(isInclude('祥鳳') && isInclude('夕張')) {\r\n if(sai(55)) {\r\n sum('GtoJ');\r\n sum('JtoL');\r\n return 'L';\r\n } else {\r\n sum('GtoL');\r\n return 'L';\r\n }\r\n } else {\r\n if(sai(85)) {\r\n sum('GtoJ');\r\n sum('JtoL');\r\n return 'L';\r\n } else {\r\n sum('GtoL');\r\n return 'L';\r\n }\r\n }\r\n break;\r\n case 'L':\r\n if(!isInclude('祥鳳') && !isInclude('夕張')) {\r\n if(isFaster()) {\r\n if(sai(50)) {\r\n sum('LtoK');\r\n sum('KtoO');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n } else if(f_seek[1] < 60) {\r\n if(sai(50)) {\r\n sum('LtoM');\r\n sum('MtoK');\r\n sum('KtoO');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n } else if(f_seek[1] < 62 && f_seek[1] >= 60) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('LtoK');\r\n sum('KtoO');\r\n return null;\r\n } else if(num <= 0.66) {\r\n sum('LtoM');\r\n sum('MtoK');\r\n sum('KtoO');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 62) {\r\n if(sai(50)) {\r\n sum('LtoK');\r\n sum('KtoO');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n } // LoSより例外なし\r\n } if(isFaster()) {\r\n sum('LtoK');\r\n sum('KtoO');\r\n return null;\r\n } else if(f_seek[1] < 62 && f_seek[1] >= 60) {\r\n if(sai(50)) {\r\n sum('LtoK');\r\n sum('KtoO');\r\n return null;\r\n } else {\r\n sum('LtoM');\r\n sum('MtoK');\r\n sum('KtoO');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 62) {\r\n sum('LtoK');\r\n sum('KtoO');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n case 3: // @5-3\r\n switch(edge) {\r\n case null:\r\n if(isFaster()) {\r\n sum('1toD');\r\n sum('DtoG');\r\n return 'G';\r\n } else if(BBCVs > 2 || (BBCVs === 2 && f_speed === '低速艦隊')) {\r\n sum('1toC');\r\n sum('CtoD');\r\n sum('DtoG');\r\n return 'G';\r\n } else if(Ss > 0) {\r\n if(sai(60)) {\r\n sum('1toD');\r\n sum('DtoG');\r\n return 'G';\r\n } else {\r\n sum('1toC');\r\n sum('CtoD');\r\n sum('DtoG');\r\n return 'G';\r\n }\r\n } else {\r\n sum('1toD');\r\n sum('DtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'B':\r\n if(sai(65)) {\r\n sum('BtoA');\r\n return null;\r\n } else {\r\n sum('BtoF');\r\n return null;\r\n }\r\n break;\r\n case 'E':\r\n if(Ss > 0 || (BBCVs > 0 && DD < 2)) {\r\n if(sai(50)) {\r\n sum('EtoB');\r\n return 'B';\r\n } else {\r\n sum('EtoQ');\r\n return null;\r\n }\r\n } else if(CL > 0 || CAs > 3 || DD > 3) {\r\n sum('EtoQ');\r\n return null;\r\n } else {\r\n if(sai(50)) {\r\n sum('EtoB');\r\n return 'B';\r\n } else {\r\n sum('EtoQ');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if(BBV + CV + CVB + Ss > 0) {\r\n sum('GtoJ');\r\n return 'J';\r\n } else if(DD === 0 || CVL > 1) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(CVL === 1) {\r\n sum('GtoJ');\r\n return 'J';\r\n } else if(DD === 1) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(countSBB() > 1) {\r\n sum('GtoJ');\r\n return 'J';\r\n } else {\r\n sum('GtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'I':\r\n if(CVL > 0 || BBs > 2) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else if(DD > 2 || (CL > 0 && DD > 1)) {\r\n sum('ItoO');\r\n return 'O';\r\n } else if(BBs > 1) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else if(DD > 1) {\r\n sum('ItoO');\r\n return 'O';\r\n } else if(CL > 0 && CAs > 3 && CAs + CL + DD === 6) {\r\n sum('ItoO');\r\n return 'O';\r\n } else {\r\n if(sai(50)) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else {\r\n sum('ItoO');\r\n return 'O';\r\n }\r\n }\r\n break;\r\n case 'J':\r\n if(Ss > 0) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('JtoL');\r\n sum('LtoO');\r\n return 'O';\r\n } else if(num <= 0.66) {\r\n sum('JtoM');\r\n return null;\r\n } else {\r\n sum('JtoN');\r\n sum('NtoO');\r\n return 'O';\r\n }\r\n } else if(BBCVs > 3 || CV + CVB > 0 ||CVL > 1) {\r\n sum('JtoM');\r\n return null;\r\n } else if(CVL === 1) {\r\n if(countSBB() > 1) {\r\n sum('JtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else if(BBV > 0) {\r\n if(sai(50)) {\r\n sum('JtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('JtoL');\r\n sum('LtoO');\r\n return 'O';\r\n }\r\n } else if(DD > 2|| (CL > 0 && DD > 1) || (CAs === 3 && DD === 2)) {\r\n sum('JtoL');\r\n sum('LtoO');\r\n return 'O';\r\n } else {\r\n if(sai(50)) {\r\n sum('JtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('JtoL');\r\n sum('LtoO');\r\n return 'O';\r\n }\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('JtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('JtoL');\r\n sum('LtoO');\r\n return 'O';\r\n }\r\n }\r\n break;\r\n case 'O':\r\n if(active['5-3']['O'] === 'K') {\r\n sum('OtoK');\r\n return 'K';\r\n } else {\r\n sum('OtoP');\r\n sum('PtoK');\r\n return 'K';\r\n }\r\n break;\r\n case 'K':\r\n if(DD > 3 || (DD === 3 && CL === 1)) {\r\n sum('KtoH');\r\n sum('HtoE');\r\n return 'E';\r\n } else if(DD === 2 && (isFaster() || BBV + AO + AS > 0 || f_drum > 1 || f_craft > 1)) {\r\n sum('KtoH');\r\n sum('HtoE');\r\n return 'E';\r\n } else {\r\n sum('KtoE');\r\n return 'E';\r\n }\r\n break;\r\n }\r\n break;\r\n case 4: // @5-4\r\n switch(edge) {\r\n case null:\r\n if(CVs > 0) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(BBs > 2 || CAs > 4) {\r\n sum('1toA');\r\n return 'A';\r\n } else if(f_drum + f_craft > 4 || DD > 3 || (CL === 1 && DD > 2)) {\r\n sum('1toB');\r\n return 'B';\r\n } else {\r\n sum('1toA');\r\n return 'A';\r\n }\r\n break;\r\n case 'A':\r\n if(Ss > 0 || BBs > 4 || DD > 1 || CAs > 2) {\r\n sum('AtoD');\r\n return 'D';\r\n } else {\r\n sum('AtoF');\r\n sum('FtoH');\r\n sum('HtoI');\r\n sum('ItoJ');\r\n sum('JtoM');\r\n return 'M';\r\n }\r\n break;\r\n case 'B':\r\n if(CVs + Ss > 0) {\r\n sum('BtoC');\r\n sum('CtoG');\r\n return 'G';\r\n } else if((BBs > 0 && f_speed === '低速艦隊') || BBV + countSBB() > 1) {\r\n sum('BtoD');\r\n return 'D';\r\n } else if(isFaster() || (CL === 1 && DD > 2) || DD > 3) {\r\n sum('BtoE');\r\n sum('EtoH');\r\n sum('HtoI');\r\n sum('ItoJ');\r\n sum('JtoM');\r\n return 'M';\r\n } else if(DD === 0) {\r\n sum('BtoD');\r\n return 'D';\r\n } else {\r\n if(sai(50)) {\r\n sum('BtoD');\r\n return 'D';\r\n } else {\r\n sum('BtoE');\r\n sum('EtoH');\r\n sum('HtoI');\r\n sum('ItoJ');\r\n sum('JtoM');\r\n return 'M';\r\n }\r\n }\r\n break;\r\n case 'D':\r\n if(Ss > 0 || countSBB() > 1 || BBs > 2) {\r\n sum('DtoF');\r\n sum('FtoH');\r\n sum('HtoI');\r\n sum('ItoJ');\r\n sum('JtoM');\r\n return 'M';\r\n } else if(DD > 1) {\r\n sum('DtoE');\r\n sum('EtoH');\r\n sum('HtoI');\r\n sum('ItoJ');\r\n sum('JtoM');\r\n return 'M';\r\n } else {\r\n sum('DtoF');\r\n sum('FtoH');\r\n sum('HtoI');\r\n sum('ItoJ');\r\n sum('JtoM');\r\n return 'M';\r\n }\r\n break;\r\n case 'G':\r\n if(Ss > 0 || BBs > 3) {\r\n sum('GtoK');\r\n sum('KtoL');\r\n return 'L';\r\n } else if(CV + CVB < 3) {\r\n sum('GtoL');\r\n return 'L';\r\n } else {\r\n if(sai(70)) {\r\n sum('GtoL');\r\n return 'L';\r\n } else {\r\n sum('GtoK');\r\n sum('KtoL');\r\n return 'L';\r\n }\r\n }\r\n break;\r\n case 'L':\r\n if(isFaster()) {\r\n sum('LtoP');\r\n return null;\r\n } else if(f_seek[1] < 56) {\r\n sum('LtoN');\r\n return null;\r\n } else if((f_seek[1] < 60 && f_seek[1] >= 56) || BBs + CV + CVB > 4) {\r\n if(sai(50)) {\r\n sum('LtoP');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 60) {\r\n sum('LtoP');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n case 'M':\r\n if(isFaster()) {\r\n sum('MtoP');\r\n return null;\r\n } else if(f_seek[1] < 41) {\r\n sum('MtoO');\r\n return null;\r\n } else if((f_seek[1] < 45 && f_seek[1] >= 41)) {\r\n if(sai(50)) {\r\n sum('MtoP');\r\n return null;\r\n } else {\r\n sum('MtoO');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 45) {\r\n if(Ss > 0) {\r\n if(sai(66.6)) {\r\n sum('MtoP');\r\n return null;\r\n } else {\r\n sum('MtoO');\r\n return null;\r\n }\r\n } else {\r\n sum('MtoP');\r\n return null;\r\n }\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n case 5: // @5-5\r\n switch(edge) {\r\n case null:\r\n if(DD > 3 || f_drum > 3 || f_craft > 3) {\r\n sum('1toA');\r\n sum('AtoC');\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'B':\r\n if(CV + CVB > 2 || BBs + CLT > 3 || CLT > 2 || DD < 2) {\r\n sum('BtoK');\r\n sum('KtoP');\r\n return 'P';\r\n } else {\r\n sum('BtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'E':\r\n if(f_speed === '最速艦隊' || (DD > 1 && f_speed === '高速+艦隊')) {\r\n sum('EtoH');\r\n return 'H';\r\n } else {\r\n sum('EtoG');\r\n sum('GtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'F':\r\n if(active['5-5']['F'] === 'D') {\r\n sum('FtoD');\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n sum('FtoJ');\r\n sum('JtoP');\r\n return 'P';\r\n }\r\n break;\r\n case 'H':\r\n if(f_speed === '最速艦隊') {\r\n sum('HtoN');\r\n return 'N';\r\n } else if(BBCVs > 3) {\r\n sum('HtoP');\r\n return 'P';\r\n } else if(DD < 2) {\r\n sum('HtoL');\r\n sum('LtoN');\r\n return 'N';\r\n } else {\r\n sum('HtoN');\r\n return 'N';\r\n }\r\n break;\r\n case 'I':\r\n if(BBCVs === 3 && DD > 1) {\r\n sum('ItoL');\r\n sum('LtoN');\r\n return 'N';\r\n } else {\r\n sum('ItoM');\r\n return 'M';\r\n }\r\n break;\r\n case 'M':\r\n if(track.includes('N')) {\r\n sum('MtoO');\r\n return 'O';\r\n } else if(BBCVs > 3 || DD < 2) {\r\n sum('MtoL');\r\n sum('LtoN');\r\n return 'N';\r\n } else {\r\n sum('MtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'N':\r\n if(track.includes('M') || isFaster() || AO > 0) {\r\n sum('NtoO');\r\n return 'O';\r\n } else if(CV + CVB > 0 || BBs + CVL > 2 || DD < 2) {\r\n sum('NtoM');\r\n return 'M';\r\n } else {\r\n sum('NtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'O':\r\n if(isFaster()) {\r\n sum('OtoS');\r\n return null;\r\n } else if(f_seek[1] < 63) {\r\n sum('OtoR');\r\n return null;\r\n } else if((f_seek[1] < 66 & f_seek[1] >= 63) || Ss > 0) {\r\n if(sai(50)) {\r\n sum('OtoS');\r\n return null;\r\n } else {\r\n sum('OtoR');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 66) {\r\n sum('OtoS');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n case 'P':\r\n if(f_speed === '最速艦隊') {\r\n sum('PtoS');\r\n return null;\r\n } else if(f_speed === '高速+艦隊') {\r\n if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('PtoQ');\r\n return null;\r\n } else {\r\n sum('PtoS');\r\n return null;\r\n }\r\n } else if(BBCVs < 6) {\r\n sum('PtoS');\r\n return null;\r\n } else {\r\n if(sai(50)) {\r\n sum('PtoQ');\r\n return null;\r\n } else {\r\n sum('PtoS');\r\n return null;\r\n }\r\n }\r\n } else if(f_seek[1] < 73) {\r\n sum('PtoQ');\r\n return null;\r\n } else if((f_seek[1] < 80 && f_seek[1] >= 73) || Ss > 0 || BBCVs > 4) {\r\n if(sai(66.6)) {\r\n sum('PtoS');\r\n return null;\r\n } else {\r\n sum('PtoQ');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 80) {\r\n sum('PtoS');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n }\r\n break;\r\n case 6:\r\n switch(map) {\r\n case 1: // @6-1\r\n switch(edge) {\r\n case null:\r\n if(BBCVs + CAs > 2 || BBs > 1) {\r\n sum('1toB');\r\n return null;\r\n } else if((Ss > 2 && Ss === f_length) || (AS === 1 && Ss > 2 && AS + Ss === f_length) || (AS === 1 && Ss === 3 && DD === 2) || (AS === 1 && Ss === 4 && CL + DD === 1)) {\r\n sum('1toA');\r\n return 'A';\r\n } else if(CL + DD === 0) {\r\n sum('1toB');\r\n return null;\r\n } else {\r\n sum('1toC');\r\n sum('CtoF');\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'A':\r\n if(AS > 0) {\r\n sum('AtoF');\r\n sum('FtoG');\r\n return 'G';\r\n } else {\r\n sum('AtoD');\r\n sum('DtoF');\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'G':\r\n if(Ss < 3 || BBCVs + CAs === 2 || f_seek[3] < 12) {\r\n sum('GtoI');\r\n return null;\r\n } else if(AS > 0 && f_seek[3] >= 16) {\r\n sum('GtoH');\r\n return 'H';\r\n } else if(AS === 0 && f_seek[3] >= 16) {\r\n if(sai(85)) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('GtoI');\r\n return null;\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('GtoI');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if(f_seek[3] < 20) {\r\n sum('HtoE');\r\n return null;\r\n } else if(AS > 0) {\r\n if(f_seek[3] < 25 && f_seek[3] >= 20) {\r\n if(sai(50)) {\r\n sum('HtoE');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(f_seek[3] >= 25) {\r\n sum('HtoK');\r\n return null;\r\n } // LoSより例外なし\r\n } else if(f_seek[3] < 25 && f_seek[3] >= 20) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('HtoE');\r\n return null;\r\n } else if(num <= 0.66) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(f_seek[3] < 36 && f_seek[3] >= 25) {\r\n if(sai(50)) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(f_seek[3] >= 36) {\r\n sum('HtoK');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n case 2: // @6-2\r\n switch(edge) {\r\n case null:\r\n if(CL + DD > 3) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(BBV + CAV + AV + LHA < 2 && Ss < 5) {\r\n if(BBCVs > 4) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(BBCVs > 3) {\r\n if(sai(65)) {\r\n sum('1toB');\r\n return 'B';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n break;\r\n case 'B':\r\n if(CL + DD > 4) {\r\n sum('BtoD');\r\n return 'D';\r\n } else if(CVs < 3 && BBs === 0) {\r\n if(sai(70)) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } else {\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n break;\r\n case 'C':\r\n if(Ss === 6 || BBCVs > 4 || BBCVs + CAs === 6 || BBCVs + Ss === 6) {\r\n sum('CtoA');\r\n return null;\r\n } else if(BBCVs < 3) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 'D':\r\n if(DD < 3 || BBCVs > 0 || CL + DD < 5) {\r\n sum('DtoF');\r\n sum('FtoI');\r\n return 'I';\r\n } else {\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'E':\r\n if(BBs > 1 || CVs > 1 || DD < 2) {\r\n sum('EtoF');\r\n sum('FtoI');\r\n return 'I';\r\n } else if(f_seek[2] < 43) {\r\n sum('EtoI');\r\n return 'I';\r\n } else if(f_seek[2] < 50 && f_seek[2] >= 43) {\r\n if(sai(50)) {\r\n sum('EtoI');\r\n return 'I';\r\n } else {\r\n sum('EtoJ');\r\n sum('JtoK');\r\n return null;\r\n }\r\n } else if(f_seek[2] >= 50) {\r\n sum('EtoJ');\r\n sum('JtoK');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n case 'H':\r\n if(f_seek[2] < 32) {\r\n sum('HtoG');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n break;\r\n case 'I':\r\n if(Ss > 3 || f_seek[2] < 35) {\r\n sum('ItoG');\r\n return null;\r\n } else if(f_seek[2] < 40 && f_seek[2] >= 35) {\r\n if(sai(50)) {\r\n sum('ItoG');\r\n return null;\r\n } else {\r\n sum('ItoK');\r\n return null;\r\n }\r\n } else if(f_seek[2] >= 40) {\r\n sum('ItoK');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n case 3: // @6-3\r\n switch(edge) {\r\n case null:\r\n sum('1toA');\r\n return 'A';\r\n break;\r\n case 'A':\r\n if(active['6-3']['A'] === 'B') {\r\n sum('AtoB');\r\n sum('BtoD');\r\n sum('DtoE');\r\n return 'E';\r\n } else {\r\n sum('AtoC');\r\n sum('CtoE');\r\n return 'E';\r\n }\r\n break;\r\n case 'E':\r\n if(AV < 2) {\r\n if(CL < 2 && DD > 2) {\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else if(CL < 3) {\r\n if(sai(60)) {\r\n sum('EtoF');\r\n sum('FtoH');\r\n return 'H';\r\n } else {\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n } else {\r\n sum('EtoF');\r\n sum('FtoH');\r\n return 'H';\r\n }\r\n } else {\r\n sum('EtoF');\r\n sum('FtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'H':\r\n if(f_seek[2] < 36) {\r\n sum('HtoI');\r\n return null;\r\n } else if(f_seek[2] < 38 && f_seek[2] >= 36) {\r\n if(sai(50)) {\r\n sum('HtoI');\r\n return null;\r\n } else {\r\n sum('HtoJ');\r\n return null;\r\n }\r\n } else if(f_seek[2] >= 38) {\r\n sum('HtoJ');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n case 4: // @6-4\r\n switch(edge) {\r\n case null:\r\n if(LHA + CVs > 0 || ((!isInclude('長門改二') && !isInclude('陸奥改二')) && BBs === 2) || CAV > 2) {\r\n sum('2toM');\r\n sum('MtoK');\r\n return 'K';\r\n } else if(f_speed !== '低速艦隊' && ((isFCL() && DD === 3) || DD > 3)) {\r\n sum('1toB');\r\n sum('BtoD');\r\n sum('DtoC');\r\n sum('CtoF');\r\n sum('FtoN');\r\n return null;\r\n } else if(DD > 1) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('2toM');\r\n sum('MtoK');\r\n return 'K';\r\n }\r\n break;\r\n case 'A':\r\n if(isInclude('秋津洲') && (CAV === 1 || CL > 0 || DD > 2)) {\r\n sum('AtoD');\r\n sum('DtoC');\r\n sum('CtoF');\r\n sum('FtoN');\r\n return null;\r\n } else if(BBs > 0 || f_speed === '低速艦隊') {\r\n sum('AtoE');\r\n return 'E';\r\n } else if(isFCL() || DD > 2) {\r\n sum('AtoD');\r\n sum('DtoC');\r\n sum('CtoF');\r\n sum('FtoN');\r\n return null;\r\n } else {\r\n sum('AtoE');\r\n return 'E';\r\n }\r\n break;\r\n case 'E':\r\n if(isInclude('秋津洲') || isInclude('如月')) {\r\n sum('EtoD');\r\n sum('DtoC');\r\n sum('CtoF');\r\n sum('FtoN');\r\n return null;\r\n } else if(CAs < 2 && CL > 0 && f_speed !== '低速艦隊') {\r\n sum('EtoD');\r\n sum('DtoC');\r\n sum('CtoF');\r\n sum('FtoN');\r\n return null;\r\n } else {\r\n sum('EtoG');\r\n sum('GtoD');\r\n sum('DtoC');\r\n sum('CtoF');\r\n sum('FtoN');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if(isInclude('長門改二') && isInclude('陸奥改二') && CVs === 2) {\r\n sum('JtoL');\r\n sum('LtoI');\r\n sum('ItoN');\r\n return null;\r\n } else if(!isInclude('長門改二') && !isInclude('陸奥改二') && (BBCVs > 2 || BBs === 2)) {\r\n sum('JtoL');\r\n sum('LtoI');\r\n sum('ItoN');\r\n return null;\r\n } else if(CL === 0) {\r\n sum('JtoL');\r\n sum('LtoI');\r\n sum('ItoN');\r\n return null;\r\n } else if(LHA > 0 && DD > 1) {\r\n sum('JtoN');\r\n return null;\r\n } else if(CVs > 1 && f_speed === '低速艦隊') {\r\n sum('JtoL');\r\n sum('LtoI');\r\n sum('ItoN');\r\n return null;\r\n } else {\r\n sum('JtoI');\r\n sum('ItoN');\r\n return null;\r\n }\r\n break;\r\n case 'K':\r\n if(BBs === 2 || BBs + CAs > 2) {\r\n sum('KtoH');\r\n sum('HtoJ');\r\n return 'J';\r\n } else if(DD > 1) {\r\n sum('KtoJ');\r\n return 'J';\r\n } else {\r\n sum('KtoH');\r\n sum('HtoJ');\r\n return 'J';\r\n }\r\n break;\r\n }\r\n break;\r\n case 5: // @6-5\r\n switch(edge) {\r\n case null:\r\n if(CL === 0 || CVs + CLT > 0 || BBs > 3) {\r\n sum('1toA');\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('2toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'B':\r\n if(BBs === 3 || DD < 2) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoF');\r\n sum('FtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'C':\r\n if(DD === 0 || CLT > 1 || BBCVs > 3 || BBCVs + CAs > 4) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('CtoD');\r\n sum('DtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'E':\r\n if(CVs > 0 && CL > 0 && DD > 0) {\r\n sum('EtoH');\r\n sum('HtoG');\r\n return 'G';\r\n } else {\r\n sum('EtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'G':\r\n if(f_seek[2] < 50) {\r\n sum('GtoK');\r\n return null;\r\n } else {\r\n sum('GtoM');\r\n return null;\r\n }\r\n break;\r\n case 'I':\r\n if(CL === 0) {\r\n sum('ItoH');\r\n sum('HtoG');\r\n return 'G';\r\n } else if(DD > 1 || (BBs === 0 && CVs + CAs < 5 && CVs < 3)) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else {\r\n sum('ItoH');\r\n sum('HtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'J':\r\n if(f_seek[2] < 35) {\r\n sum('JtoL');\r\n return null;\r\n } else {\r\n sum('JtoM');\r\n return null;\r\n }\r\n break;\r\n }\r\n break;\r\n }\r\n break;\r\n case 7:\r\n switch(map) {\r\n case 1: // @7-1\r\n switch(edge) {\r\n case null:\r\n if(Ss > 0) {\r\n if(BBCVs > 0 || f_length > 4) {\r\n if(sai(50)) {\r\n sum('1toB');\r\n return 'B';\r\n } else {\r\n sum('1toD');\r\n return 'D';\r\n }\r\n } else if(f_length < 5) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(num <= 0.66) {\r\n sum('1toD');\r\n return 'D';\r\n } else {\r\n sum('1toF');\r\n sum('FtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n }\r\n } else if(BBCVs > 0 || f_length === 6) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(f_length === 5 || AO > 0) {\r\n sum('1toD');\r\n return 'D';\r\n } else if(f_length < 5) {\r\n sum('1toF');\r\n sum('FtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } // f_lengthより例外なし\r\n break;\r\n case 'B':\r\n if(BBs + CV + CVB > 0 || CVL > 1 || CAs > 2) {\r\n sum('BtoA');\r\n sum('AtoC');\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else if(DD + DE > 1) {\r\n sum('BtoC');\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n if(sai(50)) {\r\n sum('BtoA');\r\n sum('AtoC');\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('BtoC');\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n }\r\n break;\r\n case 'D':\r\n if((CL === 1 && DD === 4) || (DD > 0 && DE > 2) || (AO > 0 && DE > 2) || Ds === 5) {\r\n sum('DtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else if(Ds === 4) {\r\n if(CT + AO > 0) {\r\n sum('DtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else if(AV > 0) {\r\n if(sai(50)) {\r\n sum('DtoC');\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n } else {\r\n sum('DtoC');\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n } else {\r\n sum('DtoC');\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'H':\r\n if((CL > 0 && DD > 3) || (DD > 0 && DE > 2)) {\r\n sum('HtoK');\r\n return null;\r\n } else if(AO > 0) {\r\n if(sai(50)) {\r\n sum('HtoI');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(BBCVs > 1) {\r\n sum('HtoJ');\r\n return null;\r\n } else if(BBCVs === 1) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('HtoI');\r\n return null;\r\n } else if(num <= 0.66) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.225) {\r\n sum('HtoI');\r\n return null;\r\n } else if(num <= 0.30) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 2: // @7-2\r\n switch(edge) {\r\n case null:\r\n if(Ds < 2 || Ss > 0) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(f_length === 6) {\r\n if(CV + CVB > 1 || BBs + CV + CVB > 3 || CL + CT > 2) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n } else if(f_length === 5) {\r\n if(CV + CVB > 2) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(BBs + CV + CVB > 0 || CL + CT > 1 || DE < 3) {\r\n sum('1toB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n } else if(f_length < 5) {\r\n if(BBs + CV + CVB > 0 || Ds < 3) {\r\n sum('1toB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n } // f_lengthより例外なし\r\n break;\r\n case 'C':\r\n if(AO + Ss > 0) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(f_length === 6) {\r\n if(BBs + CV + CVB > 0) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(Ds > 3) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_length === 5) {\r\n if(BBs + CV + CVB > 1) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(Ds > 3 || DE > 2) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_length < 5) {\r\n if(BBs + CV + CVB > 1) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(Ds > 2 || DE > 1) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } // f_lengthより例外なし\r\n break;\r\n case 'D':\r\n if(isFaster()) {\r\n sum('DtoI');\r\n return 'I';\r\n } else if(BBCVs > 3) {\r\n sum('DtoH');\r\n sum('HtoI');\r\n return 'I';\r\n } else if(f_speed !== '低速艦隊') {\r\n sum('DtoI');\r\n return 'I';\r\n } else if(BBCVs === 3) {\r\n sum('DtoH');\r\n sum('HtoI');\r\n return 'I';\r\n } else if(BBCVs === 2) {\r\n if(sai(65)) {\r\n sum('DtoI');\r\n return 'I';\r\n } else {\r\n sum('DtoH');\r\n sum('HtoI');\r\n return 'I';\r\n }\r\n } else if(BBCVs < 2) {\r\n sum('DtoI');\r\n return 'I';\r\n } // BBCVsより例外なし\r\n break;\r\n case 'E':\r\n if(f_length < 6 || Ds > 4 || (DD > 0 && DE > 2)) {\r\n sum('EtoG');\r\n return null;\r\n } else if(f_seek[3] < 46) {\r\n sum('EtoF');\r\n return null;\r\n } else {\r\n sum('EtoG');\r\n return null;\r\n }\r\n break;\r\n case 'I':\r\n if(AO > 0 || (AV > 0 && Ds > 2)) {\r\n sum('ItoJ');\r\n sum('JtoK');\r\n return null;\r\n } else if(f_seek[3] < 63) {\r\n sum('ItoJ');\r\n sum('JtoK');\r\n return null;\r\n } else if(f_seek[3] < 69 && f_seek[3] >= 63) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('ItoJ');\r\n sum('JtoK');\r\n return null;\r\n } else if(num <= 0.66) {\r\n sum('ItoL');\r\n return null;\r\n } else {\r\n sum('ItoM');\r\n return null;\r\n }\r\n } else if(f_seek[3] >= 69) {\r\n sum('ItoM');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n case 3: // @7-3\r\n if(active['7-3']['1'] === '0') {\r\n // 解放前\r\n switch(edge) {\r\n case null:\r\n sum('1toA');\r\n return 'A';\r\n break;\r\n case 'A':\r\n if(f_length === 1) {\r\n sum('AtoC');\r\n return 'C';\r\n } else if(CA === 0 || CVs > 0 || Ds === 0 || f_length > 4) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(isInclude('羽黒') && isInclude('神風')) {\r\n sum('AtoC');\r\n return 'C';\r\n } else if(f_length === 4) {\r\n if(CA > 1 || Ds < 2) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(CA + CL + Ds === f_length) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n } else if(f_length < 4) {\r\n if(CA + CL + Ds === f_length) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n } // f_lengthより例外なし\r\n break;\r\n case 'C':\r\n if(BBCVs > 0 || Ds === 0 || f_length > 4) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(isInclude('羽黒') && isInclude('神風')) {\r\n if(CAs > 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(isInclude('足柄') || isInclude('妙高')) {\r\n sum('CtoE');\r\n return null;\r\n } else if(Ds < 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else {\r\n sum('CtoE');\r\n return null;\r\n }\r\n } else if(f_length === 4) {\r\n if(isInclude('羽黒') && Ds === 3) {\r\n sum('CtoE');\r\n return null;\r\n } else if(isInclude('神風') && Ds === 4) {\r\n sum('CtoE');\r\n return null;\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_length === 3) {\r\n if(CAs > 1 || Ds < 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(CA + Ds === f_length) {\r\n sum('CtoE');\r\n return null;\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_length < 3) {\r\n sum('CtoE');\r\n return null;\r\n } // f_lengthより例外なし\r\n break;\r\n case 'D':\r\n if(BBCVs > 0 || f_length === 6 || CAs > 3 || CAV > 1) {\r\n sum('DtoF');\r\n return null;\r\n } else {\r\n sum('DtoE');\r\n return null;\r\n }\r\n break;\r\n }\r\n } else {\r\n // 解放後\r\n switch(edge) {\r\n case null:\r\n sum('1toA');\r\n return 'A';\r\n break;\r\n case 'A':\r\n if(f_length === 1) {\r\n sum('AtoC');\r\n return 'C';\r\n } else if(CVs > 0) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(AO === 1 && BBs > 2) {\r\n sum('AtoC');\r\n return 'C';\r\n } else if(CA === 0 || Ds === 0 || (BBs > 0 && !isInclude('羽黒'))) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(isInclude('羽黒') && isInclude('神風')) {\r\n sum('AtoC');\r\n return 'C';\r\n } else if(f_length > 4) {\r\n if(!isInclude('羽黒') && f_speed === '低速艦隊') {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(Ds < 3) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoC');\r\n return 'C';\r\n }\r\n } else if(f_length === 4) {\r\n if(CA > 1 || Ds < 2) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(CA + CL + Ds === f_length) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n } else if(f_length < 4) {\r\n if(CA + CL + Ds === f_length) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(BBCVs > 0 || Ds === 0) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(f_speed === '最速艦隊') {\r\n sum('CtoI');\r\n return 'I';\r\n } else if(f_length > 4) {\r\n if(isFaster() && CL + DD > 3) {\r\n sum('CtoI');\r\n return 'I';\r\n } else if(f_length === 6) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(isInclude('羽黒') && isInclude('神風')) {\r\n if(Ds < 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(CL > 0 || isInclude('足柄')) {\r\n sum('CtoI');\r\n return 'I';\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_speed !== '低速艦隊' && CA === 1 && CL === 1 && DD === 3) {\r\n sum('CtoI');\r\n return 'I';\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_length === 4) {\r\n if(isInclude('羽黒') && isInclude('神風')) {\r\n if(CAs > 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(isInclude('足柄') || isInclude('妙高')) {\r\n sum('CtoE');\r\n return null;\r\n } else if(Ds < 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else {\r\n sum('CtoE');\r\n return null;\r\n }\r\n } else if((isInclude('羽黒') && Ds === 3) || (isInclude('神風') && Ds === 4)) {\r\n sum('CtoE');\r\n return null;\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_length < 4) {\r\n if(CAs > 1 || Ds < 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(CA + Ds === f_length) {\r\n sum('CtoE');\r\n return null;\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_length < 3) {\r\n sum('CtoE');\r\n return null;\r\n } // f_lengthより例外なし\r\n break;\r\n case 'D':\r\n if(BBs > 2 || CVs > 2 || CAV > 2) {\r\n sum('DtoF');\r\n return null;\r\n } else {\r\n sum('DtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'G':\r\n if(CA === 0 && Ds > 1 && (AO > 0 || AV > 1)) {\r\n sum('GtoH');\r\n return null;\r\n } else if(Ss > 0) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(BBCVs > 0) {\r\n sum('GtoJ');\r\n return 'J';\r\n } else if(isInclude('羽黒') && isInclude('神風')) {\r\n if(f_length < 5) {\r\n sum('GtoP');\r\n return null;\r\n } else if(DD < 3) {\r\n sum('GtoJ');\r\n return 'J';\r\n } else if(isFaster()) {\r\n sum('GtoP');\r\n return null;\r\n } else if(CAs > 2 || f_speed === '低速艦隊') {\r\n sum('GtoJ');\r\n return 'J';\r\n } else if(isInclude('足柄')) {\r\n sum('GtoP');\r\n return null;\r\n } else {\r\n sum('GtoK');\r\n sum('KtoP');\r\n return null;\r\n }\r\n } else if(Ds < 3 || CAs > 2) {\r\n sum('GtoJ');\r\n return 'J';\r\n } else {\r\n sum('GtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'I':\r\n if(BBCVs > 0 || CAs > 2 || Ds === 0) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else if(isInclude('羽黒') && isInclude('神風')) {\r\n if(Ds > 2) {\r\n if(isFaster()) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else {\r\n sum('ItoM');\r\n return 'M';\r\n }\r\n } else if(Ds === 2) {\r\n if(f_speed === '最速艦隊') {\r\n sum('ItoM');\r\n return 'M';\r\n } else {\r\n sum('ItoL');\r\n sum('LtoM');\r\n return 'M';\r\n }\r\n } else if(Ds === 1) {\r\n sum('ItoL');\r\n sum('LtoM');\r\n return 'M';\r\n } // Dsより例外なし\r\n } else if(f_speed === '最速艦隊' && DD > 2) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else if((isInclude('羽黒') || isInclude('神風')) && isInclude('足柄') && Ds > 2) {\r\n sum('ItoM');\r\n return 'M';\r\n } else {\r\n sum('ItoL');\r\n sum('LtoM');\r\n return 'M';\r\n }\r\n break;\r\n case 'J':\r\n if(BBCVs > 0 || f_speed === '低速艦隊' || CAs > 3) {\r\n sum('JtoM');\r\n return 'M';\r\n } else if(DD > 2) {\r\n if((isInclude('羽黒') && isInclude('足柄')) || (isInclude('羽黒') && isInclude('神風'))) {\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n sum('JtoM');\r\n return 'M';\r\n }\r\n } else if(DD === 2) {\r\n if(isInclude('羽黒') && isInclude('神風') && isInclude('足柄')) {\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n sum('JtoM');\r\n return 'M';\r\n }\r\n } else if(DD === 1) {\r\n sum('JtoM');\r\n return 'M';\r\n } else { // wikiに記載なし\r\n sum('JtoM');\r\n return 'M';\r\n }\r\n break;\r\n case 'M':\r\n if(CV + CVB > 0 || BBCVs > 1 || Ss > 3) {\r\n sum('MtoN');\r\n return null;\r\n } else if(countSBB() > 0 || AO > 0 || AV > 1) {\r\n sum('MtoO');\r\n return null;\r\n } else {\r\n sum('MtoP');\r\n return null;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n case 4: // @7-4\r\n switch(edge) {\r\n case null:\r\n if(BB + CV + CVB + Ss > 0 || CAs > 1 || CL + CT + CLT > 1) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(isInclude('あきつ丸') && DE === 2 && (DD === 1 || DE === 1)) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoE');\r\n return 'E';\r\n } else if((BBV + CVL === 2 && isInclude('あきつ丸')) || BBV + CVL > 2) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(Ds > 2 || DE > 1) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoE');\r\n return 'E';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n break;\r\n case 'C':\r\n if(BB + CV + CVB + Ss > 0 || CVL + countShipsStartWith('あきつ丸') > 2) {\r\n sum('CtoD');\r\n sum('DtoF');\r\n return 'F';\r\n } else if(Ds > 3 || (CT > 0 && Ds > 2) || DE > 2 || (isFaster() && DD > 1)) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('CtoD');\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'E':\r\n if(AO + LHA > 0 && DE > 3 && countTaiyo() + AO + LHA + DD + DE === 6) {\r\n sum('EtoG');\r\n sum('GtoL');\r\n sum('LtoP');\r\n return null;\r\n } else {\r\n sum('EtoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'F':\r\n if(active['7-4']['F'] === 'H') {\r\n sum('FtoH');\r\n sum('HtoK');\r\n sum('KtoM');\r\n return 'M';\r\n } else {\r\n sum('FtoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'G':\r\n // 索敵で分岐するようだが不明 とりあえず素通りで実装\r\n break;\r\n case 'J':// 日本語wiki正直わからん\r\n if(track.includes('D')) {\r\n sum('JtoK');\r\n sum('KtoM');\r\n return 'M';\r\n } else if(track.includes('E')) {\r\n if(f_seek[3] < 33) {\r\n sum('JtoK');\r\n sum('KtoM');\r\n return 'M';\r\n } else if(f_seek[3] < 37 && f_seek[3] >= 33) {\r\n if(sai(50)) {\r\n if(CT > 0 && DE > 2 && countTaiyo() + CT + Ds === 5 && f_length === 5) {\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n sum('JtoL');\r\n sum('LtoP');\r\n return null;\r\n }\r\n } else {\r\n sum('JtoK');\r\n sum('KtoM');\r\n return 'M';\r\n }\r\n } else if(f_seek[3] >= 37) {\r\n if(CT > 0 && DE > 2 && countTaiyo() + CT + Ds === 5 && f_length === 5) {\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n sum('JtoL');\r\n sum('LtoP');\r\n return null;\r\n }\r\n } // LoSより例外なし\r\n } // DかEどっちかは通る\r\n break;\r\n case 'K':\r\n // KtoPは見つかってないらしい 全てMへ\r\n break;\r\n case 'M':\r\n if(f_seek[3] < 45) {\r\n sum('MtoN');\r\n return null;\r\n } else if((countSBB() > 0 && CV + CVB > 0) || (BBs - countSBB() > 1) || BBV > 1 || (CVL > 1 || (CVL === 1 && isInclude('あきつ丸'))) || (BBs - countSBB() + BBV + CVL > 2 || (BBs - countSBB() + BBV + CVL === 2 && isInclude('あきつ丸'))) || Ds < 2) {\r\n if(f_seek[3] < 47 && f_seek[3] >= 45) {\r\n if(sai(50)) {\r\n sum('MtoN');\r\n return null;\r\n } else {\r\n sum('MtoO');\r\n return null;\r\n }\r\n } else if(f_seek[3] >= 47){\r\n sum('MtoO');\r\n return null;\r\n } // LoSより例外なし\r\n } else {\r\n sum('MtoP');\r\n return null;\r\n }\r\n break;\r\n }\r\n break;\r\n case 5: // @7-5\r\n switch(edge) {\r\n case null:\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n break;\r\n case 'B':\r\n if(isFaster()) {\r\n sum('BtoD');\r\n return 'D';\r\n } else if(CV + CVB > 1 || countSBB() > 1 || Ss > 0 || CL === 0 || Ds < 2) {\r\n sum('BtoC');\r\n sum('CtoD');\r\n return 'D';\r\n } else if(Ds > 2) {\r\n sum('BtoD');\r\n return 'D';\r\n } else if(CV + CVB > 0 || CVL > 1 || BBs > 2 || CAs > 2) {\r\n sum('BtoC');\r\n sum('CtoD');\r\n return 'D';\r\n } else {\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 'D':\r\n if(f_speed === '最速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(CV + CVB > 1 || CVs > 2 || BBs + CAs > 2 || BBs + CV + CVB + CAs > 2 || Ss > 0 || CL + DD === 0) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(f_speed === '高速+艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(Ds < 2) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(Ds > 2 || f_speed !== '低速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if((CAV === 1 && BBV === 1 && CL === 1 && DD === 3 && f_speed === '低速艦隊') || (CAV === 2 && CVL === 1 && CL === 1 && DD === 2 && f_speed === '低速艦隊')) { // 例外的にFへ\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(active['7-5']['F'] === 'G') {\r\n sum('FtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('FtoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'H':\r\n if(active['7-5']['H'] === 'I') {\r\n sum('HtoI');\r\n return 'I';\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n break;\r\n case 'I':\r\n if(f_seek[3] < 53) {\r\n sum('ItoL');\r\n sum('LtoM');\r\n return null;\r\n } else if(f_seek[3] < 59 && f_seek[3] >= 53) {\r\n if(sai(50)) {\r\n sum('ItoL');\r\n sum('LtoM');\r\n return null;\r\n } else {\r\n sum('ItoM');\r\n return null;\r\n }\r\n } else if(f_seek[3] >= 59) {\r\n sum('ItoM');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n case 'J':\r\n if((CVL === 1 && CAs === 2 && CL === 1 && Ds === 2) || isFaster()) {\r\n sum('JtoO');\r\n return 'O';\r\n } else if(CV + CVB > 0 || CVL > 2 || countSBB() > 1 || BBs + CAs > 2 || Ds < 2) {\r\n sum('JtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else if(Ds > 2 || f_speed !== '低速艦隊') {\r\n sum('JtoO');\r\n return 'O';\r\n } else {\r\n sum('JtoN');\r\n sum('NtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'O':\r\n if(active['7-5']['O'] === 'P') {\r\n sum('OtoP');\r\n return 'P';\r\n } else {\r\n sum('OtoQ');\r\n return null;\r\n }\r\n break;\r\n case 'P':\r\n if(f_seek[3] < 58) {\r\n sum('PtoS');\r\n return null;\r\n } else if(f_seek[3] < 63 && f_seek[3] >= 58) {\r\n if(sai(33.3)) {\r\n sum('PtoR');\r\n sum('RtoT');\r\n return null;\r\n } else {\r\n if(f_speed === '最速艦隊') {\r\n sum('PtoT');\r\n return null;\r\n } else if(CV + CVB > 0 || BBs + CVL > 1 || BBs + CAs > 2 || CL === 0) {\r\n sum('PtoR');\r\n sum('RtoT');\r\n return null;\r\n } else {\r\n sum('PtoT');\r\n return null;\r\n }\r\n }\r\n } else if(f_seek[3] >= 63) {\r\n if(f_speed === '最速艦隊') {\r\n sum('PtoT');\r\n return null;\r\n } else if(CV > 0 || BBs + CVL > 1 || BBs + CAs > 2 || CL === 0) {\r\n sum('PtoR');\r\n sum('RtoT');\r\n return null;\r\n } else {\r\n sum('PtoT');\r\n return null;\r\n }\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n }\r\n break;\r\n case 57:\r\n switch(map) {\r\n case 7: // @57-7\r\n if(active['57-7']['1'] === '1') {\r\n switch(edge) {\r\n case null:\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n break;\r\n case 'A':\r\n if(CV > 0 || CL === 0) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(f_speed === '低速艦隊' && Ds < 4) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else {\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n break;\r\n case 'A1':\r\n if((BBs < 3 || (CV > 0 && Ds > 3)) && CL > 0 && Ds > 2) {\r\n sum('A1toA2');\r\n return 'A2';\r\n } else {\r\n sum('A1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A2':\r\n if(active['57-7']['A2'] === 'A3') {\r\n sum('A2toA3');\r\n return 'A3';\r\n } else {\r\n sum('A2toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A3':\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('A3toA5');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(f_seek[3] < 86) {\r\n sum('BtoB1');\r\n return null;\r\n } else {\r\n sum('BtoB2');\r\n return 'B2';\r\n }\r\n break;\r\n case 'B2':\r\n if(active['57-7']['B2'] === 'B3') {\r\n sum('B2toB3');\r\n return null;\r\n } else {\r\n sum('B2toB4');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['57-7']['C'] === 'A3') {\r\n sum('CtoA3');\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('CtoC1');\r\n sum('C1toC2');\r\n return 'C2';\r\n }\r\n break;\r\n case 'C2':\r\n if(CV < 3) {\r\n sum('C2toD');\r\n return 'D';\r\n } else {\r\n sum('C2toC3');\r\n return null;\r\n }\r\n break;\r\n case 'D':\r\n if(f_speed !== '低速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(BBCVs > 5) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(DD > 3) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_speed === '低速艦隊') {\r\n sum('FtoG');\r\n sum('GtoH');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return null;\r\n }\r\n break;\r\n }\r\n } else if(active['57-7']['1'] === '2') {\r\n switch(edge) {\r\n case null:\r\n if(f_type === '空母機動部隊') {\r\n sum('2toI');\r\n sum('ItoJ');\r\n return 'J';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n break;\r\n case 'A':\r\n if(CV > 0 || CL === 0) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(f_speed === '低速艦隊' && Ds < 4) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else {\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n break;\r\n case 'A1':\r\n if((BBs < 3 || (CV > 0 && Ds > 3)) && CL > 0 && Ds > 2) {\r\n sum('A1toA2');\r\n return 'A2';\r\n } else {\r\n sum('A1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A2':\r\n if(active['57-7']['A2'] === 'A3') {\r\n sum('A2toA3');\r\n return 'A3';\r\n } else {\r\n sum('A2toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A3':\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('A3toA5');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(f_seek[3] < 86) {\r\n sum('BtoB1');\r\n return null;\r\n } else {\r\n sum('BtoB2');\r\n return 'B2';\r\n }\r\n break;\r\n case 'B2':\r\n if(active['57-7']['B2'] === 'B3') {\r\n sum('B2toB3');\r\n return null;\r\n } else {\r\n sum('B2toB4');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['57-7']['C'] === 'A3') {\r\n sum('CtoA3');\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('CtoC1');\r\n sum('C1toC2');\r\n return 'C2';\r\n }\r\n break;\r\n case 'C2':\r\n if(CV < 3) {\r\n sum('C2toD');\r\n return 'D';\r\n } else {\r\n sum('C2toC3');\r\n return null;\r\n }\r\n break;\r\n case 'D':\r\n if(f_speed !== '低速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(BBCVs > 5) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(DD > 3) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_speed === '低速艦隊') {\r\n sum('FtoG');\r\n sum('GtoH');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return null;\r\n }\r\n break; // ここまで同じ\r\n case 'J':\r\n if(active['57-7']['J'] === 'K') {\r\n sum('JtoK');\r\n return 'K';\r\n } else {\r\n sum('JtoL');\r\n return null;\r\n }\r\n break;\r\n case 'K':\r\n if(BBs > 2) {\r\n sum('KtoM');\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n } else {\r\n sum('KtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n }\r\n } else if(active['57-7']['1'] === '3') {\r\n switch(edge) {\r\n case null:\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('1toA');\r\n return 'A';\r\n } else if(f_type === '水上打撃部隊' && BBs > 3) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(f_type === '輸送護衛部隊') {\r\n sum('3toQ');\r\n return 'Q';\r\n } else {\r\n sum('2toI');\r\n sum('ItoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'A':\r\n if(CV > 0 || CL === 0) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(f_speed === '低速艦隊' && Ds < 4) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else {\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n break;\r\n case 'A1':\r\n if((BBs < 3 || (CV > 0 && Ds > 3)) && CL > 0 && Ds > 2) {\r\n sum('A1toA2');\r\n return 'A2';\r\n } else {\r\n sum('A1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A2':\r\n if(active['57-7']['A2'] === 'A3') {\r\n sum('A2toA3');\r\n return 'A3';\r\n } else {\r\n sum('A2toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A3':\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('A3toA5');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(f_seek[3] < 86) {\r\n sum('BtoB1');\r\n return null;\r\n } else {\r\n sum('BtoB2');\r\n return 'B2';\r\n }\r\n break;\r\n case 'B2':\r\n if(active['57-7']['B2'] === 'B3') {\r\n sum('B2toB3');\r\n return null;\r\n } else {\r\n sum('B2toB4');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['57-7']['C'] === 'A3') {\r\n sum('CtoA3');\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('CtoC1');\r\n sum('C1toC2');\r\n return 'C2';\r\n }\r\n break;\r\n case 'C2':\r\n if(CV < 3) {\r\n sum('C2toD');\r\n return 'D';\r\n } else {\r\n sum('C2toC3');\r\n return null;\r\n }\r\n break;\r\n case 'D':\r\n if(f_speed !== '低速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(BBCVs > 5) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(DD > 3) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_speed === '低速艦隊') {\r\n sum('FtoG');\r\n sum('GtoH');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return null;\r\n }\r\n break; // ここまで同じ\r\n case 'J':\r\n if(active['57-7']['J'] === 'K') {\r\n sum('JtoK');\r\n return 'K';\r\n } else {\r\n sum('JtoL');\r\n return null;\r\n }\r\n break;\r\n case 'K':\r\n if(BBs > 2) {\r\n sum('KtoM');\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n } else {\r\n sum('KtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n case 'Q':\r\n if(f_speed === '低速艦隊' && BBV + CAs > 2) {\r\n sum('QtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('QtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'O':\r\n if(f_type === '輸送護衛部隊') {\r\n sum('OtoR');\r\n sum('RtoS');\r\n sum('StoP');\r\n return null;\r\n } else {\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n }\r\n } else if(active['57-7']['1'] === '4') {\r\n switch(edge) {\r\n case null:\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('1toA');\r\n return 'A';\r\n } else if(f_type === '水上打撃部隊' && BBs > 3) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(f_type === '輸送護衛部隊') {\r\n sum('3toQ');\r\n return 'Q';\r\n } else {\r\n sum('2toI');\r\n sum('ItoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'A':\r\n if(CV > 0 || CL === 0) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(f_speed === '低速艦隊' && Ds < 4) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else {\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n break;\r\n case 'A1':\r\n if((BBs < 3 || (CV > 0 && Ds > 3)) && CL > 0 && Ds > 2) {\r\n sum('A1toA2');\r\n return 'A2';\r\n } else {\r\n sum('A1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A2':\r\n if(active['57-7']['A2'] === 'A3') {\r\n sum('A2toA3');\r\n return 'A3';\r\n } else {\r\n sum('A2toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A3':\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('A3toA5');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(f_seek[3] < 86) {\r\n sum('BtoB1');\r\n return null;\r\n } else {\r\n sum('BtoB2');\r\n return 'B2';\r\n }\r\n break;\r\n case 'B2':\r\n if(active['57-7']['B2'] === 'B3') {\r\n sum('B2toB3');\r\n return null;\r\n } else {\r\n sum('B2toB4');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['57-7']['C'] === 'A3') {\r\n sum('CtoA3');\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('CtoC1');\r\n sum('C1toC2');\r\n return 'C2';\r\n }\r\n break;\r\n case 'C2': // 更新部分\r\n if(f_type === '空母機動部隊' && f_speed !== '低速艦隊' && (AR + AO > 0 || isInclude('秋津洲'))) {\r\n sum('C2toL');\r\n return 'L';\r\n } else if(CV < 3) {\r\n sum('C2toD');\r\n return 'D';\r\n } else {\r\n sum('C2toC3');\r\n return null;\r\n }\r\n break;\r\n case 'D':\r\n if(f_speed !== '低速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(BBCVs > 5) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(DD > 3) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_speed === '低速艦隊') {\r\n sum('FtoG');\r\n sum('GtoH');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if(active['57-7']['J'] === 'K') {\r\n sum('JtoK');\r\n return 'K';\r\n } else {\r\n sum('JtoL');\r\n return null;\r\n }\r\n break;\r\n case 'L': // 追加\r\n if(BBCVs < 6) {\r\n sum('LtoT');\r\n sum('TtoU');\r\n return 'U';\r\n } else {\r\n sum('LtoN');\r\n return 'N';\r\n }\r\n break;\r\n case 'K':\r\n if(BBs > 2) {\r\n sum('KtoM');\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n } else {\r\n sum('KtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n case 'Q':\r\n if(f_speed === '低速艦隊' && BBV + CAs > 2) {\r\n sum('QtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('QtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'N':\r\n if(track.includes('K')) {\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('NtoT');\r\n sum('TtoU');\r\n return 'U';\r\n }\r\n break;\r\n case 'O':\r\n if(f_type === '輸送護衛部隊') {\r\n sum('OtoR');\r\n sum('RtoS');\r\n sum('StoP');\r\n return null;\r\n } else {\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n case 'U':\r\n if(BBs > 4) {\r\n sum('UtoV');\r\n sum('VtoX');\r\n return null;\r\n } else {\r\n sum('UtoX');\r\n return null;\r\n }\r\n break;\r\n }\r\n } else if(active['57-7']['1'] === '5') {\r\n switch(edge) {\r\n case null:\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('1toA');\r\n return 'A';\r\n } else if(f_type === '水上打撃部隊' && BBs > 3) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(f_type === '輸送護衛部隊') {\r\n sum('3toQ');\r\n return 'Q';\r\n } else {\r\n sum('2toI');\r\n sum('ItoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'A':\r\n if(CV > 0 || CL === 0) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(f_speed === '低速艦隊' && Ds < 4) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else {\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n break;\r\n case 'A1':\r\n if((BBs < 3 || (CV > 0 && Ds > 3)) && CL > 0 && Ds > 2) {\r\n sum('A1toA2');\r\n return 'A2';\r\n } else {\r\n sum('A1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A2':\r\n if(active['57-7']['A2'] === 'A3') {\r\n sum('A2toA3');\r\n return 'A3';\r\n } else {\r\n sum('A2toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A3':\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('A3toA5');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(f_seek[3] < 86) {\r\n sum('BtoB1');\r\n return null;\r\n } else {\r\n sum('BtoB2');\r\n return 'B2';\r\n }\r\n break;\r\n case 'B2':\r\n if(active['57-7']['B2'] === 'B3') {\r\n sum('B2toB3');\r\n return null;\r\n } else {\r\n sum('B2toB4');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['57-7']['C'] === 'A3') {\r\n sum('CtoA3');\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('CtoC1');\r\n sum('C1toC2');\r\n return 'C2';\r\n }\r\n break;\r\n case 'C2': // 更新部分\r\n if(f_type === '空母機動部隊' && f_speed !== '低速艦隊' && (AR + AO > 0 || isInclude('秋津洲'))) {\r\n sum('C2toL');\r\n return 'L';\r\n } else if(CV < 3) {\r\n sum('C2toD');\r\n return 'D';\r\n } else {\r\n sum('C2toC3');\r\n return null;\r\n }\r\n break;\r\n case 'D':\r\n if(f_speed !== '低速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(BBCVs > 5) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(DD > 3) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_speed === '低速艦隊') {\r\n sum('FtoG');\r\n sum('GtoH');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if(active['57-7']['J'] === 'K') {\r\n sum('JtoK');\r\n return 'K';\r\n } else {\r\n sum('JtoL');\r\n return 'L';\r\n }\r\n break;\r\n case 'L': // 追加\r\n if(BBCVs < 6) {\r\n sum('LtoT');\r\n sum('TtoU');\r\n return 'U';\r\n } else {\r\n sum('LtoN');\r\n return 'N';\r\n }\r\n break;\r\n case 'K':\r\n if(BBs > 2) {\r\n sum('KtoM');\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n } else {\r\n sum('KtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n case 'Q':\r\n if(f_speed === '低速艦隊' && BBV + CAs > 2) {\r\n sum('QtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('QtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'N':\r\n if(track.includes('K')) {\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('NtoT');\r\n sum('TtoU');\r\n return 'U';\r\n }\r\n break;\r\n case 'O':\r\n if(f_type === '輸送護衛部隊') {\r\n sum('OtoR');\r\n sum('RtoS');\r\n sum('StoP');\r\n return null;\r\n } else {\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n case 'U':\r\n if(BBs > 4) {\r\n sum('UtoV');\r\n sum('VtoX');\r\n return 'X';\r\n } else {\r\n sum('UtoX');\r\n return 'X';\r\n }\r\n break;\r\n case 'X':\r\n if(AR + AO > 0 || isInclude('秋津洲')) {\r\n sum('XtoY');\r\n sum('YtoZ');\r\n return null;\r\n } else {\r\n sum('XtoZ');\r\n return null;\r\n }\r\n break;\r\n }\r\n } else if(active['57-7']['1'] === '6') {\r\n switch(edge) {\r\n case null:\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('1toA');\r\n return 'A';\r\n } else if(f_type === '水上打撃部隊' && BBs > 3) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(f_type === '輸送護衛部隊') {\r\n sum('3toQ');\r\n return 'Q';\r\n } else {\r\n sum('2toI');\r\n sum('ItoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'A':\r\n if(CV > 0 || CL === 0) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(f_speed === '低速艦隊' && Ds < 4) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else {\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n break;\r\n case 'A1':\r\n if((BBs < 3 || (CV > 0 && Ds > 3)) && CL > 0 && Ds > 2) {\r\n sum('A1toA2');\r\n return 'A2';\r\n } else {\r\n sum('A1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A2':\r\n if(active['57-7']['A2'] === 'A3') {\r\n sum('A2toA3');\r\n return 'A3';\r\n } else {\r\n sum('A2toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A3':\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('A3toA5');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(f_seek[3] < 86) {\r\n sum('BtoB1');\r\n return null;\r\n } else {\r\n sum('BtoB2');\r\n return 'B2';\r\n }\r\n break;\r\n case 'B2':\r\n if(active['57-7']['B2'] === 'B3') {\r\n sum('B2toB3');\r\n return null;\r\n } else {\r\n sum('B2toB4');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['57-7']['C'] === 'A3') {\r\n sum('CtoA3');\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('CtoC1');\r\n sum('C1toC2');\r\n return 'C2';\r\n }\r\n break;\r\n case 'C2': // 更新部分\r\n if(f_type === '空母機動部隊' && f_speed !== '低速艦隊' && (AR + AO > 0 || isInclude('秋津洲'))) {\r\n sum('C2toL');\r\n return 'L';\r\n } else if(CV < 3) {\r\n sum('C2toD');\r\n return 'D';\r\n } else {\r\n sum('C2toC3');\r\n return null;\r\n }\r\n break;\r\n case 'D':\r\n if(f_speed !== '低速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(BBCVs > 5) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(DD > 3) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_speed === '低速艦隊') {\r\n sum('FtoG');\r\n sum('GtoH');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if(active['57-7']['J'] === 'K') {\r\n sum('JtoK');\r\n return 'K';\r\n } else {\r\n sum('JtoL');\r\n return 'L';\r\n }\r\n break;\r\n case 'L': // 更新\r\n if(BBCVs > 6 || (BBCVs === 6 && f_speed === '低速艦隊')) {\r\n sum('LtoN');\r\n return 'N';\r\n } else if(DD < 4 && f_speed === '低速艦隊') {\r\n sum('LtoT');\r\n sum('TtoU');\r\n return 'U';\r\n } else if(f_speed === '最速艦隊' || (DD > 7 && f_speed !== '低速艦隊')) {\r\n sum('LtoX');\r\n return 'X';\r\n } else if((countYamato() < 2 && isFaster()) || (countYamato() < 2 && CV < 3 && CL + DD > 4 && f_speed !== '低速艦隊')) {\r\n sum('LtoV');\r\n sum('VtoX');\r\n return 'X';\r\n } else {\r\n sum('LtoU');\r\n return 'U';\r\n }\r\n break;\r\n case 'K':\r\n if(BBs > 2) {\r\n sum('KtoM');\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n } else {\r\n sum('KtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n case 'Q':\r\n if(f_speed === '低速艦隊' && BBV + CAs > 2) {\r\n sum('QtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('QtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'N':\r\n if(track.includes('K')) {\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('NtoT');\r\n sum('TtoU');\r\n return 'U';\r\n }\r\n break;\r\n case 'O':\r\n if(f_type === '輸送護衛部隊') {\r\n sum('OtoR');\r\n sum('RtoS');\r\n sum('StoP');\r\n return null;\r\n } else {\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n case 'U':\r\n if(BBs > 4) {\r\n sum('UtoV');\r\n sum('VtoX');\r\n return 'X';\r\n } else {\r\n sum('UtoX');\r\n return 'X';\r\n }\r\n break;\r\n case 'X':\r\n if(AR + AO > 0 || isInclude('秋津洲')) {\r\n sum('XtoY');\r\n sum('YtoZ');\r\n return null;\r\n } else {\r\n sum('XtoZ');\r\n return null;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 58:\r\n switch(map) {\r\n case 1: {// @58-1\r\n const phase = Number(active['58-1']['1']);\r\n const kanko_carrier = CVs + f_names.filter(v => v.includes('あきつ丸')).length;\r\n switch(edge) {\r\n case null:\r\n if(kanko_carrier === 0 && Ds > 3) {\r\n if (is_once) return 1;\r\n return '2';\r\n } else if(kanko_carrier > f_kanko) {\r\n if (is_once) return 2;\r\n return '2';\r\n } else if(AO + LHA > 0 && Ds > 2) {\r\n if (is_once) return 3;\r\n return '2';\r\n } else if(AV > 1 && Ds > 2) {\r\n if (is_once) return 4;\r\n return '2';\r\n } else if(phase === 3 && kanko_carrier > 0) {\r\n if (is_once) return 5;\r\n sum('3toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(kanko_carrier > 2) {\r\n if (is_once) return 6;\r\n sum('1toA');\r\n return 'A';\r\n } else if(BBs > 0) {\r\n if (is_once) return 7;\r\n sum('1toA');\r\n return 'A';\r\n } else if(Ss > 0 && AS === 0) {\r\n if (is_once) return 8;\r\n return '2';\r\n } else if(AS > 1) {\r\n if (is_once) return 9;\r\n return '2';\r\n } else if(phase === 3 && CA > 1 && Ds > 1 && CL + CT > 0) {\r\n if (is_once) return 10;\r\n sum('3toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(kanko_carrier > 0 && Ds > 2) {\r\n if (is_once) return 11;\r\n return '2';\r\n } else {\r\n if (is_once) return 12;\r\n sum('1toA');\r\n return 'A';\r\n }\r\n break;\r\n case '2':\r\n if(AV > 0) {\r\n if (is_once) return 1;\r\n sum('2toI');\r\n return 'I';\r\n } else if(isFaster()) {\r\n if (is_once) return 2;\r\n sum('2toN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return null;\r\n } else if(AO + LHA === 2 && AO + LHA + Ds === 6) {\r\n if (is_once) return 3;\r\n sum('2toN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return null;\r\n } else if(AO + LHA === 1 && AO + LHA + Ds === f_length && f_length < 6) {\r\n if (is_once) return 4;\r\n sum('2toN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return null;\r\n } else {\r\n if (is_once) return 5;\r\n sum('2toI');\r\n return 'I';\r\n }\r\n break;\r\n case 'B':\r\n if(phase === 2) {\r\n if (is_once) return 1;\r\n sum('BtoC');\r\n sum('CtoR');\r\n return 'R';\r\n } else if(CL > 0 && DD > 2 && f_speed === '高速艦隊') {\r\n if (is_once) return 2;\r\n sum('BtoW');\r\n return 'W';\r\n } else {\r\n if (is_once) return 3;\r\n sum('BtoC');\r\n sum('CtoR');\r\n return 'R';\r\n }\r\n break;\r\n case 'D':\r\n if(track.includes('A')) {\r\n if (is_once) return 1;\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(track.includes('I')) {\r\n if(CVs > 2) {\r\n if (is_once) return 2;\r\n sum('DtoJ');\r\n sum('JtoK');\r\n return 'K';\r\n } else if(DD < 2) {\r\n if (is_once) return 3;\r\n sum('DtoJ');\r\n sum('JtoK');\r\n return 'K';\r\n } else if(f_speed === '低速艦隊') {\r\n if (is_once) return 4;\r\n sum('DtoJ');\r\n sum('JtoK');\r\n return 'K';\r\n } else {\r\n if (is_once) return 5;\r\n sum('DtoK');\r\n return 'K';\r\n }\r\n }\r\n break;\r\n case 'K':\r\n if(f_seek[3] >= 68) {\r\n if (is_once) return 1;\r\n sum('KtoM');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('KtoL');\r\n return null;\r\n }\r\n break;\r\n case 'R':\r\n if(BBs < 3 && CL + AV > 0 && DD > 1 && f_speed === '高速艦隊') {\r\n if (is_once) return 1;\r\n sum('RtoR2');\r\n return 'R2';\r\n } else {\r\n if (is_once) return 2;\r\n sum('RtoR1');\r\n sum('R1toR2');\r\n return 'R2';\r\n }\r\n break;\r\n case 'R2':\r\n if(DD > 4) {\r\n if (is_once) return 1;\r\n sum('R2toT');\r\n sum('TtoX');\r\n return null;\r\n } else if(CL > 0 && DD > 3 && f_speed === '高速艦隊') {\r\n if (is_once) return 2;\r\n sum('R2toT');\r\n sum('TtoX');\r\n return null;\r\n } else {\r\n if (is_once) return 3;\r\n sum('R2toS');\r\n return 'S';\r\n }\r\n break;\r\n case 'S':\r\n if(f_seek[3] >= 80) {\r\n if (is_once) return 1;\r\n sum('StoT');\r\n sum('TtoX');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('StoU');\r\n return null;\r\n }\r\n break;\r\n case 'W':\r\n if(CA > 1 && DD > 1) {\r\n if (is_once) return 1;\r\n sum('WtoR2');\r\n return 'R2';\r\n } else if(f_speed === '低速艦隊') {\r\n if (is_once) return 2;\r\n sum('WtoR');\r\n return 'R';\r\n } else if(BBs > 0 && CV + CVB > 1) {\r\n if (is_once) return 3;\r\n sum('WtoR');\r\n return 'R';\r\n } else if(DD > 2) {\r\n if (is_once) return 4;\r\n sum('WtoR2');\r\n return 'R2';\r\n } else if(DD < 2) {\r\n if (is_once) return 5;\r\n sum('WtoR');\r\n return 'R';\r\n } else if(CL === 0) {\r\n if (is_once) return 6;\r\n sum('WtoR');\r\n return 'R';\r\n } else if(CV + CVB > 2) {\r\n if (is_once) return 7;\r\n sum('WtoR2');\r\n return 'R2';\r\n } else if(CV + CVB < 2) {\r\n if (is_once) return 8;\r\n sum('WtoR2');\r\n return 'R2';\r\n } else if(BBs === 0) {\r\n if (is_once) return 9;\r\n sum('WtoR2');\r\n return 'R2';\r\n } else if(f_seek[3] >= 100) {\r\n if (is_once) return 10;\r\n sum('WtoR2');\r\n return 'R2';\r\n } else {\r\n if (is_once) return 11;\r\n sum('WtoR');\r\n return 'R';\r\n }\r\n break;\r\n case 'A':\r\n if(active['58-1']['A'] === 'B') {\r\n sum('AtoB');\r\n return 'B';\r\n } else {\r\n sum('AtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 'I':\r\n if(active['58-1']['I'] === 'D') {\r\n sum('ItoD');\r\n return 'D';\r\n } else {\r\n sum('ItoN1');\r\n sum('N1toN2');\r\n sum('N2toO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return null;\r\n }\r\n break;\r\n case 'F':\r\n if(active['58-1']['F'] === 'G') {\r\n sum('FtoG');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n case 2: { // @58-2\r\n const phase = Number(active['58-2']['1']);\r\n const difficulty = Number(active['58-2']['2']);\r\n const kanko_carrier = CVs + f_names.filter(v => v.includes('あきつ丸')).length;\r\n switch(edge) {\r\n case null:\r\n if(phase === 1) {\r\n if (is_once) return 1;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else if(phase === 2) {\r\n if(isCom()) {\r\n if (is_once) return 2;\r\n sum('2toL');\r\n return 'L';\r\n } else {\r\n if (is_once) return 3;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n }\r\n } else if(phase === 3) {\r\n if(isCom()) {\r\n if (is_once) return 4;\r\n sum('2toL');\r\n return 'L';\r\n } else {\r\n if(BBs > 0) {\r\n if (is_once) return 5;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else if(kanko_carrier > 0) {\r\n if (is_once) return 6;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else if(difficulty === 1 && Ss < 3) {\r\n if (is_once) return 7;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else if(difficulty === 2 && Ss < 2) {\r\n if (is_once) return 8;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else if(difficulty > 2 && Ss === 0) {\r\n if (is_once) return 9;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else {\r\n if (is_once) return 10;\r\n sum('3toS');\r\n sum('StoT');\r\n return 'T';\r\n }\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(track.includes('A')) {\r\n if(f_speed === '低速艦隊') {\r\n if (is_once) return 1;\r\n sum('CtoF');\r\n return null;\r\n } else if(CV + CVB > 0) {\r\n if (is_once) return 2;\r\n sum('CtoF');\r\n return null;\r\n } else {\r\n if (is_once) return 3;\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(track.includes('S')) {\r\n if (is_once) return 4;\r\n sum('CtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'D':\r\n if(!isCom()) {\r\n if(f_seek[3] >= 98) {\r\n if (is_once) return 1;\r\n sum('DtoD2');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('DtoD1');\r\n return null;\r\n }\r\n } else {\r\n if (is_once) return 3;\r\n sum('DtoN');\r\n return 'N';\r\n }\r\n break;\r\n case 'E':\r\n if(CV + CVB > 0) {\r\n if (is_once) return 1;\r\n sum('EtoF');\r\n return null;\r\n } else if(f_speed === '高速艦隊') {\r\n if (is_once) return 2;\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else if(BBs > 1) {\r\n if (is_once) return 3;\r\n sum('EtoF');\r\n return null;\r\n } else if(CL > 0 && Ds > 1) {\r\n if (is_once) return 4;\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n if (is_once) return 5;\r\n sum('EtoF');\r\n return null;\r\n }\r\n break;\r\n case 'H':\r\n if(track.includes('A')) {\r\n if(f_seek[3] < 80) {\r\n if (is_once) return 1;\r\n sum('HtoK');\r\n return null;\r\n } else if(f_speed === '低速艦隊') {\r\n if (is_once) return 2;\r\n sum('HtoJ');\r\n return 'J';\r\n } else if(BBs > 1) {\r\n if (is_once) return 3;\r\n sum('HtoJ');\r\n return 'J';\r\n } else if(CVL + f_names.filter(v => v.includes('あきつ丸')).length > 1) {\r\n if (is_once) return 4;\r\n sum('HtoJ');\r\n return 'J';\r\n } else {\r\n if (is_once) return 5;\r\n sum('HtoI');\r\n return 'I';\r\n }\r\n } else if(track.includes('3')) {\r\n sum('HtoV');\r\n return 'V';\r\n }\r\n break;\r\n case 'I':\r\n if(phase < 3) {\r\n if (is_once) return 1;\r\n return null;\r\n } else if(Ss > 0) {\r\n if (is_once) return 2;\r\n sum('ItoU');\r\n return 'U';\r\n } else {\r\n if (is_once) return 3;\r\n sum('ItoD3');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if(!isCom()) {\r\n if (is_once) return 1;\r\n sum('JtoP');\r\n return 'P';\r\n } else if(f_speed === '低速艦隊') {\r\n if (is_once) return 2;\r\n sum('JtoN');\r\n return 'N';\r\n } else if(BBs > 2) {\r\n if (is_once) return 3;\r\n sum('JtoN');\r\n return 'N';\r\n } else if(CVs > 2) {\r\n if (is_once) return 4;\r\n sum('JtoN');\r\n return 'N';\r\n } else if(CL > 1 && DD > 4) {\r\n if (is_once) return 5;\r\n sum('JtoP');\r\n return 'P';\r\n } else {\r\n if (is_once) return 6;\r\n sum('JtoN');\r\n return 'N';\r\n }\r\n break;\r\n case 'L':\r\n if(f_type === '空母機動部隊') {\r\n if (is_once) return 1;\r\n sum('LtoM');\r\n sum('MtoJ');\r\n return 'J';\r\n } else if(f_type === '水上打撃部隊') {\r\n if (is_once) return 2;\r\n sum('LtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 'N':\r\n if(CV + CVB > 0) {\r\n if (is_once) return 1;\r\n sum('NtoO');\r\n sum('OtoP');\r\n return 'P';\r\n } else if(CVL > 2) {\r\n if (is_once) return 2;\r\n sum('NtoO');\r\n sum('OtoP');\r\n return 'P';\r\n } else if(f_speed === '高速艦隊') {\r\n if (is_once) return 3;\r\n sum('NtoP');\r\n return 'P';\r\n } else if(CL > 1 && DD > 2) {\r\n if (is_once) return 4;\r\n sum('NtoP');\r\n return 'P';\r\n } else {\r\n if (is_once) return 5;\r\n sum('NtoO');\r\n sum('OtoP');\r\n return 'P';\r\n }\r\n break;\r\n case 'P':\r\n if(f_seek[1] >= 62) {\r\n if (is_once) return 1;\r\n sum('PtoR');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('PtoQ');\r\n return null;\r\n }\r\n break;\r\n case 'T':\r\n if(CAs > 1) {\r\n if (is_once) return 1;\r\n sum('TtoC');\r\n return 'C';\r\n } else if(CL > 1) {\r\n if (is_once) return 2;\r\n sum('TtoC');\r\n return 'C';\r\n } else {\r\n if (is_once) return 3;\r\n sum('TtoU');\r\n return 'U';\r\n }\r\n break;\r\n case 'U':\r\n if(CAs > 0) {\r\n if (is_once) return 1;\r\n sum('UtoH');\r\n return 'H';\r\n } else if(CL > 1) {\r\n if (is_once) return 2;\r\n sum('UtoH');\r\n return 'H';\r\n } else if(difficulty === 4) {\r\n if (is_once) return 3;\r\n sum('UtoV');\r\n return 'V';\r\n } else if(AV > 0) {\r\n if (is_once) return 4;\r\n sum('UtoH');\r\n return 'H';\r\n } else if(AS > 0) {\r\n if (is_once) return 5;\r\n sum('UtoV');\r\n return 'V';\r\n } else {\r\n if (is_once) return 6;\r\n sum('UtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'V':\r\n if(CAs + AV > 1) {\r\n if (is_once) return 1;\r\n sum('VtoW');\r\n sum('WtoX');\r\n sum('XtoY');\r\n return null;\r\n } else if(difficulty === 1 && Ss > 3) {\r\n if (is_once) return 2;\r\n sum('VtoX');\r\n sum('XtoY');\r\n return null;\r\n } else if(difficulty === 2 && Ss > 2) {\r\n if (is_once) return 3;\r\n sum('VtoX');\r\n sum('XtoY');\r\n return null;\r\n } else if(difficulty === 3 && Ss > 1) {\r\n if (is_once) return 4;\r\n sum('VtoX');\r\n sum('XtoY');\r\n return null;\r\n } else if(difficulty === 4) {\r\n if (is_once) return 5;\r\n sum('VtoX');\r\n sum('XtoY');\r\n return null;\r\n } else {\r\n if (is_once) return 6;\r\n sum('VtoW');\r\n sum('WtoX');\r\n sum('XtoY');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(active['58-2']['B'] === 'C') {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoE');\r\n return 'E';\r\n }\r\n break;\r\n }\r\n break;\r\n }\r\n case 3: { // @58-3\r\n const phase = Number(active['58-3']['1']);\r\n const difficulty = Number(active['58-3']['2']);\r\n const kanko_carrier = CVs + f_names.filter(v => v.includes('あきつ丸')).length;\r\n switch(edge) {\r\n case null:\r\n if(isCom()) {\r\n if (is_once) return 1;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else {\r\n if(phase < 3) {\r\n if (is_once) return 2;\r\n sum('2toH');\r\n return 'H';\r\n } else {\r\n if(AO > 0) {\r\n if (is_once) return 3;\r\n sum('3toI');\r\n return 'I';\r\n } else if(CL > 0 && DD > 2 && f_speed !== '低速艦隊') {\r\n if (is_once) return 4;\r\n sum('3toI');\r\n return 'I';\r\n } else if(kanko_carrier > 0) {\r\n if (is_once) return 5;\r\n sum('2toH');\r\n return 'H';\r\n } else if(BBs > 0) {\r\n if (is_once) return 6;\r\n sum('2toH');\r\n return 'H';\r\n } else if(AO + LHA + AV > 1) {\r\n if (is_once) return 7;\r\n sum('2toH');\r\n return 'H';\r\n } else if(phase < 4) {\r\n if (is_once) return 8;\r\n sum('3toI');\r\n return 'I';\r\n } else {\r\n if(difficulty === 1 && AS > 0 && Ss > 2) {\r\n if (is_once) return 9;\r\n sum('4toV');\r\n sum('VtoW');\r\n return 'W';\r\n } if(difficulty === 2 && Ss > 2) {\r\n if (is_once) return 10;\r\n sum('4toV');\r\n sum('VtoW');\r\n return 'W';\r\n } if(difficulty === 3 && Ss > 1) {\r\n if (is_once) return 11;\r\n sum('4toV');\r\n sum('VtoW');\r\n return 'W';\r\n } if(difficulty === 4 && Ss > 0) {\r\n if (is_once) return 12;\r\n sum('4toV');\r\n sum('VtoW');\r\n return 'W';\r\n } if(difficulty === 4 && Ds > 2) {\r\n if (is_once) return 13;\r\n sum('4toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else {\r\n if (is_once) return 14;\r\n sum('2toH');\r\n return 'H';\r\n }\r\n }\r\n }\r\n }\r\n break;\r\n case 'B':\r\n if(BBCVs > 5) {\r\n if (is_once) return 1;\r\n sum('BtoC');\r\n sum('CtoD');\r\n return 'D';\r\n } else if(f_speed !== '低速艦隊') {\r\n if (is_once) return 2;\r\n sum('BtoD');\r\n return 'D';\r\n } else if(CL > 1 && Ds > 3) {\r\n if (is_once) return 3;\r\n sum('BtoD');\r\n return 'D';\r\n } else {\r\n if (is_once) return 4;\r\n sum('BtoC');\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 'D':\r\n if(BBCVs > 6) {\r\n if (is_once) return 1;\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(BBs > 3) {\r\n if (is_once) return 2;\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(CV + CVB > 2) {\r\n if (is_once) return 3;\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else {\r\n if (is_once) return 4;\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_seek[1] >= 65) {\r\n if (is_once) return 1;\r\n sum('FtoO');\r\n return 'O';\r\n } else {\r\n if (is_once) return 2;\r\n sum('FtoG');\r\n return null;\r\n }\r\n break;\r\n case 'H':\r\n if(CL > 0 && DD > 3 && f_speed !== '低速艦隊') {\r\n if (is_once) return 1;\r\n sum('HtoJ');\r\n return 'J';\r\n } else {\r\n if (is_once) return 2;\r\n sum('HtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'I':\r\n if(BBCVs > 4) {\r\n if (is_once) return 1;\r\n sum('ItoL');\r\n return 'L';\r\n } else if(Ds < 2) {\r\n if (is_once) return 2;\r\n sum('ItoL');\r\n return 'L';\r\n } else if(f_speed !== '低速艦隊') {\r\n if (is_once) return 3;\r\n sum('ItoM');\r\n return 'M';\r\n } else if(BBs > 1) {\r\n if (is_once) return 4;\r\n sum('ItoL');\r\n return 'L';\r\n } else if(Ds > 1) {\r\n if (is_once) return 5;\r\n sum('ItoL');\r\n return 'L';\r\n } else {\r\n if (is_once) return 6;\r\n sum('ItoM');\r\n return 'M';\r\n }\r\n break;\r\n case 'J':\r\n if(f_seek[1] >= 45) {\r\n if (is_once) return 1;\r\n sum('JtoN');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('JtoK');\r\n return null;\r\n }\r\n break;\r\n case 'L':\r\n if(f_seek[1] >= 58) {\r\n if (is_once) return 1;\r\n sum('LtoM');\r\n return 'M';\r\n } else {\r\n if (is_once) return 2;\r\n sum('LtoG');\r\n return null;\r\n }\r\n break;\r\n case 'O':\r\n if(f_seek[1] < 75) {\r\n if (is_once) return 1;\r\n sum('OtoO1');\r\n return null;\r\n } else if(BBs < 3) {\r\n if (is_once) return 2;\r\n sum('OtoO3');\r\n return null;\r\n } else if(CL > 1) {\r\n if (is_once) return 3;\r\n sum('OtoO3');\r\n return null;\r\n } else {\r\n if (is_once) return 4;\r\n sum('OtoO2');\r\n sum('O2toO3');\r\n return null;\r\n }\r\n break;\r\n case 'P':\r\n if(f_seek[3] >= 98) {\r\n if (is_once) return 1;\r\n sum('PtoR');\r\n return 'R';\r\n } else {\r\n if (is_once) return 2;\r\n sum('PtoQ');\r\n return null;\r\n }\r\n break;\r\n case 'R':\r\n if(isFaster()) {\r\n if (is_once) return 1;\r\n sum('RtoU');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('RtoS');\r\n return 'S';\r\n }\r\n break;\r\n case 'S':\r\n if(f_speed === '低速艦隊') {\r\n if (is_once) return 1;\r\n sum('StoT');\r\n sum('TtoU');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('StoU');\r\n return null;\r\n }\r\n break;\r\n case 'W':\r\n if(AV + LHA > 0) {\r\n if (is_once) return 1;\r\n sum('WtoX');\r\n sum('XtoY');\r\n return 'Y';\r\n } else if(difficulty === 1 && AS > 0 && Ss > 3) {\r\n if (is_once) return 2;\r\n sum('WtoY');\r\n return 'Y';\r\n } else if(difficulty === 1 && DD > 1) {\r\n if (is_once) return 3;\r\n sum('WtoY');\r\n return 'Y';\r\n } else if(difficulty > 1) {\r\n if (is_once) return 4;\r\n sum('WtoY');\r\n return 'Y';\r\n } else {\r\n if (is_once) return 5;\r\n sum('WtoX');\r\n sum('XtoY');\r\n return 'Y';\r\n }\r\n break;\r\n case 'Y':\r\n if(CAs + CL + CT + CLT + AV + LHA > 2) {\r\n if (is_once) return 1;\r\n sum('YtoY1');\r\n sum('Y1toY2');\r\n sum('Y2toZ');\r\n return null;\r\n } else if(CAs + AV === 2) {\r\n if (is_once) return 2;\r\n sum('YtoY1');\r\n sum('Y1toY2');\r\n sum('Y2toZ');\r\n return null;\r\n } else if(DD > 0) {\r\n if (is_once) return 3;\r\n sum('YtoY2');\r\n sum('Y2toZ');\r\n return null;\r\n } else if(Ss > 4) {\r\n if (is_once) return 4;\r\n sum('YtoY2');\r\n sum('Y2toZ');\r\n return null;\r\n } else if(CAs + CL + CT + CLT + AV + LHA === 2) {\r\n if (is_once) return 5;\r\n sum('YtoY1');\r\n sum('Y1toY2');\r\n sum('Y2toZ');\r\n return null;\r\n } else if(Ss < 4) {\r\n if (is_once) return 6;\r\n sum('YtoY1');\r\n sum('Y1toY2');\r\n sum('Y2toZ');\r\n return null;\r\n } else {\r\n if (is_once) return 7;\r\n sum('YtoY2');\r\n sum('Y2toZ');\r\n return null;\r\n }\r\n break;\r\n case 'M':\r\n if(active['58-3']['M'] === 'P') {\r\n if (is_once) return 1;\r\n sum('MtoP');\r\n return 'P';\r\n } else {\r\n if (is_once) return 2;\r\n sum('MtoN');\r\n return null;\r\n }\r\n break;\r\n }\r\n break;\r\n }\r\n case 4: { // @58-4\r\n const phase = Number(active['58-4']['1']);\r\n const difficulty = Number(active['58-4']['2']);\r\n switch(edge) {\r\n case null:\r\n if(phase < 4) {\r\n if (is_once) return 1;\r\n return '1';\r\n } else if(phase > 3) {\r\n if (is_once) return 2;\r\n if(!isCom()) {\r\n return '1';\r\n } else if(f_type === '輸送護衛部隊') {\r\n if (is_once) return 3;\r\n sum('2toH');\r\n return 'H';\r\n } else if(f_type === '水上打撃部隊') {\r\n if(BBV + CAV === 2 && CL === 1 && BBV + CL + Ds + AO + AS + LHA === 12) {\r\n if (is_once) return 4;\r\n sum('2toH');\r\n return 'H';\r\n } else if(((BBV + CAV === 1) || (BBV + CAV === 2)) && CL + CT === 2 && BBV + CAV + CL + CT + Ds + AO + AS + LHA === 12) {\r\n if (is_once) return 5;\r\n sum('2toH');\r\n return 'H';\r\n } else if(phase < 6) {\r\n if (is_once) return 6;\r\n return '1';\r\n } else if(phase === 6) {\r\n if (is_once) return 7;\r\n return '3';\r\n }\r\n } else if(f_type === '空母機動部隊') {\r\n if (is_once) return 8;\r\n return '1';\r\n }\r\n }\r\n break;\r\n case '1':\r\n if(phase > 4 && Ss > 3) {\r\n if (is_once) return 1;\r\n sum('1toP');\r\n sum('PtoJ');\r\n return 'J';\r\n } else if(CV + CVB > 3) {\r\n if (is_once) return 2;\r\n sum('1toA');\r\n return 'A';\r\n } else if(f_speed === '高速艦隊') {\r\n if (is_once) return 3;\r\n sum('1toA1');\r\n return 'A1';\r\n } else if(isCom()) {\r\n if(countYamato() > 1) {\r\n if (is_once) return 4;\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n if (is_once) return 5;\r\n sum('1toA1');\r\n return 'A1';\r\n }\r\n } else if(!isCom()) {\r\n if(countYamato() > 1) {\r\n if (is_once) return 6;\r\n sum('1toA');\r\n return 'A';\r\n } else if(AS + Ss > 0) {\r\n if (is_once) return 7;\r\n sum('1toA1');\r\n return 'A1';\r\n } else if(difficulty === 4) {\r\n if (is_once) return 8;\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n if (is_once) return 9;\r\n sum('1toA');\r\n return 'A';\r\n }\r\n }\r\n break;\r\n case '3':\r\n if(f_speed === '高速艦隊') {\r\n if (is_once) return 1;\r\n sum('3toT');\r\n sum('TtoU');\r\n return 'U';\r\n } else if(Ds > 4) {\r\n if (is_once) return 2;\r\n sum('3toT');\r\n sum('TtoU');\r\n return 'U';\r\n } else if(CVs > 2) {\r\n if (is_once) return 3;\r\n sum('3toF');\r\n return 'F';\r\n } else if(countYamato() > 0) {\r\n if (is_once) return 4;\r\n sum('3toF');\r\n return 'F';\r\n } else {\r\n if (is_once) return 5;\r\n sum('3toF');\r\n return 'F';\r\n }\r\n break;\r\n case 'A':\r\n if(!isCom()) {\r\n if (is_once) return 1;\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(CV + CVB > 3) {\r\n if (is_once) return 2;\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(Ds > 3) {\r\n if (is_once) return 3;\r\n sum('AtoB');\r\n return 'B';\r\n } else {\r\n if (is_once) return 4;\r\n sum('AtoA1');\r\n return 'A1';\r\n }\r\n break;\r\n case 'A1':\r\n if(!isCom()) {\r\n if (is_once) return 1;\r\n sum('A1toA2');\r\n sum('A2toA3');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('A1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'C':\r\n if(AV > 1) {\r\n if (is_once) return 1;\r\n sum('CtoC2');\r\n return null;\r\n } else if(f_speed === '高速艦隊') {\r\n if (is_once) return 2;\r\n sum('CtoC1');\r\n sum('C1toE');\r\n return 'E';\r\n } else if(CVs > 3) {\r\n if (is_once) return 3;\r\n sum('CtoC2');\r\n return null;\r\n } else if(CAs > 2) {\r\n if (is_once) return 4;\r\n sum('CtoC2');\r\n return null;\r\n } else {\r\n if (is_once) return 5;\r\n sum('CtoC1');\r\n sum('C1toE');\r\n return 'E';\r\n }\r\n break;\r\n case 'D':\r\n if(BB > 0) {\r\n if (is_once) return 1;\r\n sum('DtoD2');\r\n return null;\r\n } else if(CL + CT > 2) {\r\n if (is_once) return 2;\r\n sum('DtoD1');\r\n return null;\r\n } else if(CVL > 0 && Ds > 3) {\r\n if (is_once) return 3;\r\n sum('DtoD1');\r\n return null;\r\n } else if(CVL === 0 && BBV === 0 && CL + CT > 1) {\r\n if (is_once) return 4;\r\n sum('DtoD1');\r\n return null;\r\n } else if(CVL === 0 && CL + CT > 1 && Ds > 3) {\r\n if (is_once) return 5;\r\n sum('DtoD1');\r\n return null;\r\n } else {\r\n if (is_once) return 6;\r\n sum('DtoD2');\r\n return null;\r\n }\r\n break;\r\n case 'E':\r\n if(countYamato() === 2 && DD < 5) {\r\n if (is_once) return 1;\r\n sum('EtoF');\r\n return 'F';\r\n } else if(countYamato() === 1 && DD < 4) {\r\n if (is_once) return 2;\r\n sum('EtoF');\r\n return 'F';\r\n } else if(countYamato() === 0 && DD < 3) {\r\n if (is_once) return 3;\r\n sum('EtoF');\r\n return 'F';\r\n } else if(BBCVs < 5) {\r\n if (is_once) return 4;\r\n sum('EtoF1');\r\n return 'F1';\r\n } else if(f_speed === '低速艦隊') {\r\n if (is_once) return 5;\r\n sum('EtoF');\r\n return 'F';\r\n } else if(BBCVs === 5) {\r\n if (is_once) return 6;\r\n sum('EtoF1');\r\n return 'F1';\r\n } else if(CL > 1) {\r\n if (is_once) return 7;\r\n sum('EtoF1');\r\n return 'F1';\r\n } else {\r\n if (is_once) return 8;\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(!isCom()) {\r\n if (is_once) return 1;\r\n sum('FtoJ1');\r\n return 'J1';\r\n } else if(f_type === '輸送護衛部隊') {\r\n if (is_once) return 2;\r\n sum('FtoJ1');\r\n return 'J1';\r\n } else if(track.includes('P')) {\r\n if (is_once) return 3;\r\n sum('FtoJ1');\r\n return 'J1';\r\n } else if(track.includes('1')) {\r\n if (is_once) return 4;\r\n sum('FtoF1');\r\n return 'F1';\r\n } else if(track.includes('3')) {\r\n if (is_once) return 5;\r\n sum('FtoU');\r\n return 'U';\r\n }\r\n break;\r\n case 'F1':\r\n if(f_seek[1] >= 98) {\r\n if (is_once) return 1;\r\n sum('F1toG');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('F1toF2');\r\n return null;\r\n }\r\n break;\r\n case 'H':\r\n if(f_speed === '低速艦隊') {\r\n if (is_once) return 1;\r\n sum('HtoI');\r\n sum('ItoI1');\r\n return 'I1';\r\n } else {\r\n if (is_once) return 2;\r\n sum('HtoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'I1':\r\n if(DD > 7) {\r\n if (is_once) return 1;\r\n sum('ItoI3');\r\n sum('I3toL');\r\n return 'L';\r\n } else {\r\n if (is_once) return 2;\r\n sum('I1toI2');\r\n sum('I2toK');\r\n sum('KtoL');\r\n return 'L';\r\n }\r\n break;\r\n case 'J':\r\n if(phase < 5) {\r\n if (is_once) return 1;\r\n sum('JtoJ1');\r\n return 'J1';\r\n } else if(BBCVs > 0) {\r\n if (is_once) return 2;\r\n sum('JtoF');\r\n return 'F';\r\n } else if(difficulty === 1 && Ss > 3) {\r\n if (is_once) return 3;\r\n sum('JtoJ1');\r\n return 'J1';\r\n } else if(difficulty === 2 && Ss > 2) {\r\n if (is_once) return 4;\r\n sum('JtoJ1');\r\n return 'J1';\r\n } else if(difficulty === 3 && Ss > 1) {\r\n if (is_once) return 5;\r\n sum('JtoJ1');\r\n return 'J1';\r\n } else if(difficulty === 4) {\r\n if (is_once) return 6;\r\n sum('JtoJ1');\r\n return 'J1';\r\n } else {\r\n if (is_once) return 7;\r\n sum('JtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'J1':\r\n if(isCom()) {\r\n if (is_once) return 1;\r\n sum('J1toJ2');\r\n return 'J2';\r\n } else if(BBCVs > 0) {\r\n if (is_once) return 2;\r\n sum('J1toQ');\r\n sum('QtoR');\r\n sum('RtoS');\r\n return null;\r\n } else if(CL === 1 && DD === 2 && AS === 1 && Ss === 3) {\r\n if (is_once) return 3;\r\n sum('J1toR');\r\n sum('RtoS');\r\n return null;\r\n } else if(CL > 0 && DD > 2) {\r\n if (is_once) return 4;\r\n sum('J1toR');\r\n sum('RtoS');\r\n return null;\r\n } else if(AS === 0) {\r\n if (is_once) return 5;\r\n sum('J1toQ');\r\n sum('QtoR');\r\n sum('RtoS');\r\n return null;\r\n } else if(CAs + CL > 0) {\r\n if (is_once) return 6;\r\n sum('J1toQ');\r\n sum('QtoR');\r\n sum('RtoS');\r\n return null;\r\n } else if(AV > 1) {\r\n if (is_once) return 7;\r\n sum('J1toQ');\r\n sum('QtoR');\r\n sum('RtoS');\r\n return null;\r\n } else if(DD > 2){\r\n if (is_once) return 8;\r\n sum('J1toQ');\r\n sum('QtoR');\r\n sum('RtoS');\r\n return null;\r\n } else if(Ss > 3) {\r\n if (is_once) return 9;\r\n sum('J1toR');\r\n sum('RtoS');\r\n return null;\r\n } else if(AV === 0) {\r\n if (is_once) return 10;\r\n sum('J1toR');\r\n sum('RtoS');\r\n return null;\r\n } else {\r\n if (is_once) return 11;\r\n sum('J1toQ');\r\n sum('QtoR');\r\n sum('RtoS');\r\n return null;\r\n }\r\n break;\r\n case 'J2':\r\n if(track.includes('2')) {\r\n if(DD > 7) {\r\n if (is_once) return 1;\r\n sum('J2toM');\r\n return 'M';\r\n } else {\r\n if (is_once) return 2;\r\n sum('J2toL');\r\n return 'L';\r\n }\r\n } else if(track.includes('3')) {\r\n if (is_once) return 3;\r\n sum('J2toV');\r\n return 'V';\r\n }\r\n break;\r\n case 'L':\r\n if(track.includes('2')) {\r\n if (is_once) return 1;\r\n sum('LtoM');\r\n return 'M';\r\n } else if(track.includes('3')) {\r\n if (is_once) return 2;\r\n sum('LtoV');\r\n return 'V';\r\n }\r\n break;\r\n case 'M':\r\n if(f_seek[1] >= 52) {\r\n if (is_once) return 1;\r\n sum('MtoO');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('MtoN');\r\n return null;\r\n }\r\n break;\r\n case 'U':\r\n if(countYamato() < 2 && CL > 1 && DD > 3 && f_speed === '高速艦隊') {\r\n if (is_once) return 1;\r\n sum('UtoV');\r\n return 'V';\r\n } else if(CV + CVB > 0) {\r\n if (is_once) return 2;\r\n sum('UtoJ2');\r\n return 'J2';\r\n } else if(Ds > 5) {\r\n if (is_once) return 3;\r\n sum('UtoV');\r\n return 'V';\r\n } else if(CVL > 1) {\r\n if (is_once) return 4;\r\n sum('UtoJ2');\r\n return 'J2';\r\n } else if(Ds > 3) {\r\n if (is_once) return 5;\r\n sum('UtoV');\r\n return 'V';\r\n } else {\r\n if (is_once) return 6;\r\n sum('UtoJ2');\r\n return 'J2';\r\n }\r\n break;\r\n case 'V':\r\n if(f_names.includes('明石改') || f_names.includes('朝日改') || f_names.includes('秋津洲改')) {\r\n if (is_once) return 1;\r\n sum('VtoW');\r\n sum('WtoX');\r\n return 'X';\r\n } else {\r\n if (is_once) return 2;\r\n sum('VtoX');\r\n return 'X';\r\n }\r\n break;\r\n case 'X':\r\n if(f_seek[1] >= 84) {\r\n if (is_once) return 1;\r\n sum('XtoZ');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('XtoY');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(active['58-4']['B'] === 'C') {\r\n if (is_once) return 1;\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n if (is_once) return 2;\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n break;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n case 59:\r\n switch(map) {\r\n case 1: { // @59-1\r\n const phase = Number(active['59-1']['1']);\r\n switch(edge) {\r\n case null:\r\n if(phase === 1) {\r\n sum('1toA');\r\n return 'A';\r\n } else if(CV + CVB > 0) {\r\n sum('1toA');\r\n return 'A';\r\n } else if(BBs + CVL > 3) {\r\n sum('1toA');\r\n return 'A';\r\n } else if(BBs > 2) {\r\n sum('1toA');\r\n return 'A'; \r\n } else if(AO > 0) {\r\n sum('1toA');\r\n return 'A'; \r\n } else if(CL + AV > 2) {\r\n sum('1toA');\r\n return 'A'; \r\n } else if(BBs > 0 && CL > 0 && AV > 0) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n return '2';\r\n }\r\n break;\r\n case '2':\r\n if(LHA > 0) {\r\n sum('2toI');\r\n sum('ItoJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(isFaster()) {\r\n sum('2toJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(Ss > 0) {\r\n sum('2toI');\r\n sum('ItoJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(CVL > 1) {\r\n sum('2toI');\r\n sum('ItoJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(CAs > 2) {\r\n sum('2toI');\r\n sum('ItoJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(Ds < 2) {\r\n sum('2toI');\r\n sum('ItoJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(f_speed !== '低速艦隊') {\r\n sum('2toJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(BBs > 1) {\r\n sum('2toI');\r\n sum('ItoJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(CL + CT === 0) {\r\n sum('2toI');\r\n sum('ItoJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else {\r\n sum('2toJ');\r\n sum('JtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'A':\r\n if(Ds === 0) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(AO > 0) {\r\n sum('AtoD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(Ds === 1) {\r\n if(Ss > 0) {\r\n sum('AtoC1');\r\n return 'C1';\r\n } else if(BBCVs > 2) {\r\n sum('AtoC1');\r\n return 'C1';\r\n } else {\r\n sum('AtoD');\r\n sum('DtoE');\r\n return 'E';\r\n }\r\n } else if(Ds > 1) {\r\n if(Ss > 0 && f_speed === '低速艦隊') {\r\n sum('AtoC1');\r\n return 'C1';\r\n } else if(CVs > 2 && CL + CT === 0) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(BBCVs === 4) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(BBCVs === 3) {\r\n sum('AtoD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(BBCVs === 2 && CL + CT + AV === 0) {\r\n sum('AtoD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(BBCVs < 2 && CL + CT === 0) {\r\n sum('AtoD');\r\n sum('DtoE');\r\n return 'E';\r\n } else {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n }\r\n break;\r\n case 'C1':\r\n if(BBs + CV + CVB + Ss > 1) {\r\n sum('C1toD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(CVs > 2) {\r\n sum('C1toD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(Ss > 0 && Ds < 5) {\r\n sum('C1toD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(Ds < 2) {\r\n sum('C1toD');\r\n sum('DtoE');\r\n return 'E';\r\n } else {\r\n sum('C1toE');\r\n return 'E';\r\n }\r\n break;\r\n case 'C2':\r\n if(BBs < 2 && CV + CVB === 0 && CVL < 2 && Ds > 1 && f_speed !== '低速艦隊') {\r\n sum('C2toL');\r\n sum('LtoM');\r\n return null;\r\n } else {\r\n sum('C2toC1');\r\n return 'C1';\r\n }\r\n break;\r\n case 'G':\r\n if(track.includes('1')) {\r\n sum('GtoH');\r\n return null;\r\n } else if(phase < 3) {\r\n sum('GtoK');\r\n sum('KtoL');\r\n sum('LtoM');\r\n return null;\r\n } else if(BBCVs > 1) {\r\n sum('GtoK');\r\n sum('KtoL');\r\n sum('LtoM');\r\n return null;\r\n } else if(Ds > 4) {\r\n sum('GtoL');\r\n sum('LtoM');\r\n return null;\r\n } else if(f_speed === '低速艦隊') {\r\n sum('GtoK');\r\n sum('KtoL');\r\n sum('LtoM');\r\n return null;\r\n } else if(Ds === 4) {\r\n sum('GtoL');\r\n sum('LtoM');\r\n return null;\r\n } else if(Ds === 3 && CL > 0 && BBCVs === 0) {\r\n sum('GtoL');\r\n sum('LtoM');\r\n return null;\r\n } else {\r\n sum('GtoK');\r\n sum('KtoL');\r\n sum('LtoM');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['59-1']['C'] === 'C1') {\r\n sum('CtoC1');\r\n return 'C1';\r\n } else {\r\n sum('CtoC2');\r\n sum('C2toL');\r\n sum('LtoM');\r\n return null;\r\n }\r\n break;\r\n case 'E':\r\n if(active['59-1']['E'] === 'F') {\r\n sum('EtoF');\r\n return null;\r\n } else {\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n case 2: // @59-2\r\n switch(edge) {\r\n case null:\r\n if(!isCom()) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('2toF');\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'A':\r\n if(isFaster()) {\r\n sum('AtoA2');\r\n sum('A2toB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(DD > 3) {\r\n sum('AtoA2');\r\n sum('A2toB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(DD > 2 && f_speed !== '低速艦隊') {\r\n sum('AtoA2');\r\n sum('A2toB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoA1');\r\n sum('A1toA2');\r\n sum('A2toB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n break;\r\n case 'C':\r\n if(f_seek[3] >= 60) {\r\n sum('CtoE');\r\n return null;\r\n } else {\r\n sum('CtoD');\r\n return null;\r\n }\r\n break;\r\n case 'G':\r\n if(f_type === '輸送護衛部隊') {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(CVs + countAkitsuMaru() > 4) {\r\n sum('GtoH');\r\n sum('HtoK');\r\n sum('KtoN');\r\n return 'N';\r\n } else if(BBs > 3) {\r\n sum('GtoH');\r\n sum('HtoK');\r\n sum('KtoN');\r\n return 'N';\r\n } else if(CV + CVB > 2) {\r\n sum('GtoH');\r\n sum('HtoK');\r\n sum('KtoN');\r\n return 'N';\r\n } else if(Ds < 3) {\r\n sum('GtoH');\r\n sum('HtoK');\r\n sum('KtoN');\r\n return 'N';\r\n } else if(DD === 3) {\r\n if(f_speed === '低速艦隊') {\r\n sum('GtoH');\r\n sum('HtoK');\r\n sum('KtoN');\r\n return 'N';\r\n } else if(LHA > 0) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(AV > 1) {\r\n sum('GtoI');\r\n return 'I';\r\n } else {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return 'N';\r\n }\r\n } else if(DD > 3) {\r\n if(LHA > 0) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(AV > 1) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(BBs === 3 && CVs === 1 && CL + CT === 2) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(f_speed !== '低速艦隊') {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return 'N';\r\n } else if(CV + CVB < 2 && CL + CT > 1) {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return 'N';\r\n } else {\r\n sum('GtoH');\r\n sum('HtoK');\r\n sum('KtoN');\r\n return 'N';\r\n }\r\n }\r\n break;\r\n case 'I':\r\n if(CVs + countAkitsuMaru() > 1) {\r\n sum('ItoJ');\r\n sum('JtoL');\r\n return 'L';\r\n } else if(DD < 4) {\r\n sum('ItoJ');\r\n sum('JtoL');\r\n return 'L';\r\n } else if(f_speed !== '低速艦隊') {\r\n sum('ItoL');\r\n return 'L';\r\n } else if(CL + CT > 1 && Ds + LHA > 5) {\r\n sum('ItoL');\r\n return 'L';\r\n } else {\r\n sum('ItoJ');\r\n sum('JtoL');\r\n return 'L';\r\n }\r\n break;\r\n case 'R':\r\n if(f_seek[1] >= 68) {\r\n sum('RtoW');\r\n return null;\r\n } else {\r\n sum('RtoV');\r\n return null;\r\n }\r\n break;\r\n case 'S':\r\n if(f_seek[1] >= 58) {\r\n sum('StoU');\r\n return null;\r\n } else {\r\n sum('StoT');\r\n return null;\r\n }\r\n break;\r\n case 'L':\r\n if(active['59-2']['L'] === 'M') {\r\n sum('LtoM');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return 'N';\r\n }\r\n break;\r\n case 'N':\r\n if(active['59-2']['N'] === 'O') {\r\n sum('NtoO');\r\n sum('OtoS');\r\n return 'S';\r\n } else {\r\n sum('NtoP');\r\n return 'P';\r\n }\r\n break;\r\n case 'P':\r\n if(active['59-2']['P'] === 'Q') {\r\n sum('PtoQ');\r\n return null;\r\n } else {\r\n sum('PtoR');\r\n return 'R';\r\n }\r\n break;\r\n }\r\n break;\r\n case 3: { // @59-3\r\n const phase = Number(active['59-3']['1']);\r\n switch(edge) {\r\n case null:\r\n if(!isCom() && f_length !== 7) {\r\n return '1';\r\n } else if(!isCom() && f_length === 7) {\r\n return '2';\r\n } else if(f_type === '輸送護衛部隊') {\r\n return '1';\r\n } else if(phase === 1 && (f_type === '水上打撃部隊' || f_type === '空母機動部隊')) {\r\n return '1';\r\n } else if(phase > 1 && (f_type === '水上打撃部隊' || f_type === '空母機動部隊')) {\r\n sum('3toP');\r\n return 'P';\r\n }\r\n break;\r\n case '1':\r\n if(!isCom()) {\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else {\r\n sum('1toL');\r\n sum('LtoM');\r\n sum('MtoB1');\r\n return 'B1';\r\n }\r\n break;\r\n case '2':\r\n if(CV + CVB < 3 && Ds > 2) {\r\n sum('2toH');\r\n return 'H';\r\n } else {\r\n sum('2toG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'B':\r\n if(CVs > 3) {\r\n sum('BtoB2');\r\n sum('B2toH1');\r\n sum('H1toH2');\r\n sum('H2toI');\r\n return 'I';\r\n } else if(CV + CVB > 2) {\r\n sum('BtoB2');\r\n sum('B2toH1');\r\n sum('H1toH2');\r\n sum('H2toI');\r\n return 'I';\r\n } else if(AV > 1) {\r\n sum('BtoB2');\r\n sum('B2toH1');\r\n sum('H1toH2');\r\n sum('H2toI');\r\n return 'I';\r\n } else if(LHA > 0) {\r\n sum('BtoB2');\r\n sum('B2toH1');\r\n sum('H1toH2');\r\n sum('H2toI');\r\n return 'I';\r\n } else if(BBs < 3 && Ds > 2) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoB1');\r\n return 'B1';\r\n }\r\n break;\r\n case 'B1':\r\n if(!isCom()) {\r\n sum('B1toC');\r\n return 'C';\r\n } else if(f_type === '輸送護衛部隊') {\r\n sum('B1toP');\r\n return 'P';\r\n } else if(f_type === '水上打撃部隊') {\r\n sum('B1toN');\r\n return 'N';\r\n } else if(f_type === '空母機動部隊') {\r\n if(CVs + countAkitsuMaru() > 3) {\r\n sum('B1toN');\r\n return 'N';\r\n } else if(CV + CVB > 1) {\r\n sum('B1toN');\r\n return 'N';\r\n } else if(Ds < 2 && BBs > 3) {\r\n sum('B1toN');\r\n return 'N';\r\n } else {\r\n sum('B1toP');\r\n return 'P';\r\n }\r\n } else {\r\n sum('B1toP');\r\n return 'P';\r\n }\r\n break;\r\n case 'C3':\r\n if(f_seek[3] < 103) {\r\n sum('C3toE');\r\n return null;\r\n } else if(BBs + CV + CVB > 3) {\r\n sum('C3toD');\r\n sum('DtoF');\r\n return null;\r\n } else if(Ds < 2) {\r\n sum('C3toD');\r\n sum('DtoF');\r\n return null;\r\n } else {\r\n sum('C3toF');\r\n return null;\r\n }\r\n break;\r\n case 'H':\r\n if(Ds > 3 && f_speed !== '低速艦隊') {\r\n sum('HtoH2');\r\n sum('H2toI');\r\n return 'I';\r\n } else if(CV + CVB > 1) {\r\n sum('HtoB2');\r\n sum('B2toH1');\r\n sum('H1toH2');\r\n sum('H2toI');\r\n return 'I';\r\n } else {\r\n sum('HtoH1');\r\n sum('H1toH2');\r\n sum('H2toI');\r\n return 'I';\r\n }\r\n break;\r\n case 'I':\r\n if(f_seek[3] >= 82) {\r\n sum('ItoK');\r\n return null;\r\n } else {\r\n sum('ItoJ');\r\n return null;\r\n }\r\n break;\r\n case 'N':\r\n if(f_type === '水上打撃部隊') {\r\n sum('NtoO');\r\n sum('OtoP');\r\n return 'P';\r\n } else if(f_type === '空母機動部隊') {\r\n if(f_speed === '低速艦隊') {\r\n sum('NtoO');\r\n sum('OtoP');\r\n return 'P';\r\n } else {\r\n sum('NtoP');\r\n return 'P';\r\n }\r\n }\r\n break;\r\n case 'P':\r\n if(track.includes('1')) {\r\n sum('PtoQ');\r\n return 'Q';\r\n } else if(track.includes('3')) {\r\n if(countYamato() > 1) {\r\n sum('PtoT');\r\n sum('TtoV');\r\n return 'V';\r\n } else if(CV + CVB > 2) {\r\n sum('PtoT');\r\n sum('TtoV');\r\n return 'V';\r\n } else if(Ss > 0 && AS === 0) {\r\n sum('PtoT');\r\n sum('TtoV');\r\n return 'V';\r\n } else if(f_type === '水上打撃部隊' && f_speed === '低速艦隊') {\r\n sum('PtoT');\r\n sum('TtoV');\r\n return 'V';\r\n } else {\r\n sum('PtoU');\r\n sum('UtoV');\r\n return 'V';\r\n }\r\n }\r\n break;\r\n case 'Q':\r\n if(f_seek[1] >= 53) {\r\n sum('QtoS');\r\n return null;\r\n } else {\r\n sum('QtoR');\r\n return null;\r\n }\r\n break;\r\n case 'V':\r\n if(LHA > 0 && f_speed === '低速艦隊') {\r\n sum('VtoV1');\r\n return null;\r\n } else if(AV > 1 && f_speed === '低速艦隊') {\r\n sum('VtoV1');\r\n return null;\r\n } else if(BBs > 3 && f_speed === '低速艦隊') {\r\n sum('VtoV1');\r\n return null;\r\n } else if(BBs > 4) {\r\n sum('VtoV1');\r\n return null;\r\n } else if(BBCVs > 5) {\r\n sum('VtoV2');\r\n sum('V2toV3');\r\n return 'V3';\r\n } else if(BBs + CV + CVB > 4) {\r\n sum('VtoV2');\r\n sum('V2toV3');\r\n return 'V3';\r\n } else if(CV + CVB > 2) {\r\n sum('VtoV2');\r\n sum('V2toV3');\r\n return 'V3';\r\n } else if(Ss > 0 && AS === 0) {\r\n sum('VtoV2');\r\n sum('V2toV3');\r\n return 'V3';\r\n } else if(countYamato() > 1 && f_speed === '低速艦隊') {\r\n sum('VtoV2');\r\n sum('V2toV3');\r\n return 'V3';\r\n } else if(phase < 3) {\r\n sum('VtoV3');\r\n return 'V3';\r\n } else if(Ds < 4) {\r\n sum('VtoV3');\r\n return 'V3';\r\n } else if(CL > 1 && CA > 1) {\r\n sum('VtoX');\r\n return null;\r\n } else if(f_speed !== '低速艦隊') {\r\n sum('VtoX');\r\n return null;\r\n } else {\r\n sum('VtoV3');\r\n return 'V3';\r\n }\r\n break;\r\n case 'V3':\r\n if(f_seek[1] >= 72) {\r\n sum('V3toX');\r\n return null;\r\n } else {\r\n sum('V3toW');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['59-3']['C'] === 'C1') {\r\n sum('CtoC1');\r\n return null;\r\n } else {\r\n sum('CtoC2');\r\n sum('C2toC3');\r\n return 'C3';\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n case 4: {\r\n const phase = Number(active['59-4']['1']);\r\n switch(edge) {\r\n case null:\r\n if(!isCom()) {\r\n return '1';\r\n } else {\r\n sum('2toT');\r\n return 'T';\r\n }\r\n break;\r\n case '1':\r\n if(Ss > 0) {\r\n sum('1toA1');\r\n sum('A1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else if(f_speed !== '低速艦隊') {\r\n if(BBs > 2) {\r\n sum('1toA1');\r\n sum('A1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else if(Ds > 1) {\r\n sum('1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else if(f_length < 5) {\r\n sum('1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else {\r\n sum('1toA1');\r\n sum('A1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n } else {\r\n if(CVs > 1) {\r\n sum('1toA1');\r\n sum('A1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else if(BBs > 0) {\r\n sum('1toA1');\r\n sum('A1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else if(CL + CT > 0 && Ds > 1) {\r\n sum('1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else if(f_length < 5) {\r\n sum('1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else {\r\n sum('1toA1');\r\n sum('A1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(BBs + CV + CVB > 2) {\r\n sum('CtoI');\r\n return 'I';\r\n } else if(CV + CVB > 1) {\r\n sum('CtoI');\r\n return 'I';\r\n } else if(CVs > 2) {\r\n sum('CtoI');\r\n return 'I';\r\n } else if(Ds < 2) {\r\n sum('CtoI');\r\n return 'I';\r\n } else if(phase > 1 && BBs === 0) {\r\n sum('CtoM');\r\n return 'M';\r\n } else if(phase > 1 && f_length < 7 && BBs === 1 && CL > 0) {\r\n sum('CtoM');\r\n return 'M';\r\n } else {\r\n sum('CtoL');\r\n return null;\r\n }\r\n break;\r\n case 'F':\r\n if(true) {\r\n sum('FtoF1');\r\n sum('F1toG');\r\n return 'G';\r\n } else {}\r\n break;\r\n case 'G':\r\n if(true) {\r\n sum('GtoH');\r\n return null;\r\n } else {}\r\n break;\r\n case 'I':\r\n if(CV + CVB > 1) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else if(CL === 0 && Ds < 3) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else if(true) {\r\n sum('ItoL');\r\n return null;\r\n } else {}\r\n break;\r\n case 'J':\r\n if(true) {\r\n sum('JtoL');\r\n return null;\r\n } else {}\r\n break;\r\n case 'M':\r\n if(CV + CVB > 0) {\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return 'Q';\r\n } else if(CVL > 1) {\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return 'Q';\r\n } else if(Ds > 3) {\r\n sum('MtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return 'Q';\r\n } else if(CL + CT > 0 && Ds === 3) {\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return 'Q';\r\n } else if(CL + CT > 0 && f_speed !== '低速艦隊') {\r\n sum('MtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return 'Q';\r\n } else {\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return 'Q';\r\n }\r\n break;\r\n case 'Q':\r\n if(f_seek[3] >= 72) {\r\n sum('QtoS');\r\n return null;\r\n } else {\r\n sum('QtoR');\r\n return null;\r\n }\r\n break;\r\n case 'T':\r\n if(isFaster()) {\r\n sum('TtoT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(Ss > 0 && AS === 0) {\r\n sum('TtoT1');\r\n sum('T1toT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(BBs > 3) {\r\n sum('TtoT1');\r\n sum('T1toT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(CVs > 3) {\r\n sum('TtoT1');\r\n sum('T1toT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(CV + CVB > 2) {\r\n sum('TtoT1');\r\n sum('T1toT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(CL + CT + Ds < 4) {\r\n sum('TtoT1');\r\n sum('T1toT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(f_speed !== '低速艦隊') {\r\n sum('TtoT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(BBs < 3 && CL + CT > 1 && Ds > 3) {\r\n sum('TtoT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else {\r\n sum('TtoT1');\r\n sum('T1toT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n }\r\n break;\r\n case 'W':\r\n if(f_seek[1] < 80) {\r\n sum('WtoX');\r\n return 'X';\r\n } else if(isFaster()) {\r\n sum('WtoZ');\r\n return null;\r\n } else if(countYamato() > 0) {\r\n sum('WtoX');\r\n return 'X';\r\n } else if(BBs > 3) {\r\n sum('WtoX');\r\n return 'X';\r\n } else if(BBs > 2 && CVs > 2) {\r\n sum('WtoX');\r\n return 'X';\r\n } else {\r\n sum('WtoZ');\r\n return null;\r\n }\r\n break;\r\n case 'X':\r\n if(f_seek[1] < 73) {\r\n sum('XtoK');\r\n return null;\r\n } else if(isFaster()) {\r\n sum('XtoZ');\r\n return null;\r\n } else if(countYamato() > 1) {\r\n sum('XtoY');\r\n sum('YtoZ');\r\n return null;\r\n } else {\r\n sum('XtoZ');\r\n return null;\r\n }\r\n break;\r\n case 'A2':\r\n if(active['59-4']['A2'] === 'B') {\r\n sum('A2toB');\r\n sum('BtoD');\r\n return 'D';\r\n } else {\r\n sum('A2toC');\r\n return 'C';\r\n }\r\n break;\r\n case 'D':\r\n if(active['59-4']['D'] === 'E') {\r\n sum('DtoE');\r\n return null;\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n case 5: {\r\n const phase = Number(active['59-5']['1']);\r\n switch(edge) {\r\n case null:\r\n if(!isCom()) {\r\n return '1';\r\n } else if(phase === 1 && isCom()) {\r\n return '2';\r\n } else if(phase > 1) {\r\n if(BB + CV + CVB > 2) {\r\n sum('3toM');\r\n sum('MtoM1');\r\n sum('M1toM2');\r\n return 'M2';\r\n } else if(CV + CVB > 1) {\r\n sum('3toM');\r\n sum('MtoM1');\r\n sum('M1toM2');\r\n return 'M2';\r\n } else {\r\n return '2';\r\n }\r\n }\r\n break;\r\n case '1':\r\n if(isFaster()) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(f_speed === '低速艦隊') {\r\n sum('1toA1');\r\n return 'A1';\r\n } else if(BBs + CV + CVB > 0) {\r\n sum('1toA1');\r\n return 'A1';\r\n } else if(CVL > 1) {\r\n sum('1toA1');\r\n return 'A1';\r\n } else {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n break;\r\n case '2':\r\n if(isFaster()) {\r\n sum('2toE');\r\n return 'E';\r\n } else if(Ss > 0 && AS === 0) {\r\n sum('2toD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(BBs + CV + CVB > 1) {\r\n sum('2toD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(Ds < 4) {\r\n sum('2toD');\r\n sum('DtoE');\r\n return 'E';\r\n } else {\r\n sum('2toE');\r\n return 'E';\r\n }\r\n break;\r\n case 'A1':\r\n if(Ss > 0) {\r\n sum('A1toA2');\r\n sum('A2toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(BBCVs > 2) {\r\n sum('A1toA2');\r\n sum('A2toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(BBs > 1) {\r\n sum('A1toA2');\r\n sum('A2toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('A1toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n break;\r\n case 'C':\r\n if(f_seek[3] >= 70) {\r\n sum('CtoC2');\r\n return null;\r\n } else {\r\n sum('CtoC1');\r\n return null;\r\n }\r\n break;\r\n case 'E':\r\n if(isFaster()) {\r\n sum('EtoG');\r\n return 'G';\r\n } else if(Ds > 5) {\r\n sum('EtoG');\r\n return 'G';\r\n } else if(Ds > 4 && CA > 1 && CV + CVB === 0 && BBs + CVL < 2 && f_speed !== '低速艦隊') {\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('EtoF');\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'J':\r\n if(true) {\r\n sum('JtoL');\r\n return null;\r\n } else {}\r\n break;\r\n case 'M2':\r\n if(isFaster()) {\r\n sum('M2toN');\r\n sum('NtoO');\r\n return 'O';\r\n } else if(f_type === '空母機動部隊') {\r\n sum('M2toN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('M2toM3');\r\n sum('M3toN');\r\n sum('NtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'O':\r\n if(isFaster()) {\r\n sum('OtoO2');\r\n return 'O2';\r\n } else if(countYamato() > 0) {\r\n sum('OtoO1');\r\n sum('O1toO2');\r\n return 'O2';\r\n } else if(CVs > 3) {\r\n sum('OtoO1');\r\n sum('O1toO2');\r\n return 'O2';\r\n } else if(CV + CVB > 2) {\r\n sum('OtoO1');\r\n sum('O1toO2');\r\n return 'O2';\r\n } else if(Ds < 4) {\r\n sum('OtoO1');\r\n sum('O1toO2');\r\n return 'O2';\r\n } else {\r\n sum('OtoO2');\r\n return 'O2';\r\n }\r\n break;\r\n case 'Q':\r\n if(isFaster()) {\r\n sum('QtoR');\r\n return null;\r\n } else if(countYamato() > 1) {\r\n sum('QtoR1');\r\n return 'R1';\r\n } else if(countYamato() === 1 && f_speed === '低速艦隊') {\r\n sum('QtoR1');\r\n return 'R1';\r\n } else if(BBs > 2) {\r\n sum('QtoR1');\r\n return 'R1';\r\n } else {\r\n sum('QtoR');\r\n return null;\r\n }\r\n break;\r\n case 'R1':\r\n if(countYamato() + countShipsByName('Iowa') < 2) {\r\n sum('R1toR');\r\n return null;\r\n } else if(f_speed !== '低速艦隊') {\r\n sum('R1toR');\r\n return null;\r\n } else if(f_speed === '低速艦隊') {\r\n sum('R1toR2');\r\n sum('R2toR');\r\n return null;\r\n }\r\n break;\r\n case 'S':\r\n if(countYamato() > 1) {\r\n sum('StoS2');\r\n return 'S2'; \r\n } else if(CV + CVB > 0) {\r\n sum('StoS2');\r\n return 'S2'; \r\n } else if(f_speed !== '低速艦隊') {\r\n if(CA > 1 && CVL < 2) {\r\n sum('StoT');\r\n return 'T';\r\n } else {\r\n sum('StoS1');\r\n sum('S1toT');\r\n return 'T'; \r\n }\r\n } else if(f_speed === '低速艦隊') {\r\n if(CL + CT > 2 && Ds > 2) {\r\n sum('StoS1');\r\n sum('S1toT');\r\n return 'T'; \r\n } else {\r\n sum('StoS2');\r\n return 'S2'; \r\n }\r\n }\r\n break;\r\n case 'S2':\r\n if(true) {\r\n sum('S2toS1');\r\n sum('S1toT');\r\n return 'T';\r\n } else {}\r\n break;\r\n case 'T':\r\n if(f_seek[1] >= 65) {\r\n sum('TtoV');\r\n return null;\r\n } else {\r\n sum('TtoU');\r\n return null;\r\n }\r\n break;\r\n case 'Z':\r\n if(CVs + countAkitsuMaru() > 2) {\r\n sum('ZtoY');\r\n return null;\r\n } else if(CAs > 3) {\r\n sum('ZtoY');\r\n return null;\r\n } else if(BBs > 3) {\r\n sum('ZtoZ1');\r\n return 'Z1';\r\n } else if(phase < 3) {\r\n if(isFaster()) {\r\n sum('ZtoY');\r\n return null;\r\n } else if(BBs < 3) {\r\n sum('ZtoY');\r\n return null;\r\n } else {\r\n sum('ZtoZ1');\r\n return 'Z1';\r\n }\r\n } else if(phase === 3) {\r\n if(isFaster()) {\r\n sum('ZtoZZ');\r\n return null;\r\n } else if(countYamato() === 0 && BBs < 3) {\r\n sum('ZtoZZ');\r\n return null;\r\n } else if(countYamato() === 1 && BBs < 3 && CAs > 1 && CL + CT > 1 && Ds > 3) {\r\n sum('ZtoZZ');\r\n return null;\r\n } else {\r\n sum('ZtoZ1');\r\n return 'Z1';\r\n }\r\n }\r\n break;\r\n case 'Z1':\r\n if(true) {\r\n sum('Z1toZZ');\r\n return null;\r\n } else {}\r\n break;\r\n case 'G':\r\n if(active['59-5']['G'] === 'H') {\r\n sum('GtoH');\r\n sum('HtoS');\r\n return 'S';\r\n } else {\r\n sum('GtoI');\r\n sum('ItoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'O2':\r\n if(active['59-5']['O2'] === 'P') {\r\n sum('O2toP');\r\n sum('PtoW');\r\n return 'W';\r\n } else {\r\n sum('O2toQ');\r\n return 'Q';\r\n }\r\n break;\r\n case 'W':\r\n if(active['59-5']['W'] === 'Z') {\r\n sum('WtoZ');\r\n return 'Z';\r\n } else {\r\n sum('WtoX');\r\n return null;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n }\r\n }\r\n \r\n // 演算開始\r\n // simControllerから叩くこと\r\n function startSim() {\r\n // measureTime(true);\r\n return new Promise((resolve) => {\r\n if(a_flag && f_flag) {\r\n area = localStorage.getItem('area');\r\n const elem = area.split('-');\r\n const world = Number(elem[0]);\r\n const map = Number(elem[1]);\r\n let edge = null;\r\n // 無限ループ防止\r\n let max_c = 10000; // 何回回すか\r\n const max_s = 150000;\r\n if(area.includes('58')) {\r\n max_c = 1; // イベは1回だけ\r\n }\r\n let safety = 0;\r\n let count = 0;\r\n while(count < max_c) {\r\n edge = branch(world, map, edge, false);\r\n if(edge === null) {\r\n count++;\r\n pushLog();\r\n track = [];\r\n }\r\n safety++;\r\n if(safety > max_s) {\r\n alert('無限ループ防止 バグった');\r\n console.log('無限ループ');\r\n console.log('以下諸元');\r\n console.log(`海域: ${world}-${map}`);\r\n console.log('艦種', com);\r\n console.log('最終航路', track);\r\n console.log(`safety: ${safety}`);\r\n console.log(`count: ${count}`);\r\n console.log(`ドラム缶: ${f_drum}`);\r\n console.log(`電探: ${f_radar}`);\r\n console.log(`大発系: ${f_craft}`);\r\n console.log(`寒甲: ${f_kanko}`);\r\n console.log(`f_speed: ${f_speed}`);\r\n console.log(rate);\r\n console.log('終わり');\r\n return;\r\n }\r\n }\r\n console.log('航路', rate);\r\n // 正直どういう挙動になってるのか分からない\r\n // 非同期でいい感じにやってくれてるならいいやって感じ\r\n drawMap(max_c);\r\n rate = {};\r\n t_logs = {};\r\n\r\n resolve();\r\n }\r\n });\r\n }\r\n\r\n // マップ描画\r\n function drawMap(max_c) {\r\n removePopupInfo();\r\n const map = map_info; // map.jsより\r\n const spots = map['spots'][area];\r\n const routes = map['route'][area];\r\n let elements = {\r\n nodes: [],\r\n edges: []\r\n };\r\n // nodes流し込み\r\n for (const key in spots) {\r\n if (spots.hasOwnProperty(key)) {\r\n // 座標,マスの種類\r\n const [x, y, label] = spots[key];\r\n elements.nodes.push({\r\n data: {id:key, name:key, label:label},\r\n position: {x, y}\r\n });\r\n }\r\n }\r\n // esges流し込み\r\n for (const key in routes) {\r\n if (routes.hasOwnProperty(key)) {\r\n const [source, target] = routes[key];\r\n // 通っていないルートはrateに無いので0に置き換え\r\n let ratio = ((rate[source + 'to' + target] / max_c) * 100).toFixed(1);\r\n ratio = isNaN(ratio) ? 0 : parseFloat(ratio);\r\n elements.edges.push({\r\n data: {\r\n source,\r\n target,\r\n ratio: ratio// 小数第二位以下四捨五入\r\n }\r\n });\r\n }\r\n }\r\n\r\n // スタイルシート\r\n const style = [\r\n { selector: 'node',\r\n style: {\r\n 'color': 'rgb(250,250,250)',\r\n 'font-weight': '100',\r\n 'text-outline-color': 'rgba(20,20,20)',\r\n 'text-outline-opacity': '.85',\r\n 'text-outline-width': '1.5px',\r\n 'content': 'data(name)',\r\n 'text-valign': 'center',\r\n 'text-halign': 'center',\r\n 'padding': '0pt',\r\n 'font-size': '15px',\r\n 'background-clip': 'none',// z-indexでedgesの下に潜り込ませるは上手くいかなかった\r\n }\r\n }, // マスの分類ごとに表示分岐\r\n { selector: 'node[label = \"st\"]', // 出撃\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/start.png`,\r\n 'font-weight': '600',\r\n 'text-outline-width': '2px',\r\n 'font-size': '20px',\r\n 'width': '48px',\r\n 'height': '48px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '1px', // 位置微調整\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"po\"]', // 港湾\r\n style: {\r\n 'background-image': `../media/nodes/port.png`,\r\n 'width': '48px',\r\n 'height': '48px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '5.7px',\r\n 'background-position-y': '5px'\r\n }\r\n },\r\n { selector: 'node[label = \"bo\"]', // ボス\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/boss.png`,\r\n 'width': '48px',\r\n 'height': '48px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '5px',\r\n 'background-position-y': '1px'\r\n }\r\n },\r\n { selector: 'node[label = \"ab\"]', // 航空戦\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/air-b.png`,\r\n 'width': '48px',\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '1px' // 位置微調整\r\n }\r\n },\r\n { selector: 'node[label = \"ad\"]', // 空襲\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/air-d.png`,\r\n 'width': '44px',\r\n 'height': '25px',\r\n 'background-opacity': 0,\r\n }\r\n },\r\n { selector: 'node[label = \"ac\"]', // 能動分岐\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/calm.png`,\r\n 'border-width': 3, // ボーダーの太さ\r\n 'border-color': '#2c4dff', // #ff3f87\r\n 'width': '27px',\r\n 'height': '27px',\r\n 'background-position-x': '0px',\r\n 'background-position-y': '-1px',\r\n }\r\n },\r\n { selector: 'node[label = \"en\"]', // 通常戦 基本設定\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/enemy.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"su\"]', // 対潜\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/enemy.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"ca\"]', // 気のせい\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/calm.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"wh\"]', // 渦潮\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/whirl.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"re\"]', // 資源\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/resource.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"ni\"]', // 夜戦\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/night.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"sc\"]', // 航空偵察\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/scout.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"un\"]', // 不明\r\n style: {\r\n 'background-image': `../media/nodes/unknown.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"as\"]', // 対潜空襲\r\n style: {\r\n 'background-image': `../media/nodes/airstrike_supported.png`,\r\n 'width': '48px',\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"tl\"]', // 揚陸地点\r\n style: {\r\n 'background-image': `../media/nodes/transport_loadout.png`,\r\n 'width': '48px',\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '12px',\r\n 'background-position-y': '1px'\r\n }\r\n },\r\n { selector: 'edge',\r\n style: {\r\n 'color': 'rgb(250,250,250)',\r\n 'font-weight': '100',\r\n 'text-outline-color': 'rgba(20,20,20)',\r\n 'text-outline-opacity': '.85',\r\n 'text-outline-width': '1.5px',\r\n 'width': '4px',\r\n 'curve-style': 'bezier', // こいつが無いと矢印にならないっぽい\r\n 'target-arrow-shape': 'triangle',\r\n 'content':'data(ratio)',\r\n 'events': 'no'\r\n }\r\n }, // 割合によって色分け\r\n { selector: 'edge[ratio = 100]',\r\n style: {\r\n 'line-color': 'rgb(220,20,60)',\r\n 'target-arrow-color': 'rgb(220,20,60)',\r\n }\r\n },\r\n { selector: 'edge[ratio < 100][ratio >= 80]',\r\n style: {\r\n 'line-color': 'rgb(255,99,71)',\r\n 'target-arrow-color': 'rgb(255,99,71)',\r\n }\r\n },\r\n { selector: 'edge[ratio < 80][ratio >= 60]',\r\n style: {\r\n 'line-color': 'rgb(255,165,0)',\r\n 'target-arrow-color': 'rgb(255,165,0)',\r\n }\r\n },\r\n { selector: 'edge[ratio < 60][ratio >= 40]',\r\n style: {\r\n 'line-color': 'rgb(255,215,0)',\r\n 'target-arrow-color': 'rgb(255,215,0)',\r\n }\r\n },\r\n { selector: 'edge[ratio < 40][ratio >= 20]',\r\n style: {\r\n 'line-color': 'rgb(255,215,0)',\r\n 'target-arrow-color': 'rgb(255,215,0)',\r\n }\r\n },\r\n { selector: 'edge[ratio < 20][ratio > 0]',\r\n style: {\r\n 'line-color': 'rgb(240,230,140)',\r\n 'target-arrow-color': 'rgb(240,230,140)',\r\n }\r\n },\r\n { selector: 'edge[ratio = 0]',\r\n style: {\r\n 'line-color': 'rgb(169,169,169)',\r\n 'content':'' // 0の場合表示なし\r\n }\r\n }\r\n ];\r\n\r\n const layout = {\r\n name:'preset'\r\n };\r\n\r\n // 出力\r\n cy = cytoscape_dist_cytoscape_min_js__WEBPACK_IMPORTED_MODULE_3___default()({\r\n // #cyに生成\r\n container: document.getElementById('cy'),\r\n elements: elements,\r\n style: style,\r\n layout:layout,\r\n autoungrabify: true, // nodeのドラッグ不可\r\n userZoomingEnabled: false\r\n });\r\n // 更新\r\n drew_area = area;\r\n console.log(`drew_area: ${drew_area}`);\r\n let node = null;\r\n cy.on('mouseup', function (e) {\r\n const tar = e.target;\r\n if(tar.data('name')) {\r\n node = tar.data('name');\r\n // ソースコード参照\r\n if(event && event.ctrlKey) {\r\n const url = `${location.origin}/source/?search=${drew_area}-${node}`;\r\n window.open(url);\r\n return;\r\n }\r\n }\r\n });\r\n // 分岐条件表示\r\n cy.on('mousedown', function (e) {\r\n const tar = e.target;\r\n if(tar.data('name')) {\r\n node = tar.data('name');\r\n // Phase\r\n // 2023夏はフェイズごとに記述したが以降は分からない\r\n let b_area = null;\r\n if(active.hasOwnProperty(drew_area)) {\r\n if(active[drew_area].hasOwnProperty('1') && (drew_area.includes('7') || drew_area.includes('57'))) {\r\n b_area = branch_info[`${drew_area}-${active[drew_area]['1']}`];\r\n } else {\r\n b_area = branch_info[drew_area];\r\n }\r\n } else {\r\n b_area = branch_info[drew_area];\r\n }\r\n if(b_area.hasOwnProperty(node)) {\r\n removePopupInfo();\r\n let text = b_area[node];\r\n // 改行、赤字置換\r\n text = text.replaceAll('$e', '
');\r\n text = text.replaceAll('$i', '    ');\r\n text = text.replaceAll('$co', '');\r\n text = text.replaceAll('$oc', '');\r\n text = text.replaceAll('$bo', '');\r\n text = text.replaceAll('$ob', '');\r\n text = text.replaceAll('$sw', ``);\r\n text = text.replaceAll('$or', ``);\r\n text = text.replaceAll('$ro', '');\r\n if(drew_area.includes('58')) {\r\n const blocks = text.split(/\\$bl(.*?)\\$lb/g).filter(Boolean);\r\n const split_area = drew_area.split('-');\r\n const world = Number(split_area[0]);\r\n const map = Number(split_area[1]);\r\n console.log(`world: ${world}`);\r\n console.log(`map: ${map}`);\r\n console.log(`node: ${node}`);\r\n // 先ず1周してtrackを作る\r\n let edge = null;\r\n // 無限ループ防止\r\n const safety = 0;\r\n let count = 0;\r\n while(count < 15) {\r\n edge = branch(world, map, edge, false);\r\n if(edge === null) {\r\n break;\r\n }\r\n if(count === 14) {\r\n alert('無限ループ防止 バグった');\r\n console.log('無限ループ');\r\n console.log('以下諸元');\r\n console.log(`海域: ${world}-${map}`);\r\n console.log('直後艦種');\r\n console.log(com);\r\n console.log('軌跡' + track);\r\n console.log(`safety: ${safety}`);\r\n console.log(`count: ${count}`);\r\n console.log(`ドラム缶: ${f_drum}`);\r\n console.log(`電探: ${f_radar}`);\r\n console.log(`大発系: ${f_craft}`);\r\n console.log(`寒甲: ${f_kanko}`);\r\n console.log(`f_speed: ${f_speed}`);\r\n console.log(rate);\r\n console.log('終わり');\r\n return;\r\n }\r\n count++;\r\n }\r\n let matchNum = branch(world, map, node, true);\r\n if(!matchNum && !isNaN(node)) {\r\n matchNum = branch(world, map, null, true);\r\n }\r\n console.log(`matchNum: ${matchNum}`);\r\n if(blocks[matchNum - 1]) {\r\n blocks[matchNum - 1] = `${blocks[matchNum - 1]}`;\r\n }\r\n text = blocks.join('');\r\n }\r\n text = text.replaceAll('/*', '');\r\n text = text.replaceAll('*/', '');\r\n popup(e, text);\r\n } else {\r\n removePopupInfo();\r\n }\r\n } else {\r\n removePopupInfo();\r\n }\r\n });\r\n // ポップアップ生成\r\n // eventとhtmlを渡す\r\n function popup(e, html) {\r\n // 選択したnodeを分かりやすくしたいがデザインが難しい\r\n // e.target.style.color = '#ff0000';\r\n\r\n // クリックした座標(cy基準)\r\n const position = e.target.renderedPosition();\r\n\r\n // cy領域の左上の座標を取得\r\n const cyContainer = cy.container().getBoundingClientRect();\r\n\r\n // htmlを作成\r\n html = `

${html}

`;\r\n const popup = document.createElement('div');\r\n popup.innerHTML = html;\r\n popup.id = 'popup-info';\r\n\r\n // 表示位置調整\r\n let top, left;\r\n\r\n if (position.x >= 650) {\r\n left = position.x + cyContainer.left - 260;\r\n top = position.y + cyContainer.top + 20;\r\n } else {\r\n left = position.x + cyContainer.left + 20;\r\n top = position.y + cyContainer.top - 10;\r\n }\r\n \r\n const style = popup.style;\r\n style.top = top + 'px';\r\n style.left = left + 'px';\r\n\r\n // 表示\r\n document.body.appendChild(popup);\r\n }\r\n\r\n // 図上で右クリック\r\n cy.contextMenus({\r\n menuItems: [\r\n {\r\n id: 'cy-ct-bg',\r\n content: '索敵無視',\r\n coreAsWell: true,\r\n show: true,\r\n onClickFunction: function () {\r\n if(is_ignore_seek) {\r\n f_seek = fs_copy;\r\n is_ignore_seek = false;\r\n } else {\r\n // 退避\r\n fs_copy = f_seek;\r\n f_seek = [999,999,999,999];\r\n is_ignore_seek = true;\r\n }\r\n reloadImportDisplay();\r\n simController();\r\n }\r\n }\r\n ]\r\n });\r\n // nodeを右クリックで獲得資源予測\r\n cy.on('cxttapstart', 'node', function(e) {\r\n removePopupInfo();\r\n const node = e.target.data('name');\r\n let content = '';\r\n let r_data = {\r\n fuel: null,\r\n max_fuel: 'unknown',\r\n ammo: null,\r\n max_ammo: 'unknown',\r\n steel: null,\r\n max_steel: 'unknown',\r\n imo: null,\r\n max_imo: 'unknown',\r\n is_nomal: true, // ドラム缶*2 + 大発系*3ならtrue(含ボーキのドラム缶*1.5)\r\n memo:'',\r\n };\r\n let c_data = {\r\n fuel: 0,\r\n ammo: 0,\r\n steel: 0,\r\n imo: 0\r\n };\r\n \r\n switch(drew_area) {\r\n case '1-2':\r\n if(node === 'B') {\r\n r_data.ammo = [10, 20];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '1-3':\r\n if(node === 'D') {\r\n r_data.fuel = [10, 20];\r\n } else if(node === 'G') {\r\n r_data.fuel = [10, 30];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '1-4':\r\n if(node === 'C') {\r\n r_data.steel = [10, 20];\r\n } else if(node === 'E') {\r\n r_data.ammo = [10, 20];\r\n } else if(node === 'G') {\r\n r_data.imo = [10, 20];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '1-6':\r\n if(node === 'G') {\r\n r_data.ammo = 20;\r\n r_data.max_ammo = 40;\r\n r_data.is_nomal = false;\r\n mold('ammo', 0 , 5);\r\n } else if(node === 'M') {\r\n r_data.fuel = 40;\r\n r_data.max_fuel = 80;\r\n r_data.is_nomal = false;\r\n mold('fuel', 0, 10);\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '2-1':\r\n if(node === 'B') {\r\n r_data.steel = [10, 30];\r\n } else if(node === 'E') {\r\n r_data.memo = '高速建造材:1';\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '2-2':\r\n if(node === 'A') {\r\n r_data.imo = [10, 20];\r\n } else if(node === 'F') {\r\n r_data.imo = [15, 35];\r\n } else if(node === 'J') {\r\n r_data.memo = '高速建造材:1';\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '2-3':\r\n if(node === 'D') {\r\n r_data.fuel = [15, 45];\r\n } else if(node === 'G') {\r\n r_data.ammo = [15, 45];\r\n } else if(node === 'H') {\r\n r_data.ammo = [35, 40];\r\n } else if(node === 'I') {\r\n r_data.fuel = [15, 45];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '2-4':\r\n if(node === 'A') {\r\n r_data.memo = '高速建造材:1
((上陸用舟艇+特型内火艇)4以上で+2個の確率が発生する?)';\r\n } else if(node === 'D') {\r\n r_data.fuel = [25, 60];\r\n } else if(node === 'G') {\r\n r_data.memo = '開発資材:1';\r\n } else if(node === 'N') {\r\n r_data.ammo = [20, 60];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '2-5':\r\n if(node === 'M') {\r\n r_data.fuel = 70;\r\n r_data.is_nomal = false;\r\n mold('fuel', 0, 0);\r\n } else if(node === 'N') {\r\n r_data.steel = [50, 60];\r\n r_data.is_nomal = false;\r\n mold('steel', 0, 0);\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '3-1':\r\n if(node === 'A') {\r\n r_data.ammo = [35, 140];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '3-2':\r\n if(node === 'B') {\r\n r_data.ammo = [50, 150];\r\n } else if(node === 'I') {\r\n r_data.memo = '家具箱(小):1';\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '3-3':\r\n if(node === 'D') {\r\n r_data.memo = '家具箱(中):1';\r\n } else if(node === 'H') {\r\n r_data.memo = '家具箱(大):1';\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '3-4':\r\n if(node === 'E') {\r\n r_data.imo = [25, 150];\r\n } else if(node === 'K') {\r\n r_data.memo = '家具箱(大):1';\r\n } else if(node === 'O') {\r\n r_data.memo = '家具箱(中):1';\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '3-5':\r\n if(node === 'J') {\r\n r_data.ammo = 50;\r\n r_data.is_nomal = false;\r\n mold('ammo', 10, 0);\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '4-1':\r\n if(node === 'B') {\r\n r_data.fuel = [40, 120];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '4-2':\r\n if(node === 'J') {\r\n r_data.imo = [40, 60];\r\n } else if(node === 'K') {\r\n r_data.steel = [20, 80];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '4-3':\r\n if(node === 'B') {\r\n r_data.fuel = [30, 90];\r\n } else if(node === 'J') {\r\n r_data.imo = [50, 100];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '4-4':\r\n if(node === 'C') {\r\n r_data.fuel = [60, 150];\r\n } else if(node === 'J') {\r\n r_data.steel = [40, 70];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '5-1':\r\n if(node === 'C') {\r\n r_data.steel = [25, 50];\r\n } else if(node === 'H') {\r\n r_data.ammo = [45, 70];\r\n r_data.is_nomal = false;\r\n mold('ammo', 0, 0);\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '5-2':\r\n if(node === 'G') {\r\n r_data.ammo = [20, 50];\r\n } else if(node === 'J') {\r\n r_data.imo = [40, 80];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '5-3':\r\n if(node === 'F') {\r\n r_data.ammo = [60, 80];\r\n } else if(node === 'H') {\r\n r_data.steel = [50, 80];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '5-4':\r\n if(node === 'I') {\r\n r_data.ammo = 60;\r\n r_data.max_ammo = 180;\r\n r_data.is_nomal = false;\r\n mold('ammo', 10, 15);\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '5-5':\r\n if(node === 'E') {\r\n r_data.fuel = 40;\r\n r_data.max_fuel = 180;\r\n r_data.is_nomal = false;\r\n mold('fuel', 15, 10);\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '7-1':\r\n if(node === 'E') {\r\n r_data.fuel = [10, 20];\r\n } else if(node === 'I') {\r\n r_data.fuel = [30, 50];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '7-2':\r\n if(node === 'K') {\r\n r_data.fuel = [25, 40];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '7-3':\r\n if(node === 'H') {\r\n r_data.fuel = [30, 50];\r\n } else if(node === 'O') {\r\n r_data.imo = [40, 50];\r\n r_data.is_nomal = false;\r\n mold('imo', 2, 3);\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '7-4':\r\n if(node === 'O') { // 7-4-Oはだいぶ特殊なのでフルスクラッチ\r\n let fuel = ft_drum * 8 + ft_craft * 7;\r\n fuel += com.BBV * 10 + com.CVL * 7 + com.AV * 6 + com.AS * 5 + com.LHA * 8 + com.AO * 22;\r\n let imo = ft_drum * 6 + ft_craft * 10;\r\n imo += com.BBV * 10 + com.CVL * 7 + com.AV * 6 + com.AS * 5 + com.LHA * 8 + com.AO * 22;\r\n content += `

`;\r\n content += `

base: 40

`;\r\n content += `

max: 200

`;\r\n content += `

add: ${fuel} = ${ft_drum} * 8 + ${ft_craft} * 7

`;\r\n content += `

+ 航空戦艦 ${com.BBV} * 10

`;\r\n content += `

+ 軽空母 ${com.CVL} * 7

`;\r\n content += `

+ 水上機母艦 ${com.AV} * 6

`;\r\n content += `

+ 潜水母艦 ${com.AS} * 5

`;\r\n content += `

+ 揚陸艦 ${com.LHA} * 8

`;\r\n content += `

+ 補給艦 ${com.AO} * 22

`;\r\n content += `

`;\r\n content += `

base: 20

`;\r\n content += `

max: 120

`;\r\n content += `

add: ${imo} = ${ft_drum} * 6 + ${ft_craft} * 10

`;\r\n content += `

+ 航空戦艦 ${com.BBV} * 10

`;\r\n content += `

+ 軽空母 ${com.CVL} * 4

`;\r\n content += `

+ 水上機母艦 ${com.AV} * 5

`;\r\n content += `

+ 潜水母艦 ${com.AS} * 5

`;\r\n content += `

+ 揚陸艦 ${com.LHA} * 7

`;\r\n content += `

+ 補給艦 ${com.AO} * 16

`;\r\n r_data.is_nomal = false;\r\n } else {\r\n return;\r\n }\r\n break;\r\n default:\r\n return;\r\n }\r\n if(r_data.is_nomal) {\r\n if(r_data.fuel) {\r\n mold('fuel', 2, 3);\r\n }\r\n if(r_data.ammo) {\r\n mold('ammo', 2, 3);\r\n }\r\n if(r_data.steel) {\r\n mold('steel', 2, 3);\r\n }\r\n if(r_data.imo) {\r\n mold('imo', 1.5, 2);\r\n }\r\n }\r\n if(r_data.memo) {\r\n content += `

${r_data.memo}

`;\r\n }\r\n popup(e, content);\r\n function mold(name, d_mag, c_mag) {\r\n c_data[name] = Math.trunc(ft_drum * d_mag) + ft_craft * c_mag;\r\n content += `

`;\r\n if(Array.isArray(r_data[name])) {\r\n content += `

base: ${r_data[name][0]} ~ ${r_data[name][1]}

`;\r\n } else {\r\n content += `

base: ${r_data[name]}

`;\r\n }\r\n if(name === 'imo') {\r\n content += `

add: ${c_data[name]} = Math.trunc(${ft_drum} * ${d_mag}) + ${ft_craft} * ${c_mag}

`;\r\n } else {\r\n content += `

add: ${c_data[name]} = ${ft_drum} * ${d_mag} + ${ft_craft} * ${c_mag}

`;\r\n }\r\n content += `

max: ${r_data[`max_${name}`]}

`;\r\n }\r\n });\r\n // 図上スクロールをページスクロールに変換\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#cy').on('wheel', function(e){\r\n e.preventDefault();\r\n e.stopPropagation();\r\n const delta = e.originalEvent.deltaY;\r\n // がくつくけどsmoothにすると連続スクロール時にもたる\r\n window.scrollBy(0, delta);\r\n });\r\n // measureTime(false, 'startSim&drawMap');\r\n console.log('ルート', t_logs);\r\n }\r\n // ※未使用\r\n // 演算と描画が完了したらinfo画面の情報を準備\r\n // 基地は計算しないからこれはこれで半端かも\r\n function preInfo(callback) {\r\n return new Promise((resolve) => {\r\n console.log('preInfo');\r\n // 値の大きい順に並びかえ\r\n t_logs = sortObjectByValues(t_logs);\r\n\r\n // l_mags > mags > mag みたいな感じ\r\n let l_costs = []; // 艦ごとの消費資源\r\n let max_costs = getMaxCosts(); // 各艦の最大消費資源\r\n let l_mags = []; // 何パーセント消費するか\r\n let l_sums = [[0, 0]]; // 消費資源合計\r\n let l_rems = [[100, 100]]; // 残資源割合\r\n let l_uzu_num = []; // 渦潮のindex\r\n if(t_logs.length) {\r\n for(let t_log of t_logs) { // 航路単位\r\n let mags = [];\r\n let rems = [];\r\n let nodes = t_log.split('e');\r\n for(let i;i < nodes.length;i++) { // 戦闘 or 渦潮単位\r\n let node = nodes[i];\r\n let mag = null;\r\n let type = map_info['spots'][drew_area][node][2];\r\n if(type === 'en') {\r\n mag = [20, 20];\r\n } else if(type === 'ni') {\r\n\r\n } else if(type === 'su') {\r\n\r\n } else if(type === 'ad') {\r\n\r\n } else if(type === 'ab') {\r\n\r\n } else if(type === 'wh') {\r\n uzu_num.push(i);\r\n } else {\r\n continue;\r\n }\r\n let rem = rems.at(-1);\r\n rems.push([[rem[0] - mag[0]], [rem[1] - mag[1]]]);\r\n mags.push(mag);\r\n }\r\n l_mags.push(mags);\r\n l_rems.push(rems);\r\n for(let mag of mags) {\r\n let costs = [];\r\n for(let q;q < max_costs.length;q++) {\r\n let max_cost = max_costs[q];\r\n if(f_lvs[q] > 99) {\r\n let fuel = Math.floor(max_cost[0] * 0.85) * mag[0];\r\n let ammo = Math.floor(max_cost[1] * 0.85) * mag[1];\r\n costs.push([fuel, ammo]);\r\n } else {\r\n let fuel = max_cost[0] * mag[0];\r\n let ammo = max_cost[1] * mag[1];\r\n costs.push([fuel, ammo]);\r\n }\r\n }\r\n l_costs.push(costs);\r\n }\r\n }\r\n for(let i;i < l_costs.length;i++) {\r\n let costs = l_costs[i];\r\n }\r\n }\r\n resolve();\r\n });\r\n }\r\n // 区間計測デバッグ用\r\n // is_start・・・開始ならtrue終了ならfalse\r\n function measureTime(is_start, text) {\r\n if(!text) text = '';\r\n if (is_start) {\r\n console.log('計測開始');\r\n s_time = performance.now(); // 開始時の時間を取得\r\n } else {\r\n console.log('計測終了');\r\n const seconds = performance.now() - s_time;\r\n console.log(`${text}: ${seconds}ms`);\r\n }\r\n }\r\n // popup-infoが存在すれば削除\r\n function removePopupInfo() {\r\n if(jquery__WEBPACK_IMPORTED_MODULE_0___default()('#popup-info')) {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#popup-info').remove();\r\n }\r\n }\r\n \r\n // 読み込み時にlocalstorageから諸々の設定を読込、反映\r\n // 上に置くとtrigger()が不発する 謎\r\n setup();\r\n function setup() {\r\n let a = localStorage.getItem('active');\r\n let s = localStorage.getItem('selected_type');\r\n let f = localStorage.getItem('fleet');\r\n // 能動分岐セット\r\n if(!a) {\r\n a = active;\r\n localStorage.setItem('active', JSON.stringify(a));\r\n } else {\r\n try {\r\n a = JSON.parse(a);\r\n // 全てのキーが存在するかチェック\r\n // 無いのがあればそこだけ初期値を設定\r\n for (const key in active) {\r\n if (!a.hasOwnProperty(key)) {\r\n a[key] = active[key];\r\n }\r\n }\r\n localStorage.setItem('active', JSON.stringify(a));\r\n } catch(e) {\r\n alert('データ異常:当該データを初期化します');\r\n a = active;\r\n localStorage.setItem('active', JSON.stringify(a));\r\n }\r\n }\r\n // html反映\r\n for(const key in a) {\r\n for(const key2 in a[key]) {\r\n const val = a[key][key2];\r\n const name = key + '-' + key2;\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('input[name=\"' + name + '\"][value=\"' + val + '\"]').prop('checked', true);\r\n active = a;\r\n }\r\n }\r\n // html反映\r\n const ar = localStorage.getItem('area');\r\n if(ar) {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#area-display').text(`海域: ${ar}`);\r\n setArea(ar);\r\n }\r\n if(s) {\r\n selected_type = Number(s);\r\n }\r\n // 艦隊セット\r\n // urlパラメータからの読み込みならlocalstorageに入れてパラメータなしでリロード\r\n // 入力チェックはsetFleetInfoあたりでやる\r\n let deck = getParam('predeck');\r\n if(deck) {\r\n deck = decodeURIComponent(deck);\r\n localStorage.setItem('fleet', deck);\r\n location.href = location.origin + location.pathname;\r\n } else if(f) {\r\n // 艦隊は文字列のまま貼る\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').val(f);\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').trigger('input');\r\n }\r\n }\r\n // URLから任意のパラメータを取得\r\n function getParam(name, url) {\r\n if (!url) {\r\n url = window.location.href;\r\n }\r\n name = name.replace(/[\\[\\]]/g, '\\\\$&');\r\n const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),\r\n results = regex.exec(url);\r\n if (!results) {\r\n return null;\r\n }\r\n if (!results[2]) {\r\n return '';\r\n }\r\n return decodeURIComponent(results[2].replace(/\\+/g, ' '));\r\n }\r\n\r\n /*\r\n key:海域\r\n char:node\r\n value:値\r\n 変数、ストレージ双方更新\r\n */\r\n function updateActive(key, char, value) {\r\n let elem = localStorage.getItem('active');\r\n if(elem) {\r\n elem = JSON.parse(elem);\r\n elem[key][char] = value;\r\n } else {\r\n elem = active;\r\n elem[key][char] = value;\r\n }\r\n active = elem;\r\n localStorage.setItem('active', JSON.stringify(elem));\r\n }\r\n // localStorage内を全削除\r\n function allClear() {\r\n const res = confirm('本当に?\\n特に問題はありませんが');\r\n if(res) {\r\n // ローカルストレージ全削除\r\n localStorage.clear();\r\n // リロード\r\n location.reload();\r\n }\r\n }\r\n // popupから能動分岐切り替え\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').on('click', '.remote-active', function() {\r\n const name = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val();\r\n const inputs = jquery__WEBPACK_IMPORTED_MODULE_0___default()(`input[name=\"${name}\"]`);\r\n if(inputs.eq(0).prop('checked')) {\r\n inputs.eq(1).prop('checked', true);\r\n inputs.eq(1).trigger('input');\r\n } else {\r\n inputs.eq(0).prop('checked', true);\r\n inputs.eq(0).trigger('input');\r\n }\r\n });\r\n // 海域入力画面表示\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#area-display').on('click', function() {\r\n document.getElementById('mask').style.display = 'block';\r\n document.getElementById('area-container').style.display = 'flex';\r\n document.getElementById('area-box').style.display = 'block';\r\n });\r\n // 海域選択画面非表示\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#area-container').on('click', function() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#mask').css('display', 'none');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#area-container').css('display', 'none');\r\n });\r\n // 設定画面表示\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#conf-icon-box').on('click', function() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#mask').css('display', 'block');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#conf-container').css('display', 'flex');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#conf-box').css('display', 'block');\r\n });\r\n // 設定画面非表示\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#conf-container').on('click', function() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#mask').css('display', 'none');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#conf-container').css('display', 'none');\r\n });\r\n // バブリング阻止\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#area-box, #conf-box').on('click', function(e) {\r\n e.stopPropagation();\r\n });\r\n // localstorage全削除\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#all-clear').on('click', function() {\r\n allClear();\r\n });\r\n // オプションリスト折り畳み/展開\r\n document.getElementById('fold').addEventListener('click', function() {\r\n const optionUp = this.querySelector('#option-up');\r\n const optionDown = this.querySelector('#option-down');\r\n const listContainer = document.querySelectorAll('#option-box > .options');\r\n\r\n if (optionUp.style.display === 'none') {\r\n optionUp.style.display = 'block';\r\n optionDown.style.display = 'none';\r\n listContainer.forEach(function(item) {\r\n item.style.height = '';\r\n });\r\n } else {\r\n optionUp.style.display = 'none';\r\n optionDown.style.display = 'block';\r\n listContainer.forEach(function(item) {\r\n item.style.height = '22px';\r\n });\r\n }\r\n });\r\n\r\n // infomation ※未実装\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#infomation').on('click', function() {\r\n\r\n });\r\n // 連想配列を値の大きい順にソート\r\n function sortObjectByValues(obj) {\r\n if(obj.length > 1) {\r\n // オブジェクトをキーと値のペアを持つ配列に変換\r\n const entries = Object.entries(obj);\r\n // 配列を値の大きい順にソート\r\n const sortedEntries = entries.sort((a, b) => b[1] - a[1]);\r\n // ソートされた配列から新しいオブジェクトを再構築\r\n const sortedObject = Object.fromEntries(sortedEntries);\r\n return sortedObject;\r\n } else {\r\n return obj;\r\n }\r\n }\r\n // 艦の最大資源消費量を配列で返す\r\n function getMaxCosts() {\r\n let res = [];\r\n for(const s_id of f_ids) { // 艦\r\n const max_fuel = s_data.find(entry => entry.id === s_id).fuel;\r\n const max_ammo = s_data.find(entry => entry.id === s_id).ammo;\r\n res.push([max_fuel, max_ammo]);\r\n }\r\n return res;\r\n }\r\n // スクショ\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#screen-shot').on('click', function() {\r\n if(drew_area) {\r\n const now = new Date();\r\n let hours = now.getHours();\r\n let minutes = now.getMinutes();\r\n // 二桁の形式に変換\r\n hours = hours < 10 ? '0' + hours : hours;\r\n minutes = minutes < 10 ? '0' + minutes : minutes;\r\n const time = `${hours}${minutes}`;\r\n const fileName = `${drew_area}_${time}`;\r\n const deck = generateDeck();\r\n // gkcoi出力\r\n const g_speed = getFleetSpeedWithNum(f_speed);\r\n console.log('gkcoiへの引数');\r\n console.log('deck', deck);\r\n console.log(`g_speed: ${g_speed}`);\r\n console.log(`f_seek: ${f_seek}`);\r\n (0,gkcoi__WEBPACK_IMPORTED_MODULE_5__.generate)(deck, g_speed, f_seek).then((canvas) => {\r\n const g_blob = getGkcoiBlob(canvas);\r\n const cy_blob = getCyBlob();\r\n combineAndDownloadBlobs(cy_blob, g_blob, fileName);\r\n }).catch((error) => {\r\n console.error(error);\r\n alert('スクショ失敗: 未対応の艦が含まれるかも?');\r\n });\r\n }\r\n });\r\n // gkcoiに渡すデッキビルダー生成\r\n function generateDeck() {\r\n const res = {\r\n lang: 'jp',\r\n theme: 'dark',\r\n hqlv: i_json.hqlv\r\n };\r\n if(selected_type < 5) {\r\n desF(selected_type);\r\n } else {\r\n desF(1);\r\n desF(2);\r\n }\r\n function desF(num) {\r\n let n = 1; // deckに設定するf\r\n if(num === 2) {\r\n n = 2;\r\n }\r\n let s_length = f_length - f2_length;\r\n let f = {};\r\n for(let i = 0;i < s_length;i++) {\r\n const s_id = i_json[`f${num}`][`s${i + 1}`]['id'];\r\n const i_ship = i_json[`f${num}`][`s${i + 1}`];\r\n const s_ship = s_data.find((item) => item.id === s_id);\r\n const hp = s_ship.hp;\r\n const lv = i_ship.lv;\r\n const asw = getLFparam(s_ship, lv, 'ass');\r\n const los = getLFparam(s_ship, lv, 'seek');\r\n const luck = i_ship.luck;\r\n // 表示されないのは指定しない\r\n let ship = {\r\n id: s_id,\r\n lv: lv,\r\n hp: hp,\r\n fp: 0,\r\n tp: 0,\r\n aa: 0,\r\n ar: 0,\r\n asw: asw,\r\n ev: 0,\r\n los: los,\r\n luck: luck\r\n };\r\n let items = {};\r\n let j = 1;\r\n for(const key in i_ship.items) {\r\n let name = `i${j}`;\r\n if(key === 'ix') {\r\n name = 'ix';\r\n }\r\n items[name] = {\r\n id: i_ship.items[key].id,\r\n rf: i_ship.items[key].rf,\r\n mas: 7\r\n }\r\n j++;\r\n }\r\n ship.items = items;\r\n f[`s${i + 1}`] = ship;\r\n }\r\n res[`f${n}`] = f;\r\n }\r\n return res;\r\n }\r\n // 一次関数的に上昇するパラメータを計算して返す\r\n // 引数s_dataのjson,パラメータ名\r\n function getLFparam(ship, lv, param) {\r\n const max = ship[`max_${param}`];\r\n const min = ship[param];\r\n const res = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](max).minus(min).times(lv).div(99).floor().plus(min);\r\n return parseInt(res);\r\n }\r\n // cytoscapeのblob取得\r\n function getCyBlob() {\r\n return cy.jpg({\r\n maxWidth:1293,\r\n quality:1,\r\n output: 'blob',\r\n full: true,\r\n bg:'#212121'\r\n });\r\n }\r\n // Canvasをblobで取得\r\n function getGkcoiBlob(canvas) {\r\n // CanvasからBase64形式の画像データを取得\r\n const dataUrl = canvas.toDataURL('image/jpeg');\r\n // Base64形式のデータからBlobオブジェクトを作成\r\n return dataURItoBlob(dataUrl);\r\n }\r\n // Data URIをBlobオブジェクトに変換\r\n function dataURItoBlob(dataURI) {\r\n const byteString = atob(dataURI.split(',')[1]);\r\n const ab = new ArrayBuffer(byteString.length);\r\n const ia = new Uint8Array(ab);\r\n for (let i = 0; i < byteString.length; i++) {\r\n ia[i] = byteString.charCodeAt(i);\r\n }\r\n return new Blob([ab], { type: 'image/jpeg' });\r\n }\r\n // blobから画像を生成して上限に連結(img1が上)幅はimg1に合わせる\r\n function combineAndDownloadBlobs(blob1, blob2, fileName) {\r\n const canvas = document.createElement('canvas');\r\n const context = canvas.getContext('2d');\r\n // 入力Blobの高さを取得\r\n let b1_height, b2_height;\r\n // BlobのためのImage要素を作成\r\n const img1 = new Image();\r\n const img2 = new Image();\r\n // 1つ目の画像の読み込みが完了したときの処理\r\n img1.onload = function() {\r\n b1_height = img1.height;\r\n // 2つ目の画像の読み込みが完了したときの処理\r\n img2.onload = function() {\r\n b2_height = img2.height;\r\n // 2つの画像の幅を比較し、大きい方に合わせる\r\n const max_width = Math.max(img1.width, img2.width);\r\n canvas.width = max_width;\r\n canvas.height = b1_height + b2_height;\r\n // 画像を描画\r\n context.drawImage(img1, 0, 0, max_width, b1_height);\r\n context.drawImage(img2, 0, b1_height, max_width, b2_height);\r\n const combinedImage = canvas.toDataURL(); // 画像をDataURLに変換\r\n const a = document.createElement('a');\r\n a.href = combinedImage;\r\n a.download = `${fileName}.jpg`;\r\n document.body.appendChild(a);\r\n a.click();\r\n document.body.removeChild(a);\r\n // BlobのURLを解放\r\n URL.revokeObjectURL(img1.src);\r\n URL.revokeObjectURL(img2.src);\r\n };\r\n // 2つ目の画像を読み込む\r\n img2.src = URL.createObjectURL(blob2);\r\n };\r\n // 1つ目の画像を読み込む\r\n img1.src = URL.createObjectURL(blob1);\r\n }\r\n // 数値から艦隊速度を文字列で取得\r\n function getFleetSpeedWithNum(text) {\r\n let res = 0;\r\n switch(text) {\r\n case '低速艦隊':\r\n res = 5;\r\n break;\r\n case '高速艦隊':\r\n res = 10;\r\n break;\r\n case '高速+艦隊':\r\n res = 15\r\n break;\r\n case '最速艦隊':\r\n res = 20;\r\n break;\r\n }\r\n return res;\r\n }\r\n // ※デバッグ用\r\n // 海域とNodeを指定して現在の編成での返り値を出力\r\n window.branch = branch;\r\n // キーボードショートカット\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).keydown(function(e) {\r\n switch(e.keyCode) {\r\n case 65:\r\n bruteForceTest();\r\n }\r\n });\r\n});\r\n\n\n//# sourceURL=webpack://compass/./src/js/main.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var jquery_ui_ui_widgets_draggable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery-ui/ui/widgets/draggable */ \"./node_modules/jquery-ui/ui/widgets/draggable.js\");\n/* harmony import */ var jquery_ui_ui_widgets_draggable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery_ui_ui_widgets_draggable__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! decimal.js */ \"./node_modules/decimal.js/decimal.mjs\");\n/* harmony import */ var cytoscape_dist_cytoscape_min_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! cytoscape/dist/cytoscape.min.js */ \"./node_modules/cytoscape/dist/cytoscape.min.js\");\n/* harmony import */ var cytoscape_dist_cytoscape_min_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(cytoscape_dist_cytoscape_min_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var cytoscape_context_menus__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! cytoscape-context-menus */ \"./node_modules/cytoscape-context-menus/cytoscape-context-menus.js\");\n/* harmony import */ var cytoscape_context_menus__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(cytoscape_context_menus__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var gkcoi__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! gkcoi */ \"./node_modules/gkcoi/esm/index.js\");\n/*\r\n 更新手続き\r\n\r\n イベなど新海域\r\n 1.関数\r\n branch\r\n countUnits・・・搭載艦数で何か新しく数えたいのがあれば\r\n 他分岐条件に必要なもの\r\n 2.変数\r\n areas\r\n op_areas・・・何かしらオプションがあれば\r\n active\r\n 1が攻略段階\r\n 2が難易度 飽くまで慣例\r\n 3.データ\r\n data/map.js\r\n data/branch.js\r\n 4.表示系\r\n index.html\r\n #area-inner・・・海域\r\n #option-box・・・オプション\r\n\r\n このへん追加すれば動くはず、たぶん\r\n\r\n 新艦・新装備\r\n data/ship.js\r\n data/item.js\r\n*/\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\ncytoscape_dist_cytoscape_min_js__WEBPACK_IMPORTED_MODULE_3___default().use((cytoscape_context_menus__WEBPACK_IMPORTED_MODULE_4___default()));\r\n\r\njquery__WEBPACK_IMPORTED_MODULE_0___default()(function() {\r\n /*\r\n s_dataはship.js\r\n e_dataはitem.js\r\n map_infoはmap.jsより\r\n\r\n 制空シミュを基準にしたときの本家デッキビルダー差異・注意点\r\n 艦ID'のみ'文字列\r\n 改修値が0のとき、キーがそもそもない\r\n */\r\n // 艦隊諸元\r\n let com = {\r\n BB:0, // 戦艦\r\n BBV:0, // 航空戦艦&改装航空戦艦\r\n CV:0, // 正規空母\r\n CVB:0, // 装甲空母\r\n CVL:0, // 軽空母\r\n CA:0, // 重巡\r\n CAV:0, // 航巡\r\n CL:0, // 軽巡\r\n CLT:0, // 雷巡\r\n ATU:0, // 練習特務艦 欠番\r\n CT:0, // 練習巡洋艦\r\n DD:0, // 駆逐艦\r\n DE:0, // 海防艦\r\n SS:0, // 潜水艦\r\n SSV:0, // 潜水空母\r\n AV:0, // 水母\r\n AO:0, // 補給艦\r\n ASU:0, // 特務艦 欠番\r\n LHT:0, // 灯台補給船 欠番\r\n CVE:0, // 特設護衛空母 欠番\r\n LHA:0, // 揚陸艦\r\n LST:0, // 戦車揚陸艦 欠番\r\n AS:0, // 潜水母艦\r\n AR:0 // 工作艦\r\n };\r\n let i_json = null; // インポートしたjsonを格納\r\n // 艦隊諸元 分岐演算に使う\r\n let f_length = 0; // 構成艦数\r\n let f_ids = null;\r\n let f_names = null; // 構成艦艦名\r\n let f2_names = null; // 随伴艦隊構成艦名 表示の為だけ\r\n let f2_length = 0;\r\n let f_speed = null; // 速度\r\n let f_seek = null; // 索敵値\r\n // ドラム缶、大発系、電探搭載艦数\r\n let f_drum = 0;\r\n let f_radar = 0;\r\n let f_craft = 0;\r\n let f_kanko = 0;\r\n /*\r\n 読込モード\r\n 1:第一艦隊\r\n 2:第二艦隊\r\n 3:第三艦隊\r\n 4:第四艦隊\r\n 5:水上打撃部隊\r\n 6:空母機動部隊\r\n 7:輸送護衛部隊\r\n 判定も少しはするけど殆ど自己申告\r\n */\r\n let f_type = null;\r\n\r\n // 資源マス計算に使う(分岐判定には使わない)装備の累計\r\n let ft_drum = 0;\r\n let ft_craft = 0;\r\n\r\n // 消費資源計算に使う\r\n let f_lvs = [];\r\n\r\n // 読込時にあれこれしたやつを艦隊単位で入れる\r\n // あとで実際に反映する艦隊を艦隊番号を指定してfシリーズに移す\r\n let c_lengths = [];\r\n let c_ids = [];\r\n let c_names = [];\r\n let c_types = [];\r\n let c_seeks = [];\r\n let c_speeds = [];\r\n let c_drums = [];\r\n let c_radars = [];\r\n let c_crafts = [];\r\n let c_kanko = [];\r\n\r\n // 資源マス計算に使う(分岐判定には使わない)装備の累計\r\n /*\r\n 大発動艇\r\n 大発動艇(八九式中戦車&陸戦隊)\r\n 特に式内火艇\r\n 特大発動艇\r\n 装甲艇(AB艇)\r\n 武装大発\r\n 大発動艇(II号戦車/北アフリカ仕様)\r\n 特大発動艇+一式砲戦車\r\n 特四式内火艇\r\n 特四式内火艇改\r\n */\r\n const valid_crafts = [68,166,167,193,408,409,436,449,525,526];\r\n let ct_drums = [];\r\n let ct_crafts = [];\r\n\r\n // 消費資源計算に使う\r\n let c_lvs = [];\r\n\r\n /*\r\n 艦隊種別選択したやつ(数値)が入る\r\n 1:第一艦隊\r\n 2:第二艦隊\r\n 3:第三艦隊\r\n 4:第四艦隊\r\n 5:空母機動部隊\r\n 6:水上打撃部隊\r\n 7:輸送護衛部隊\r\n */\r\n let selected_type = null;\r\n\r\n // 受け付ける海域\r\n const areas = ['1-1','1-2','1-3','1-4','1-5','1-6','2-1','2-2','2-3','2-4','2-5','3-1','3-2','3-3','3-4','3-5','4-1','4-2','4-3','4-4','4-5','5-1','5-2','5-3','5-4','5-5','6-1','6-2','6-3','6-4','6-5','7-1','7-2','7-3','7-3-1','7-4','7-5','57-7','58-1','58-2','58-3','58-4','59-1','59-2','59-3','59-4','59-5'];\r\n // optionがある海域\r\n const op_areas = ['4-5','5-3','5-5','6-3','7-3','7-4','7-5','57-7','58-1','58-2','58-3','58-4','59-1','59-2','59-3','59-4','59-5'];\r\n\r\n // 1がキーの値はPhase\r\n let active = {'4-5':{'A':'D','C':'F','I':'J'},'5-3':{'O':'K'}, '5-5':{'F':'D'}, '6-3':{'A':'B'},'7-3':{'1':'0'},'7-4':{'F':'H'},'7-5':{'F':'G','H':'I','O':'P'}, '57-7':{'1':'1','A2':'A3','B':'B1','B2':'B3','C':'A3','J':'K'},'58-1':{'1':'1','A':'D','I':'N1','F':'G'},'58-2':{'1':'1','2':'1','B':'E'},'58-3':{'1':'1','2':'1','M':'P'},'58-4':{'1':'1','2':'1','B':'D'},'59-1':{'1':'1','C':'C1','E':'F'},'59-2':{'L':'M','N':'O','P':'Q'},'59-3':{'1':'1','C':'C1'},'59-4':{'1':'1','A2':'B','D':'E'},'59-5':{'1':'1','G':'H','O2':'P','W':'Z'}};\r\n\r\n let area = null; // 入力で切り替えるの\r\n let drew_area = null; // 表示中の海域\r\n\r\n // 演算開始の為のフラグ\r\n let a_flag = false;\r\n let f_flag = false;\r\n\r\n let rate = {}; // これにルート情報を詰め込んでいく\r\n let track = []; // 最後の軌跡\r\n let t_logs = {}; // trackを1周ごとに格納\r\n\r\n let cy = null;\r\n\r\n // 索敵無視フラグと退避用変数\r\n let is_ignore_seek = false;\r\n let fs_copy = null;\r\n\r\n let s_time = 0; // 区間計測用\r\n \r\n const isDev = location.hostname !== 'x-20a.github.io'; // 開発環境であるか\r\n \r\n const cdn = 'https://cdn.jsdelivr.net/gh/X-20A/X-20A.github.io@main';\r\n\r\n // 海域が入力されたら適正かチェックしてフラグ切替\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.areas').on('click', function() {\r\n setArea(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val());\r\n });\r\n // 海域入力で発火 オプション表示したり\r\n function setArea(text) {\r\n console.log(`area: ${text}`);\r\n if(areas.includes(text)) {\r\n a_flag = true;\r\n localStorage.setItem('area', text);\r\n if(op_areas.includes(text)) {\r\n // オプションが必要な海域は入力を表示\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#option-box').css('display','block');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#option-box .options').each(function () {\r\n const child = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);\r\n if (child.attr('id') === text) {\r\n child.css('display', 'block');\r\n } else {\r\n // 子要素が存在しない場合はdisplayをnoneに設定\r\n child.css('display', 'none');\r\n }\r\n });\r\n } else {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#option-box').css('display','none');\r\n }\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#area-container').click();\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#area-display').text(`海域: ${text}`);\r\n } else {\r\n a_flag = false;\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#option-box').css('display','none');\r\n }\r\n simController();\r\n }\r\n // オプションドラッグ\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#draggable-list').draggable({ containment: 'window', scroll: false });\r\n // オプションが変更されたら取得してlocalstorageへ保存\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.option-value').on('input', function() {\r\n const name = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('name');\r\n const namePattern = /^([\\dA-Z]+-[\\dA-Z]+)-([\\dA-Z]+)$/i;\r\n const match = name.match(namePattern);\r\n const key = match[1];\r\n const char = match[2];\r\n const value = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val();\r\n if(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('type') === 'radio') {\r\n updateActive(key, char, value);\r\n }\r\n simController();\r\n });\r\n // デッキビルダー読み込み\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').on('input', function() {\r\n const text = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val();\r\n try {\r\n i_json = JSON.parse(text);\r\n } catch(e) {\r\n console.log(e);\r\n f_flag = false;\r\n alert('処理中断: 形式不正');\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).blur();\r\n return;\r\n }\r\n /*\r\n 処理の流れ\r\n 1.貼り付けられた時点で第四艦隊まで読み込んで計算まで済ます\r\n 2.一艦隊しか情報が無ければそのまま演算開始\r\n 3.key:tに値があればその形式で演算開始\r\n 4.それ以外は艦隊形式の選択を待つ\r\n */\r\n // cシリーズ初期化\r\n inCs();\r\n // 1\r\n let zeroCount = 0;\r\n let tar = null;\r\n for(let i = 1;i < 5;i++) {\r\n const count = countShips(i);\r\n c_lengths.push(count);\r\n if(count === 0) {\r\n zeroCount++;\r\n } else {\r\n tar = i;\r\n }\r\n if(count) {\r\n c_ids.push(getIdsFromFleet(i));\r\n c_lvs.push(getLvs(i))\r\n c_names.push(getShipName(i));\r\n c_types.push(getType(i));\r\n try {\r\n c_seeks.push(calcSeek(i));\r\n } catch(e) {\r\n console.error(e);\r\n alert('処理中断:未対応の艦、装備が含まれるかも?');\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).blur();\r\n return;\r\n }\r\n c_speeds.push(calcSpeed(i));\r\n countUnits(i, false);\r\n countUnits(i, true);\r\n } else {\r\n // 第一・第二艦隊が空で第三艦隊だけあるみたいな場合\r\n // 空を入れてやる\r\n c_ids.push([]);\r\n c_lvs.push([]);\r\n c_names.push([]);\r\n c_types.push([]);\r\n c_seeks.push([]);\r\n c_speeds.push([]);\r\n c_drums.push(0);\r\n c_radars.push(0);\r\n c_crafts.push(0);\r\n c_kanko.push(0);\r\n\r\n ct_drums.push(0);\r\n ct_crafts.push(0);\r\n }\r\n }\r\n console.log(`c_lengths: ${c_lengths}`);\r\n console.log(`c_ids: ${c_ids}`);\r\n console.log(`c_lvs: ${c_lvs}`);\r\n console.log(`c_searchs: ${c_seeks}`);\r\n console.log(`c_speeds: ${c_speeds}`);\r\n console.log(`c_drums: ${c_drums}, c_radars: ${c_radars}, c_crafts: ${c_crafts}, c_kanko: ${c_kanko}`);\r\n if(zeroCount === 3) {\r\n // 2.情報の有る艦隊が一つだけの場合はそのまま読み込み\r\n setFleetInfo(tar);\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#type-select').css('display', 'none');\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).blur();\r\n return;\r\n } else if(zeroCount === 4) {\r\n alert('処理中断: 艦隊が空かも?');\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).blur();\r\n return;\r\n }\r\n // 3\r\n let t = null;\r\n if(i_json['f1']['t']) {\r\n t = Number(i_json['f1']['t']);\r\n switch(t) {\r\n case 1:\r\n selected_type = 5;\r\n break;\r\n case 2:\r\n selected_type = 6;\r\n break;\r\n case 3:\r\n selected_type = 7;\r\n break;\r\n }\r\n }\r\n console.log(`制空シミュからの艦隊種別指定: ${t}`);\r\n let view = '艦隊種別';\r\n console.log(`設定艦隊種別: ${selected_type}`);\r\n if(selected_type) {\r\n if(selected_type > 4) {\r\n if(c_lengths[0] && c_lengths[1]) { // 第一と第二に少なくとも1艦\r\n switch(selected_type) {\r\n case 5:\r\n view = '空母機動部隊';\r\n break;\r\n case 6:\r\n view = '水上打撃部隊';\r\n break;\r\n case 7:\r\n view = '輸送護衛部隊';\r\n break;\r\n }\r\n } else {\r\n alert('第一艦隊もしくは第二艦隊が空?');\r\n setBackSelect();\r\n }\r\n } else {\r\n switch(selected_type) {\r\n case 1:\r\n view = '第一艦隊';\r\n break;\r\n case 2:\r\n view = '第二艦隊';\r\n break;\r\n case 3:\r\n view = '第三艦隊';\r\n break;\r\n case 4:\r\n view = '第四艦隊';\r\n break;\r\n }\r\n }\r\n setFleetInfo(selected_type);\r\n }\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#type-select').css('display', 'block');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#type-select').text(view);\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).blur();\r\n });\r\n // 艦隊種別選択表示\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#type-select').on('mouseover', function() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-option-box').css('display', 'block');\r\n });\r\n // 艦隊種別選択非表示\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-option-box').on('mouseleave', function() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-option-box').css('display', 'none');\r\n });\r\n // 艦隊形式が選択されたら該当する計算データを変数反映して演算開始\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.fleet-type').on('click', function() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#type-select').text(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).text());\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-option-box').css('display', 'none');\r\n const type = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('type');\r\n setFleetInfo(type);\r\n });\r\n // セレクトの値を一つ前に戻す\r\n // 読込がまずったときに\r\n function setBackSelect() {\r\n console.log('setBackSelect');\r\n const options = jquery__WEBPACK_IMPORTED_MODULE_0___default()('.fleet-type');\r\n if(selected_type) {\r\n for (const option of options) {\r\n if(option.dataset.type === selected_type + '') { // 文字列化してから比較\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#type-select').text(option.textContent);\r\n }\r\n }\r\n } else {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#type-select').text('艦隊種別');\r\n localStorage.removeItem('selected_type');\r\n }\r\n }\r\n // 計算結果から抜き出して変数セット\r\n // 引数:艦隊種別\r\n function setFleetInfo(f) {\r\n f--; // 配列指定の為\r\n // 初期化してから\r\n for (const key in com) {\r\n com[key] = 0;\r\n }\r\n try {\r\n if(f < 4) {\r\n // 通常艦隊\r\n f_length = c_lengths[f];\r\n console.log(`f_length: ${f_length}`);\r\n if(!f_length) {\r\n alert('処理中断: 艦隊が空かも?');\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').blur();\r\n setBackSelect();\r\n return;\r\n }\r\n // 構成艦のid\r\n f_ids = c_ids[f];\r\n console.log(`f_ids: ${f_ids}`);\r\n // 構成艦のlv\r\n f_lvs = c_lvs[f];\r\n console.log(`f_lvs: ${f_lvs}`);\r\n // 構成艦の名前\r\n f_names = c_names[f];\r\n console.log(`f_names: ${f_names}`);\r\n const types = c_types[f];\r\n console.log(`types: ${types}`);\r\n // 変数反映\r\n reflectionCom(types);\r\n // 索敵値\r\n f_seek = c_seeks[f];\r\n console.log(`f_search: ${f_seek}`);\r\n // 速度\r\n f_speed = c_speeds[f];\r\n console.log(`f_speed: ${f_speed}`);\r\n // ドラム缶、大発、電探搭載艦数カウント 変数にセット\r\n f_drum = c_drums[f];\r\n f_radar = c_radars[f];\r\n f_craft = c_crafts[f];\r\n f_kanko = c_kanko[f];\r\n console.log('搭載艦数');\r\n console.log(`ドラム缶: ${f_drum}`);\r\n console.log(`電探: ${f_radar}`);\r\n console.log(`大発系: ${f_craft}`);\r\n console.log(`寒甲: ${f_kanko}`);\r\n\r\n ft_drum = ct_drums[f];\r\n ft_craft = ct_crafts[f];\r\n console.log(`ドラム缶累計: ${ft_drum}`);\r\n console.log(`大発系累計: ${ft_craft}`);\r\n if(f_length === 7) {\r\n f_type = '遊撃部隊';\r\n } else {\r\n f_type = '通常艦隊';\r\n }\r\n console.log(`f_type: ${f_type}`);\r\n } else {\r\n // 連合艦隊\r\n // 第一艦隊と第二艦隊を足したり\r\n f_length = c_lengths[0] + c_lengths[1];\r\n f2_length = c_lengths[1];\r\n console.log(`f_length: ${f_length}`);\r\n if(!c_lengths[0] || !c_lengths[1]) {\r\n alert('処理中断: 艦隊が空かも?');\r\n setBackSelect();\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').blur();\r\n return;\r\n }\r\n // 構成艦のid\r\n f_ids = c_ids[0].concat(c_ids[1]);\r\n console.log(`f_ids: ${f_ids}`);\r\n f_lvs = c_lvs[0].concat(c_lvs[1]);\r\n // 構成艦のlv\r\n console.log(`f_lvs: ${f_lvs}`);\r\n // 構成艦の名前\r\n f_names = c_names[0].concat(c_names[1]);\r\n f2_names = c_names[1];\r\n console.log(`f_names: ${f_names}`);\r\n const types = c_types[0].concat(c_types[1]);\r\n console.log(`types: ${types}`);\r\n // 変数反映\r\n reflectionCom(types);\r\n // 索敵値 各項足し合わせ\r\n f_seek = [];\r\n for (let i = 0; i < 4; i++) {\r\n f_seek.push(new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](c_seeks[0][i]).plus(new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](c_seeks[1][i])));\r\n }\r\n console.log(`f_search: ${f_seek}`);\r\n // 速度\r\n // 低い方から適用\r\n if(c_speeds[0] === '低速艦隊' || c_speeds[1] === '低速艦隊') {\r\n f_speed = '低速艦隊';\r\n } else if(c_speeds[0] === '高速艦隊' || c_speeds[1] === '高速艦隊') {\r\n f_speed = '高速艦隊';\r\n } else if(c_speeds[0] === '高速+艦隊' || c_speeds[1] === '高速+艦隊') {\r\n f_speed = '高速+艦隊';\r\n } else {\r\n f_speed = '最速艦隊';\r\n }\r\n console.log(`f_speed: ${f_speed}`);\r\n // ドラム缶、大発、電探搭載艦数カウント 変数にセット\r\n f_drum = c_drums[0] + c_drums[1];\r\n f_radar = c_radars[0] + c_radars[1];\r\n f_craft = c_crafts[0] + c_crafts[1];\r\n f_kanko = c_kanko[0] + c_kanko[1];\r\n console.log(`ドラム缶: ${f_drum}`);\r\n console.log(`電探: ${f_radar}`);\r\n console.log(`大発系: ${f_craft}`);\r\n\r\n ft_drum = ct_drums[0] + ct_drums[1];\r\n ft_craft = ct_crafts[0] + ct_crafts[1];\r\n // 艦隊種別\r\n if(f === 4) {\r\n f_type = '空母機動部隊';\r\n } else if(f === 5) {\r\n f_type = '水上打撃部隊';\r\n } else if(f === 6) {\r\n f_type = '輸送護衛部隊';\r\n }\r\n console.log(`f_type: ${f_type}`);\r\n }\r\n } catch(e) {\r\n console.log(`error: ${e}`);\r\n alert('処理中断: 艦隊情報の取得に失敗しました');\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').blur();\r\n setBackSelect();\r\n return;\r\n }\r\n // 気休めだけども保存前にチェック\r\n if(f_length && f_ids && f_names && f_seek && f_seek[0] && f_speed) {\r\n // 丸ごとlocalstorageへ\r\n localStorage.setItem('fleet', JSON.stringify(i_json));\r\n f_flag = true;\r\n selected_type = f + 1; // 配列指定の為に引いた分足しなおす\r\n localStorage.setItem('selected_type', selected_type);\r\n // 表示\r\n reloadImportDisplay();\r\n is_ignore_seek = false;\r\n simController();\r\n } else {\r\n alert('処理中断: 入力値に不備があるかも?');\r\n // 空欄化\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').val('');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').blur();\r\n setBackSelect();\r\n }\r\n console.log('艦隊諸元読込完了');\r\n }\r\n // cシリーズ初期化\r\n function inCs() {\r\n c_lengths = [];\r\n c_ids = [];\r\n c_names = [];\r\n c_types = [];\r\n c_seeks = [];\r\n c_speeds = [];\r\n c_drums = [];\r\n c_radars = [];\r\n c_crafts = [];\r\n c_kanko = [];\r\n\r\n ct_drums = [];\r\n ct_crafts = [];\r\n\r\n c_lvs = [];\r\n }\r\n // ドラム缶、大発、電探搭載艦数, 寒甲カウント\r\n function countUnits(num, is_for_resource) {\r\n let drum = 0;\r\n let radar = 0;\r\n let craft = 0;\r\n let kanko = 0;\r\n if(is_for_resource) {\r\n for(let i = 0;i < c_lengths[num - 1];i++) {\r\n const e_ids = getEqIds(c_ids[num - 1][i], num);\r\n // 累計\r\n for(const e_id of e_ids) {\r\n if(e_id === 75) { // ドラム缶\r\n drum++;\r\n } else if(valid_crafts.includes(e_id)) { // 大発系\r\n craft++;\r\n }\r\n }\r\n }\r\n ct_drums.push(drum);\r\n ct_crafts.push(craft);\r\n } else {\r\n for(let i = 0;i < c_lengths[num - 1];i++) {\r\n const e_ids = getEqIds(c_ids[num - 1][i], num);\r\n // 一隻につき1回だけカウント\r\n let d = true;\r\n let r = true;\r\n let c = true;\r\n let k = true;\r\n for(const e_id of e_ids) {\r\n if(e_id === 75) { // ドラム缶\r\n if(d) {\r\n drum++;\r\n d = false;\r\n }\r\n }\r\n // typeを取得\r\n const t_id = getEqType(e_id);\r\n if(t_id === 5812 || t_id === 5813) {\r\n if(r) {\r\n // 小型電探\r\n // 大型電探\r\n radar++;\r\n r = false;\r\n }\r\n } else if(t_id === 81424 || t_id === 84724|| t_id === 203746) {\r\n // 特大発動艇+戦車第11連隊及びM4A1のみ除外 M4A1はtype:84524で含まれない\r\n if(e_id !== 230) {\r\n if(c) {\r\n craft++;\r\n c = false;\r\n }\r\n }\r\n } else if(e_id === 402) { // 寒甲\r\n if(k) {\r\n kanko++;\r\n k = false;\r\n }\r\n }\r\n }\r\n }\r\n c_drums.push(drum);\r\n c_radars.push(radar);\r\n c_crafts.push(craft);\r\n c_kanko.push(kanko);\r\n }\r\n\r\n }\r\n // typeの先頭3つを連結してidとして返す(数値型)\r\n function getEqType(e_id) {\r\n const entry = e_data.find(entry => entry.id === e_id);\r\n return Number(entry.type.slice(0, 3).join(''));\r\n }\r\n // 速度を取得 高速+艦隊etc\r\n function calcSpeed(num) {\r\n const arr = [];\r\n for(let i = 0;i < c_lengths[num - 1];i++) {\r\n const e_ids = getEqIds(c_ids[num - 1][i], num);\r\n const rf = getEqRfs(c_ids[num - 1][i], num);\r\n /*\r\n 33:タービン\r\n 34:強化缶\r\n 87:新型缶\r\n */\r\n let tur = 0; // タービン\r\n let kan = 0; // 強化缶\r\n let n_kan = 0; // 新型缶\r\n let pow = 0; // 新型缶☆7↑\r\n for(let q = 0;q < e_ids.length;q++) {\r\n if(e_ids[q] === 33) {\r\n tur++;\r\n } else if(e_ids[q] === 34) {\r\n kan++;\r\n } else if(e_ids[q] === 87) {\r\n n_kan++;\r\n if(rf[q] > 6) {\r\n pow++;\r\n }\r\n }\r\n }\r\n const kans = kan + n_kan;\r\n const ship = s_data.find(entry => entry.id === c_ids[num - 1][i]);\r\n const sg = ship.sg;\r\n let val = 0;\r\n switch(sg) {\r\n case 0: // 高速A\r\n val = 1;\r\n if(tur && n_kan || pow > 1) {\r\n val = 3;\r\n } else if(tur && kans || pow) {\r\n val = 2;\r\n }\r\n arr.push(val);\r\n break;\r\n case 1: // 高速B1\r\n val = 1;\r\n if(tur && n_kan && kans > 1) {\r\n val = 3;\r\n } else if(tur && kans) {\r\n val = 2;\r\n }\r\n arr.push(val);\r\n break;\r\n case 2:// 高速B2\r\n val = 1;\r\n if(tur &&(n_kan > 1 || kans > 2)) {\r\n val = 3;\r\n } else if(tur && kans) {\r\n val = 2;\r\n }\r\n arr.push(val);\r\n break;\r\n case 3: // 高速C\r\n val = 1;\r\n if(tur && kans) {\r\n val = 2;\r\n }\r\n arr.push(val);\r\n break;\r\n case 4: // 低速A群\r\n val = 0;\r\n if(tur && n_kan && kans > 2) {\r\n val = 3;\r\n } else if(tur && pow > 1) {\r\n val = 3;\r\n } else if(tur && n_kan && kans > 1) {\r\n val = 2;\r\n } else if(tur && pow) {\r\n val = 2;\r\n } else if(tur && kans) {\r\n val = 1;\r\n }\r\n arr.push(val);\r\n break;\r\n case 5: // 低速B\r\n val = 0;\r\n if(tur && (n_kan > 1 || kans > 2)) {\r\n val = 2;\r\n } else if(tur && kans) {\r\n val = 1;\r\n }\r\n arr.push(val);\r\n break;\r\n case 6: // 低速C\r\n val = 0;\r\n if(tur && kans) {\r\n val = 1;\r\n }\r\n arr.push(val);\r\n break;\r\n case 7: // 低速D\r\n val = 0;\r\n if(tur && n_kan) {\r\n val = 2;\r\n } else if(n_kan || tur && kans) {\r\n val = 1;\r\n }\r\n arr.push(val);\r\n break;\r\n case 8: // 低速E\r\n val = 0;\r\n if(tur && n_kan && kans > 1) {\r\n val = 3;\r\n } else if(tur && n_kan) {\r\n val = 2;\r\n } else if(tur && kans) {\r\n val = 1;\r\n } else if(n_kan) {\r\n val = 1;\r\n }\r\n arr.push(val);\r\n break;\r\n case 9: // サミュ/改&夕張改二特\r\n val = 0;\r\n if(tur && (n_kan > 1 || kans > 2)) {\r\n val = 2;\r\n } else if(tur) {\r\n val = 1;\r\n }\r\n arr.push(val);\r\n break;\r\n }\r\n }\r\n console.log(`艦隊各速度: ${arr}`);\r\n let res = '';\r\n if(arr.every(elem => elem === 3)) {\r\n res = '最速艦隊';\r\n } else if(arr.every(elem => elem > 1)) {\r\n res = '高速+艦隊';\r\n } else if(arr.every(elem => elem > 0)) {\r\n res = '高速艦隊';\r\n } else {\r\n res = '低速艦隊';\r\n }\r\n return res;\r\n }\r\n // 構成艦のidを取得 配列で返す\r\n function getIdsFromFleet(num) {\r\n const ids = [];\r\n const f = `f${num}`;\r\n for (let i = 1; i <= c_lengths[num - 1]; i++) {\r\n const key = 's' + i;\r\n if (i_json[f][key] && i_json[f][key].hasOwnProperty('id')) {\r\n ids.push(Number(i_json[f][key].id));\r\n }\r\n }\r\n return ids;\r\n }\r\n // jsonからlv取得 配列で返す\r\n function getLvs(num) {\r\n const lvs = [];\r\n const f = `f${num}`;\r\n for (let i = 1; i <= c_lengths[num - 1]; i++) {\r\n const key = 's' + i;\r\n if (i_json[f][key] && i_json[f][key].hasOwnProperty('lv')) {\r\n lvs.push(i_json[f][key].lv);\r\n }\r\n }\r\n return lvs;\r\n }\r\n // 構成艦数カウント\r\n function countShips(num) {\r\n // f1内のsキーの配下にあるオブジェクト数をカウント\r\n try {\r\n const count = Object.keys(i_json[`f${num}`]).filter(key => /^s\\d+$/.test(key)).length;\r\n return count;\r\n } catch(e) {\r\n console.log('多分艦隊が空');\r\n return 0;\r\n }\r\n }\r\n // 索敵計算\r\n function calcSeek(num) {\r\n let res = [];\r\n let sum_base = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](0); // 艦娘索敵値によるスコア\r\n const f_length_correct = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](2 * (6 - c_lengths[num - 1])); // 隻数補正\r\n let sum_eq = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](0); // 装備によるスコア\r\n let command = 120;\r\n if(i_json.hqlv) { // オリジナルのデッキビルダーには司令レベルが無いみたい\r\n command = i_json.hqlv;\r\n }\r\n command = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](command).times(0.4); // 司令部補正\r\n for (let i = 0; i < c_lengths[num - 1]; i++) {\r\n // 素の索敵値計算\r\n const key = 's' + (i + 1);\r\n const lv = i_json[`f${num}`][key]['lv'];\r\n // 索敵値の最大値と最小値を取得\r\n const ship = s_data.find(entry => entry.id === c_ids[num - 1][i]);\r\n const min_seek = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](ship.seek);\r\n const max_seek = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](ship.max_seek);\r\n const cur_seek = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](max_seek).minus(min_seek).times(lv).div(99).floor().plus(min_seek);\r\n console.log(`艦名: ${c_names[num - 1][i]}, 素索敵値: ${cur_seek}`);\r\n // 装備id取得\r\n const i_ids = getEqIds(c_ids[num - 1][i], num);\r\n console.log(`装備id: ${i_ids}`);\r\n // 装備ボーナス\r\n const bonus = getSeekBonus(ship, i_ids, num);\r\n console.log(`seek_bonus: ${bonus}`);\r\n // 素の索敵値の平方根を加算\r\n sum_base = sum_base.plus(decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sqrt(cur_seek.plus(bonus)));\r\n // 改修値取得\r\n const rfs = getEqRfs(c_ids[num - 1][i], num);\r\n for(let q = 0;q < i_ids.length;q++) {\r\n // 装備の索敵値が1以上だったらあれこれ\r\n const eq = e_data.find(entry => entry.id === i_ids[q]);\r\n const seek = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](eq.seek);\r\n if(seek > 0) {\r\n // 係数\r\n const coefficient = getEqCo(i_ids[q]);\r\n const eq_co = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](coefficient[0]); // 装備係数\r\n const rf_co = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](coefficient[1]); // 改修係数\r\n const rf = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](rfs[q]);\r\n console.log(`装備係数: ${coefficient[0]}, 改修係数: ${coefficient[1]}, 改修効果: ${rf_co.times(decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sqrt(rf))}`);\r\n sum_eq = sum_eq.plus(eq_co.times(seek.plus(rf_co.times(decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].sqrt(rf)))));\r\n }\r\n }\r\n }\r\n const material = sum_base.plus(f_length_correct).minus(command);\r\n // 係数 四捨五入で小数第二位まで\r\n for(let j = 1;j < 5;j++) {\r\n const elem = material.plus(sum_eq.times(j));\r\n // 値の正負で丸めの挙動を揃える\r\n if(elem < 0) {\r\n res.push(elem.negated().toDecimalPlaces(2, decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ROUND_UP).negated());\r\n } else {\r\n res.push(elem.toDecimalPlaces(2, decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ROUND_DOWN));\r\n }\r\n }\r\n return res;\r\n }\r\n // 装備ボーナス取得 艦のjson, 装備id(配列)\r\n function getSeekBonus(ship, e_ids, num) {\r\n let res = 0;\r\n const id = ship.id;\r\n const name = ship.name;\r\n const na = ship.na;\r\n const type = ship.type;\r\n const dup = []; // 重複不可のがきたらこれに追加\r\n const e_length = e_ids.length;\r\n for(let i = 0;i < e_length;i++) {\r\n const e_id = e_ids[i];\r\n switch(e_id) {\r\n case 315: // SG初期\r\n if(name === '丹陽' || name === '雪風改二') {\r\n if(!dup.includes(e_id)) {\r\n res += 3;\r\n dup.push(e_id);\r\n }\r\n } else if(na === 1) { // USA\r\n res += 4;\r\n }\r\n break;\r\n case 456: // SG後期\r\n if(name === '丹陽' || name === '雪風改二') {\r\n if(!dup.includes(e_id)) {\r\n res += 3;\r\n dup.push(e_id);\r\n }\r\n } else if(na === 1) { // USA\r\n res += 4;\r\n } else if(na === 3) { // UK\r\n res += 2;\r\n }\r\n break;\r\n case 278: // SK\r\n if(na === 1) { // USA\r\n if(!dup.includes(e_id)) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n case 279: // SK+SG\r\n if(na === 1) { // USA\r\n if(!dup.includes(e_id)) {\r\n res += 2;\r\n dup.push(e_id);\r\n }\r\n } else if(na === 3) { // UK\r\n if(!dup.includes(e_id)) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n case 517: { // 清霜逆探\r\n const gifted = ['朝霜改二','清霜改二','初霜改二','潮改二','Верный','霞改二','時雨改三','雪風改二'];\r\n if(name === '清霜改二丁') {\r\n if(!dup.includes(e_id)) {\r\n res += 3;\r\n dup.push(e_id);\r\n }\r\n } else if(gifted.includes(name)) {\r\n if(!dup.includes(e_id)) {\r\n res += 2;\r\n dup.push(e_id);\r\n }\r\n } else if(na === 0 && type === '駆逐艦') {\r\n if(!dup.includes(e_id)) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n }\r\n case 30: // 21号対空電探\r\n case 410: { // 21号対空電探改二\r\n const akizuki = ['秋月','照月','初月','涼月','冬月'];\r\n const mogami = ['最上改','最上改二','最上改二特'];\r\n if(akizuki.some(item => name.startsWith(item)) || mogami.includes(name)) {\r\n if(!dup.includes(e_id)) {\r\n res += 2;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n }\r\n case 118: { // 紫雲\r\n if(name.includes('大淀')) {\r\n res += 2;\r\n const rf = getEqRfs(id, num)[i];\r\n if(rf === 10) { // 改修maxで更に+1\r\n res += 1;\r\n }\r\n }\r\n break;\r\n }\r\n case 414: { // SOC seagull\r\n if(na === 1) { // USA\r\n if(type === '軽巡洋艦' || type === '重巡洋艦') {\r\n const rf = getEqRfs(id, num)[i];\r\n if(!dup.includes(e_id)) {\r\n res += 2;\r\n // 改修でさらにボーナス\r\n if(rf > 3) {\r\n res += 1;\r\n }\r\n dup.push(e_id);\r\n }\r\n } else if(type === '戦艦' || type === '巡洋戦艦') {\r\n if(!dup.includes(e_id)) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n case 115: // Ar196改\r\n if(name.includes('Bismarck') || name.includes('Prinz Eugen')) {\r\n res += 2;\r\n }\r\n break;\r\n case 371: // Fairey Seafox改\r\n if(name.includes('Gotland')) {\r\n if(!dup.includes(e_id)) {\r\n res += 6;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('Nelson')) {\r\n if(!dup.includes(e_id)) {\r\n res += 5;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('Commandant Teste')) {\r\n if(!dup.includes(e_id)) {\r\n res += 4;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('Warspite') || name.includes('Richelieu') || name.includes('Jean Bart')) {\r\n if(!dup.includes(e_id)) {\r\n res += 3;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n case 370: // Swordfish Mk.II改(水偵型)\r\n if(name.includes('Warspite')) {\r\n if(!dup.includes(e_id)) {\r\n res += 3;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('Nelson') || name.includes('Sheffield') || name.includes('Gotland')) {\r\n if(!dup.includes(e_id)) {\r\n res += 2;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('Commandant Teste') || name.includes('瑞穂') || name.includes('神威')) {\r\n if(!dup.includes(e_id)) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n case 194: { // Laté 298B\r\n const gifted = ['Commandant Teste','Richelieu','Jean Bart','瑞穂','神威'];\r\n if(gifted.some(item => item.includes(name))) {\r\n res += 2;\r\n dup.push(e_id);\r\n }\r\n break;\r\n }\r\n case 415: // SO3C Seamew改\r\n if(na === 1) { // USA\r\n if(type === '軽巡洋艦' || type === '重巡洋艦') {\r\n if(!dup.includes(e_id)) {\r\n res += 2;\r\n dup.push(e_id);\r\n }\r\n } else if(type === '戦艦' || type === '巡洋戦艦') {\r\n if(!dup.includes(e_id)) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n }\r\n }\r\n break;\r\n case 369: // Swordfish Mk.III改(水上機型/熟練)\r\n if(name === 'Gotland andra') {\r\n if(dup.filter(item => item === e_id).length === 0) {\r\n res += 4;\r\n dup.push(e_id);\r\n } else if(dup.filter(item => item === e_id).length === 1) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('Gotland') || name.includes('Commandant Teste')) {\r\n if(!dup.includes(e_id)) {\r\n res += 3;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('瑞穂') || name.includes('神威')) {\r\n if(!dup.includes(e_id)) {\r\n res += 2;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n case 368: // Swordfish Mk.III改(水上機型)\r\n if(name === 'Gotland andra') {\r\n if(dup.filter(item => item === e_id).length === 0) {\r\n res += 4;\r\n dup.push(e_id);\r\n } else if(dup.filter(item => item === e_id).length < 5) {\r\n res += 3;\r\n dup.push(e_id);\r\n }\r\n } else if(name.includes('Gotland')) {\r\n res += 3;\r\n } else if(name.includes('Commandant Teste') || name.includes('瑞穂') || name.includes('神威')) {\r\n res += 2;\r\n }\r\n break;\r\n case 367: // Swordfish(水上機型)\r\n if(name.includes('Gotland') || name.includes('Commandant Teste') || name.includes('瑞穂') || name.includes('神威')) {\r\n res += 1;\r\n }\r\n break;\r\n case 408: // 装甲艇(AB艇)\r\n if(name.includes('神州丸')) {\r\n res += 2;\r\n } else if(name.includes('あきつ丸') || type === '駆逐艦') {// 本来大発の乗る駆逐艦だが、駆逐に乗ってる時点でボーナスつけちゃう\r\n res += 1;\r\n }\r\n break;\r\n case 409: // 武装大発\r\n if(name.includes('神州丸')) {\r\n res += 2;\r\n } else if(name.includes('あきつ丸')) {// 本来大発の乗る駆逐艦だが、駆逐に乗ってる時点でボーナスつけちゃう\r\n res += 1;\r\n }\r\n break;\r\n case 412: // 水雷見張員\r\n if(na === 0) {\r\n if(type === '駆逐艦') {\r\n res += 1;\r\n } else if(type === '軽巡洋艦') {\r\n res += 3;\r\n } else if(type === '重巡洋艦') {\r\n res += 1;\r\n }\r\n }\r\n break;\r\n case 129: // 見張員\r\n if(na === 0) {\r\n if(type === '駆逐艦') {\r\n res += 1;\r\n } else if(type === '軽巡洋艦') {\r\n res += 3;\r\n } else if(type === '重巡洋艦') {\r\n res += 3;\r\n }\r\n }\r\n break;\r\n case 521: { // 紫雲(熟練)\r\n const rf = getEqRfs(id, num)[i];\r\n if(name.includes('大淀改')) {\r\n if(rf > 0) { // 改修1以上で+5\r\n res += 5;\r\n }\r\n if(rf > 3) { // ☆4以上で更に+1\r\n res += 1;\r\n }\r\n } else if(name.includes('三隈改二特')) {\r\n if(rf > 0) { // 改修1以上で+4\r\n res += 4;\r\n }\r\n }\r\n break;\r\n }\r\n case 522: // 零式小型水上機\r\n if(type === '潜水艦' || type === '潜水空母') {\r\n res += 3;\r\n }\r\n break;\r\n case 523: // 零式小型水上機(熟練)\r\n if(type === '潜水艦' || type === '潜水空母') {\r\n res += 4;\r\n }\r\n break;\r\n case 527: // Type281 レーダー\r\n if(na === 3) { // UK(大型)組\r\n res += 2;\r\n }\r\n break;\r\n case 273: { // 彩雲(偵四) ☆2のときのみ\r\n const rf = getEqRfs(id, num)[i];\r\n if(rf === 2) {\r\n if(!dup.includes(e_id)) {\r\n res += 1;\r\n dup.push(e_id);\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n return res;\r\n }\r\n // 装備係数&改修係数取得 配列[装備係数, 改修係数]を返す\r\n function getEqCo(id) {\r\n let res = [];\r\n // typeを取得\r\n const e_id = getEqType(id);\r\n // やや無駄になるが2回に分けた方が見やすくて良いと思う\r\n switch(e_id) {\r\n // 装備係数\r\n case 356: // 艦戦\r\n case 357: // 艦爆\r\n case 53645: // 水戦\r\n case 173341: // 大型飛行艇\r\n case 31626: // 対潜哨戒機\r\n case 31525: // 回転翼機\r\n case 34425: // S51J & S51J改\r\n case 34057: // 噴式戦闘爆撃機\r\n case 111: // 小口径主砲\r\n case 112: // 中口径主砲\r\n case 5812: // 小型電探\r\n case 5813: // 大型電探\r\n case 244251: // 潜水電探\r\n case 2332: // 潜水魚雷\r\n case 71014: // ソナー\r\n case 71040: // 大型ソナー\r\n case 81829: // 探照灯\r\n case 81842: // 大型探照灯\r\n case 132335: // 航空要員\r\n case 162739: // 見張員\r\n case 122234: // 司令部\r\n case 2422: // 甲標的\r\n case 84724: // AB艇\r\n res.push(0.6);\r\n break;\r\n case 358: // 艦攻\r\n res.push(0.8);\r\n break;\r\n case 579: // 艦偵\r\n res.push(1);\r\n break;\r\n case 54311: // 水爆\r\n res.push(1.1);\r\n break;\r\n case 5710: // 水偵\r\n res.push(1.2);\r\n break;\r\n }\r\n switch(e_id) {\r\n // 改修係数\r\n case 31525: // 回転翼機\r\n case 34425: // S51J & S51J改\r\n case 162739: // 見張員\r\n res.push(0);\r\n break;\r\n case 54311: // 水爆\r\n res.push(1.15);\r\n break;\r\n case 579: // 艦偵\r\n case 173341: // 大型飛行艇\r\n case 5710: // 水偵\r\n res.push(1.2);\r\n break;\r\n case 5812: // 小型電探\r\n res.push(1.25);\r\n break;\r\n case 5813: // 大型電探\r\n res.push(1.4);\r\n break;\r\n default:\r\n res.push(0);\r\n break;\r\n }\r\n return res;\r\n }\r\n // 艦idと艦隊番号から装備idを配列で得る ※同一の艦が含まれると不具合が出るかも\r\n function getEqIds(s_id, num) {\r\n let ids = [];\r\n for (const s_key in i_json[`f${num}`]) {\r\n const ship = i_json[`f${num}`][s_key];\r\n if (Number(ship.id) && Number(ship.id) === Number(s_id)) { // 本家デッキビルダーへの対応で艦IDは数値化\r\n const items = ship.items;\r\n for(const i_key in items) {\r\n if(items[i_key].id) {\r\n ids.push(items[i_key].id);\r\n }\r\n }\r\n }\r\n }\r\n return ids;\r\n }\r\n // 艦idから装備改修値を配列で得る\r\n function getEqRfs(s_id, num) {\r\n let rfs = [];\r\n for (const s_key in i_json[`f${num}`]) {\r\n const ship = i_json[`f${num}`][s_key];\r\n if (Number(ship.id) && Number(ship.id) === Number(s_id)) { // 本家デッキビルダーへの対応で艦IDは数値化\r\n const items = ship.items;\r\n for(const i_key in items) {\r\n if(items[i_key].rf) {\r\n rfs.push(items[i_key].rf);\r\n } else { // デッキビルダー本家は改修値ゼロはキーがない\r\n rfs.push(0);\r\n }\r\n }\r\n }\r\n }\r\n return rfs;\r\n }\r\n // 艦種を変数に反映\r\n function reflectionCom(types) {\r\n for(let i = 0;i < types.length;i++) {\r\n switch(types[i]) {\r\n case '戦艦':\r\n case '巡洋戦艦':\r\n com['BB']++;\r\n break;\r\n case '航空戦艦':\r\n com['BBV']++;\r\n break;\r\n case '正規空母':\r\n com['CV']++;\r\n break;\r\n case '装甲空母':\r\n com['CVB']++;\r\n break;\r\n case '軽空母':\r\n com['CVL']++;\r\n break;\r\n case '重巡洋艦':\r\n com['CA']++;\r\n break;\r\n case '航空巡洋艦':\r\n com['CAV']++;\r\n break;\r\n case '軽巡洋艦':\r\n com['CL']++;\r\n break;\r\n case '重雷装巡洋艦':\r\n com['CLT']++;\r\n break;\r\n case '練習巡洋艦':\r\n com['CT']++;\r\n break;\r\n case '駆逐艦':\r\n com['DD']++;\r\n break;\r\n case '海防艦':\r\n com['DE']++;\r\n break;\r\n case '潜水艦':\r\n com['SS']++;\r\n break;\r\n case '潜水空母':\r\n com['SSV']++;\r\n break;\r\n case '水上機母艦':\r\n com['AV']++;\r\n break;\r\n case '補給艦':\r\n com['AO']++;\r\n break;\r\n case '揚陸艦':\r\n com['LHA']++;\r\n break;\r\n case '潜水母艦':\r\n com['AS']++;\r\n break;\r\n case '工作艦':\r\n com['AR']++;\r\n break;\r\n }\r\n }\r\n }\r\n // 構成艦の名前を配列で返す\r\n // 引数:随伴であるか否か\r\n function getShipName(num) {\r\n let names = [];\r\n for (const id of c_ids[num - 1]) {\r\n const ship = s_data.find((item) => item.id === id);\r\n if (ship) {\r\n names.push(ship.name);\r\n }\r\n }\r\n return names;\r\n }\r\n // idから艦種取得 配列で渡す\r\n function getType(num) {\r\n let types = [];\r\n for (const id of c_ids[num - 1]) {\r\n const ship = s_data.find(entry => entry.id === id);\r\n if (ship) {\r\n types.push(ship.type);\r\n }\r\n }\r\n return types;\r\n }\r\n // 艦隊情報表示\r\n function reloadImportDisplay() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#import-display').empty();\r\n let part = '';\r\n if(f_type && f_type !== '遊撃部隊' && f_type !== '通常艦隊') {\r\n // 連合艦隊\r\n part += `主力: ${f_names[0]}`;\r\n for(let i = 1;i < f_length - f2_length;i++) {\r\n part += ` | ${f_names[i]}`;\r\n }\r\n part += `
随伴: ${f2_names[0]}`;\r\n for(let i = 1;i < f2_length;i++) {\r\n part += ` | ${f2_names[i]}`;\r\n }\r\n } else {\r\n // 通常艦隊\r\n part += `${f_names[0]}`;\r\n for(let i = 1;i < f_length;i++) {\r\n part += ` | ${f_names[i]}`;\r\n }\r\n }\r\n let u = '';\r\n if(f_type !== '通常艦隊') {\r\n u += `

${f_type}

`;\r\n }\r\n if(f_names && f_speed && f_seek) {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#import-display').append(`\r\n ${u}\r\n

\r\n ${f_speed} | 搭載艦数[ドラム缶:${f_drum},大発系:${f_craft},電探:${f_radar}]\r\n

\r\n

\r\n ${part}\r\n

\r\n

\r\n 索敵値:\r\n 1: ${f_seek[0]}\r\n 2: ${f_seek[1]}\r\n 3: ${f_seek[2]}\r\n 4: ${f_seek[3]}\r\n

\r\n `);\r\n }\r\n }\r\n // シミュレータが同期処理させたいので関数化\r\n // startSim以降を呼び出したいときはこれを叩く\r\n function simController() {\r\n Promise.resolve()\r\n .then(startSim)\r\n // .then(preInfo)\r\n .then(function() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.icon-on-map').css('display', 'block');\r\n }).catch(error => {\r\n console.error('エラーが発生しました:', error);\r\n return area;\r\n });\r\n }\r\n\r\n // 以下分岐判定に必要な関数\r\n\r\n // 特定の艦が含まれるかチェック\r\n // 改、改二等後に続く文字列は許容するが名前が変わる場合は都度呼び出すこと\r\n function isInclude(name) {\r\n return f_names.some(elem => elem.includes(name));\r\n }\r\n // isIncludeと同じ\r\n // カウントを返す\r\n function countShipsStartWith(name) {\r\n return f_names.filter(elem => elem.startsWith(name)).length;\r\n }\r\n // 高速+艦隊か最速艦隊であればtrue\r\n function isFaster() {\r\n if(f_speed === '高速+艦隊' || f_speed === '最速艦隊') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n // 旗艦が軽巡であればtrue\r\n function isFCL () {\r\n const name = f_names[0];\r\n // 先頭一致\r\n const clsName = ['矢矧','能代','Helena','Brooklyn','Honolulu','神通','Sheffield','L.d.S.D.d.Abruzzi','G.Garibaldi','Perth','大淀','球磨','De Ruyter','長良','名取','川内','那珂','阿賀野','酒匂','天龍','Atlanta','五十鈴','多摩','Gotland','鬼怒','由良','阿武隈','夕張','龍田'];\r\n // こちらは完全一致\r\n const exCL = ['北上','大井','木曾','木曾改'];\r\n if(clsName.some(item => name.startsWith(item))) {\r\n return true;\r\n } else if(exCL.includes(name)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n // 低速戦艦をカウント\r\n function countSBB() {\r\n const slowBBs = ['扶桑','山城','伊勢','日向','長門','長門改','長門改二','陸奥','陸奥改','陸奥改二','大和','大和改','武蔵','武蔵改','武蔵改二','Conte di Cavour','Nevada','Nevada改','Nevada改 Mod.2','Colorado','Colorado改','Maryland','Marylan改','Warspite','Warspite改','Nelson','Nelson改','Rodney','Rodney改','Гангут','Октябрьская революция','Гангут два'];\r\n // 配列arr1の要素をセットに変換\r\n const set = new Set(f_names);\r\n // 配列arr2の要素を1つずつ調べて、重複があるか確認\r\n let count = 0;\r\n for (const element of slowBBs) {\r\n if (set.has(element)) {\r\n count++;\r\n }\r\n }\r\n return count;\r\n }\r\n // 大鷹型カウント\r\n function countTaiyo() {\r\n const taiyos = ['春日丸', '大鷹', '八幡丸', '雲鷹', '神鷹'];\r\n let count = 0;\r\n for (const element of f_names) {\r\n for (const name of taiyos) {\r\n if (element.startsWith(name)) {\r\n count++;\r\n break; // 一致した場合、内側のループを抜けます\r\n }\r\n }\r\n }\r\n return count;\r\n }\r\n // 大和型カウント\r\n function countYamato() {\r\n const yamatos = ['大和', '武蔵'];\r\n let count = 0;\r\n for (const element of f_names) {\r\n for (const name of yamatos) {\r\n if (element.startsWith(name)) {\r\n count++;\r\n break; // 一致した場合、内側のループを抜けます\r\n }\r\n }\r\n }\r\n return count;\r\n }\r\n // あきつ丸カウント\r\n function countAkitsuMaru() {\r\n return f_names.filter(str => str.startsWith('あきつ丸')).length;\r\n }\r\n // 特定艦カウントの汎用版\r\n // 前方一致でカウントするので呼び出し方に注意\r\n function countShipsByName(name) {\r\n return f_names.filter(str => str.startsWith(name)).length;\r\n }\r\n // 艦隊が連合艦隊であるか\r\n function isCom() {\r\n if(f_type === '空母機動部隊' || f_type === '水上打撃部隊' || f_type === '輸送護衛部隊') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n // rate(経路)をカウント\r\n // 同じものがあれば加算、無ければ追加\r\n function sum(route) {\r\n // 無ければ追加、あれば加算\r\n rate[route] ? rate[route] += 1:rate[route] = 1;\r\n // 追跡\r\n const parts = route.split('to');\r\n if(track.length) {\r\n track.push(parts[1]);\r\n } else {\r\n track.push(parts[0]);\r\n track.push(parts[1]);\r\n }\r\n }\r\n // track(1周ごとの経路)を重複チェックしてからt_logsに格納 既にあれば加算\r\n function pushLog() {\r\n const key = track.join('e');\r\n t_logs[key] ? t_logs[key] += 1:t_logs[key] = 1;\r\n }\r\n // 百分率で指定 小数第一位まで可\r\n // 指定した確率でtrue\r\n function sai(num) {\r\n // 0から100までの乱数を生成\r\n const randomValue = Math.random() * 100;\r\n // 引数で指定された小数以下第一位までの値に変換\r\n const roundedNum = Math.round(num * 10) / 10;\r\n // 1から100の間で指定された値以下であればtrueを返す\r\n return randomValue <= roundedNum;\r\n }\r\n \r\n /*\r\n 分岐関数\r\n マップをworld-map,マスをアルファベットで、スタート地点ならnull\r\n 再帰にするとスタックする\r\n 纏められそうなのもあるが実装優先で愚直に書く\r\n 但し条件から漏れると即無限ループなので必ずelse等で拾うこと\r\n */\r\n function branch(world, map, edge, is_once) {\r\n const BB = com['BB']; // 戦艦\r\n const BBV = com['BBV'];// 航空戦艦&改装航空戦艦\r\n const CV = com['CV']; // 正規空母\r\n const CVB = com['CVB']; // 装甲空母\r\n const CVL = com['CVL']; // 軽空母\r\n const CA = com['CA']; // 重巡\r\n const CAV = com['CAV']; // 航巡\r\n const CL = com['CL']; // 軽巡\r\n const CLT = com['CLT']; // 雷巡\r\n // const ATU = com['ATU']; // 練習特務艦\r\n const CT = com['CT']; // 練習巡洋艦\r\n const DD = com['DD']; // 駆逐艦\r\n const DE = com['DE']; // 海防艦\r\n const SS = com['SS']; // 潜水艦\r\n const SSV = com['SSV']; // 潜水空母\r\n const AV = com['AV']; // 水母\r\n const AO = com['AO']; // 補給艦\r\n // const ASU = com['ASU']; // 特務艦\r\n // const LHT = com['LHT']; // 灯台補給船\r\n // const CVE = com['CVE']; // 特設護衛空母\r\n const LHA = com['LHA']; // 揚陸艦\r\n // const LST = com['LST']; // 戦車揚陸艦\r\n const AS = com['AS']; // 潜水母艦\r\n const AR = com['AR']; // 工作艦\r\n\r\n const BBs = BB + BBV; // 戦艦級\r\n const CVs = CV + CVL + CVB; // 空母系\r\n const BBCVs = BBs + CVs; // 戦艦級+空母系\r\n const CAs = CA + CAV; // 重巡級\r\n const Ds = DD + DE; // 駆逐艦 + 海防艦\r\n const Ss = SS + SSV; // 潜水艦 + 潜水空母\r\n switch(world) {\r\n case 1:\r\n switch(map) {\r\n case 1: // @1-1\r\n switch(edge) {\r\n case null:\r\n sum('1toA');\r\n return 'A';\r\n break;\r\n case 'A':\r\n switch(f_length) {\r\n case 1:\r\n sai(80)?sum('AtoC'):sum('AtoB');\r\n break;\r\n case 2:\r\n sai(75)?sum('AtoC'):sum('AtoB');\r\n break;\r\n case 3:\r\n sai(70)?sum('AtoC'):sum('AtoB');\r\n break;\r\n case 4:\r\n sai(65)?sum('AtoC'):sum('AtoB');\r\n break;\r\n case 5:\r\n sai(60)?sum('AtoC'):sum('AtoB');\r\n break;\r\n case 6:\r\n sai(55)?sum('AtoC'):sum('AtoB');\r\n break;\r\n }\r\n return null;\r\n break;\r\n }\r\n break;\r\n case 2: // @1-2\r\n switch(edge) {\r\n case null:\r\n if(Ds === 4 && f_length < 6) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n switch(f_length) {\r\n case 6:\r\n if(sai(40)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n return null;\r\n }\r\n break;\r\n case 5:\r\n if(sai(50)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n return null;\r\n }\r\n break;\r\n case 4:\r\n if(sai(60)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n return null;\r\n }\r\n break;\r\n default:\r\n if(sai(70)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 'A':\r\n if(f_speed !== '低速艦隊') {\r\n sum('AtoE');\r\n } else if(Ds < 4) {\r\n sum('AtoD');\r\n sum('DtoE');\r\n } else if(Ds === 6) {\r\n sum('AtoE');\r\n } else if(CL + CT === 1 && Ds === 5) {\r\n sum('AtoE');\r\n } else if(CL === 1 && Ds > 3) {\r\n sum('AtoE');\r\n } else {\r\n if(sai(65)) {\r\n sum('AtoE');\r\n } else {\r\n sum('AtoD');\r\n sum('DtoE');\r\n }\r\n }\r\n return null;\r\n }\r\n break;\r\n case 3: // @1-3\r\n switch(edge) {\r\n case null:\r\n if(AO + AV > 0) {\r\n sum('1toA');\r\n return 'A';\r\n } else if(CVs > 0) {\r\n sum('1toC');\r\n sum('CtoF');\r\n return 'F';\r\n } else {\r\n if(sai(50)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toC');\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n }\r\n break;\r\n case 'A':\r\n if(AO > 0 || DE > 3) {\r\n sum('AtoD');\r\n sum('DtoB');\r\n sum('BtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(AV > 0 || Ds > 3) {\r\n if(sai(80)) {\r\n sum('AtoD');\r\n sum('DtoB');\r\n sum('BtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else {\r\n sum('AtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n } else if(Ss > 0) {\r\n sum('AtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else {\r\n if(sai(50)) {\r\n sum('AtoD');\r\n sum('DtoB');\r\n sum('BtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else {\r\n sum('AtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(CV + CVB > 0 || countSBB() > 0) {\r\n sum('FtoH');\r\n return 'H';\r\n } else if((CAV > 0 && DD > 1) || DD > 3 || ((CL + CT > 0) && Ds > 3)) {\r\n sum('FtoJ');\r\n return null;\r\n } else if(f_speed !== '低速艦隊') {\r\n if(sai(60)) {\r\n sum('FtoJ');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return 'H';\r\n }\r\n } else {\r\n if(sai(60)) {\r\n sum('FtoH');\r\n return 'H';\r\n } else {\r\n sum('FtoJ');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if(AO > 0) {\r\n sum('HtoG');\r\n return null;\r\n } else if(AV + CAV > 0 || (CL+ CT > 0 && DD > 1)) {\r\n sum('HtoJ');\r\n return null;\r\n } else if(DD > 1) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.4) {\r\n sum('HtoG');\r\n } else if(num <= 0.8) {\r\n sum('HtoJ');\r\n } else {\r\n sum('HtoI');\r\n }\r\n return null;\r\n } else {\r\n if(sai(60)) {\r\n sum('HtoI');\r\n } else {\r\n sum('HtoJ');\r\n }\r\n }\r\n return null;\r\n break;\r\n }\r\n break;\r\n case 4: // @1-4\r\n switch(edge) {\r\n case null:\r\n if(sai(50)) {\r\n sum('1toA');\r\n sum('AtoD');\r\n return 'D';\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'B':\r\n if((CVs > 2) || BBs > 2 || Ds === 0) {\r\n sum('BtoD');\r\n return 'D';\r\n } else if(Ds > 2) {\r\n sum('BtoC');\r\n return 'C';\r\n }else if(CL > 0) {\r\n if(sai(80)) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } else if(sai(60)) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 'D':\r\n if(AS > 0) {\r\n sum('DtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else if(AV > 0) {\r\n sum('DtoG');\r\n sum('GtoJ');\r\n return 'J';\r\n }else if(sai(50)) {\r\n sum('DtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else {\r\n sum('DtoG');\r\n sum('GtoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'F':\r\n if(Ds > 3) {\r\n sum('FtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else if(Ds > 1) {\r\n if(AV + AS + AO > 0 || BBV === 2) {\r\n sum('FtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else if(Ds === 3) {\r\n if(sai(80)) {\r\n sum('FtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n sum('HtoL');\r\n return null;\r\n }\r\n } else if(Ds === 2) {\r\n if(sai(60)) {\r\n sum('FtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n sum('HtoL');\r\n return null;\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('FtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n sum('HtoL');\r\n return null;\r\n }\r\n }\r\n }\r\n if(sai(50)) {\r\n sum('FtoE');\r\n sum('EtoH');\r\n sum('HtoL');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n sum('HtoL');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if((CL > 0 && AV > 0 && Ds > 1) || DD > 3) {\r\n sum('JtoL');\r\n return null;\r\n } else if(DD > 1) {\r\n if(sai(75)) {\r\n sum('JtoL');\r\n return null;\r\n } else {\r\n sum('JtoK');\r\n return null;\r\n }\r\n } else {\r\n if(sai(65)) {\r\n sum('JtoL');\r\n return null;\r\n } else {\r\n sum('JtoK');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 5: // @1-5\r\n switch(edge) {\r\n case null:\r\n sum('1toA');\r\n sum('AtoD');\r\n return 'D';\r\n break;\r\n case 'D':\r\n if(f_length === 1 || f_length === DE || AO > 0) {\r\n sum('DtoE');\r\n return 'E';\r\n } else if(f_length > 4) {\r\n if(Ss > 0) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n if(sai(50)) {\r\n sum('DtoE');\r\n return 'E';\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n }\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'E':\r\n if(f_length > 4) {\r\n sum('EtoC');\r\n return 'C';\r\n } else if(f_length === DE) {\r\n sum('EtoJ');\r\n return null;\r\n } else {\r\n sum('EtoC');\r\n return 'C';\r\n }\r\n break;\r\n case 'C':\r\n if(f_length === DE || (CL > 0 && DE === 4)) {\r\n sum('CtoJ');\r\n return null;\r\n } else if(f_length < 5 && AO > 0) {\r\n if(sai(50)) {\r\n sum('CtoJ');\r\n return null;\r\n } else {\r\n sum('CtoB');\r\n return null;\r\n }\r\n } else {\r\n sum('CtoB');\r\n return null;\r\n }\r\n break;\r\n case 'F':\r\n if(BB + CV + CVB + Ss > 0 || CVL > 1 || CL > 2) {\r\n sum('FtoI');\r\n return null;\r\n } else {\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'G':\r\n if(f_length > 4) {\r\n sum('GtoH');\r\n return null;\r\n } else {\r\n sum('GtoJ');\r\n return null;\r\n }\r\n break;\r\n }\r\n break;\r\n case 6: // @1-6\r\n // ゴールはNマスとして扱う\r\n switch(edge) {\r\n case null:\r\n if(BBV + CVL + CA > 0 || CAV > 1 || Ds < 4) {\r\n sum('1toC');\r\n sum('CtoH');\r\n sum('HtoK');\r\n sum('KtoM');\r\n return 'M';\r\n } else {\r\n sum('1toA');\r\n sum('AtoE');\r\n sum('EtoG');\r\n return ('G');\r\n }\r\n break;\r\n case 'G':\r\n if(CL > 0 && Ds === 5) {\r\n sum('GtoF');\r\n sum('FtoB');\r\n sum('BtoN');\r\n return null;\r\n } else {\r\n if(sai(75)) {\r\n sum('GtoF');\r\n sum('FtoB');\r\n sum('BtoN');\r\n return null;\r\n } else {\r\n sum('GtoK');\r\n sum('KtoM');\r\n return 'M';\r\n }\r\n }\r\n break;\r\n case 'M':\r\n if(BBV + CA + CVL > 2 || BBV + CAs > 2 || Ds < 3 || f_seek[2] < 28) {\r\n sum('MtoL');\r\n sum('LtoI');\r\n sum('ItoD');\r\n sum('DtoN');\r\n return null;\r\n } else if(f_seek[2] < 30) {\r\n if(sai(50)) {\r\n sum('MtoL');\r\n sum('LtoI');\r\n sum('ItoD');\r\n sum('DtoN');\r\n return null;\r\n } else {\r\n sum('MtoJ');\r\n sum('JtoD');\r\n sum('DtoN');\r\n return null;\r\n }\r\n } else {\r\n sum('MtoJ');\r\n sum('JtoD');\r\n sum('DtoN');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 2:\r\n switch(map) {\r\n case 1: // @2-1\r\n switch(edge) {\r\n case null:\r\n sum('1toC');\r\n return 'C';\r\n break;\r\n case 'C':\r\n if(CVs > 2 || BBV > 1 || (AO > 0 && Ss === 0)) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else if(BBV > 0 && CV + AS > 0) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.7) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else if(num <= 0.85) {\r\n sum('CtoD');\r\n sum('DtoH');\r\n return null;\r\n } else {\r\n sum('CtoE');\r\n return 'E';\r\n }\r\n } else if(AV + AS > 0) {\r\n sum('CtoE');\r\n return 'E'; \r\n } else {\r\n if(sai(50)) {\r\n sum('CtoD');\r\n sum('DtoH');\r\n return null;\r\n } else {\r\n sum('CtoE');\r\n return 'E';\r\n }\r\n }\r\n break;\r\n case 'E':\r\n if(BBCVs > 4) {\r\n sum('EtoF');\r\n return 'F';\r\n } else if(f_length === 6) {\r\n if(BBCVs > 0) {\r\n sum('EtoD');\r\n sum('DtoH');\r\n return null;\r\n } else if(DD +DE === 6 || (CL === 1 && Ds === 5) || (f_speed !== '低速艦隊' && CL === 1 && DD === 4)) {\r\n sum('EtoH');\r\n return null;\r\n } else {\r\n sum('EtoD');\r\n sum('DtoH');\r\n return null;\r\n }\r\n } else {\r\n if(Ds === 5 || (CL === 1 && Ds === 4) || f_speed !== '低速艦隊' && CL === 1 && DD === 3) {\r\n sum('EtoH');\r\n return null;\r\n } else {\r\n if(sai(60)) {\r\n sum('EtoD');\r\n sum('DtoH');\r\n return null;\r\n } else {\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(BBCVs > 4) {\r\n sum('FtoG');\r\n return null;\r\n } else if(DD > 2 || (CL === 1 && DD > 1)) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n if(sai(60)) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoG');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 2: // @2-2\r\n switch(edge) {\r\n case null:\r\n sum('1toC');\r\n return 'C';\r\n break;\r\n case 'C':\r\n if(CVs > 2 || BBV > 1 || (AO > 0 && Ss === 0)) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else if(BBV > 0) {\r\n if(AV + AS > 0) {\r\n if(sai(70)) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else {\r\n sum('CtoE');\r\n return 'E';\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else {\r\n sum('CtoD');\r\n return null;\r\n }\r\n }\r\n } else if(AV +AS > 0) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n if(sai(50)) {\r\n sum('CtoD');\r\n return null;\r\n } else {\r\n sum('CtoE');\r\n return 'E';\r\n }\r\n }\r\n break;\r\n case 'E':\r\n if(BBCVs > 3) {\r\n sum('EtoG');\r\n return 'G';\r\n } else if(DE > 1) {\r\n sum('EtoF');\r\n sum('FtoH');\r\n return 'H';\r\n } else if(BBCVs === 3) {\r\n if(sai(70)) {\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('EtoK');\r\n return null;\r\n }\r\n } else if(BBCVs === 2) {\r\n if(sai(50)) {\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('EtoK');\r\n return null;\r\n }\r\n } else if(BBCVs === 1) {\r\n if(sai(70)) {\r\n sum('EtoK');\r\n return null;\r\n } else {\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n } else if(Ds > 2 && AS > 0) {\r\n sum('EtoF');\r\n sum('FtoH');\r\n return 'H';\r\n } else if(Ds > 1) {\r\n if(CL > 0 && f_speed !== '低速艦隊') {\r\n sum('EtoK');\r\n return null;\r\n } else {\r\n if(sai(70)) {\r\n sum('EtoK');\r\n return null;\r\n } else {\r\n sum('EtoF');\r\n sum('FtoH');\r\n return 'H';\r\n }\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('EtoK');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if(CVs > 0 || DD === 0) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n if(sai(50)) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('GtoK');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if(BBCVs > 3) {\r\n if(sai(70)) {\r\n sum('HtoI');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(CVs + CAV + AV > 0) {\r\n sum('HtoK');\r\n return null;\r\n } else if(Ss > 0) {\r\n if(sai(70)) {\r\n sum('HtoI');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(Ds > 1) {\r\n if(sai(50)) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(Ds === 1) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('HtoI');\r\n return null;\r\n } else if(num <= 0.66) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('HtoI');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 3: // @2-3\r\n switch(edge) {\r\n case null:\r\n if(Ss + AS === f_length) {\r\n sum('1toC');\r\n return 'C';\r\n } else {\r\n if(sai(50)) {\r\n sum('1toB');\r\n sum('BtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else {\r\n sum('1toA');\r\n sum('AtoD');\r\n return 'D';\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(sai(60)) {\r\n sum('CtoD');\r\n return 'D';\r\n } else {\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'D':\r\n if(AV + AO > 0 && Ds > 1 || (Ss > 1 && AS > 0)) {\r\n sum('DtoG');\r\n return 'G';\r\n } else if(Ss === f_length) {\r\n if(sai(65)) {\r\n sum('DtoG');\r\n return 'G';\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n } else if(Ss > 0 && BBCVs > 0) {\r\n if(sai(65)) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoG');\r\n return 'G';\r\n }\r\n } else {\r\n if(Ds > 3) {\r\n if(sai(75)) {\r\n sum('DtoG');\r\n return 'G';\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n } else if(Ds > 2) {\r\n if(sai(65)) {\r\n sum('DtoG');\r\n return 'G';\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n } else if(Ds > 1) {\r\n if(sai(50)) {\r\n sum('DtoG');\r\n return 'G';\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n } else {\r\n if(sai(35)) {\r\n sum('DtoG');\r\n return 'G';\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(CVs + CL + AV > 0) {\r\n if(sai(90)) {\r\n sum('FtoJ');\r\n return 'J';\r\n } else {\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n } else if(Ss > 1 && AS > 0) {\r\n if(sai(80)) {\r\n sum('FtoG');\r\n return 'G';\r\n } else {\r\n sum('FtoJ');\r\n return 'J';\r\n }\r\n } else {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.25) {\r\n sum('FtoG');\r\n return 'G';\r\n } else if(num <= 0.60) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoJ');\r\n return 'J';\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if(Ss > 1 && AS > 0){\r\n if(sai(60)) {\r\n sum('GtoI');\r\n sum('ItoK');\r\n sum('KtoN');\r\n return null;\r\n } else {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(Ss === f_length) {\r\n if(sai(55)) {\r\n sum('GtoI');\r\n sum('ItoK');\r\n sum('KtoN');\r\n return null;\r\n } else {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(CL + Ds < 2) {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return null;\r\n } else if(AV + AO > 0 && Ds > 1) {\r\n if(sai(65)) {\r\n sum('GtoI');\r\n sum('ItoK');\r\n sum('KtoN');\r\n return null;\r\n } else {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(Ds > 2) {\r\n if(sai(55)) {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return null;\r\n } else {\r\n sum('GtoI');\r\n sum('ItoK');\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(Ds > 0) {\r\n if(sai(65)) {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return null;\r\n } else {\r\n sum('GtoI');\r\n sum('ItoK');\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(Ds === 0) {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if(CL > 0 && DD > 3 || (CL === 1 && CA === 5)) {\r\n sum('JtoN');\r\n return null;\r\n } else if(Ss === f_length) {\r\n if(sai(90)) {\r\n sum('JtoN');\r\n return null;\r\n } else {\r\n sum('JtoM');\r\n return null;\r\n }\r\n } else if(Ss > 0) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.1) {\r\n sum('JtoM');\r\n return null;\r\n } else if(num <= 0.55) {\r\n sum('JtoL');\r\n return null;\r\n } else {\r\n sum('JtoN');\r\n return null;\r\n }\r\n } else if(BBCVs === 6) {\r\n sum('JtoL');\r\n return null;\r\n } else if(BBCVs === 5) {\r\n if(sai(85)) {\r\n sum('JtoL');\r\n return null;\r\n } else {\r\n sum('JtoN');\r\n return null;\r\n }\r\n } else if(BBCVs === 4) {\r\n if(sai(75)) {\r\n sum('JtoN');\r\n return null;\r\n } else {\r\n sum('JtoL');\r\n return null;\r\n }\r\n } else if(BBCVs === 3) {\r\n if(sai(80)) {\r\n sum('JtoN');\r\n return null;\r\n } else {\r\n sum('JtoL');\r\n return null;\r\n }\r\n } else if(BBCVs < 3) {\r\n if(sai(90)) {\r\n sum('JtoN');\r\n return null;\r\n } else {\r\n sum('JtoL');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 4: // @2-4\r\n switch(edge) {\r\n case null:\r\n sum('1toB');\r\n return 'B';\r\n break;\r\n case 'B':\r\n if(DD === 6) {\r\n sum('BtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else if(CL + CT === 1 && DD > 3 && (CAs === 1 || DD === 5 || DE === 1)) {\r\n sum('BtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else if(Ds < 3) {\r\n if(CVs > 2) {\r\n sum('BtoC');\r\n return 'C';\r\n } else if(BBs + CV + CVB > 2) {\r\n sum('BtoC');\r\n return 'C';\r\n } else if(BBs + CV + CVB === 2) {\r\n if(sai(80)) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n } else if(CV + CVB > 0) {\r\n if(sai(60)) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n } else if(Ss > 0) {\r\n if(sai(60)) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n } else {\r\n if(sai(60)) {\r\n sum('BtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n }\r\n } else {\r\n if(sai(60)) {\r\n sum('BtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(AS + AO > 0) {\r\n sum('CtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n if(sai(50)) {\r\n sum('CtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(CVL > 0 && Ds > 1) {\r\n if(sai(92.5)) {\r\n sum('FtoJ');\r\n return 'J';\r\n } else {\r\n sum('FtoA');\r\n return null;\r\n }\r\n } else if(CVL > 0) {\r\n if(sai(82.5)) {\r\n sum('FtoJ');\r\n return 'J';\r\n } else {\r\n sum('FtoA');\r\n return null;\r\n }\r\n } else if(DD > 1) {\r\n if(sai(75)) {\r\n sum('FtoJ');\r\n return 'J';\r\n } else {\r\n sum('FtoA');\r\n return null;\r\n }\r\n } else if(DD < 2) {\r\n sum('FtoA');\r\n return null;\r\n } // DDで例外なし確認\r\n break;\r\n case 'H':\r\n if(CL + CT > 0 && DD === 4 && (CA + CL + CT > 0 || DD === 5)) {\r\n sum('HtoL');\r\n return 'L';\r\n } else {\r\n sum('HtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'I':\r\n if(CVL > 0 && CL > 0) {\r\n if(sai(92.5)) {\r\n sum('ItoK');\r\n return 'K';\r\n } else {\r\n sum('ItoE');\r\n sum('EtoD');\r\n return null;\r\n }\r\n } else if(CVL > 0) {\r\n if(sai(82.5)) {\r\n sum('ItoK');\r\n return 'K';\r\n } else {\r\n sum('ItoE');\r\n sum('EtoD');\r\n return null;\r\n }\r\n } else if(CL > 0) {\r\n if(sai(75)) {\r\n sum('ItoK');\r\n return 'K';\r\n } else {\r\n sum('ItoE');\r\n sum('EtoD');\r\n return null;\r\n }\r\n } else {\r\n if(sai(70)) {\r\n sum('ItoE');\r\n sum('EtoD');\r\n return null;\r\n } else {\r\n sum('ItoK');\r\n return 'K';\r\n }\r\n }\r\n break;\r\n case 'J':\r\n if(BBCVs > 3) {\r\n sum('JtoL');\r\n return 'L';\r\n } else if(BBCVs === 3 || CV + CVB === 2) {\r\n sum('JtoM');\r\n sum('MtoP');\r\n return null;\r\n } else if(CV + CVB === 0) {\r\n sum('JtoL');\r\n return 'L';\r\n } else {\r\n if(sai(65)) {\r\n sum('JtoM');\r\n sum('MtoP');\r\n return null;\r\n } else {\r\n sum('JtoL');\r\n return 'L';\r\n }\r\n }\r\n break;\r\n case 'K':\r\n if(AS + AO > 1) {\r\n sum('KtoN');\r\n return null;\r\n } else if(AV + AS + AO > 0) {\r\n if(Ds > 1) {\r\n if(sai(70)) {\r\n sum('KtoL');\r\n return 'L';\r\n } else {\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(Ds === 1) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.4) {\r\n sum('KtoL');\r\n return 'L';\r\n } else if(num <= 0.8) {\r\n sum('KtoN');\r\n return null;\r\n } else {\r\n sum('KtoO');\r\n return null;\r\n }\r\n } else if(Ds === 0) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.25) {\r\n sum('KtoL');\r\n return 'L';\r\n } else if(num <= 0.6) {\r\n sum('KtoN');\r\n return null;\r\n } else {\r\n sum('KtoO');\r\n return null;\r\n }\r\n }\r\n } else if(Ds > 1) {\r\n sum('KtoL');\r\n return 'L';\r\n } else if(Ds === 1) {\r\n if(sai(65)) {\r\n sum('KtoL');\r\n return 'L';\r\n } else {\r\n sum('KtoO');\r\n return null;\r\n }\r\n } else if(CAV > 0) {\r\n if(BB > 0) {\r\n if(sai(65)) {\r\n sum('KtoO');\r\n return null;\r\n } else {\r\n sum('KtoL');\r\n return 'L';\r\n }\r\n } else {\r\n if(sai(65)) {\r\n sum('KtoL');\r\n return 'L';\r\n } else {\r\n sum('KtoO');\r\n return null;\r\n }\r\n }\r\n } else if(BB > 1) {\r\n if(sai(77)) {\r\n sum('KtoO');\r\n return null;\r\n } else {\r\n sum('KtoL');\r\n return 'L';\r\n }\r\n } else {\r\n if(sai(65)) {\r\n sum('KtoL');\r\n return 'L';\r\n } else {\r\n sum('KtoO');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'L':\r\n if(BBCVs === 4) {\r\n sum('LtoM');\r\n sum('MtoP');\r\n return null;\r\n } else if(CL > 0 && DD > 1) {\r\n sum('LtoP');\r\n return null;\r\n } else if(BBs + CV + CVB < 3) {\r\n sum('LtoP');\r\n return null;\r\n } else {\r\n if(sai(60)) {\r\n sum('LtoM');\r\n sum('MtoP');\r\n return null;\r\n } else {\r\n sum('LtoP');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 5: // @2-5\r\n switch(edge) {\r\n case null:\r\n if(Ss > 3) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(Ss > 0 && BBs < 4 && (CVs > 0 || AV > 1)) {\r\n if(sai(50)) {\r\n sum('1toB');\r\n return 'B';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n } else if(CVs > 0 || AV > 1) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(f_drum > 1 || Ds > 3 || (CL > 0 && Ds > 2)) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(BBs > 0 || (CL + CLT > 0 && CAV > 0 && CA + CL + CLT > 4)) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(f_length === 6) {\r\n if(sai(80)) {\r\n sum('1toB');\r\n return 'B';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n } else {\r\n if(sai(95)) {\r\n sum('1toC');\r\n return 'C';\r\n } else {\r\n sum('1toB');\r\n return 'B';\r\n }\r\n }\r\n break;\r\n case 'B':\r\n if(Ss > 2) {\r\n sum('BtoA');\r\n return null;\r\n } else {\r\n sum('BtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'C':\r\n if(CVs > 2 || BBs > 2) {\r\n sum('CtoD');\r\n return null;\r\n } else if(CL > 0 && DD > 1 || CAV > 1 && DD > 1) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n if(sai(70)) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('CtoD');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'E':\r\n if(BBs > 0) {\r\n sum('EtoG');\r\n return 'G';\r\n } else if(CL > 0 && Ds > 3) {\r\n sum('EtoI');\r\n return 'I';\r\n } else if(f_speed === '低速艦隊' || CV + CVB + CAs > 1) {\r\n sum('EtoG');\r\n return 'G';\r\n } else if(CL > 0 && DD > 2) {\r\n sum('EtoI');\r\n return 'I';\r\n } else {\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'F':\r\n if(f_speed === '低速艦隊') {\r\n sum('FtoJ');\r\n return 'J';\r\n } else if(DD > 2 || (CL > 0 && DD > 1)) {\r\n sum('FtoE');\r\n return 'E';\r\n } else {\r\n if(sai(65)) {\r\n sum('FtoJ');\r\n return 'J';\r\n } else {\r\n sum('FtoE');\r\n return 'E';\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if((BBCVs < 2 && Ds > 3) || (BBCVs === 0 && CL > 0 && DD > 2)) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(f_seek[0] < 37) {\r\n sum('GtoK');\r\n return null;\r\n } else if(f_seek[0] < 41 && f_seek[0] >= 37) {\r\n if(sai(50)) {\r\n sum('GtoI');\r\n return 'I';\r\n } else {\r\n sum('GtoK');\r\n return null;\r\n }\r\n } else {\r\n sum('GtoL');\r\n return 'L';\r\n }\r\n break;\r\n case 'I':\r\n if(f_seek[0] < 31) {\r\n sum('ItoH');\r\n return null;\r\n } else if(f_seek[0] < 34 && f_seek[0] >= 31) {\r\n if(sai(50)) {\r\n sum('ItoH');\r\n return null;\r\n } else {\r\n sum('ItoO');\r\n return null;\r\n }\r\n } else {\r\n sum('ItoO');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if(f_seek[0] < 42) {\r\n sum('JtoH');\r\n return null;\r\n } else if(f_seek[0] < 49 && f_seek[0] >= 42) {\r\n if(BBCVs > 3) {\r\n const num = Math.random().toFixed(3);\r\n if(num <= 0.333) {\r\n sum('JtoH');\r\n return null;\r\n } else if(num <= 0.666) {\r\n sum('JtoM');\r\n return null;\r\n } else {\r\n sum('JtoO');\r\n return null;\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('JtoH');\r\n return null;\r\n } else {\r\n sum('JtoO');\r\n return null;\r\n }\r\n }\r\n } else if(BBCVs > 3) {\r\n if(sai(50)) {\r\n sum('JtoM');\r\n return null;\r\n } else {\r\n sum('JtoO');\r\n return null;\r\n }\r\n } else if(f_seek[0] >= 49) {\r\n sum('JtoO');\r\n return null;\r\n }\r\n break;\r\n case 'L':\r\n if(CL > 0 && DD > 1) {\r\n sum('LtoO');\r\n return null;\r\n } else if(BBCVs === 0) {\r\n if(sai(60)) {\r\n sum('LtoO');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n } else {\r\n if(sai(60)) {\r\n sum('LtoN');\r\n return null;\r\n } else {\r\n sum('LtoO');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n }\r\n break;\r\n case 3:\r\n switch(map) {\r\n case 1: // @3-1\r\n switch(edge) {\r\n case null:\r\n sum('1toC');\r\n return 'C';\r\n break;\r\n case 'C':\r\n if(Ds < 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(BBV + CL + AV + AO > 2) {\r\n if(BBCVs > 2) {\r\n if(sai(50)) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else {\r\n sum('CtoF');\r\n sum('FtoG');\r\n return null;\r\n }\r\n }\r\n } else if(AV + AO > 0 && Ds > 2) {\r\n if(sai(50)) {\r\n sum('CtoB');\r\n sum('BtoA');\r\n return null;\r\n } else {\r\n sum('CtoF');\r\n sum('FtoG');\r\n return null;\r\n }\r\n } else if(Ss > 2) {\r\n if(sai(50)) {\r\n sum('CtoD');\r\n return 'D';\r\n } else {\r\n sum('CtoF');\r\n sum('FtoG');\r\n return null;\r\n }\r\n } else if(BBCVs > 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else {\r\n sum('CtoF');\r\n sum('FtoG');\r\n return null;\r\n }\r\n break;\r\n case 'D':\r\n if(BBCVs > 4 || Ss === 6) {\r\n sum('DtoE');\r\n return null;\r\n } else if(AS === 1 && Ss === 5) {\r\n sum('DtoG');\r\n return null;\r\n } else {\r\n sum('DtoF');\r\n sum('FtoG');\r\n return null;\r\n }\r\n break;\r\n }\r\n break;\r\n case 2: // @3-2\r\n switch(edge) {\r\n case null:\r\n if(BBCVs > 0 || (CL === 1 && DD > 3) || DD === 6) {\r\n sum('1toC');\r\n return 'C';\r\n } else {\r\n sum('1toA');\r\n sum('AtoB');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(DD < 4 || BBs + CV + CVB > 1) {\r\n sum('CtoA');\r\n sum('AtoB');\r\n return null;\r\n } else if(BB > 0) {\r\n if(sai(50)) {\r\n sum('CtoA');\r\n sum('AtoB');\r\n return null;\r\n } else {\r\n sum('CtoG');\r\n return 'G';\r\n }\r\n } else if(f_speed === '低速艦隊' || f_radar === 0 || CL + DD + AO < 6) {\r\n sum('CtoG');\r\n return 'G';\r\n } else if(f_speed === '最速艦隊' && f_radar > 3) {\r\n sum('CtoE');\r\n return 'E';\r\n } else if(f_speed === '高速+艦隊' || AO > 0) {\r\n if(sai(60)) {\r\n sum('CtoG');\r\n return 'G';\r\n } else {\r\n sum('CtoE');\r\n return 'E';\r\n }\r\n } else {\r\n sum('CtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'E':\r\n if(f_speed === '高速+艦隊') {\r\n sum('EtoF');\r\n sum('FtoL');\r\n return null;\r\n } else {\r\n if(sai(80)) {\r\n sum('EtoF');\r\n sum('FtoL');\r\n return null;\r\n } else {\r\n sum('EtoD');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if(Ss > 0 || CV + CVB > 0 || BBs + CVL === 2) {\r\n sum('GtoJ');\r\n sum('JtoK');\r\n return null;\r\n } else if(f_speed === '低速艦隊' || f_radar === 0 || CL + DD + AO < 6) {\r\n sum('GtoH');\r\n return 'H';\r\n } else if(isFaster()) {\r\n sum('GtoF');\r\n sum('FtoL');\r\n return null;\r\n } else if(AO > 0) {\r\n if(sai(55)) {\r\n sum('GtoF');\r\n sum('FtoL');\r\n return null;\r\n } else {\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n } else {\r\n if(sai(65)) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('GtoF');\r\n sum('FtoL');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if(CL + DD + AO === 6) {\r\n sum('HtoF');\r\n sum('FtoL');\r\n return null;\r\n } else {\r\n sum('HtoI');\r\n return null;\r\n }\r\n break;\r\n }\r\n break;\r\n case 3: // @3-3\r\n switch(edge) {\r\n case null:\r\n sum('1toA');\r\n return 'A';\r\n break;\r\n case 'A':\r\n if(CV + CVB > 0 || BBs + CVL > 3 || BBs + CVL === 1 && CL === 1 && DD === 4) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoB');\r\n return 'B';\r\n }\r\n break;\r\n case 'B':\r\n if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('BtoD');\r\n return null;\r\n } else {\r\n sum('BtoF');\r\n return 'F';\r\n }\r\n } else if(BBs + CVL < 2 || (BBs + CVL < 3 && DD > 1)) {\r\n sum('BtoF');\r\n return 'F';\r\n } else {\r\n if(sai(50)) {\r\n sum('BtoD');\r\n return null;\r\n } else {\r\n sum('BtoF');\r\n return 'F';\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(Ds < 2 || CV + CVB > 1 || BBCVs > 2) {\r\n sum('CtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else if(BBCVs === 2 || (BBCVs === 1 && CL === 1 && DD === 4)) {\r\n sum('CtoG');\r\n return 'G';\r\n } else {\r\n sum('CtoE');\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'F':\r\n if(DD < 2 || BBs > 2) {\r\n sum('FtoG');\r\n return 'G';\r\n } else if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoJ');\r\n return 'J';\r\n }\r\n } else if(CL + CAV + AV > 0) {\r\n sum('FtoJ');\r\n return 'J';\r\n } else {\r\n if(sai(50)) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoJ');\r\n return 'J';\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoM');\r\n return null;\r\n }\r\n } else if(BBCVs < 4) {\r\n sum('GtoM');\r\n return null;\r\n } else if(BBCVs === 4) {\r\n if(sai(50)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoM');\r\n return null;\r\n }\r\n } else if(BBCVs === 5) {\r\n if(sai(65)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoM');\r\n return null;\r\n }\r\n } else if(BBCVs === 6) {\r\n if(sai(85)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoM');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'J':\r\n if(DD > 4 || (CL === 1 && DD > 3)) {\r\n sum('JtoM');\r\n return null;\r\n } else {\r\n sum('JtoK');\r\n return 'K';\r\n }\r\n break;\r\n case 'K':\r\n if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('KtoL');\r\n return null;\r\n } else {\r\n sum('KtoM');\r\n return null;\r\n }\r\n } else if(BBs + CVL < 2) {\r\n sum('KtoM');\r\n return null;\r\n } else if(BBs + CVL === 2) {\r\n if(sai(75)) {\r\n sum('KtoM');\r\n return null;\r\n } else {\r\n sum('KtoL');\r\n return null;\r\n }\r\n } else if(BBs + CVL === 3) {\r\n if(sai(50)) {\r\n sum('KtoM');\r\n return null;\r\n } else {\r\n sum('KtoL');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 4: // @3-4\r\n switch(edge) {\r\n case null:\r\n if(CL + Ds === 0 || BBCVs > 2) {\r\n sum('1toA');\r\n sum('AtoC');\r\n return 'C';\r\n } else if(BBCVs === 2 || Ss > 0) {\r\n if(sai(65)) {\r\n sum('1toB');\r\n sum('BtoH');\r\n return 'H';\r\n } else {\r\n sum('1toA');\r\n sum('AtoC');\r\n return 'C';\r\n }\r\n } else if(BBCVs === 1) {\r\n sum('1toB');\r\n sum('BtoH');\r\n return 'H';\r\n } else if(BBCVs === 0) {\r\n if(DD < 3) {\r\n if(sai(65)) {\r\n sum('1toB');\r\n sum('BtoH');\r\n return 'H';\r\n } else {\r\n sum('1toD');\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n } else {\r\n sum('1toD');\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n } // 航空戦艦により例外なし\r\n break;\r\n case 'C':\r\n if(CV + CVB > 2 || CL + Ds === 0 || BBCVs > 4) {\r\n sum('CtoB');\r\n sum('BtoH');\r\n return 'H';\r\n } else if(BBCVs === 2) {\r\n sum('CtoF');\r\n return 'F';\r\n } else if(AV + AO > 0) {\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else if(AS > 0) {\r\n if(sai(50)) {\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n } else {\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(BBCVs + CAs > 4) {\r\n sum('FtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else if(BBs + CV + CVB < 3 && CL > 0 && Ds > 1) {\r\n if(isFaster()) {\r\n sum('FtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.1) {\r\n sum('FtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else if(num <= 0.55) {\r\n sum('FtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n sum('FtoM');\r\n return 'M';\r\n }\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('FtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n sum('FtoM');\r\n return 'M';\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if(DD < 3 || CL + DD < 4 || CV + CVB > 0 || BBs + CVL > 1) {\r\n sum('HtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else if(CL + DD > 4) {\r\n sum('HtoL');\r\n return 'L';\r\n } else if(CL === 0) {\r\n sum('HtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n if(sai(65)) {\r\n sum('HtoL');\r\n return 'L';\r\n } else {\r\n sum('HtoG');\r\n sum('GtoJ');\r\n sum('JtoP');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'L':\r\n if(CAs + CL + DD === 6) {\r\n sum('LtoJ');\r\n sum('JtoP');\r\n return null;\r\n } else if(BBs + CVL === 0) {\r\n sum('LtoN');\r\n sum('NtoP');\r\n return null;\r\n } else {\r\n if(sai(50)) {\r\n sum('LtoN');\r\n sum('NtoP');\r\n return null;\r\n } else {\r\n sum('LtoO');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'M':\r\n if(CL > 0 && DD > 0) {\r\n sum('MtoP');\r\n return null;\r\n } else {\r\n if(sai(50)) {\r\n sum('MtoP');\r\n return null;\r\n } else {\r\n sum('MtoK');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 5: // @3-5\r\n switch(edge) {\r\n case null:\r\n if(Ss > 2 || BBs > 1 || BBs + CAs > 2 || CVs + CLT > 0) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(DD > 4) {\r\n sum('1toF');\r\n return 'F';\r\n } else if(DD === 4) {\r\n if(sai(75)) {\r\n sum('1toF');\r\n return 'F';\r\n } else {\r\n sum('1toB');\r\n return 'B';\r\n }\r\n } else if(DD < 4) {\r\n if(sai(50)) {\r\n sum('1toF');\r\n return 'F';\r\n } else {\r\n sum('1toB');\r\n return 'B';\r\n }\r\n } // DDより例外なし\r\n break;\r\n case 'B':\r\n if(Ss > 3 || CVs > 3 || BBCVs > 4) {\r\n sum('BtoA');\r\n return null;\r\n } else if(CLT > 1 || CVs > 1 || BBs > 2 || BBCVs + CAs > 4) {\r\n sum('BtoD');\r\n sum('DtoH');\r\n return 'H';\r\n } else if(CVs === 0 && CL === 1 && DD > 1) {\r\n sum('BtoE');\r\n sum('EtoH');\r\n return 'H';\r\n } else {\r\n sum('BtoC');\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(BBCVs + LHA > 0 || CL + CLT > 3 || CAs > 1) {\r\n sum('FtoE');\r\n sum('EtoH');\r\n return 'H';\r\n } else if(CAs === 1) {\r\n if(sai(75)) {\r\n sum('FtoG');\r\n return 'G';\r\n } else {\r\n sum('FtoE');\r\n sum('EtoH');\r\n return 'H';\r\n }\r\n } else if(CAs === 0) {\r\n if(CL === 3) {\r\n if(sai(85)) {\r\n sum('FtoG');\r\n return 'G';\r\n } else {\r\n sum('FtoE');\r\n sum('EtoH');\r\n return 'H';\r\n }\r\n } else if(CL < 3) {\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n } // CAsより例外なし\r\n break;\r\n case 'G':\r\n if(f_seek[3] < 23) {\r\n sum('GtoI');\r\n return null;\r\n } else if(f_seek[3] < 28 && f_seek[3] >= 23) {\r\n if(sai(50)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoK');\r\n return null;\r\n }\r\n } else if(f_seek[3] >= 28) {\r\n sum('GtoK');\r\n return null;\r\n } // 例外なし\r\n break;\r\n case 'H':\r\n if(BBCVs > 3 || (BBCVs > 1 && LHA > 0)) {\r\n sum('HtoJ');\r\n return null;\r\n } else if(f_seek[3] < 35) {\r\n sum('HtoJ');\r\n return null;\r\n } else if(f_seek[3] < 40 && f_seek[3] >= 35) {\r\n if(sai(50)) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(f_seek[3] >= 40) {\r\n sum('HtoK');\r\n return null;\r\n } // 例外なし\r\n break;\r\n }\r\n break;\r\n }\r\n break;\r\n case 4:\r\n switch(map) {\r\n case 1: // @4-1\r\n switch(edge) {\r\n case null:\r\n if(sai(50)) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoD');\r\n return 'D';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n break;\r\n case 'C':\r\n if(BBCVs > 4) {\r\n sum('CtoE');\r\n return null;\r\n } else if(BBCVs === 4) {\r\n if(sai(70)) {\r\n sum('CtoE');\r\n return null;\r\n } else {\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n } else if(BBCVs === 3) {\r\n if(sai(50)) {\r\n sum('CtoE');\r\n return null;\r\n } else {\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n } else if(BBCVs < 3) {\r\n sum('CtoF');\r\n return 'F';\r\n } // BBCVsより例外なし\r\n break;\r\n case 'D':\r\n if(BBCVs > 4) {\r\n sum('DtoH');\r\n return 'H';\r\n } else if(Ss < 0) {\r\n if(sai(70)) {\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n sum('DtoG');\r\n sum('GtoJ');\r\n return null;\r\n }\r\n } else if(BBCVs === 4 || Ds < 2) {\r\n sum('DtoG');\r\n sum('GtoJ');\r\n return null;\r\n } else if(BBCVs === 0 || Ds > 3) {\r\n sum('DtoH');\r\n return 'H';\r\n } else if(Ds === 3 || CL === 0) {\r\n sum('DtoG');\r\n sum('GtoJ');\r\n return null;\r\n } else if(CAs > 0 && CAs + CL + CT === 3) {\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n if(sai(50)) {\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n sum('DtoG');\r\n sum('GtoJ');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(BBCVs > 0 || Ds < 4) {\r\n sum('FtoD');\r\n return 'D';\r\n } else if(CL + CT > 0 || CAs === 0) {\r\n sum('FtoH');\r\n return 'H';\r\n } else {\r\n sum('FtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 'H':\r\n if(Ss === 1) {\r\n if(sai(50)) {\r\n sum('HtoI');\r\n return null;\r\n } else {\r\n sum('HtoJ');\r\n return null;\r\n }\r\n } else if(Ss > 1) {\r\n sum('HtoI');\r\n return null;\r\n } else if(BBCVs > 4) {\r\n sum('HtoI');\r\n return null;\r\n } else if(BBCVs < 2) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n if(sai(50)) {\r\n sum('HtoI');\r\n return null;\r\n } else {\r\n sum('HtoJ');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 2: // @4-2\r\n switch(edge) {\r\n case null:\r\n switch(Ds) {\r\n case 0:\r\n if(sai(90)) {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n } else {\r\n sum('1toA');\r\n return 'A';\r\n }\r\n break;\r\n case 1:\r\n if(sai(80)) {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n } else {\r\n sum('1toA');\r\n return 'A';\r\n }\r\n break;\r\n case 2:\r\n if(CV > 1) {\r\n if(sai(55)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } else if(CVs > 1) {\r\n if(sai(60)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } else if(CVs === 1) {\r\n if(sai(65)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } else if(CVs === 0) {\r\n if(sai(72.5)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } // CVsより例外なし\r\n break;\r\n case 3:\r\n if(CVs > 1) {\r\n if(sai(72.5)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } else if(CVs < 2) {\r\n if(sai(77.5)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } // CVsより例外なし\r\n break;\r\n case 4:\r\n if(sai(85)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 5:\r\n case 6:\r\n if(sai(90)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toB');\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n break;\r\n }\r\n break;\r\n case 'A':\r\n if(Ds < 2) {\r\n sum('AtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoE');\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n } else if(Ds > 3 || (CL > 0 && Ds > 2)) {\r\n sum('AtoC');\r\n return 'C';\r\n } else if(Ds === 3) {\r\n if(sai(85)) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoE');\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n } else if(CL > 0 && Ds === 2) {\r\n if(sai(85)) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoE');\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n } else {\r\n if(sai(55)) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoE');\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(Ds < 2 || BBCVs > 3) {\r\n sum('CtoG');\r\n return 'G';\r\n } else if(BBCVs === 3) {\r\n if(CL === 0) {\r\n if(sai(85)) {\r\n sum('CtoG');\r\n return 'G';\r\n } else {\r\n sum('CtoL');\r\n return null;\r\n }\r\n } else {\r\n if(sai(65)) {\r\n sum('CtoG');\r\n return 'G';\r\n } else {\r\n sum('CtoL');\r\n return null;\r\n }\r\n }\r\n } else if(CL > 0 || Ds > 3) {\r\n sum('CtoL');\r\n return null;\r\n } else {\r\n if(sai(65)) {\r\n sum('CtoG');\r\n return 'G';\r\n } else {\r\n sum('CtoL');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'D':\r\n if(BBCVs === 6) {\r\n sum('DtoH');\r\n return 'H';\r\n } else if(BBCVs < 3) {\r\n if(Ds > 1) {\r\n sum('DtoC');\r\n return 'C';\r\n } else {\r\n if(sai(60)) {\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n sum('DtoC');\r\n return 'C';\r\n }\r\n }\r\n } else if(Ds < 2) {\r\n if(sai(85)) {\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n sum('DtoC');\r\n return 'C';\r\n }\r\n } else if(BBs === 4) {\r\n if(sai(70)) {\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n sum('DtoC');\r\n return 'C';\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n sum('DtoC');\r\n return 'C';\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if(Ds > 2) {\r\n sum('GtoL');\r\n return null;\r\n } else if(Ds < 3) {\r\n if(CL + CAV + AV > 0) {\r\n sum('GtoL');\r\n return null;\r\n } else {\r\n if(sai(65)) {\r\n sum('GtoL');\r\n return null;\r\n } else {\r\n sum('GtoF');\r\n sum('FtoJ');\r\n return null;\r\n }\r\n }\r\n } else if(Ss > 0) { // @\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.5) {\r\n sum('GtoF');\r\n sum('FtoJ');\r\n return null;\r\n } else if(num <= 0.75) {\r\n sum('GtoL');\r\n return null;\r\n } else {\r\n sum('GtoI');\r\n return null;\r\n }\r\n } else if(BBCVs > 4) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.5) {\r\n sum('GtoI');\r\n return null;\r\n } else if(num <= 0.75) {\r\n sum('GtoL');\r\n return null;\r\n } else {\r\n sum('GtoF');\r\n sum('FtoJ');\r\n return null;\r\n }\r\n } else if(BBCVs < 2) {\r\n if(sai(85)) {\r\n sum('GtoL');\r\n return null;\r\n } else {\r\n sum('GtoF');\r\n sum('FtoJ');\r\n return null;\r\n }\r\n } else {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('GtoF');\r\n sum('FtoJ');\r\n return null;\r\n } else if(num <= 0.66) {\r\n sum('GtoL');\r\n return null;\r\n } else {\r\n sum('GtoI');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if(DD > 1) {\r\n sum('HtoG');\r\n return 'G';\r\n } else if(Ds > 1) {\r\n if(sai(80)) {\r\n sum('HtoG');\r\n return 'G';\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(BBCVs > 4) {\r\n if(sai(80)) {\r\n sum('HtoK');\r\n return null;\r\n } else {\r\n sum('HtoG');\r\n return 'G';\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('HtoK');\r\n return null;\r\n } else {\r\n sum('HtoG');\r\n return 'G';\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 3: // @4-3 nullがヤな感じ 多分こういうことだろうという\r\n switch (edge) {\r\n case null:\r\n if(CV + CVB > 0) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(Ds > 3 && (f_speed !== '低速艦隊' || BBs + CVL === 0)) {\r\n sum('1toD');\r\n sum('DtoH');\r\n return 'H';\r\n } else if(Ds > 2 && CL > 0) {\r\n sum('1toD');\r\n sum('DtoH');\r\n return 'H';\r\n } else if(Ds > 1 && CL + AO > 0) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n if(sai(50)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n }\r\n break;\r\n case 'A':\r\n if(AV + AO + BBV > 0) {\r\n sum('AtoB');\r\n return 'B';\r\n } else if(AO > 1 && Ds > 1){\r\n sum('AtoD');\r\n sum('DtoH');\r\n return 'H';\r\n } else if(CVL > 0) {\r\n sum('AtoB');\r\n return 'B';\r\n } else {\r\n if(sai(50)) {\r\n sum('AtoB');\r\n return 'B';\r\n } else {\r\n sum('AtoD');\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n }\r\n break;\r\n case 'B':\r\n if(Ds < 2 || BBs + CVL > 2) {\r\n sum('BtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else if(f_speed !== '低速艦隊') {\r\n sum('BtoG');\r\n return 'G';\r\n } else {\r\n if(sai(65)) {\r\n sum('BtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('BtoG');\r\n return 'G';\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(BBCVs > 3) {\r\n sum('CtoF');\r\n return 'F';\r\n } else if(Ss === 0 && CL === 1 && Ds > 1) {\r\n sum('CtoD');\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n if(sai(80)) {\r\n sum('CtoF');\r\n return 'F';\r\n } else {\r\n sum('CtoD');\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(Ss > 0 || DD === 0 || CVs === 0) {\r\n sum('FtoK');\r\n return 'K';\r\n } else if(f_speed !== '低速艦隊' && BBCVs < 3 && DD > 1) {\r\n sum('FtoH');\r\n return 'H';\r\n } else {\r\n if(sai(70)) { // @\r\n sum('FtoK');\r\n return 'K';\r\n } else {\r\n sum('FtoH');\r\n return 'H';\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if(CVL === 0) {\r\n sum('GtoJ');\r\n return null;\r\n } else {\r\n if(sai(65)) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('GtoI');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if(CVs === 2) {\r\n if(sai(90)) {\r\n sum('HtoN');\r\n return null;\r\n } else {\r\n sum('HtoI');\r\n return null;\r\n }\r\n } else if(CVs === 0 && CA === 2) {\r\n if(sai(80)) { // @\r\n sum('HtoN');\r\n return null;\r\n } else {\r\n sum('HtoI');\r\n return null;\r\n }\r\n } else {\r\n if(sai(70)) {\r\n sum('HtoN');\r\n return null;\r\n } else {\r\n sum('HtoI');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'K':\r\n if(Ss > 0 || (CVs > 2 || CVs === 0) || Ds < 2) {\r\n sum('KtoL');\r\n return 'L';\r\n } else if(CV + CVB === 1 && AV + CVL === 1) {\r\n if(sai(55)) {\r\n sum('KtoL');\r\n return 'L';\r\n } else {\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(CVs === 2) {\r\n if(sai(67.5)) {\r\n sum('KtoL');\r\n return 'L';\r\n } else {\r\n sum('KtoN');\r\n return null;\r\n }\r\n } else if(CVs === 1) {\r\n if(sai(85)) {\r\n sum('KtoL');\r\n return 'L';\r\n } else {\r\n sum('KtoN');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'L':\r\n if(CL + Ds === 0 || BBCVs > 4 || CVs === 0) {\r\n sum('LtoM');\r\n return null;\r\n } else if(CA === 2) {\r\n sum('LtoN');\r\n return null;\r\n } else if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('LtoM');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n } else if(BBCVs < 3) {\r\n sum('LtoN');\r\n return null;\r\n } else {\r\n if(sai(50)) {\r\n sum('LtoM');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 4: // @4-4\r\n switch(edge) {\r\n case null:\r\n if(Ds > 1) {\r\n sum('1toA');\r\n sum('AtoE');\r\n return 'E';\r\n } else {\r\n if(sai(50)) {\r\n sum('1toA');\r\n sum('AtoE');\r\n return 'E';\r\n } else {\r\n sum('1toB');\r\n return 'B';\r\n }\r\n }\r\n break;\r\n case 'B':\r\n if(BBCVs > 3) {\r\n sum('BtoA');\r\n sum('AtoE');\r\n return 'E';\r\n } else if(CA > 0) {\r\n if(sai(70)) {\r\n sum('BtoD');\r\n sum('DtoE');\r\n return 'E';\r\n } else {\r\n sum('BtoF');\r\n return 'F';\r\n }\r\n } else {\r\n sum('BtoD');\r\n sum('DtoE');\r\n return 'E';\r\n }\r\n break;\r\n case 'E':\r\n if(BBs + CV + CVB > 3) {\r\n sum('EtoG');\r\n return 'G';\r\n } else if(CAs + CL > 0 && Ds > 1) {\r\n sum('EtoI');\r\n return 'I';\r\n } else if(DE > 2 || (DE > 1 && AO + AS > 0)) {\r\n sum('EtoC');\r\n return null;\r\n } else if(Ds > 1) {\r\n if(BBCVs > 3) {\r\n if(sai(80)) {\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('EtoI');\r\n return 'I';\r\n }\r\n } else if(BBCVs < 4) {\r\n if(sai(65)) {\r\n sum('EtoI');\r\n return 'I';\r\n } else {\r\n sum('EtoG');\r\n return 'G';\r\n\r\n }\r\n } // BBCVsより例外なし\r\n } else if(Ss > 3) {\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n if(sai(50)) {\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('EtoI');\r\n return 'I';\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(BBCVs > 2) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'G': {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.25) {\r\n sum('GtoC');\r\n return null;\r\n } else if(num <= 0.75) {\r\n sum('GtoI');\r\n return 'I';\r\n } else {\r\n sum('GtoJ');\r\n return null;\r\n }\r\n break;\r\n }\r\n case 'I':\r\n if(Ds > 1) {\r\n if(CV + CVB === 2 || CAs === 2 || (CV + CVB === 0 && CL > 0)) {\r\n sum('ItoK');\r\n return null;\r\n } else {\r\n if(sai(75)) {\r\n sum('ItoK');\r\n return null;\r\n } else {\r\n sum('ItoH');\r\n return null;\r\n }\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('ItoK');\r\n return null;\r\n } else {\r\n sum('ItoH');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 5: // @4-5\r\n switch(edge) {\r\n case null:\r\n if(sai(50)) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n break;\r\n case 'A':\r\n if(active['4-5']['A'] === 'B') {\r\n sum('AtoB');\r\n sum('BtoE');\r\n return 'E';\r\n } else {\r\n sum('AtoD');\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'C':\r\n if(active['4-5']['C'] === 'F') {\r\n sum('CtoF');\r\n sum('FtoI');\r\n return 'I';\r\n } else {\r\n sum('CtoD');\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'E':\r\n if(isFaster() || AO > 0 || BBCVs > 2 || (CL > 0 && Ds > 1)) {\r\n sum('EtoM');\r\n return 'M';\r\n } else {\r\n sum('EtoK');\r\n return 'K';\r\n }\r\n break;\r\n case 'G':\r\n if(CL > 0 && Ds > 1) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n if(sai(50)) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('GtoD');\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if((isFaster() && BBCVs < 5) || (CL === 1 && Ds > 2) || (!track.includes('D') && CL === 1 && Ds > 1)) {\r\n sum('HtoT');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return 'K';\r\n }\r\n break;\r\n case 'I':\r\n if(active['4-5']['I'] === 'G') {\r\n sum('ItoG');\r\n return 'G';\r\n } else {\r\n sum('ItoJ');\r\n sum('JtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'K':\r\n if(track.includes('E') || BBs + CV + CVB > 3 || BBCVs > 4 || AO > 0) {\r\n sum('KtoM');\r\n return 'M';\r\n } else if(f_seek[1] < 63) {\r\n sum('KtoL');\r\n return null;\r\n } else if(f_seek[1] < 70 && f_seek[1] >= 63) {\r\n if(Ss > 0) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('KtoM');\r\n return 'M';\r\n } else if(num <= 0.66) {\r\n sum('KtoL');\r\n return null;\r\n } else {\r\n sum('KtoT');\r\n return null;\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('KtoL');\r\n return null;\r\n } else {\r\n sum('KtoT');\r\n return null;\r\n }\r\n }\r\n } else if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('KtoM');\r\n return null;\r\n } else {\r\n sum('KtoT');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 70) {\r\n sum('KtoT');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n case 'M':\r\n if(f_speed === '最速艦隊') {\r\n sum('MtoN');\r\n sum('NtoT');\r\n return null;\r\n } else if(DD < 2) {\r\n sum('MtoR');\r\n return 'R';\r\n } else if(f_speed === '高速+艦隊') {\r\n sum('MtoN');\r\n sum('NtoT');\r\n return null;\r\n } else if(f_speed === '低速艦隊') {\r\n sum('MtoR');\r\n return 'R';\r\n } else if(BBs + CV + CVB < 2) {\r\n sum('MtoN');\r\n sum('NtoT');\r\n return null;\r\n } else {\r\n sum('MtoR');\r\n return 'R';\r\n }\r\n break;\r\n case 'O':\r\n if(BBCVs > 4) {\r\n sum('OtoN');\r\n sum('NtoT');\r\n return null;\r\n } else {\r\n if(sai(50)) {\r\n sum('OtoN');\r\n sum('NtoT');\r\n return null;\r\n } else {\r\n sum('OtoT');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'Q':\r\n if(f_seek[1] < 55) {\r\n sum('QtoP');\r\n return null;\r\n } else if(f_seek[1] < 59 && f_seek[1] >= 55) {\r\n if(BBCVs > 4) {\r\n if(sai(50)) {\r\n sum('QtoO');\r\n return 'O';\r\n } else {\r\n sum('QtoP');\r\n return null;\r\n }\r\n } else if(DD === 0) {\r\n if(sai(50)) {\r\n sum('QtoO');\r\n return 'O';\r\n } else {\r\n sum('QtoP');\r\n return null;\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('QtoN');\r\n sum('NtoT');\r\n return null;\r\n } else {\r\n sum('QtoP');\r\n return null;\r\n }\r\n }\r\n } else if(BBCVs > 4 || DD === 0) {\r\n sum('QtoO');\r\n return 'O';\r\n } else if(f_seek[1] >= 59) {\r\n sum('QtoN');\r\n sum('NtoT');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n case 'R':\r\n if(f_speed === '高速+艦隊' || (f_speed !== '低速艦隊' && CL + CAV > 0 && DD > 1)) {\r\n sum('RtoN');\r\n sum('NtoT');\r\n return null;\r\n } else {\r\n sum('RtoS');\r\n sum('StoQ');\r\n return 'Q';\r\n }\r\n break;\r\n }\r\n break;\r\n }\r\n break;\r\n case 5:\r\n switch(map) {\r\n case 1: // @5-1 Fが怪しげではある\r\n switch(edge) {\r\n case null:\r\n if(BBCVs > 4) {\r\n sum('1toA');\r\n sum('AtoD');\r\n sum('DtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else if((BBCVs < 3 && DD > 1) || (CAs > 3 && CL > 0) || (CAs > 1 && CL === 1)) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(BBs === 3 && CL === 1 && DD === 2) {\r\n if(sai(75)) {\r\n sum('1toB');\r\n return 'B';\r\n } else {\r\n sum('1toA');\r\n sum('AtoD');\r\n sum('DtoE');\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('1toB');\r\n return 'B';\r\n } else {\r\n sum('1toA');\r\n sum('AtoD');\r\n sum('DtoE');\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n }\r\n break;\r\n case 'B':\r\n if(CV + CVB > 0 || CVL > 1) {\r\n sum('BtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else if(BBs < 3) {\r\n sum('BtoC');\r\n sum('CtoF');\r\n return 'F';\r\n } else if(CL === 1) {\r\n sum('BtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else if(DD > 1) {\r\n sum('BtoC');\r\n sum('CtoF');\r\n return 'F';\r\n } else {\r\n if(sai(50)) {\r\n sum('BtoE');\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('BtoC');\r\n sum('CtoF');\r\n return 'F';\r\n }\r\n }\r\n break;\r\n case 'F':\r\n if(CL + DD === 0 || BBs + CVL > 3) {\r\n sum('FtoH');\r\n return null;\r\n } else if(BBs + CVL === 3) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('FtoG');\r\n return 'G';\r\n } else if(num <= 0.66) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoJ');\r\n return null;\r\n }\r\n } else if(f_speed === '最速艦隊') {\r\n sum('FtoJ');\r\n return null;\r\n } else if(CL > 0) {\r\n if(DD > 1) {\r\n sum('FtoJ');\r\n return null;\r\n } else {\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n } else if(DD > 3) {\r\n sum('FtoJ');\r\n return null;\r\n } else if(DD === 3) {\r\n if(sai(70)) {\r\n sum('FtoJ');\r\n return null;\r\n } else {\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n } else if(DD === 2) {\r\n if(sai(70)) {\r\n sum('FtoG');\r\n return 'G';\r\n } else {\r\n sum('FtoJ');\r\n return null;\r\n }\r\n } else if(DD === 1) {\r\n sum('FtoG');\r\n return 'G';\r\n } // DDより例外なし 多分\r\n break;\r\n case 'G':\r\n if(BBCVs > 4) {\r\n sum('GtoI');\r\n return null;\r\n } else if(CVs > 0 && BBCVs > 2) {\r\n if(sai(50)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoJ');\r\n return null;\r\n }\r\n } else if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoJ');\r\n return null;\r\n }\r\n } else if(f_speed === '高速+艦隊') {\r\n sum('GtoJ');\r\n return null;\r\n } else if(CAs > 3) {\r\n if(BBCVs + CLT === 0) {\r\n sum('GtoJ');\r\n return null;\r\n } else {\r\n if(sai(70)) {\r\n sum('GtoJ');\r\n return null;\r\n } else {\r\n sum('GtoI');\r\n return null;\r\n }\r\n }\r\n } else if(CV + CVB > 0) {\r\n if(sai(70)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoJ');\r\n return null;\r\n }\r\n } else if(DD > 3 || (CAs > 1 && DD > 1) || (CL > 0 && DD > 1)) {\r\n sum('GtoJ');\r\n return null;\r\n } else if(BBs === 3 && CL === 1 && CAs === 2) {\r\n if(sai(85)) {\r\n sum('GtoJ');\r\n return null;\r\n } else {\r\n sum('GtoI');\r\n return null;\r\n }\r\n } else {\r\n if(sai(70)) {\r\n sum('GtoI');\r\n return null;\r\n } else {\r\n sum('GtoJ');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 2: // @5-2\r\n switch(edge) {\r\n case null:\r\n if(BBCVs > 4 || BBs > 3 || CV + CVB > 2 || Ss > 0) {\r\n if(sai(50)) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n break;\r\n case 'C':\r\n if((CVs === 2 && CAs === 2 && DD === 2) || (isInclude('夕張') && CVL + CAs + DD + AO === 5) || (isInclude('祥鳳') && CAs + CL + CT + DD + AO === 5)) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(f_speed === '低速艦隊') {\r\n sum('CtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(isInclude('翔鶴') && isInclude('瑞鶴') && DD > 1) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(BBs + CV + CVB > 0) {\r\n sum('CtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if((CVL === 2 && DD > 1) || (CVL === 1 && CAs > 0 && DD > 1)) {\r\n sum('CtoD');\r\n return 'D';\r\n } else {\r\n sum('CtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'D':\r\n if((isInclude('祥鳳') && DD === 3) && (((CA === 1 && (CL === 1 || AO === 1)) || AO === 2))) {\r\n sum('DtoG');\r\n return 'G';\r\n } else if(isInclude('夕張') && DD === 2) {\r\n if(DD === 3 || (AO === 1 && (DD === 2 || CA === 2)) || (AO == 2 && (DD === 1 || CA === 2)) || (isInclude('祥鳳') && (CA === 2 || AO === 2))) {\r\n sum('DtoG');\r\n return 'G';\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_seek[1] < 63) {\r\n sum('FtoH');\r\n return null;\r\n } else if(f_seek[1] < 70 && f_seek[1] >= 63) {\r\n if(BBs + CV + CVB > 4) {\r\n if(sai(50)) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoI');\r\n sum('ItoO');\r\n return null;\r\n }\r\n } else if(BBs > 2 || CVs > 2) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('FtoH');\r\n return null;\r\n } else if(num <= 0.66) {\r\n sum('FtoI');\r\n sum('ItoO');\r\n return null;\r\n } else {\r\n sum('FtoO');\r\n return null;\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('FtoH');\r\n return null;\r\n } else {\r\n sum('FtoO');\r\n return null;\r\n }\r\n }\r\n } else if(BBs + CV + CVB > 4) {\r\n sum('FtoI');\r\n sum('ItoO');\r\n return null;\r\n } else if(BBs > 2 || CVs > 2) {\r\n if(sai(70)) {\r\n sum('FtoI');\r\n sum('ItoO');\r\n return null;\r\n } else {\r\n sum('FtoO');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 70) {\r\n sum('FtoO');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n case 'G':\r\n if(isInclude('祥鳳') && isInclude('夕張')) {\r\n if(sai(55)) {\r\n sum('GtoJ');\r\n sum('JtoL');\r\n return 'L';\r\n } else {\r\n sum('GtoL');\r\n return 'L';\r\n }\r\n } else {\r\n if(sai(85)) {\r\n sum('GtoJ');\r\n sum('JtoL');\r\n return 'L';\r\n } else {\r\n sum('GtoL');\r\n return 'L';\r\n }\r\n }\r\n break;\r\n case 'L':\r\n if(!isInclude('祥鳳') && !isInclude('夕張')) {\r\n if(isFaster()) {\r\n if(sai(50)) {\r\n sum('LtoK');\r\n sum('KtoO');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n } else if(f_seek[1] < 60) {\r\n if(sai(50)) {\r\n sum('LtoM');\r\n sum('MtoK');\r\n sum('KtoO');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n } else if(f_seek[1] < 62 && f_seek[1] >= 60) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('LtoK');\r\n sum('KtoO');\r\n return null;\r\n } else if(num <= 0.66) {\r\n sum('LtoM');\r\n sum('MtoK');\r\n sum('KtoO');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 62) {\r\n if(sai(50)) {\r\n sum('LtoK');\r\n sum('KtoO');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n } // LoSより例外なし\r\n } if(isFaster()) {\r\n sum('LtoK');\r\n sum('KtoO');\r\n return null;\r\n } else if(f_seek[1] < 62 && f_seek[1] >= 60) {\r\n if(sai(50)) {\r\n sum('LtoK');\r\n sum('KtoO');\r\n return null;\r\n } else {\r\n sum('LtoM');\r\n sum('MtoK');\r\n sum('KtoO');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 62) {\r\n sum('LtoK');\r\n sum('KtoO');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n case 3: // @5-3\r\n switch(edge) {\r\n case null:\r\n if(isFaster()) {\r\n sum('1toD');\r\n sum('DtoG');\r\n return 'G';\r\n } else if(BBCVs > 2 || (BBCVs === 2 && f_speed === '低速艦隊')) {\r\n sum('1toC');\r\n sum('CtoD');\r\n sum('DtoG');\r\n return 'G';\r\n } else if(Ss > 0) {\r\n if(sai(60)) {\r\n sum('1toD');\r\n sum('DtoG');\r\n return 'G';\r\n } else {\r\n sum('1toC');\r\n sum('CtoD');\r\n sum('DtoG');\r\n return 'G';\r\n }\r\n } else {\r\n sum('1toD');\r\n sum('DtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'B':\r\n if(sai(65)) {\r\n sum('BtoA');\r\n return null;\r\n } else {\r\n sum('BtoF');\r\n return null;\r\n }\r\n break;\r\n case 'E':\r\n if(Ss > 0 || (BBCVs > 0 && DD < 2)) {\r\n if(sai(50)) {\r\n sum('EtoB');\r\n return 'B';\r\n } else {\r\n sum('EtoQ');\r\n return null;\r\n }\r\n } else if(CL > 0 || CAs > 3 || DD > 3) {\r\n sum('EtoQ');\r\n return null;\r\n } else {\r\n if(sai(50)) {\r\n sum('EtoB');\r\n return 'B';\r\n } else {\r\n sum('EtoQ');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'G':\r\n if(BBV + CV + CVB + Ss > 0) {\r\n sum('GtoJ');\r\n return 'J';\r\n } else if(DD === 0 || CVL > 1) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(CVL === 1) {\r\n sum('GtoJ');\r\n return 'J';\r\n } else if(DD === 1) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(countSBB() > 1) {\r\n sum('GtoJ');\r\n return 'J';\r\n } else {\r\n sum('GtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'I':\r\n if(CVL > 0 || BBs > 2) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else if(DD > 2 || (CL > 0 && DD > 1)) {\r\n sum('ItoO');\r\n return 'O';\r\n } else if(BBs > 1) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else if(DD > 1) {\r\n sum('ItoO');\r\n return 'O';\r\n } else if(CL > 0 && CAs > 3 && CAs + CL + DD === 6) {\r\n sum('ItoO');\r\n return 'O';\r\n } else {\r\n if(sai(50)) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else {\r\n sum('ItoO');\r\n return 'O';\r\n }\r\n }\r\n break;\r\n case 'J':\r\n if(Ss > 0) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('JtoL');\r\n sum('LtoO');\r\n return 'O';\r\n } else if(num <= 0.66) {\r\n sum('JtoM');\r\n return null;\r\n } else {\r\n sum('JtoN');\r\n sum('NtoO');\r\n return 'O';\r\n }\r\n } else if(BBCVs > 3 || CV + CVB > 0 ||CVL > 1) {\r\n sum('JtoM');\r\n return null;\r\n } else if(CVL === 1) {\r\n if(countSBB() > 1) {\r\n sum('JtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else if(BBV > 0) {\r\n if(sai(50)) {\r\n sum('JtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('JtoL');\r\n sum('LtoO');\r\n return 'O';\r\n }\r\n } else if(DD > 2|| (CL > 0 && DD > 1) || (CAs === 3 && DD === 2)) {\r\n sum('JtoL');\r\n sum('LtoO');\r\n return 'O';\r\n } else {\r\n if(sai(50)) {\r\n sum('JtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('JtoL');\r\n sum('LtoO');\r\n return 'O';\r\n }\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('JtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('JtoL');\r\n sum('LtoO');\r\n return 'O';\r\n }\r\n }\r\n break;\r\n case 'O':\r\n if(active['5-3']['O'] === 'K') {\r\n sum('OtoK');\r\n return 'K';\r\n } else {\r\n sum('OtoP');\r\n sum('PtoK');\r\n return 'K';\r\n }\r\n break;\r\n case 'K':\r\n if(DD > 3 || (DD === 3 && CL === 1)) {\r\n sum('KtoH');\r\n sum('HtoE');\r\n return 'E';\r\n } else if(DD === 2 && (isFaster() || BBV + AO + AS > 0 || f_drum > 1 || f_craft > 1)) {\r\n sum('KtoH');\r\n sum('HtoE');\r\n return 'E';\r\n } else {\r\n sum('KtoE');\r\n return 'E';\r\n }\r\n break;\r\n }\r\n break;\r\n case 4: // @5-4\r\n switch(edge) {\r\n case null:\r\n if(CVs > 0) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(BBs > 2 || CAs > 4) {\r\n sum('1toA');\r\n return 'A';\r\n } else if(f_drum + f_craft > 4 || DD > 3 || (CL === 1 && DD > 2)) {\r\n sum('1toB');\r\n return 'B';\r\n } else {\r\n sum('1toA');\r\n return 'A';\r\n }\r\n break;\r\n case 'A':\r\n if(Ss > 0 || BBs > 4 || DD > 1 || CAs > 2) {\r\n sum('AtoD');\r\n return 'D';\r\n } else {\r\n sum('AtoF');\r\n sum('FtoH');\r\n sum('HtoI');\r\n sum('ItoJ');\r\n sum('JtoM');\r\n return 'M';\r\n }\r\n break;\r\n case 'B':\r\n if(CVs + Ss > 0) {\r\n sum('BtoC');\r\n sum('CtoG');\r\n return 'G';\r\n } else if((BBs > 0 && f_speed === '低速艦隊') || BBV + countSBB() > 1) {\r\n sum('BtoD');\r\n return 'D';\r\n } else if(isFaster() || (CL === 1 && DD > 2) || DD > 3) {\r\n sum('BtoE');\r\n sum('EtoH');\r\n sum('HtoI');\r\n sum('ItoJ');\r\n sum('JtoM');\r\n return 'M';\r\n } else if(DD === 0) {\r\n sum('BtoD');\r\n return 'D';\r\n } else {\r\n if(sai(50)) {\r\n sum('BtoD');\r\n return 'D';\r\n } else {\r\n sum('BtoE');\r\n sum('EtoH');\r\n sum('HtoI');\r\n sum('ItoJ');\r\n sum('JtoM');\r\n return 'M';\r\n }\r\n }\r\n break;\r\n case 'D':\r\n if(Ss > 0 || countSBB() > 1 || BBs > 2) {\r\n sum('DtoF');\r\n sum('FtoH');\r\n sum('HtoI');\r\n sum('ItoJ');\r\n sum('JtoM');\r\n return 'M';\r\n } else if(DD > 1) {\r\n sum('DtoE');\r\n sum('EtoH');\r\n sum('HtoI');\r\n sum('ItoJ');\r\n sum('JtoM');\r\n return 'M';\r\n } else {\r\n sum('DtoF');\r\n sum('FtoH');\r\n sum('HtoI');\r\n sum('ItoJ');\r\n sum('JtoM');\r\n return 'M';\r\n }\r\n break;\r\n case 'G':\r\n if(Ss > 0 || BBs > 3) {\r\n sum('GtoK');\r\n sum('KtoL');\r\n return 'L';\r\n } else if(CV + CVB < 3) {\r\n sum('GtoL');\r\n return 'L';\r\n } else {\r\n if(sai(70)) {\r\n sum('GtoL');\r\n return 'L';\r\n } else {\r\n sum('GtoK');\r\n sum('KtoL');\r\n return 'L';\r\n }\r\n }\r\n break;\r\n case 'L':\r\n if(isFaster()) {\r\n sum('LtoP');\r\n return null;\r\n } else if(f_seek[1] < 56) {\r\n sum('LtoN');\r\n return null;\r\n } else if((f_seek[1] < 60 && f_seek[1] >= 56) || BBs + CV + CVB > 4) {\r\n if(sai(50)) {\r\n sum('LtoP');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 60) {\r\n sum('LtoP');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n case 'M':\r\n if(isFaster()) {\r\n sum('MtoP');\r\n return null;\r\n } else if(f_seek[1] < 41) {\r\n sum('MtoO');\r\n return null;\r\n } else if((f_seek[1] < 45 && f_seek[1] >= 41)) {\r\n if(sai(50)) {\r\n sum('MtoP');\r\n return null;\r\n } else {\r\n sum('MtoO');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 45) {\r\n if(Ss > 0) {\r\n if(sai(66.6)) {\r\n sum('MtoP');\r\n return null;\r\n } else {\r\n sum('MtoO');\r\n return null;\r\n }\r\n } else {\r\n sum('MtoP');\r\n return null;\r\n }\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n case 5: // @5-5\r\n switch(edge) {\r\n case null:\r\n if(DD > 3 || f_drum > 3 || f_craft > 3) {\r\n sum('1toA');\r\n sum('AtoC');\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'B':\r\n if(CV + CVB > 2 || BBs + CLT > 3 || CLT > 2 || DD < 2) {\r\n sum('BtoK');\r\n sum('KtoP');\r\n return 'P';\r\n } else {\r\n sum('BtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'E':\r\n if(f_speed === '最速艦隊' || (DD > 1 && f_speed === '高速+艦隊')) {\r\n sum('EtoH');\r\n return 'H';\r\n } else {\r\n sum('EtoG');\r\n sum('GtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'F':\r\n if(active['5-5']['F'] === 'D') {\r\n sum('FtoD');\r\n sum('DtoH');\r\n return 'H';\r\n } else {\r\n sum('FtoJ');\r\n sum('JtoP');\r\n return 'P';\r\n }\r\n break;\r\n case 'H':\r\n if(f_speed === '最速艦隊') {\r\n sum('HtoN');\r\n return 'N';\r\n } else if(BBCVs > 3) {\r\n sum('HtoP');\r\n return 'P';\r\n } else if(DD < 2) {\r\n sum('HtoL');\r\n sum('LtoN');\r\n return 'N';\r\n } else {\r\n sum('HtoN');\r\n return 'N';\r\n }\r\n break;\r\n case 'I':\r\n if(BBCVs === 3 && DD > 1) {\r\n sum('ItoL');\r\n sum('LtoN');\r\n return 'N';\r\n } else {\r\n sum('ItoM');\r\n return 'M';\r\n }\r\n break;\r\n case 'M':\r\n if(track.includes('N')) {\r\n sum('MtoO');\r\n return 'O';\r\n } else if(BBCVs > 3 || DD < 2) {\r\n sum('MtoL');\r\n sum('LtoN');\r\n return 'N';\r\n } else {\r\n sum('MtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'N':\r\n if(track.includes('M') || isFaster() || AO > 0) {\r\n sum('NtoO');\r\n return 'O';\r\n } else if(CV + CVB > 0 || BBs + CVL > 2 || DD < 2) {\r\n sum('NtoM');\r\n return 'M';\r\n } else {\r\n sum('NtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'O':\r\n if(isFaster()) {\r\n sum('OtoS');\r\n return null;\r\n } else if(f_seek[1] < 63) {\r\n sum('OtoR');\r\n return null;\r\n } else if((f_seek[1] < 66 & f_seek[1] >= 63) || Ss > 0) {\r\n if(sai(50)) {\r\n sum('OtoS');\r\n return null;\r\n } else {\r\n sum('OtoR');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 66) {\r\n sum('OtoS');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n case 'P':\r\n if(f_speed === '最速艦隊') {\r\n sum('PtoS');\r\n return null;\r\n } else if(f_speed === '高速+艦隊') {\r\n if(Ss > 0) {\r\n if(sai(50)) {\r\n sum('PtoQ');\r\n return null;\r\n } else {\r\n sum('PtoS');\r\n return null;\r\n }\r\n } else if(BBCVs < 6) {\r\n sum('PtoS');\r\n return null;\r\n } else {\r\n if(sai(50)) {\r\n sum('PtoQ');\r\n return null;\r\n } else {\r\n sum('PtoS');\r\n return null;\r\n }\r\n }\r\n } else if(f_seek[1] < 73) {\r\n sum('PtoQ');\r\n return null;\r\n } else if((f_seek[1] < 80 && f_seek[1] >= 73) || Ss > 0 || BBCVs > 4) {\r\n if(sai(66.6)) {\r\n sum('PtoS');\r\n return null;\r\n } else {\r\n sum('PtoQ');\r\n return null;\r\n }\r\n } else if(f_seek[1] >= 80) {\r\n sum('PtoS');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n }\r\n break;\r\n case 6:\r\n switch(map) {\r\n case 1: // @6-1\r\n switch(edge) {\r\n case null:\r\n if(BBCVs + CAs > 2 || BBs > 1) {\r\n sum('1toB');\r\n return null;\r\n } else if((Ss > 2 && Ss === f_length) || (AS === 1 && Ss > 2 && AS + Ss === f_length) || (AS === 1 && Ss === 3 && DD === 2) || (AS === 1 && Ss === 4 && CL + DD === 1)) {\r\n sum('1toA');\r\n return 'A';\r\n } else if(CL + DD === 0) {\r\n sum('1toB');\r\n return null;\r\n } else {\r\n sum('1toC');\r\n sum('CtoF');\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'A':\r\n if(AS > 0) {\r\n sum('AtoF');\r\n sum('FtoG');\r\n return 'G';\r\n } else {\r\n sum('AtoD');\r\n sum('DtoF');\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'G':\r\n if(Ss < 3 || BBCVs + CAs === 2 || f_seek[3] < 12) {\r\n sum('GtoI');\r\n return null;\r\n } else if(AS > 0 && f_seek[3] >= 16) {\r\n sum('GtoH');\r\n return 'H';\r\n } else if(AS === 0 && f_seek[3] >= 16) {\r\n if(sai(85)) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('GtoI');\r\n return null;\r\n }\r\n } else {\r\n if(sai(50)) {\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('GtoI');\r\n return null;\r\n }\r\n }\r\n break;\r\n case 'H':\r\n if(f_seek[3] < 20) {\r\n sum('HtoE');\r\n return null;\r\n } else if(AS > 0) {\r\n if(f_seek[3] < 25 && f_seek[3] >= 20) {\r\n if(sai(50)) {\r\n sum('HtoE');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(f_seek[3] >= 25) {\r\n sum('HtoK');\r\n return null;\r\n } // LoSより例外なし\r\n } else if(f_seek[3] < 25 && f_seek[3] >= 20) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('HtoE');\r\n return null;\r\n } else if(num <= 0.66) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(f_seek[3] < 36 && f_seek[3] >= 25) {\r\n if(sai(50)) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(f_seek[3] >= 36) {\r\n sum('HtoK');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n case 2: // @6-2\r\n switch(edge) {\r\n case null:\r\n if(CL + DD > 3) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(BBV + CAV + AV + LHA < 2 && Ss < 5) {\r\n if(BBCVs > 4) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(BBCVs > 3) {\r\n if(sai(65)) {\r\n sum('1toB');\r\n return 'B';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n break;\r\n case 'B':\r\n if(CL + DD > 4) {\r\n sum('BtoD');\r\n return 'D';\r\n } else if(CVs < 3 && BBs === 0) {\r\n if(sai(70)) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n } else {\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n break;\r\n case 'C':\r\n if(Ss === 6 || BBCVs > 4 || BBCVs + CAs === 6 || BBCVs + Ss === 6) {\r\n sum('CtoA');\r\n return null;\r\n } else if(BBCVs < 3) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 'D':\r\n if(DD < 3 || BBCVs > 0 || CL + DD < 5) {\r\n sum('DtoF');\r\n sum('FtoI');\r\n return 'I';\r\n } else {\r\n sum('DtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'E':\r\n if(BBs > 1 || CVs > 1 || DD < 2) {\r\n sum('EtoF');\r\n sum('FtoI');\r\n return 'I';\r\n } else if(f_seek[2] < 43) {\r\n sum('EtoI');\r\n return 'I';\r\n } else if(f_seek[2] < 50 && f_seek[2] >= 43) {\r\n if(sai(50)) {\r\n sum('EtoI');\r\n return 'I';\r\n } else {\r\n sum('EtoJ');\r\n sum('JtoK');\r\n return null;\r\n }\r\n } else if(f_seek[2] >= 50) {\r\n sum('EtoJ');\r\n sum('JtoK');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n case 'H':\r\n if(f_seek[2] < 32) {\r\n sum('HtoG');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n break;\r\n case 'I':\r\n if(Ss > 3 || f_seek[2] < 35) {\r\n sum('ItoG');\r\n return null;\r\n } else if(f_seek[2] < 40 && f_seek[2] >= 35) {\r\n if(sai(50)) {\r\n sum('ItoG');\r\n return null;\r\n } else {\r\n sum('ItoK');\r\n return null;\r\n }\r\n } else if(f_seek[2] >= 40) {\r\n sum('ItoK');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n case 3: // @6-3\r\n switch(edge) {\r\n case null:\r\n sum('1toA');\r\n return 'A';\r\n break;\r\n case 'A':\r\n if(active['6-3']['A'] === 'B') {\r\n sum('AtoB');\r\n sum('BtoD');\r\n sum('DtoE');\r\n return 'E';\r\n } else {\r\n sum('AtoC');\r\n sum('CtoE');\r\n return 'E';\r\n }\r\n break;\r\n case 'E':\r\n if(AV < 2) {\r\n if(CL < 2 && DD > 2) {\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else if(CL < 3) {\r\n if(sai(60)) {\r\n sum('EtoF');\r\n sum('FtoH');\r\n return 'H';\r\n } else {\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n } else {\r\n sum('EtoF');\r\n sum('FtoH');\r\n return 'H';\r\n }\r\n } else {\r\n sum('EtoF');\r\n sum('FtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'H':\r\n if(f_seek[2] < 36) {\r\n sum('HtoI');\r\n return null;\r\n } else if(f_seek[2] < 38 && f_seek[2] >= 36) {\r\n if(sai(50)) {\r\n sum('HtoI');\r\n return null;\r\n } else {\r\n sum('HtoJ');\r\n return null;\r\n }\r\n } else if(f_seek[2] >= 38) {\r\n sum('HtoJ');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n case 4: // @6-4\r\n switch(edge) {\r\n case null:\r\n if(LHA + CVs > 0 || ((!isInclude('長門改二') && !isInclude('陸奥改二')) && BBs === 2) || CAV > 2) {\r\n sum('2toM');\r\n sum('MtoK');\r\n return 'K';\r\n } else if(f_speed !== '低速艦隊' && ((isFCL() && DD === 3) || DD > 3)) {\r\n sum('1toB');\r\n sum('BtoD');\r\n sum('DtoC');\r\n sum('CtoF');\r\n sum('FtoN');\r\n return null;\r\n } else if(DD > 1) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('2toM');\r\n sum('MtoK');\r\n return 'K';\r\n }\r\n break;\r\n case 'A':\r\n if(isInclude('秋津洲') && (CAV === 1 || CL > 0 || DD > 2)) {\r\n sum('AtoD');\r\n sum('DtoC');\r\n sum('CtoF');\r\n sum('FtoN');\r\n return null;\r\n } else if(BBs > 0 || f_speed === '低速艦隊') {\r\n sum('AtoE');\r\n return 'E';\r\n } else if(isFCL() || DD > 2) {\r\n sum('AtoD');\r\n sum('DtoC');\r\n sum('CtoF');\r\n sum('FtoN');\r\n return null;\r\n } else {\r\n sum('AtoE');\r\n return 'E';\r\n }\r\n break;\r\n case 'E':\r\n if(isInclude('秋津洲') || isInclude('如月')) {\r\n sum('EtoD');\r\n sum('DtoC');\r\n sum('CtoF');\r\n sum('FtoN');\r\n return null;\r\n } else if(CAs < 2 && CL > 0 && f_speed !== '低速艦隊') {\r\n sum('EtoD');\r\n sum('DtoC');\r\n sum('CtoF');\r\n sum('FtoN');\r\n return null;\r\n } else {\r\n sum('EtoG');\r\n sum('GtoD');\r\n sum('DtoC');\r\n sum('CtoF');\r\n sum('FtoN');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if(isInclude('長門改二') && isInclude('陸奥改二') && CVs === 2) {\r\n sum('JtoL');\r\n sum('LtoI');\r\n sum('ItoN');\r\n return null;\r\n } else if(!isInclude('長門改二') && !isInclude('陸奥改二') && (BBCVs > 2 || BBs === 2)) {\r\n sum('JtoL');\r\n sum('LtoI');\r\n sum('ItoN');\r\n return null;\r\n } else if(CL === 0) {\r\n sum('JtoL');\r\n sum('LtoI');\r\n sum('ItoN');\r\n return null;\r\n } else if(LHA > 0 && DD > 1) {\r\n sum('JtoN');\r\n return null;\r\n } else if(CVs > 1 && f_speed === '低速艦隊') {\r\n sum('JtoL');\r\n sum('LtoI');\r\n sum('ItoN');\r\n return null;\r\n } else {\r\n sum('JtoI');\r\n sum('ItoN');\r\n return null;\r\n }\r\n break;\r\n case 'K':\r\n if(BBs === 2 || BBs + CAs > 2) {\r\n sum('KtoH');\r\n sum('HtoJ');\r\n return 'J';\r\n } else if(DD > 1) {\r\n sum('KtoJ');\r\n return 'J';\r\n } else {\r\n sum('KtoH');\r\n sum('HtoJ');\r\n return 'J';\r\n }\r\n break;\r\n }\r\n break;\r\n case 5: // @6-5\r\n switch(edge) {\r\n case null:\r\n if(CL === 0 || CVs + CLT > 0 || BBs > 3) {\r\n sum('1toA');\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('2toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'B':\r\n if(BBs === 3 || DD < 2) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoF');\r\n sum('FtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'C':\r\n if(DD === 0 || CLT > 1 || BBCVs > 3 || BBCVs + CAs > 4) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('CtoD');\r\n sum('DtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'E':\r\n if(CVs > 0 && CL > 0 && DD > 0) {\r\n sum('EtoH');\r\n sum('HtoG');\r\n return 'G';\r\n } else {\r\n sum('EtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'G':\r\n if(f_seek[2] < 50) {\r\n sum('GtoK');\r\n return null;\r\n } else {\r\n sum('GtoM');\r\n return null;\r\n }\r\n break;\r\n case 'I':\r\n if(CL === 0) {\r\n sum('ItoH');\r\n sum('HtoG');\r\n return 'G';\r\n } else if(DD > 1 || (BBs === 0 && CVs + CAs < 5 && CVs < 3)) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else {\r\n sum('ItoH');\r\n sum('HtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'J':\r\n if(f_seek[2] < 35) {\r\n sum('JtoL');\r\n return null;\r\n } else {\r\n sum('JtoM');\r\n return null;\r\n }\r\n break;\r\n }\r\n break;\r\n }\r\n break;\r\n case 7:\r\n switch(map) {\r\n case 1: // @7-1\r\n switch(edge) {\r\n case null:\r\n if(Ss > 0) {\r\n if(BBCVs > 0 || f_length > 4) {\r\n if(sai(50)) {\r\n sum('1toB');\r\n return 'B';\r\n } else {\r\n sum('1toD');\r\n return 'D';\r\n }\r\n } else if(f_length < 5) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(num <= 0.66) {\r\n sum('1toD');\r\n return 'D';\r\n } else {\r\n sum('1toF');\r\n sum('FtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n }\r\n } else if(BBCVs > 0 || f_length === 6) {\r\n sum('1toB');\r\n return 'B';\r\n } else if(f_length === 5 || AO > 0) {\r\n sum('1toD');\r\n return 'D';\r\n } else if(f_length < 5) {\r\n sum('1toF');\r\n sum('FtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } // f_lengthより例外なし\r\n break;\r\n case 'B':\r\n if(BBs + CV + CVB > 0 || CVL > 1 || CAs > 2) {\r\n sum('BtoA');\r\n sum('AtoC');\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else if(DD + DE > 1) {\r\n sum('BtoC');\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n if(sai(50)) {\r\n sum('BtoA');\r\n sum('AtoC');\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('BtoC');\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n }\r\n break;\r\n case 'D':\r\n if((CL === 1 && DD === 4) || (DD > 0 && DE > 2) || (AO > 0 && DE > 2) || Ds === 5) {\r\n sum('DtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else if(Ds === 4) {\r\n if(CT + AO > 0) {\r\n sum('DtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else if(AV > 0) {\r\n if(sai(50)) {\r\n sum('DtoC');\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n } else {\r\n sum('DtoC');\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n } else {\r\n sum('DtoC');\r\n sum('CtoE');\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'H':\r\n if((CL > 0 && DD > 3) || (DD > 0 && DE > 2)) {\r\n sum('HtoK');\r\n return null;\r\n } else if(AO > 0) {\r\n if(sai(50)) {\r\n sum('HtoI');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else if(BBCVs > 1) {\r\n sum('HtoJ');\r\n return null;\r\n } else if(BBCVs === 1) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('HtoI');\r\n return null;\r\n } else if(num <= 0.66) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n } else {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.225) {\r\n sum('HtoI');\r\n return null;\r\n } else if(num <= 0.30) {\r\n sum('HtoJ');\r\n return null;\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 2: // @7-2\r\n switch(edge) {\r\n case null:\r\n if(Ds < 2 || Ss > 0) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(f_length === 6) {\r\n if(CV + CVB > 1 || BBs + CV + CVB > 3 || CL + CT > 2) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('1toB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n } else if(f_length === 5) {\r\n if(CV + CVB > 2) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(BBs + CV + CVB > 0 || CL + CT > 1 || DE < 3) {\r\n sum('1toB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n } else if(f_length < 5) {\r\n if(BBs + CV + CVB > 0 || Ds < 3) {\r\n sum('1toB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n } // f_lengthより例外なし\r\n break;\r\n case 'C':\r\n if(AO + Ss > 0) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(f_length === 6) {\r\n if(BBs + CV + CVB > 0) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(Ds > 3) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_length === 5) {\r\n if(BBs + CV + CVB > 1) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(Ds > 3 || DE > 2) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_length < 5) {\r\n if(BBs + CV + CVB > 1) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(Ds > 2 || DE > 1) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } // f_lengthより例外なし\r\n break;\r\n case 'D':\r\n if(isFaster()) {\r\n sum('DtoI');\r\n return 'I';\r\n } else if(BBCVs > 3) {\r\n sum('DtoH');\r\n sum('HtoI');\r\n return 'I';\r\n } else if(f_speed !== '低速艦隊') {\r\n sum('DtoI');\r\n return 'I';\r\n } else if(BBCVs === 3) {\r\n sum('DtoH');\r\n sum('HtoI');\r\n return 'I';\r\n } else if(BBCVs === 2) {\r\n if(sai(65)) {\r\n sum('DtoI');\r\n return 'I';\r\n } else {\r\n sum('DtoH');\r\n sum('HtoI');\r\n return 'I';\r\n }\r\n } else if(BBCVs < 2) {\r\n sum('DtoI');\r\n return 'I';\r\n } // BBCVsより例外なし\r\n break;\r\n case 'E':\r\n if(f_length < 6 || Ds > 4 || (DD > 0 && DE > 2)) {\r\n sum('EtoG');\r\n return null;\r\n } else if(f_seek[3] < 46) {\r\n sum('EtoF');\r\n return null;\r\n } else {\r\n sum('EtoG');\r\n return null;\r\n }\r\n break;\r\n case 'I':\r\n if(AO > 0 || (AV > 0 && Ds > 2)) {\r\n sum('ItoJ');\r\n sum('JtoK');\r\n return null;\r\n } else if(f_seek[3] < 63) {\r\n sum('ItoJ');\r\n sum('JtoK');\r\n return null;\r\n } else if(f_seek[3] < 69 && f_seek[3] >= 63) {\r\n const num = Math.random().toFixed(2);\r\n if(num <= 0.33) {\r\n sum('ItoJ');\r\n sum('JtoK');\r\n return null;\r\n } else if(num <= 0.66) {\r\n sum('ItoL');\r\n return null;\r\n } else {\r\n sum('ItoM');\r\n return null;\r\n }\r\n } else if(f_seek[3] >= 69) {\r\n sum('ItoM');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n case 3: // @7-3\r\n if(active['7-3']['1'] === '0') {\r\n // 解放前\r\n switch(edge) {\r\n case null:\r\n sum('1toA');\r\n return 'A';\r\n break;\r\n case 'A':\r\n if(f_length === 1) {\r\n sum('AtoC');\r\n return 'C';\r\n } else if(CA === 0 || CVs > 0 || Ds === 0 || f_length > 4) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(isInclude('羽黒') && isInclude('神風')) {\r\n sum('AtoC');\r\n return 'C';\r\n } else if(f_length === 4) {\r\n if(CA > 1 || Ds < 2) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(CA + CL + Ds === f_length) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n } else if(f_length < 4) {\r\n if(CA + CL + Ds === f_length) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n } // f_lengthより例外なし\r\n break;\r\n case 'C':\r\n if(BBCVs > 0 || Ds === 0 || f_length > 4) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(isInclude('羽黒') && isInclude('神風')) {\r\n if(CAs > 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(isInclude('足柄') || isInclude('妙高')) {\r\n sum('CtoE');\r\n return null;\r\n } else if(Ds < 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else {\r\n sum('CtoE');\r\n return null;\r\n }\r\n } else if(f_length === 4) {\r\n if(isInclude('羽黒') && Ds === 3) {\r\n sum('CtoE');\r\n return null;\r\n } else if(isInclude('神風') && Ds === 4) {\r\n sum('CtoE');\r\n return null;\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_length === 3) {\r\n if(CAs > 1 || Ds < 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(CA + Ds === f_length) {\r\n sum('CtoE');\r\n return null;\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_length < 3) {\r\n sum('CtoE');\r\n return null;\r\n } // f_lengthより例外なし\r\n break;\r\n case 'D':\r\n if(BBCVs > 0 || f_length === 6 || CAs > 3 || CAV > 1) {\r\n sum('DtoF');\r\n return null;\r\n } else {\r\n sum('DtoE');\r\n return null;\r\n }\r\n break;\r\n }\r\n } else {\r\n // 解放後\r\n switch(edge) {\r\n case null:\r\n sum('1toA');\r\n return 'A';\r\n break;\r\n case 'A':\r\n if(f_length === 1) {\r\n sum('AtoC');\r\n return 'C';\r\n } else if(CVs > 0) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(AO === 1 && BBs > 2) {\r\n sum('AtoC');\r\n return 'C';\r\n } else if(CA === 0 || Ds === 0 || (BBs > 0 && !isInclude('羽黒'))) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(isInclude('羽黒') && isInclude('神風')) {\r\n sum('AtoC');\r\n return 'C';\r\n } else if(f_length > 4) {\r\n if(!isInclude('羽黒') && f_speed === '低速艦隊') {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(Ds < 3) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoC');\r\n return 'C';\r\n }\r\n } else if(f_length === 4) {\r\n if(CA > 1 || Ds < 2) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(CA + CL + Ds === f_length) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n } else if(f_length < 4) {\r\n if(CA + CL + Ds === f_length) {\r\n sum('AtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(BBCVs > 0 || Ds === 0) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(f_speed === '最速艦隊') {\r\n sum('CtoI');\r\n return 'I';\r\n } else if(f_length > 4) {\r\n if(isFaster() && CL + DD > 3) {\r\n sum('CtoI');\r\n return 'I';\r\n } else if(f_length === 6) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(isInclude('羽黒') && isInclude('神風')) {\r\n if(Ds < 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(CL > 0 || isInclude('足柄')) {\r\n sum('CtoI');\r\n return 'I';\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_speed !== '低速艦隊' && CA === 1 && CL === 1 && DD === 3) {\r\n sum('CtoI');\r\n return 'I';\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_length === 4) {\r\n if(isInclude('羽黒') && isInclude('神風')) {\r\n if(CAs > 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(isInclude('足柄') || isInclude('妙高')) {\r\n sum('CtoE');\r\n return null;\r\n } else if(Ds < 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else {\r\n sum('CtoE');\r\n return null;\r\n }\r\n } else if((isInclude('羽黒') && Ds === 3) || (isInclude('神風') && Ds === 4)) {\r\n sum('CtoE');\r\n return null;\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_length < 4) {\r\n if(CAs > 1 || Ds < 2) {\r\n sum('CtoD');\r\n return 'D';\r\n } else if(CA + Ds === f_length) {\r\n sum('CtoE');\r\n return null;\r\n } else {\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(f_length < 3) {\r\n sum('CtoE');\r\n return null;\r\n } // f_lengthより例外なし\r\n break;\r\n case 'D':\r\n if(BBs > 2 || CVs > 2 || CAV > 2) {\r\n sum('DtoF');\r\n return null;\r\n } else {\r\n sum('DtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'G':\r\n if(CA === 0 && Ds > 1 && (AO > 0 || AV > 1)) {\r\n sum('GtoH');\r\n return null;\r\n } else if(Ss > 0) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(BBCVs > 0) {\r\n sum('GtoJ');\r\n return 'J';\r\n } else if(isInclude('羽黒') && isInclude('神風')) {\r\n if(f_length < 5) {\r\n sum('GtoP');\r\n return null;\r\n } else if(DD < 3) {\r\n sum('GtoJ');\r\n return 'J';\r\n } else if(isFaster()) {\r\n sum('GtoP');\r\n return null;\r\n } else if(CAs > 2 || f_speed === '低速艦隊') {\r\n sum('GtoJ');\r\n return 'J';\r\n } else if(isInclude('足柄')) {\r\n sum('GtoP');\r\n return null;\r\n } else {\r\n sum('GtoK');\r\n sum('KtoP');\r\n return null;\r\n }\r\n } else if(Ds < 3 || CAs > 2) {\r\n sum('GtoJ');\r\n return 'J';\r\n } else {\r\n sum('GtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'I':\r\n if(BBCVs > 0 || CAs > 2 || Ds === 0) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else if(isInclude('羽黒') && isInclude('神風')) {\r\n if(Ds > 2) {\r\n if(isFaster()) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else {\r\n sum('ItoM');\r\n return 'M';\r\n }\r\n } else if(Ds === 2) {\r\n if(f_speed === '最速艦隊') {\r\n sum('ItoM');\r\n return 'M';\r\n } else {\r\n sum('ItoL');\r\n sum('LtoM');\r\n return 'M';\r\n }\r\n } else if(Ds === 1) {\r\n sum('ItoL');\r\n sum('LtoM');\r\n return 'M';\r\n } // Dsより例外なし\r\n } else if(f_speed === '最速艦隊' && DD > 2) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else if((isInclude('羽黒') || isInclude('神風')) && isInclude('足柄') && Ds > 2) {\r\n sum('ItoM');\r\n return 'M';\r\n } else {\r\n sum('ItoL');\r\n sum('LtoM');\r\n return 'M';\r\n }\r\n break;\r\n case 'J':\r\n if(BBCVs > 0 || f_speed === '低速艦隊' || CAs > 3) {\r\n sum('JtoM');\r\n return 'M';\r\n } else if(DD > 2) {\r\n if((isInclude('羽黒') && isInclude('足柄')) || (isInclude('羽黒') && isInclude('神風'))) {\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n sum('JtoM');\r\n return 'M';\r\n }\r\n } else if(DD === 2) {\r\n if(isInclude('羽黒') && isInclude('神風') && isInclude('足柄')) {\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n sum('JtoM');\r\n return 'M';\r\n }\r\n } else if(DD === 1) {\r\n sum('JtoM');\r\n return 'M';\r\n } else { // wikiに記載なし\r\n sum('JtoM');\r\n return 'M';\r\n }\r\n break;\r\n case 'M':\r\n if(CV + CVB > 0 || BBCVs > 1 || Ss > 3) {\r\n sum('MtoN');\r\n return null;\r\n } else if(countSBB() > 0 || AO > 0 || AV > 1) {\r\n sum('MtoO');\r\n return null;\r\n } else {\r\n sum('MtoP');\r\n return null;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n case 4: // @7-4\r\n switch(edge) {\r\n case null:\r\n if(BB + CV + CVB + Ss > 0 || CAs > 1 || CL + CT + CLT > 1) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(isInclude('あきつ丸') && DE === 2 && (DD === 1 || DE === 1)) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoE');\r\n return 'E';\r\n } else if((BBV + CVL === 2 && isInclude('あきつ丸')) || BBV + CVL > 2) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(Ds > 2 || DE > 1) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoE');\r\n return 'E';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n break;\r\n case 'C':\r\n if(BB + CV + CVB + Ss > 0 || CVL + countShipsStartWith('あきつ丸') > 2) {\r\n sum('CtoD');\r\n sum('DtoF');\r\n return 'F';\r\n } else if(Ds > 3 || (CT > 0 && Ds > 2) || DE > 2 || (isFaster() && DD > 1)) {\r\n sum('CtoE');\r\n return 'E';\r\n } else {\r\n sum('CtoD');\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'E':\r\n if(AO + LHA > 0 && DE > 3 && countTaiyo() + AO + LHA + DD + DE === 6) {\r\n sum('EtoG');\r\n sum('GtoL');\r\n sum('LtoP');\r\n return null;\r\n } else {\r\n sum('EtoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'F':\r\n if(active['7-4']['F'] === 'H') {\r\n sum('FtoH');\r\n sum('HtoK');\r\n sum('KtoM');\r\n return 'M';\r\n } else {\r\n sum('FtoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'G':\r\n // 索敵で分岐するようだが不明 とりあえず素通りで実装\r\n break;\r\n case 'J':// 日本語wiki正直わからん\r\n if(track.includes('D')) {\r\n sum('JtoK');\r\n sum('KtoM');\r\n return 'M';\r\n } else if(track.includes('E')) {\r\n if(f_seek[3] < 33) {\r\n sum('JtoK');\r\n sum('KtoM');\r\n return 'M';\r\n } else if(f_seek[3] < 37 && f_seek[3] >= 33) {\r\n if(sai(50)) {\r\n if(CT > 0 && DE > 2 && countTaiyo() + CT + Ds === 5 && f_length === 5) {\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n sum('JtoL');\r\n sum('LtoP');\r\n return null;\r\n }\r\n } else {\r\n sum('JtoK');\r\n sum('KtoM');\r\n return 'M';\r\n }\r\n } else if(f_seek[3] >= 37) {\r\n if(CT > 0 && DE > 2 && countTaiyo() + CT + Ds === 5 && f_length === 5) {\r\n sum('JtoP');\r\n return null;\r\n } else {\r\n sum('JtoL');\r\n sum('LtoP');\r\n return null;\r\n }\r\n } // LoSより例外なし\r\n } // DかEどっちかは通る\r\n break;\r\n case 'K':\r\n // KtoPは見つかってないらしい 全てMへ\r\n break;\r\n case 'M':\r\n if(f_seek[3] < 45) {\r\n sum('MtoN');\r\n return null;\r\n } else if((countSBB() > 0 && CV + CVB > 0) || (BBs - countSBB() > 1) || BBV > 1 || (CVL > 1 || (CVL === 1 && isInclude('あきつ丸'))) || (BBs - countSBB() + BBV + CVL > 2 || (BBs - countSBB() + BBV + CVL === 2 && isInclude('あきつ丸'))) || Ds < 2) {\r\n if(f_seek[3] < 47 && f_seek[3] >= 45) {\r\n if(sai(50)) {\r\n sum('MtoN');\r\n return null;\r\n } else {\r\n sum('MtoO');\r\n return null;\r\n }\r\n } else if(f_seek[3] >= 47){\r\n sum('MtoO');\r\n return null;\r\n } // LoSより例外なし\r\n } else {\r\n sum('MtoP');\r\n return null;\r\n }\r\n break;\r\n }\r\n break;\r\n case 5: // @7-5\r\n switch(edge) {\r\n case null:\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n break;\r\n case 'B':\r\n if(isFaster()) {\r\n sum('BtoD');\r\n return 'D';\r\n } else if(CV + CVB > 1 || countSBB() > 1 || Ss > 0 || CL === 0 || Ds < 2) {\r\n sum('BtoC');\r\n sum('CtoD');\r\n return 'D';\r\n } else if(Ds > 2) {\r\n sum('BtoD');\r\n return 'D';\r\n } else if(CV + CVB > 0 || CVL > 1 || BBs > 2 || CAs > 2) {\r\n sum('BtoC');\r\n sum('CtoD');\r\n return 'D';\r\n } else {\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 'D':\r\n if(f_speed === '最速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(CV + CVB > 1 || CVs > 2 || BBs + CAs > 2 || BBs + CV + CVB + CAs > 2 || Ss > 0 || CL + DD === 0) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(f_speed === '高速+艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(Ds < 2) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(Ds > 2 || f_speed !== '低速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if((CAV === 1 && BBV === 1 && CL === 1 && DD === 3 && f_speed === '低速艦隊') || (CAV === 2 && CVL === 1 && CL === 1 && DD === 2 && f_speed === '低速艦隊')) { // 例外的にFへ\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(active['7-5']['F'] === 'G') {\r\n sum('FtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n sum('FtoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'H':\r\n if(active['7-5']['H'] === 'I') {\r\n sum('HtoI');\r\n return 'I';\r\n } else {\r\n sum('HtoK');\r\n return null;\r\n }\r\n break;\r\n case 'I':\r\n if(f_seek[3] < 53) {\r\n sum('ItoL');\r\n sum('LtoM');\r\n return null;\r\n } else if(f_seek[3] < 59 && f_seek[3] >= 53) {\r\n if(sai(50)) {\r\n sum('ItoL');\r\n sum('LtoM');\r\n return null;\r\n } else {\r\n sum('ItoM');\r\n return null;\r\n }\r\n } else if(f_seek[3] >= 59) {\r\n sum('ItoM');\r\n return null;\r\n } // LoSより例外なし\r\n break;\r\n case 'J':\r\n if((CVL === 1 && CAs === 2 && CL === 1 && Ds === 2) || isFaster()) {\r\n sum('JtoO');\r\n return 'O';\r\n } else if(CV + CVB > 0 || CVL > 2 || countSBB() > 1 || BBs + CAs > 2 || Ds < 2) {\r\n sum('JtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else if(Ds > 2 || f_speed !== '低速艦隊') {\r\n sum('JtoO');\r\n return 'O';\r\n } else {\r\n sum('JtoN');\r\n sum('NtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'O':\r\n if(active['7-5']['O'] === 'P') {\r\n sum('OtoP');\r\n return 'P';\r\n } else {\r\n sum('OtoQ');\r\n return null;\r\n }\r\n break;\r\n case 'P':\r\n if(f_seek[3] < 58) {\r\n sum('PtoS');\r\n return null;\r\n } else if(f_seek[3] < 63 && f_seek[3] >= 58) {\r\n if(sai(33.3)) {\r\n sum('PtoR');\r\n sum('RtoT');\r\n return null;\r\n } else {\r\n if(f_speed === '最速艦隊') {\r\n sum('PtoT');\r\n return null;\r\n } else if(CV + CVB > 0 || BBs + CVL > 1 || BBs + CAs > 2 || CL === 0) {\r\n sum('PtoR');\r\n sum('RtoT');\r\n return null;\r\n } else {\r\n sum('PtoT');\r\n return null;\r\n }\r\n }\r\n } else if(f_seek[3] >= 63) {\r\n if(f_speed === '最速艦隊') {\r\n sum('PtoT');\r\n return null;\r\n } else if(CV > 0 || BBs + CVL > 1 || BBs + CAs > 2 || CL === 0) {\r\n sum('PtoR');\r\n sum('RtoT');\r\n return null;\r\n } else {\r\n sum('PtoT');\r\n return null;\r\n }\r\n } // LoSより例外なし\r\n break;\r\n }\r\n break;\r\n }\r\n break;\r\n case 57:\r\n switch(map) {\r\n case 7: // @57-7\r\n if(active['57-7']['1'] === '1') {\r\n switch(edge) {\r\n case null:\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n break;\r\n case 'A':\r\n if(CV > 0 || CL === 0) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(f_speed === '低速艦隊' && Ds < 4) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else {\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n break;\r\n case 'A1':\r\n if((BBs < 3 || (CV > 0 && Ds > 3)) && CL > 0 && Ds > 2) {\r\n sum('A1toA2');\r\n return 'A2';\r\n } else {\r\n sum('A1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A2':\r\n if(active['57-7']['A2'] === 'A3') {\r\n sum('A2toA3');\r\n return 'A3';\r\n } else {\r\n sum('A2toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A3':\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('A3toA5');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(f_seek[3] < 86) {\r\n sum('BtoB1');\r\n return null;\r\n } else {\r\n sum('BtoB2');\r\n return 'B2';\r\n }\r\n break;\r\n case 'B2':\r\n if(active['57-7']['B2'] === 'B3') {\r\n sum('B2toB3');\r\n return null;\r\n } else {\r\n sum('B2toB4');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['57-7']['C'] === 'A3') {\r\n sum('CtoA3');\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('CtoC1');\r\n sum('C1toC2');\r\n return 'C2';\r\n }\r\n break;\r\n case 'C2':\r\n if(CV < 3) {\r\n sum('C2toD');\r\n return 'D';\r\n } else {\r\n sum('C2toC3');\r\n return null;\r\n }\r\n break;\r\n case 'D':\r\n if(f_speed !== '低速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(BBCVs > 5) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(DD > 3) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_speed === '低速艦隊') {\r\n sum('FtoG');\r\n sum('GtoH');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return null;\r\n }\r\n break;\r\n }\r\n } else if(active['57-7']['1'] === '2') {\r\n switch(edge) {\r\n case null:\r\n if(f_type === '空母機動部隊') {\r\n sum('2toI');\r\n sum('ItoJ');\r\n return 'J';\r\n } else {\r\n sum('1toC');\r\n return 'C';\r\n }\r\n break;\r\n case 'A':\r\n if(CV > 0 || CL === 0) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(f_speed === '低速艦隊' && Ds < 4) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else {\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n break;\r\n case 'A1':\r\n if((BBs < 3 || (CV > 0 && Ds > 3)) && CL > 0 && Ds > 2) {\r\n sum('A1toA2');\r\n return 'A2';\r\n } else {\r\n sum('A1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A2':\r\n if(active['57-7']['A2'] === 'A3') {\r\n sum('A2toA3');\r\n return 'A3';\r\n } else {\r\n sum('A2toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A3':\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('A3toA5');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(f_seek[3] < 86) {\r\n sum('BtoB1');\r\n return null;\r\n } else {\r\n sum('BtoB2');\r\n return 'B2';\r\n }\r\n break;\r\n case 'B2':\r\n if(active['57-7']['B2'] === 'B3') {\r\n sum('B2toB3');\r\n return null;\r\n } else {\r\n sum('B2toB4');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['57-7']['C'] === 'A3') {\r\n sum('CtoA3');\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('CtoC1');\r\n sum('C1toC2');\r\n return 'C2';\r\n }\r\n break;\r\n case 'C2':\r\n if(CV < 3) {\r\n sum('C2toD');\r\n return 'D';\r\n } else {\r\n sum('C2toC3');\r\n return null;\r\n }\r\n break;\r\n case 'D':\r\n if(f_speed !== '低速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(BBCVs > 5) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(DD > 3) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_speed === '低速艦隊') {\r\n sum('FtoG');\r\n sum('GtoH');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return null;\r\n }\r\n break; // ここまで同じ\r\n case 'J':\r\n if(active['57-7']['J'] === 'K') {\r\n sum('JtoK');\r\n return 'K';\r\n } else {\r\n sum('JtoL');\r\n return null;\r\n }\r\n break;\r\n case 'K':\r\n if(BBs > 2) {\r\n sum('KtoM');\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n } else {\r\n sum('KtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n }\r\n } else if(active['57-7']['1'] === '3') {\r\n switch(edge) {\r\n case null:\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('1toA');\r\n return 'A';\r\n } else if(f_type === '水上打撃部隊' && BBs > 3) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(f_type === '輸送護衛部隊') {\r\n sum('3toQ');\r\n return 'Q';\r\n } else {\r\n sum('2toI');\r\n sum('ItoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'A':\r\n if(CV > 0 || CL === 0) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(f_speed === '低速艦隊' && Ds < 4) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else {\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n break;\r\n case 'A1':\r\n if((BBs < 3 || (CV > 0 && Ds > 3)) && CL > 0 && Ds > 2) {\r\n sum('A1toA2');\r\n return 'A2';\r\n } else {\r\n sum('A1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A2':\r\n if(active['57-7']['A2'] === 'A3') {\r\n sum('A2toA3');\r\n return 'A3';\r\n } else {\r\n sum('A2toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A3':\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('A3toA5');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(f_seek[3] < 86) {\r\n sum('BtoB1');\r\n return null;\r\n } else {\r\n sum('BtoB2');\r\n return 'B2';\r\n }\r\n break;\r\n case 'B2':\r\n if(active['57-7']['B2'] === 'B3') {\r\n sum('B2toB3');\r\n return null;\r\n } else {\r\n sum('B2toB4');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['57-7']['C'] === 'A3') {\r\n sum('CtoA3');\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('CtoC1');\r\n sum('C1toC2');\r\n return 'C2';\r\n }\r\n break;\r\n case 'C2':\r\n if(CV < 3) {\r\n sum('C2toD');\r\n return 'D';\r\n } else {\r\n sum('C2toC3');\r\n return null;\r\n }\r\n break;\r\n case 'D':\r\n if(f_speed !== '低速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(BBCVs > 5) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(DD > 3) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_speed === '低速艦隊') {\r\n sum('FtoG');\r\n sum('GtoH');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return null;\r\n }\r\n break; // ここまで同じ\r\n case 'J':\r\n if(active['57-7']['J'] === 'K') {\r\n sum('JtoK');\r\n return 'K';\r\n } else {\r\n sum('JtoL');\r\n return null;\r\n }\r\n break;\r\n case 'K':\r\n if(BBs > 2) {\r\n sum('KtoM');\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n } else {\r\n sum('KtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n case 'Q':\r\n if(f_speed === '低速艦隊' && BBV + CAs > 2) {\r\n sum('QtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('QtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'O':\r\n if(f_type === '輸送護衛部隊') {\r\n sum('OtoR');\r\n sum('RtoS');\r\n sum('StoP');\r\n return null;\r\n } else {\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n }\r\n } else if(active['57-7']['1'] === '4') {\r\n switch(edge) {\r\n case null:\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('1toA');\r\n return 'A';\r\n } else if(f_type === '水上打撃部隊' && BBs > 3) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(f_type === '輸送護衛部隊') {\r\n sum('3toQ');\r\n return 'Q';\r\n } else {\r\n sum('2toI');\r\n sum('ItoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'A':\r\n if(CV > 0 || CL === 0) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(f_speed === '低速艦隊' && Ds < 4) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else {\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n break;\r\n case 'A1':\r\n if((BBs < 3 || (CV > 0 && Ds > 3)) && CL > 0 && Ds > 2) {\r\n sum('A1toA2');\r\n return 'A2';\r\n } else {\r\n sum('A1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A2':\r\n if(active['57-7']['A2'] === 'A3') {\r\n sum('A2toA3');\r\n return 'A3';\r\n } else {\r\n sum('A2toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A3':\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('A3toA5');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(f_seek[3] < 86) {\r\n sum('BtoB1');\r\n return null;\r\n } else {\r\n sum('BtoB2');\r\n return 'B2';\r\n }\r\n break;\r\n case 'B2':\r\n if(active['57-7']['B2'] === 'B3') {\r\n sum('B2toB3');\r\n return null;\r\n } else {\r\n sum('B2toB4');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['57-7']['C'] === 'A3') {\r\n sum('CtoA3');\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('CtoC1');\r\n sum('C1toC2');\r\n return 'C2';\r\n }\r\n break;\r\n case 'C2': // 更新部分\r\n if(f_type === '空母機動部隊' && f_speed !== '低速艦隊' && (AR + AO > 0 || isInclude('秋津洲'))) {\r\n sum('C2toL');\r\n return 'L';\r\n } else if(CV < 3) {\r\n sum('C2toD');\r\n return 'D';\r\n } else {\r\n sum('C2toC3');\r\n return null;\r\n }\r\n break;\r\n case 'D':\r\n if(f_speed !== '低速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(BBCVs > 5) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(DD > 3) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_speed === '低速艦隊') {\r\n sum('FtoG');\r\n sum('GtoH');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if(active['57-7']['J'] === 'K') {\r\n sum('JtoK');\r\n return 'K';\r\n } else {\r\n sum('JtoL');\r\n return null;\r\n }\r\n break;\r\n case 'L': // 追加\r\n if(BBCVs < 6) {\r\n sum('LtoT');\r\n sum('TtoU');\r\n return 'U';\r\n } else {\r\n sum('LtoN');\r\n return 'N';\r\n }\r\n break;\r\n case 'K':\r\n if(BBs > 2) {\r\n sum('KtoM');\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n } else {\r\n sum('KtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n case 'Q':\r\n if(f_speed === '低速艦隊' && BBV + CAs > 2) {\r\n sum('QtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('QtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'N':\r\n if(track.includes('K')) {\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('NtoT');\r\n sum('TtoU');\r\n return 'U';\r\n }\r\n break;\r\n case 'O':\r\n if(f_type === '輸送護衛部隊') {\r\n sum('OtoR');\r\n sum('RtoS');\r\n sum('StoP');\r\n return null;\r\n } else {\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n case 'U':\r\n if(BBs > 4) {\r\n sum('UtoV');\r\n sum('VtoX');\r\n return null;\r\n } else {\r\n sum('UtoX');\r\n return null;\r\n }\r\n break;\r\n }\r\n } else if(active['57-7']['1'] === '5') {\r\n switch(edge) {\r\n case null:\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('1toA');\r\n return 'A';\r\n } else if(f_type === '水上打撃部隊' && BBs > 3) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(f_type === '輸送護衛部隊') {\r\n sum('3toQ');\r\n return 'Q';\r\n } else {\r\n sum('2toI');\r\n sum('ItoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'A':\r\n if(CV > 0 || CL === 0) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(f_speed === '低速艦隊' && Ds < 4) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else {\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n break;\r\n case 'A1':\r\n if((BBs < 3 || (CV > 0 && Ds > 3)) && CL > 0 && Ds > 2) {\r\n sum('A1toA2');\r\n return 'A2';\r\n } else {\r\n sum('A1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A2':\r\n if(active['57-7']['A2'] === 'A3') {\r\n sum('A2toA3');\r\n return 'A3';\r\n } else {\r\n sum('A2toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A3':\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('A3toA5');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(f_seek[3] < 86) {\r\n sum('BtoB1');\r\n return null;\r\n } else {\r\n sum('BtoB2');\r\n return 'B2';\r\n }\r\n break;\r\n case 'B2':\r\n if(active['57-7']['B2'] === 'B3') {\r\n sum('B2toB3');\r\n return null;\r\n } else {\r\n sum('B2toB4');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['57-7']['C'] === 'A3') {\r\n sum('CtoA3');\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('CtoC1');\r\n sum('C1toC2');\r\n return 'C2';\r\n }\r\n break;\r\n case 'C2': // 更新部分\r\n if(f_type === '空母機動部隊' && f_speed !== '低速艦隊' && (AR + AO > 0 || isInclude('秋津洲'))) {\r\n sum('C2toL');\r\n return 'L';\r\n } else if(CV < 3) {\r\n sum('C2toD');\r\n return 'D';\r\n } else {\r\n sum('C2toC3');\r\n return null;\r\n }\r\n break;\r\n case 'D':\r\n if(f_speed !== '低速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(BBCVs > 5) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(DD > 3) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_speed === '低速艦隊') {\r\n sum('FtoG');\r\n sum('GtoH');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if(active['57-7']['J'] === 'K') {\r\n sum('JtoK');\r\n return 'K';\r\n } else {\r\n sum('JtoL');\r\n return 'L';\r\n }\r\n break;\r\n case 'L': // 追加\r\n if(BBCVs < 6) {\r\n sum('LtoT');\r\n sum('TtoU');\r\n return 'U';\r\n } else {\r\n sum('LtoN');\r\n return 'N';\r\n }\r\n break;\r\n case 'K':\r\n if(BBs > 2) {\r\n sum('KtoM');\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n } else {\r\n sum('KtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n case 'Q':\r\n if(f_speed === '低速艦隊' && BBV + CAs > 2) {\r\n sum('QtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('QtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'N':\r\n if(track.includes('K')) {\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('NtoT');\r\n sum('TtoU');\r\n return 'U';\r\n }\r\n break;\r\n case 'O':\r\n if(f_type === '輸送護衛部隊') {\r\n sum('OtoR');\r\n sum('RtoS');\r\n sum('StoP');\r\n return null;\r\n } else {\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n case 'U':\r\n if(BBs > 4) {\r\n sum('UtoV');\r\n sum('VtoX');\r\n return 'X';\r\n } else {\r\n sum('UtoX');\r\n return 'X';\r\n }\r\n break;\r\n case 'X':\r\n if(AR + AO > 0 || isInclude('秋津洲')) {\r\n sum('XtoY');\r\n sum('YtoZ');\r\n return null;\r\n } else {\r\n sum('XtoZ');\r\n return null;\r\n }\r\n break;\r\n }\r\n } else if(active['57-7']['1'] === '6') {\r\n switch(edge) {\r\n case null:\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('1toA');\r\n return 'A';\r\n } else if(f_type === '水上打撃部隊' && BBs > 3) {\r\n sum('1toC');\r\n return 'C';\r\n } else if(f_type === '輸送護衛部隊') {\r\n sum('3toQ');\r\n return 'Q';\r\n } else {\r\n sum('2toI');\r\n sum('ItoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'A':\r\n if(CV > 0 || CL === 0) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(f_speed === '低速艦隊' && Ds < 4) {\r\n sum('AtoA1');\r\n return 'A1';\r\n } else {\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n break;\r\n case 'A1':\r\n if((BBs < 3 || (CV > 0 && Ds > 3)) && CL > 0 && Ds > 2) {\r\n sum('A1toA2');\r\n return 'A2';\r\n } else {\r\n sum('A1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A2':\r\n if(active['57-7']['A2'] === 'A3') {\r\n sum('A2toA3');\r\n return 'A3';\r\n } else {\r\n sum('A2toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'A3':\r\n if(f_type === '通常艦隊' || f_type === '遊撃部隊') {\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('A3toA5');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(f_seek[3] < 86) {\r\n sum('BtoB1');\r\n return null;\r\n } else {\r\n sum('BtoB2');\r\n return 'B2';\r\n }\r\n break;\r\n case 'B2':\r\n if(active['57-7']['B2'] === 'B3') {\r\n sum('B2toB3');\r\n return null;\r\n } else {\r\n sum('B2toB4');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['57-7']['C'] === 'A3') {\r\n sum('CtoA3');\r\n sum('A3toA4');\r\n return null;\r\n } else {\r\n sum('CtoC1');\r\n sum('C1toC2');\r\n return 'C2';\r\n }\r\n break;\r\n case 'C2': // 更新部分\r\n if(f_type === '空母機動部隊' && f_speed !== '低速艦隊' && (AR + AO > 0 || isInclude('秋津洲'))) {\r\n sum('C2toL');\r\n return 'L';\r\n } else if(CV < 3) {\r\n sum('C2toD');\r\n return 'D';\r\n } else {\r\n sum('C2toC3');\r\n return null;\r\n }\r\n break;\r\n case 'D':\r\n if(f_speed !== '低速艦隊') {\r\n sum('DtoF');\r\n return 'F';\r\n } else if(BBCVs > 5) {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(DD > 3) {\r\n sum('DtoF');\r\n return 'F';\r\n } else {\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_speed === '低速艦隊') {\r\n sum('FtoG');\r\n sum('GtoH');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if(active['57-7']['J'] === 'K') {\r\n sum('JtoK');\r\n return 'K';\r\n } else {\r\n sum('JtoL');\r\n return 'L';\r\n }\r\n break;\r\n case 'L': // 更新\r\n if(BBCVs > 6 || (BBCVs === 6 && f_speed === '低速艦隊')) {\r\n sum('LtoN');\r\n return 'N';\r\n } else if(DD < 4 && f_speed === '低速艦隊') {\r\n sum('LtoT');\r\n sum('TtoU');\r\n return 'U';\r\n } else if(f_speed === '最速艦隊' || (DD > 7 && f_speed !== '低速艦隊')) {\r\n sum('LtoX');\r\n return 'X';\r\n } else if((countYamato() < 2 && isFaster()) || (countYamato() < 2 && CV < 3 && CL + DD > 4 && f_speed !== '低速艦隊')) {\r\n sum('LtoV');\r\n sum('VtoX');\r\n return 'X';\r\n } else {\r\n sum('LtoU');\r\n return 'U';\r\n }\r\n break;\r\n case 'K':\r\n if(BBs > 2) {\r\n sum('KtoM');\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n } else {\r\n sum('KtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n case 'Q':\r\n if(f_speed === '低速艦隊' && BBV + CAs > 2) {\r\n sum('QtoN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('QtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'N':\r\n if(track.includes('K')) {\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('NtoT');\r\n sum('TtoU');\r\n return 'U';\r\n }\r\n break;\r\n case 'O':\r\n if(f_type === '輸送護衛部隊') {\r\n sum('OtoR');\r\n sum('RtoS');\r\n sum('StoP');\r\n return null;\r\n } else {\r\n sum('OtoP');\r\n return null;\r\n }\r\n break;\r\n case 'U':\r\n if(BBs > 4) {\r\n sum('UtoV');\r\n sum('VtoX');\r\n return 'X';\r\n } else {\r\n sum('UtoX');\r\n return 'X';\r\n }\r\n break;\r\n case 'X':\r\n if(AR + AO > 0 || isInclude('秋津洲')) {\r\n sum('XtoY');\r\n sum('YtoZ');\r\n return null;\r\n } else {\r\n sum('XtoZ');\r\n return null;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n case 58:\r\n switch(map) {\r\n case 1: {// @58-1\r\n const phase = Number(active['58-1']['1']);\r\n const kanko_carrier = CVs + f_names.filter(v => v.includes('あきつ丸')).length;\r\n switch(edge) {\r\n case null:\r\n if(kanko_carrier === 0 && Ds > 3) {\r\n if (is_once) return 1;\r\n return '2';\r\n } else if(kanko_carrier > f_kanko) {\r\n if (is_once) return 2;\r\n return '2';\r\n } else if(AO + LHA > 0 && Ds > 2) {\r\n if (is_once) return 3;\r\n return '2';\r\n } else if(AV > 1 && Ds > 2) {\r\n if (is_once) return 4;\r\n return '2';\r\n } else if(phase === 3 && kanko_carrier > 0) {\r\n if (is_once) return 5;\r\n sum('3toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(kanko_carrier > 2) {\r\n if (is_once) return 6;\r\n sum('1toA');\r\n return 'A';\r\n } else if(BBs > 0) {\r\n if (is_once) return 7;\r\n sum('1toA');\r\n return 'A';\r\n } else if(Ss > 0 && AS === 0) {\r\n if (is_once) return 8;\r\n return '2';\r\n } else if(AS > 1) {\r\n if (is_once) return 9;\r\n return '2';\r\n } else if(phase === 3 && CA > 1 && Ds > 1 && CL + CT > 0) {\r\n if (is_once) return 10;\r\n sum('3toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(kanko_carrier > 0 && Ds > 2) {\r\n if (is_once) return 11;\r\n return '2';\r\n } else {\r\n if (is_once) return 12;\r\n sum('1toA');\r\n return 'A';\r\n }\r\n break;\r\n case '2':\r\n if(AV > 0) {\r\n if (is_once) return 1;\r\n sum('2toI');\r\n return 'I';\r\n } else if(isFaster()) {\r\n if (is_once) return 2;\r\n sum('2toN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return null;\r\n } else if(AO + LHA === 2 && AO + LHA + Ds === 6) {\r\n if (is_once) return 3;\r\n sum('2toN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return null;\r\n } else if(AO + LHA === 1 && AO + LHA + Ds === f_length && f_length < 6) {\r\n if (is_once) return 4;\r\n sum('2toN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return null;\r\n } else {\r\n if (is_once) return 5;\r\n sum('2toI');\r\n return 'I';\r\n }\r\n break;\r\n case 'B':\r\n if(phase === 2) {\r\n if (is_once) return 1;\r\n sum('BtoC');\r\n sum('CtoR');\r\n return 'R';\r\n } else if(CL > 0 && DD > 2 && f_speed === '高速艦隊') {\r\n if (is_once) return 2;\r\n sum('BtoW');\r\n return 'W';\r\n } else {\r\n if (is_once) return 3;\r\n sum('BtoC');\r\n sum('CtoR');\r\n return 'R';\r\n }\r\n break;\r\n case 'D':\r\n if(track.includes('A')) {\r\n if (is_once) return 1;\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(track.includes('I')) {\r\n if(CVs > 2) {\r\n if (is_once) return 2;\r\n sum('DtoJ');\r\n sum('JtoK');\r\n return 'K';\r\n } else if(DD < 2) {\r\n if (is_once) return 3;\r\n sum('DtoJ');\r\n sum('JtoK');\r\n return 'K';\r\n } else if(f_speed === '低速艦隊') {\r\n if (is_once) return 4;\r\n sum('DtoJ');\r\n sum('JtoK');\r\n return 'K';\r\n } else {\r\n if (is_once) return 5;\r\n sum('DtoK');\r\n return 'K';\r\n }\r\n }\r\n break;\r\n case 'K':\r\n if(f_seek[3] >= 68) {\r\n if (is_once) return 1;\r\n sum('KtoM');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('KtoL');\r\n return null;\r\n }\r\n break;\r\n case 'R':\r\n if(BBs < 3 && CL + AV > 0 && DD > 1 && f_speed === '高速艦隊') {\r\n if (is_once) return 1;\r\n sum('RtoR2');\r\n return 'R2';\r\n } else {\r\n if (is_once) return 2;\r\n sum('RtoR1');\r\n sum('R1toR2');\r\n return 'R2';\r\n }\r\n break;\r\n case 'R2':\r\n if(DD > 4) {\r\n if (is_once) return 1;\r\n sum('R2toT');\r\n sum('TtoX');\r\n return null;\r\n } else if(CL > 0 && DD > 3 && f_speed === '高速艦隊') {\r\n if (is_once) return 2;\r\n sum('R2toT');\r\n sum('TtoX');\r\n return null;\r\n } else {\r\n if (is_once) return 3;\r\n sum('R2toS');\r\n return 'S';\r\n }\r\n break;\r\n case 'S':\r\n if(f_seek[3] >= 80) {\r\n if (is_once) return 1;\r\n sum('StoT');\r\n sum('TtoX');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('StoU');\r\n return null;\r\n }\r\n break;\r\n case 'W':\r\n if(CA > 1 && DD > 1) {\r\n if (is_once) return 1;\r\n sum('WtoR2');\r\n return 'R2';\r\n } else if(f_speed === '低速艦隊') {\r\n if (is_once) return 2;\r\n sum('WtoR');\r\n return 'R';\r\n } else if(BBs > 0 && CV + CVB > 1) {\r\n if (is_once) return 3;\r\n sum('WtoR');\r\n return 'R';\r\n } else if(DD > 2) {\r\n if (is_once) return 4;\r\n sum('WtoR2');\r\n return 'R2';\r\n } else if(DD < 2) {\r\n if (is_once) return 5;\r\n sum('WtoR');\r\n return 'R';\r\n } else if(CL === 0) {\r\n if (is_once) return 6;\r\n sum('WtoR');\r\n return 'R';\r\n } else if(CV + CVB > 2) {\r\n if (is_once) return 7;\r\n sum('WtoR2');\r\n return 'R2';\r\n } else if(CV + CVB < 2) {\r\n if (is_once) return 8;\r\n sum('WtoR2');\r\n return 'R2';\r\n } else if(BBs === 0) {\r\n if (is_once) return 9;\r\n sum('WtoR2');\r\n return 'R2';\r\n } else if(f_seek[3] >= 100) {\r\n if (is_once) return 10;\r\n sum('WtoR2');\r\n return 'R2';\r\n } else {\r\n if (is_once) return 11;\r\n sum('WtoR');\r\n return 'R';\r\n }\r\n break;\r\n case 'A':\r\n if(active['58-1']['A'] === 'B') {\r\n sum('AtoB');\r\n return 'B';\r\n } else {\r\n sum('AtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 'I':\r\n if(active['58-1']['I'] === 'D') {\r\n sum('ItoD');\r\n return 'D';\r\n } else {\r\n sum('ItoN1');\r\n sum('N1toN2');\r\n sum('N2toO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return null;\r\n }\r\n break;\r\n case 'F':\r\n if(active['58-1']['F'] === 'G') {\r\n sum('FtoG');\r\n return null;\r\n } else {\r\n sum('FtoH');\r\n return null;\r\n }\r\n }\r\n break;\r\n }\r\n case 2: { // @58-2\r\n const phase = Number(active['58-2']['1']);\r\n const difficulty = Number(active['58-2']['2']);\r\n const kanko_carrier = CVs + f_names.filter(v => v.includes('あきつ丸')).length;\r\n switch(edge) {\r\n case null:\r\n if(phase === 1) {\r\n if (is_once) return 1;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else if(phase === 2) {\r\n if(isCom()) {\r\n if (is_once) return 2;\r\n sum('2toL');\r\n return 'L';\r\n } else {\r\n if (is_once) return 3;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n }\r\n } else if(phase === 3) {\r\n if(isCom()) {\r\n if (is_once) return 4;\r\n sum('2toL');\r\n return 'L';\r\n } else {\r\n if(BBs > 0) {\r\n if (is_once) return 5;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else if(kanko_carrier > 0) {\r\n if (is_once) return 6;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else if(difficulty === 1 && Ss < 3) {\r\n if (is_once) return 7;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else if(difficulty === 2 && Ss < 2) {\r\n if (is_once) return 8;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else if(difficulty > 2 && Ss === 0) {\r\n if (is_once) return 9;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else {\r\n if (is_once) return 10;\r\n sum('3toS');\r\n sum('StoT');\r\n return 'T';\r\n }\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(track.includes('A')) {\r\n if(f_speed === '低速艦隊') {\r\n if (is_once) return 1;\r\n sum('CtoF');\r\n return null;\r\n } else if(CV + CVB > 0) {\r\n if (is_once) return 2;\r\n sum('CtoF');\r\n return null;\r\n } else {\r\n if (is_once) return 3;\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n } else if(track.includes('S')) {\r\n if (is_once) return 4;\r\n sum('CtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'D':\r\n if(!isCom()) {\r\n if(f_seek[3] >= 98) {\r\n if (is_once) return 1;\r\n sum('DtoD2');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('DtoD1');\r\n return null;\r\n }\r\n } else {\r\n if (is_once) return 3;\r\n sum('DtoN');\r\n return 'N';\r\n }\r\n break;\r\n case 'E':\r\n if(CV + CVB > 0) {\r\n if (is_once) return 1;\r\n sum('EtoF');\r\n return null;\r\n } else if(f_speed === '高速艦隊') {\r\n if (is_once) return 2;\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else if(BBs > 1) {\r\n if (is_once) return 3;\r\n sum('EtoF');\r\n return null;\r\n } else if(CL > 0 && Ds > 1) {\r\n if (is_once) return 4;\r\n sum('EtoG');\r\n sum('GtoH');\r\n return 'H';\r\n } else {\r\n if (is_once) return 5;\r\n sum('EtoF');\r\n return null;\r\n }\r\n break;\r\n case 'H':\r\n if(track.includes('A')) {\r\n if(f_seek[3] < 80) {\r\n if (is_once) return 1;\r\n sum('HtoK');\r\n return null;\r\n } else if(f_speed === '低速艦隊') {\r\n if (is_once) return 2;\r\n sum('HtoJ');\r\n return 'J';\r\n } else if(BBs > 1) {\r\n if (is_once) return 3;\r\n sum('HtoJ');\r\n return 'J';\r\n } else if(CVL + f_names.filter(v => v.includes('あきつ丸')).length > 1) {\r\n if (is_once) return 4;\r\n sum('HtoJ');\r\n return 'J';\r\n } else {\r\n if (is_once) return 5;\r\n sum('HtoI');\r\n return 'I';\r\n }\r\n } else if(track.includes('3')) {\r\n sum('HtoV');\r\n return 'V';\r\n }\r\n break;\r\n case 'I':\r\n if(phase < 3) {\r\n if (is_once) return 1;\r\n return null;\r\n } else if(Ss > 0) {\r\n if (is_once) return 2;\r\n sum('ItoU');\r\n return 'U';\r\n } else {\r\n if (is_once) return 3;\r\n sum('ItoD3');\r\n return null;\r\n }\r\n break;\r\n case 'J':\r\n if(!isCom()) {\r\n if (is_once) return 1;\r\n sum('JtoP');\r\n return 'P';\r\n } else if(f_speed === '低速艦隊') {\r\n if (is_once) return 2;\r\n sum('JtoN');\r\n return 'N';\r\n } else if(BBs > 2) {\r\n if (is_once) return 3;\r\n sum('JtoN');\r\n return 'N';\r\n } else if(CVs > 2) {\r\n if (is_once) return 4;\r\n sum('JtoN');\r\n return 'N';\r\n } else if(CL > 1 && DD > 4) {\r\n if (is_once) return 5;\r\n sum('JtoP');\r\n return 'P';\r\n } else {\r\n if (is_once) return 6;\r\n sum('JtoN');\r\n return 'N';\r\n }\r\n break;\r\n case 'L':\r\n if(f_type === '空母機動部隊') {\r\n if (is_once) return 1;\r\n sum('LtoM');\r\n sum('MtoJ');\r\n return 'J';\r\n } else if(f_type === '水上打撃部隊') {\r\n if (is_once) return 2;\r\n sum('LtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 'N':\r\n if(CV + CVB > 0) {\r\n if (is_once) return 1;\r\n sum('NtoO');\r\n sum('OtoP');\r\n return 'P';\r\n } else if(CVL > 2) {\r\n if (is_once) return 2;\r\n sum('NtoO');\r\n sum('OtoP');\r\n return 'P';\r\n } else if(f_speed === '高速艦隊') {\r\n if (is_once) return 3;\r\n sum('NtoP');\r\n return 'P';\r\n } else if(CL > 1 && DD > 2) {\r\n if (is_once) return 4;\r\n sum('NtoP');\r\n return 'P';\r\n } else {\r\n if (is_once) return 5;\r\n sum('NtoO');\r\n sum('OtoP');\r\n return 'P';\r\n }\r\n break;\r\n case 'P':\r\n if(f_seek[1] >= 62) {\r\n if (is_once) return 1;\r\n sum('PtoR');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('PtoQ');\r\n return null;\r\n }\r\n break;\r\n case 'T':\r\n if(CAs > 1) {\r\n if (is_once) return 1;\r\n sum('TtoC');\r\n return 'C';\r\n } else if(CL > 1) {\r\n if (is_once) return 2;\r\n sum('TtoC');\r\n return 'C';\r\n } else {\r\n if (is_once) return 3;\r\n sum('TtoU');\r\n return 'U';\r\n }\r\n break;\r\n case 'U':\r\n if(CAs > 0) {\r\n if (is_once) return 1;\r\n sum('UtoH');\r\n return 'H';\r\n } else if(CL > 1) {\r\n if (is_once) return 2;\r\n sum('UtoH');\r\n return 'H';\r\n } else if(difficulty === 4) {\r\n if (is_once) return 3;\r\n sum('UtoV');\r\n return 'V';\r\n } else if(AV > 0) {\r\n if (is_once) return 4;\r\n sum('UtoH');\r\n return 'H';\r\n } else if(AS > 0) {\r\n if (is_once) return 5;\r\n sum('UtoV');\r\n return 'V';\r\n } else {\r\n if (is_once) return 6;\r\n sum('UtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'V':\r\n if(CAs + AV > 1) {\r\n if (is_once) return 1;\r\n sum('VtoW');\r\n sum('WtoX');\r\n sum('XtoY');\r\n return null;\r\n } else if(difficulty === 1 && Ss > 3) {\r\n if (is_once) return 2;\r\n sum('VtoX');\r\n sum('XtoY');\r\n return null;\r\n } else if(difficulty === 2 && Ss > 2) {\r\n if (is_once) return 3;\r\n sum('VtoX');\r\n sum('XtoY');\r\n return null;\r\n } else if(difficulty === 3 && Ss > 1) {\r\n if (is_once) return 4;\r\n sum('VtoX');\r\n sum('XtoY');\r\n return null;\r\n } else if(difficulty === 4) {\r\n if (is_once) return 5;\r\n sum('VtoX');\r\n sum('XtoY');\r\n return null;\r\n } else {\r\n if (is_once) return 6;\r\n sum('VtoW');\r\n sum('WtoX');\r\n sum('XtoY');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(active['58-2']['B'] === 'C') {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoE');\r\n return 'E';\r\n }\r\n break;\r\n }\r\n break;\r\n }\r\n case 3: { // @58-3\r\n const phase = Number(active['58-3']['1']);\r\n const difficulty = Number(active['58-3']['2']);\r\n const kanko_carrier = CVs + f_names.filter(v => v.includes('あきつ丸')).length;\r\n switch(edge) {\r\n case null:\r\n if(isCom()) {\r\n if (is_once) return 1;\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else {\r\n if(phase < 3) {\r\n if (is_once) return 2;\r\n sum('2toH');\r\n return 'H';\r\n } else {\r\n if(AO > 0) {\r\n if (is_once) return 3;\r\n sum('3toI');\r\n return 'I';\r\n } else if(CL > 0 && DD > 2 && f_speed !== '低速艦隊') {\r\n if (is_once) return 4;\r\n sum('3toI');\r\n return 'I';\r\n } else if(kanko_carrier > 0) {\r\n if (is_once) return 5;\r\n sum('2toH');\r\n return 'H';\r\n } else if(BBs > 0) {\r\n if (is_once) return 6;\r\n sum('2toH');\r\n return 'H';\r\n } else if(AO + LHA + AV > 1) {\r\n if (is_once) return 7;\r\n sum('2toH');\r\n return 'H';\r\n } else if(phase < 4) {\r\n if (is_once) return 8;\r\n sum('3toI');\r\n return 'I';\r\n } else {\r\n if(difficulty === 1 && AS > 0 && Ss > 2) {\r\n if (is_once) return 9;\r\n sum('4toV');\r\n sum('VtoW');\r\n return 'W';\r\n } if(difficulty === 2 && Ss > 2) {\r\n if (is_once) return 10;\r\n sum('4toV');\r\n sum('VtoW');\r\n return 'W';\r\n } if(difficulty === 3 && Ss > 1) {\r\n if (is_once) return 11;\r\n sum('4toV');\r\n sum('VtoW');\r\n return 'W';\r\n } if(difficulty === 4 && Ss > 0) {\r\n if (is_once) return 12;\r\n sum('4toV');\r\n sum('VtoW');\r\n return 'W';\r\n } if(difficulty === 4 && Ds > 2) {\r\n if (is_once) return 13;\r\n sum('4toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else {\r\n if (is_once) return 14;\r\n sum('2toH');\r\n return 'H';\r\n }\r\n }\r\n }\r\n }\r\n break;\r\n case 'B':\r\n if(BBCVs > 5) {\r\n if (is_once) return 1;\r\n sum('BtoC');\r\n sum('CtoD');\r\n return 'D';\r\n } else if(f_speed !== '低速艦隊') {\r\n if (is_once) return 2;\r\n sum('BtoD');\r\n return 'D';\r\n } else if(CL > 1 && Ds > 3) {\r\n if (is_once) return 3;\r\n sum('BtoD');\r\n return 'D';\r\n } else {\r\n if (is_once) return 4;\r\n sum('BtoC');\r\n sum('CtoD');\r\n return 'D';\r\n }\r\n break;\r\n case 'D':\r\n if(BBCVs > 6) {\r\n if (is_once) return 1;\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(BBs > 3) {\r\n if (is_once) return 2;\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else if(CV + CVB > 2) {\r\n if (is_once) return 3;\r\n sum('DtoE');\r\n sum('EtoF');\r\n return 'F';\r\n } else {\r\n if (is_once) return 4;\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(f_seek[1] >= 65) {\r\n if (is_once) return 1;\r\n sum('FtoO');\r\n return 'O';\r\n } else {\r\n if (is_once) return 2;\r\n sum('FtoG');\r\n return null;\r\n }\r\n break;\r\n case 'H':\r\n if(CL > 0 && DD > 3 && f_speed !== '低速艦隊') {\r\n if (is_once) return 1;\r\n sum('HtoJ');\r\n return 'J';\r\n } else {\r\n if (is_once) return 2;\r\n sum('HtoI');\r\n return 'I';\r\n }\r\n break;\r\n case 'I':\r\n if(BBCVs > 4) {\r\n if (is_once) return 1;\r\n sum('ItoL');\r\n return 'L';\r\n } else if(Ds < 2) {\r\n if (is_once) return 2;\r\n sum('ItoL');\r\n return 'L';\r\n } else if(f_speed !== '低速艦隊') {\r\n if (is_once) return 3;\r\n sum('ItoM');\r\n return 'M';\r\n } else if(BBs > 1) {\r\n if (is_once) return 4;\r\n sum('ItoL');\r\n return 'L';\r\n } else if(Ds > 1) {\r\n if (is_once) return 5;\r\n sum('ItoL');\r\n return 'L';\r\n } else {\r\n if (is_once) return 6;\r\n sum('ItoM');\r\n return 'M';\r\n }\r\n break;\r\n case 'J':\r\n if(f_seek[1] >= 45) {\r\n if (is_once) return 1;\r\n sum('JtoN');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('JtoK');\r\n return null;\r\n }\r\n break;\r\n case 'L':\r\n if(f_seek[1] >= 58) {\r\n if (is_once) return 1;\r\n sum('LtoM');\r\n return 'M';\r\n } else {\r\n if (is_once) return 2;\r\n sum('LtoG');\r\n return null;\r\n }\r\n break;\r\n case 'O':\r\n if(f_seek[1] < 75) {\r\n if (is_once) return 1;\r\n sum('OtoO1');\r\n return null;\r\n } else if(BBs < 3) {\r\n if (is_once) return 2;\r\n sum('OtoO3');\r\n return null;\r\n } else if(CL > 1) {\r\n if (is_once) return 3;\r\n sum('OtoO3');\r\n return null;\r\n } else {\r\n if (is_once) return 4;\r\n sum('OtoO2');\r\n sum('O2toO3');\r\n return null;\r\n }\r\n break;\r\n case 'P':\r\n if(f_seek[3] >= 98) {\r\n if (is_once) return 1;\r\n sum('PtoR');\r\n return 'R';\r\n } else {\r\n if (is_once) return 2;\r\n sum('PtoQ');\r\n return null;\r\n }\r\n break;\r\n case 'R':\r\n if(isFaster()) {\r\n if (is_once) return 1;\r\n sum('RtoU');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('RtoS');\r\n return 'S';\r\n }\r\n break;\r\n case 'S':\r\n if(f_speed === '低速艦隊') {\r\n if (is_once) return 1;\r\n sum('StoT');\r\n sum('TtoU');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('StoU');\r\n return null;\r\n }\r\n break;\r\n case 'W':\r\n if(AV + LHA > 0) {\r\n if (is_once) return 1;\r\n sum('WtoX');\r\n sum('XtoY');\r\n return 'Y';\r\n } else if(difficulty === 1 && AS > 0 && Ss > 3) {\r\n if (is_once) return 2;\r\n sum('WtoY');\r\n return 'Y';\r\n } else if(difficulty === 1 && DD > 1) {\r\n if (is_once) return 3;\r\n sum('WtoY');\r\n return 'Y';\r\n } else if(difficulty > 1) {\r\n if (is_once) return 4;\r\n sum('WtoY');\r\n return 'Y';\r\n } else {\r\n if (is_once) return 5;\r\n sum('WtoX');\r\n sum('XtoY');\r\n return 'Y';\r\n }\r\n break;\r\n case 'Y':\r\n if(CAs + CL + CT + CLT + AV + LHA > 2) {\r\n if (is_once) return 1;\r\n sum('YtoY1');\r\n sum('Y1toY2');\r\n sum('Y2toZ');\r\n return null;\r\n } else if(CAs + AV === 2) {\r\n if (is_once) return 2;\r\n sum('YtoY1');\r\n sum('Y1toY2');\r\n sum('Y2toZ');\r\n return null;\r\n } else if(DD > 0) {\r\n if (is_once) return 3;\r\n sum('YtoY2');\r\n sum('Y2toZ');\r\n return null;\r\n } else if(Ss > 4) {\r\n if (is_once) return 4;\r\n sum('YtoY2');\r\n sum('Y2toZ');\r\n return null;\r\n } else if(CAs + CL + CT + CLT + AV + LHA === 2) {\r\n if (is_once) return 5;\r\n sum('YtoY1');\r\n sum('Y1toY2');\r\n sum('Y2toZ');\r\n return null;\r\n } else if(Ss < 4) {\r\n if (is_once) return 6;\r\n sum('YtoY1');\r\n sum('Y1toY2');\r\n sum('Y2toZ');\r\n return null;\r\n } else {\r\n if (is_once) return 7;\r\n sum('YtoY2');\r\n sum('Y2toZ');\r\n return null;\r\n }\r\n break;\r\n case 'M':\r\n if(active['58-3']['M'] === 'P') {\r\n if (is_once) return 1;\r\n sum('MtoP');\r\n return 'P';\r\n } else {\r\n if (is_once) return 2;\r\n sum('MtoN');\r\n return null;\r\n }\r\n break;\r\n }\r\n break;\r\n }\r\n case 4: { // @58-4\r\n const phase = Number(active['58-4']['1']);\r\n const difficulty = Number(active['58-4']['2']);\r\n switch(edge) {\r\n case null:\r\n if(phase < 4) {\r\n if (is_once) return 1;\r\n return '1';\r\n } else if(phase > 3) {\r\n if (is_once) return 2;\r\n if(!isCom()) {\r\n return '1';\r\n } else if(f_type === '輸送護衛部隊') {\r\n if (is_once) return 3;\r\n sum('2toH');\r\n return 'H';\r\n } else if(f_type === '水上打撃部隊') {\r\n if(BBV + CAV === 2 && CL === 1 && BBV + CL + Ds + AO + AS + LHA === 12) {\r\n if (is_once) return 4;\r\n sum('2toH');\r\n return 'H';\r\n } else if(((BBV + CAV === 1) || (BBV + CAV === 2)) && CL + CT === 2 && BBV + CAV + CL + CT + Ds + AO + AS + LHA === 12) {\r\n if (is_once) return 5;\r\n sum('2toH');\r\n return 'H';\r\n } else if(phase < 6) {\r\n if (is_once) return 6;\r\n return '1';\r\n } else if(phase === 6) {\r\n if (is_once) return 7;\r\n return '3';\r\n }\r\n } else if(f_type === '空母機動部隊') {\r\n if (is_once) return 8;\r\n return '1';\r\n }\r\n }\r\n break;\r\n case '1':\r\n if(phase > 4 && Ss > 3) {\r\n if (is_once) return 1;\r\n sum('1toP');\r\n sum('PtoJ');\r\n return 'J';\r\n } else if(CV + CVB > 3) {\r\n if (is_once) return 2;\r\n sum('1toA');\r\n return 'A';\r\n } else if(f_speed === '高速艦隊') {\r\n if (is_once) return 3;\r\n sum('1toA1');\r\n return 'A1';\r\n } else if(isCom()) {\r\n if(countYamato() > 1) {\r\n if (is_once) return 4;\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n if (is_once) return 5;\r\n sum('1toA1');\r\n return 'A1';\r\n }\r\n } else if(!isCom()) {\r\n if(countYamato() > 1) {\r\n if (is_once) return 6;\r\n sum('1toA');\r\n return 'A';\r\n } else if(AS + Ss > 0) {\r\n if (is_once) return 7;\r\n sum('1toA1');\r\n return 'A1';\r\n } else if(difficulty === 4) {\r\n if (is_once) return 8;\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n if (is_once) return 9;\r\n sum('1toA');\r\n return 'A';\r\n }\r\n }\r\n break;\r\n case '3':\r\n if(f_speed === '高速艦隊') {\r\n if (is_once) return 1;\r\n sum('3toT');\r\n sum('TtoU');\r\n return 'U';\r\n } else if(Ds > 4) {\r\n if (is_once) return 2;\r\n sum('3toT');\r\n sum('TtoU');\r\n return 'U';\r\n } else if(CVs > 2) {\r\n if (is_once) return 3;\r\n sum('3toF');\r\n return 'F';\r\n } else if(countYamato() > 0) {\r\n if (is_once) return 4;\r\n sum('3toF');\r\n return 'F';\r\n } else {\r\n if (is_once) return 5;\r\n sum('3toF');\r\n return 'F';\r\n }\r\n break;\r\n case 'A':\r\n if(!isCom()) {\r\n if (is_once) return 1;\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(CV + CVB > 3) {\r\n if (is_once) return 2;\r\n sum('AtoA1');\r\n return 'A1';\r\n } else if(Ds > 3) {\r\n if (is_once) return 3;\r\n sum('AtoB');\r\n return 'B';\r\n } else {\r\n if (is_once) return 4;\r\n sum('AtoA1');\r\n return 'A1';\r\n }\r\n break;\r\n case 'A1':\r\n if(!isCom()) {\r\n if (is_once) return 1;\r\n sum('A1toA2');\r\n sum('A2toA3');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('A1toB');\r\n return 'B';\r\n }\r\n break;\r\n case 'C':\r\n if(AV > 1) {\r\n if (is_once) return 1;\r\n sum('CtoC2');\r\n return null;\r\n } else if(f_speed === '高速艦隊') {\r\n if (is_once) return 2;\r\n sum('CtoC1');\r\n sum('C1toE');\r\n return 'E';\r\n } else if(CVs > 3) {\r\n if (is_once) return 3;\r\n sum('CtoC2');\r\n return null;\r\n } else if(CAs > 2) {\r\n if (is_once) return 4;\r\n sum('CtoC2');\r\n return null;\r\n } else {\r\n if (is_once) return 5;\r\n sum('CtoC1');\r\n sum('C1toE');\r\n return 'E';\r\n }\r\n break;\r\n case 'D':\r\n if(BB > 0) {\r\n if (is_once) return 1;\r\n sum('DtoD2');\r\n return null;\r\n } else if(CL + CT > 2) {\r\n if (is_once) return 2;\r\n sum('DtoD1');\r\n return null;\r\n } else if(CVL > 0 && Ds > 3) {\r\n if (is_once) return 3;\r\n sum('DtoD1');\r\n return null;\r\n } else if(CVL === 0 && BBV === 0 && CL + CT > 1) {\r\n if (is_once) return 4;\r\n sum('DtoD1');\r\n return null;\r\n } else if(CVL === 0 && CL + CT > 1 && Ds > 3) {\r\n if (is_once) return 5;\r\n sum('DtoD1');\r\n return null;\r\n } else {\r\n if (is_once) return 6;\r\n sum('DtoD2');\r\n return null;\r\n }\r\n break;\r\n case 'E':\r\n if(countYamato() === 2 && DD < 5) {\r\n if (is_once) return 1;\r\n sum('EtoF');\r\n return 'F';\r\n } else if(countYamato() === 1 && DD < 4) {\r\n if (is_once) return 2;\r\n sum('EtoF');\r\n return 'F';\r\n } else if(countYamato() === 0 && DD < 3) {\r\n if (is_once) return 3;\r\n sum('EtoF');\r\n return 'F';\r\n } else if(BBCVs < 5) {\r\n if (is_once) return 4;\r\n sum('EtoF1');\r\n return 'F1';\r\n } else if(f_speed === '低速艦隊') {\r\n if (is_once) return 5;\r\n sum('EtoF');\r\n return 'F';\r\n } else if(BBCVs === 5) {\r\n if (is_once) return 6;\r\n sum('EtoF1');\r\n return 'F1';\r\n } else if(CL > 1) {\r\n if (is_once) return 7;\r\n sum('EtoF1');\r\n return 'F1';\r\n } else {\r\n if (is_once) return 8;\r\n sum('EtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'F':\r\n if(!isCom()) {\r\n if (is_once) return 1;\r\n sum('FtoJ1');\r\n return 'J1';\r\n } else if(f_type === '輸送護衛部隊') {\r\n if (is_once) return 2;\r\n sum('FtoJ1');\r\n return 'J1';\r\n } else if(track.includes('P')) {\r\n if (is_once) return 3;\r\n sum('FtoJ1');\r\n return 'J1';\r\n } else if(track.includes('1')) {\r\n if (is_once) return 4;\r\n sum('FtoF1');\r\n return 'F1';\r\n } else if(track.includes('3')) {\r\n if (is_once) return 5;\r\n sum('FtoU');\r\n return 'U';\r\n }\r\n break;\r\n case 'F1':\r\n if(f_seek[1] >= 98) {\r\n if (is_once) return 1;\r\n sum('F1toG');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('F1toF2');\r\n return null;\r\n }\r\n break;\r\n case 'H':\r\n if(f_speed === '低速艦隊') {\r\n if (is_once) return 1;\r\n sum('HtoI');\r\n sum('ItoI1');\r\n return 'I1';\r\n } else {\r\n if (is_once) return 2;\r\n sum('HtoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'I1':\r\n if(DD > 7) {\r\n if (is_once) return 1;\r\n sum('ItoI3');\r\n sum('I3toL');\r\n return 'L';\r\n } else {\r\n if (is_once) return 2;\r\n sum('I1toI2');\r\n sum('I2toK');\r\n sum('KtoL');\r\n return 'L';\r\n }\r\n break;\r\n case 'J':\r\n if(phase < 5) {\r\n if (is_once) return 1;\r\n sum('JtoJ1');\r\n return 'J1';\r\n } else if(BBCVs > 0) {\r\n if (is_once) return 2;\r\n sum('JtoF');\r\n return 'F';\r\n } else if(difficulty === 1 && Ss > 3) {\r\n if (is_once) return 3;\r\n sum('JtoJ1');\r\n return 'J1';\r\n } else if(difficulty === 2 && Ss > 2) {\r\n if (is_once) return 4;\r\n sum('JtoJ1');\r\n return 'J1';\r\n } else if(difficulty === 3 && Ss > 1) {\r\n if (is_once) return 5;\r\n sum('JtoJ1');\r\n return 'J1';\r\n } else if(difficulty === 4) {\r\n if (is_once) return 6;\r\n sum('JtoJ1');\r\n return 'J1';\r\n } else {\r\n if (is_once) return 7;\r\n sum('JtoF');\r\n return 'F';\r\n }\r\n break;\r\n case 'J1':\r\n if(isCom()) {\r\n if (is_once) return 1;\r\n sum('J1toJ2');\r\n return 'J2';\r\n } else if(BBCVs > 0) {\r\n if (is_once) return 2;\r\n sum('J1toQ');\r\n sum('QtoR');\r\n sum('RtoS');\r\n return null;\r\n } else if(CL === 1 && DD === 2 && AS === 1 && Ss === 3) {\r\n if (is_once) return 3;\r\n sum('J1toR');\r\n sum('RtoS');\r\n return null;\r\n } else if(CL > 0 && DD > 2) {\r\n if (is_once) return 4;\r\n sum('J1toR');\r\n sum('RtoS');\r\n return null;\r\n } else if(AS === 0) {\r\n if (is_once) return 5;\r\n sum('J1toQ');\r\n sum('QtoR');\r\n sum('RtoS');\r\n return null;\r\n } else if(CAs + CL > 0) {\r\n if (is_once) return 6;\r\n sum('J1toQ');\r\n sum('QtoR');\r\n sum('RtoS');\r\n return null;\r\n } else if(AV > 1) {\r\n if (is_once) return 7;\r\n sum('J1toQ');\r\n sum('QtoR');\r\n sum('RtoS');\r\n return null;\r\n } else if(DD > 2){\r\n if (is_once) return 8;\r\n sum('J1toQ');\r\n sum('QtoR');\r\n sum('RtoS');\r\n return null;\r\n } else if(Ss > 3) {\r\n if (is_once) return 9;\r\n sum('J1toR');\r\n sum('RtoS');\r\n return null;\r\n } else if(AV === 0) {\r\n if (is_once) return 10;\r\n sum('J1toR');\r\n sum('RtoS');\r\n return null;\r\n } else {\r\n if (is_once) return 11;\r\n sum('J1toQ');\r\n sum('QtoR');\r\n sum('RtoS');\r\n return null;\r\n }\r\n break;\r\n case 'J2':\r\n if(track.includes('2')) {\r\n if(DD > 7) {\r\n if (is_once) return 1;\r\n sum('J2toM');\r\n return 'M';\r\n } else {\r\n if (is_once) return 2;\r\n sum('J2toL');\r\n return 'L';\r\n }\r\n } else if(track.includes('3')) {\r\n if (is_once) return 3;\r\n sum('J2toV');\r\n return 'V';\r\n }\r\n break;\r\n case 'L':\r\n if(track.includes('2')) {\r\n if (is_once) return 1;\r\n sum('LtoM');\r\n return 'M';\r\n } else if(track.includes('3')) {\r\n if (is_once) return 2;\r\n sum('LtoV');\r\n return 'V';\r\n }\r\n break;\r\n case 'M':\r\n if(f_seek[1] >= 52) {\r\n if (is_once) return 1;\r\n sum('MtoO');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('MtoN');\r\n return null;\r\n }\r\n break;\r\n case 'U':\r\n if(countYamato() < 2 && CL > 1 && DD > 3 && f_speed === '高速艦隊') {\r\n if (is_once) return 1;\r\n sum('UtoV');\r\n return 'V';\r\n } else if(CV + CVB > 0) {\r\n if (is_once) return 2;\r\n sum('UtoJ2');\r\n return 'J2';\r\n } else if(Ds > 5) {\r\n if (is_once) return 3;\r\n sum('UtoV');\r\n return 'V';\r\n } else if(CVL > 1) {\r\n if (is_once) return 4;\r\n sum('UtoJ2');\r\n return 'J2';\r\n } else if(Ds > 3) {\r\n if (is_once) return 5;\r\n sum('UtoV');\r\n return 'V';\r\n } else {\r\n if (is_once) return 6;\r\n sum('UtoJ2');\r\n return 'J2';\r\n }\r\n break;\r\n case 'V':\r\n if(f_names.includes('明石改') || f_names.includes('朝日改') || f_names.includes('秋津洲改')) {\r\n if (is_once) return 1;\r\n sum('VtoW');\r\n sum('WtoX');\r\n return 'X';\r\n } else {\r\n if (is_once) return 2;\r\n sum('VtoX');\r\n return 'X';\r\n }\r\n break;\r\n case 'X':\r\n if(f_seek[1] >= 84) {\r\n if (is_once) return 1;\r\n sum('XtoZ');\r\n return null;\r\n } else {\r\n if (is_once) return 2;\r\n sum('XtoY');\r\n return null;\r\n }\r\n break;\r\n case 'B':\r\n if(active['58-4']['B'] === 'C') {\r\n if (is_once) return 1;\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n if (is_once) return 2;\r\n sum('BtoD');\r\n return 'D';\r\n }\r\n break;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n case 59:\r\n switch(map) {\r\n case 1: { // @59-1\r\n const phase = Number(active['59-1']['1']);\r\n switch(edge) {\r\n case null:\r\n if(phase === 1) {\r\n sum('1toA');\r\n return 'A';\r\n } else if(CV + CVB > 0) {\r\n sum('1toA');\r\n return 'A';\r\n } else if(BBs + CVL > 3) {\r\n sum('1toA');\r\n return 'A';\r\n } else if(BBs > 2) {\r\n sum('1toA');\r\n return 'A'; \r\n } else if(AO > 0) {\r\n sum('1toA');\r\n return 'A'; \r\n } else if(CL + AV > 2) {\r\n sum('1toA');\r\n return 'A'; \r\n } else if(BBs > 0 && CL > 0 && AV > 0) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n return '2';\r\n }\r\n break;\r\n case '2':\r\n if(LHA > 0) {\r\n sum('2toI');\r\n sum('ItoJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(isFaster()) {\r\n sum('2toJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(Ss > 0) {\r\n sum('2toI');\r\n sum('ItoJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(CVL > 1) {\r\n sum('2toI');\r\n sum('ItoJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(CAs > 2) {\r\n sum('2toI');\r\n sum('ItoJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(Ds < 2) {\r\n sum('2toI');\r\n sum('ItoJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(f_speed !== '低速艦隊') {\r\n sum('2toJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(BBs > 1) {\r\n sum('2toI');\r\n sum('ItoJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else if(CL + CT === 0) {\r\n sum('2toI');\r\n sum('ItoJ');\r\n sum('JtoG');\r\n return 'G';\r\n } else {\r\n sum('2toJ');\r\n sum('JtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'A':\r\n if(Ds === 0) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(AO > 0) {\r\n sum('AtoD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(Ds === 1) {\r\n if(Ss > 0) {\r\n sum('AtoC1');\r\n return 'C1';\r\n } else if(BBCVs > 2) {\r\n sum('AtoC1');\r\n return 'C1';\r\n } else {\r\n sum('AtoD');\r\n sum('DtoE');\r\n return 'E';\r\n }\r\n } else if(Ds > 1) {\r\n if(Ss > 0 && f_speed === '低速艦隊') {\r\n sum('AtoC1');\r\n return 'C1';\r\n } else if(CVs > 2 && CL + CT === 0) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(BBCVs === 4) {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(BBCVs === 3) {\r\n sum('AtoD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(BBCVs === 2 && CL + CT + AV === 0) {\r\n sum('AtoD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(BBCVs < 2 && CL + CT === 0) {\r\n sum('AtoD');\r\n sum('DtoE');\r\n return 'E';\r\n } else {\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n }\r\n break;\r\n case 'C1':\r\n if(BBs + CV + CVB + Ss > 1) {\r\n sum('C1toD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(CVs > 2) {\r\n sum('C1toD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(Ss > 0 && Ds < 5) {\r\n sum('C1toD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(Ds < 2) {\r\n sum('C1toD');\r\n sum('DtoE');\r\n return 'E';\r\n } else {\r\n sum('C1toE');\r\n return 'E';\r\n }\r\n break;\r\n case 'C2':\r\n if(BBs < 2 && CV + CVB === 0 && CVL < 2 && Ds > 1 && f_speed !== '低速艦隊') {\r\n sum('C2toL');\r\n sum('LtoM');\r\n return null;\r\n } else {\r\n sum('C2toC1');\r\n return 'C1';\r\n }\r\n break;\r\n case 'G':\r\n if(track.includes('1')) {\r\n sum('GtoH');\r\n return null;\r\n } else if(phase < 3) {\r\n sum('GtoK');\r\n sum('KtoL');\r\n sum('LtoM');\r\n return null;\r\n } else if(BBCVs > 1) {\r\n sum('GtoK');\r\n sum('KtoL');\r\n sum('LtoM');\r\n return null;\r\n } else if(Ds > 4) {\r\n sum('GtoL');\r\n sum('LtoM');\r\n return null;\r\n } else if(f_speed === '低速艦隊') {\r\n sum('GtoK');\r\n sum('KtoL');\r\n sum('LtoM');\r\n return null;\r\n } else if(Ds === 4) {\r\n sum('GtoL');\r\n sum('LtoM');\r\n return null;\r\n } else if(Ds === 3 && CL > 0 && BBCVs === 0) {\r\n sum('GtoL');\r\n sum('LtoM');\r\n return null;\r\n } else {\r\n sum('GtoK');\r\n sum('KtoL');\r\n sum('LtoM');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['59-1']['C'] === 'C1') {\r\n sum('CtoC1');\r\n return 'C1';\r\n } else {\r\n sum('CtoC2');\r\n sum('C2toL');\r\n sum('LtoM');\r\n return null;\r\n }\r\n break;\r\n case 'E':\r\n if(active['59-1']['E'] === 'F') {\r\n sum('EtoF');\r\n return null;\r\n } else {\r\n sum('EtoG');\r\n return 'G';\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n case 2: // @59-2\r\n switch(edge) {\r\n case null:\r\n if(!isCom()) {\r\n sum('1toA');\r\n return 'A';\r\n } else {\r\n sum('2toF');\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'A':\r\n if(isFaster()) {\r\n sum('AtoA2');\r\n sum('A2toB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(DD > 3) {\r\n sum('AtoA2');\r\n sum('A2toB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(DD > 2 && f_speed !== '低速艦隊') {\r\n sum('AtoA2');\r\n sum('A2toB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('AtoA1');\r\n sum('A1toA2');\r\n sum('A2toB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n break;\r\n case 'C':\r\n if(f_seek[3] >= 60) {\r\n sum('CtoE');\r\n return null;\r\n } else {\r\n sum('CtoD');\r\n return null;\r\n }\r\n break;\r\n case 'G':\r\n if(f_type === '輸送護衛部隊') {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(CVs + countAkitsuMaru() > 4) {\r\n sum('GtoH');\r\n sum('HtoK');\r\n sum('KtoN');\r\n return 'N';\r\n } else if(BBs > 3) {\r\n sum('GtoH');\r\n sum('HtoK');\r\n sum('KtoN');\r\n return 'N';\r\n } else if(CV + CVB > 2) {\r\n sum('GtoH');\r\n sum('HtoK');\r\n sum('KtoN');\r\n return 'N';\r\n } else if(Ds < 3) {\r\n sum('GtoH');\r\n sum('HtoK');\r\n sum('KtoN');\r\n return 'N';\r\n } else if(DD === 3) {\r\n if(f_speed === '低速艦隊') {\r\n sum('GtoH');\r\n sum('HtoK');\r\n sum('KtoN');\r\n return 'N';\r\n } else if(LHA > 0) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(AV > 1) {\r\n sum('GtoI');\r\n return 'I';\r\n } else {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return 'N';\r\n }\r\n } else if(DD > 3) {\r\n if(LHA > 0) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(AV > 1) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(BBs === 3 && CVs === 1 && CL + CT === 2) {\r\n sum('GtoI');\r\n return 'I';\r\n } else if(f_speed !== '低速艦隊') {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return 'N';\r\n } else if(CV + CVB < 2 && CL + CT > 1) {\r\n sum('GtoK');\r\n sum('KtoN');\r\n return 'N';\r\n } else {\r\n sum('GtoH');\r\n sum('HtoK');\r\n sum('KtoN');\r\n return 'N';\r\n }\r\n }\r\n break;\r\n case 'I':\r\n if(CV + CVB > 1) {\r\n sum('ItoJ');\r\n sum('JtoL');\r\n return 'L';\r\n } else if(Ds < 4) {\r\n sum('ItoJ');\r\n sum('JtoL');\r\n return 'L';\r\n } else if(CL + CT < 2 && f_speed === '低速艦隊') {\r\n sum('ItoJ');\r\n sum('JtoL');\r\n return 'L';\r\n } else if(Ds + LHA < 6 && f_speed === '低速艦隊') {\r\n sum('ItoJ');\r\n sum('JtoL');\r\n return 'L';\r\n } else if(BBs < 2) {\r\n sum('ItoL');\r\n return 'L';\r\n } else if(CVs + countAkitsuMaru() < 2) {\r\n sum('ItoL');\r\n return 'L';\r\n } else {\r\n sum('ItoJ');\r\n sum('JtoL');\r\n return 'L';\r\n }\r\n break;\r\n case 'R':\r\n if(f_seek[1] >= 68) {\r\n sum('RtoW');\r\n return null;\r\n } else {\r\n sum('RtoV');\r\n return null;\r\n }\r\n break;\r\n case 'S':\r\n if(f_seek[1] >= 59) {\r\n sum('StoU');\r\n return null;\r\n } else {\r\n sum('StoT');\r\n return null;\r\n }\r\n break;\r\n case 'L':\r\n if(active['59-2']['L'] === 'M') {\r\n sum('LtoM');\r\n return null;\r\n } else {\r\n sum('LtoN');\r\n return 'N';\r\n }\r\n break;\r\n case 'N':\r\n if(active['59-2']['N'] === 'O') {\r\n sum('NtoO');\r\n sum('OtoS');\r\n return 'S';\r\n } else {\r\n sum('NtoP');\r\n return 'P';\r\n }\r\n break;\r\n case 'P':\r\n if(active['59-2']['P'] === 'Q') {\r\n sum('PtoQ');\r\n return null;\r\n } else {\r\n sum('PtoR');\r\n return 'R';\r\n }\r\n break;\r\n }\r\n break;\r\n case 3: { // @59-3\r\n const phase = Number(active['59-3']['1']);\r\n switch(edge) {\r\n case null:\r\n if(!isCom() && f_length !== 7) {\r\n return '1';\r\n } else if(!isCom() && f_length === 7) {\r\n return '2';\r\n } else if(f_type === '輸送護衛部隊') {\r\n return '1';\r\n } else if(phase === 1 && (f_type === '水上打撃部隊' || f_type === '空母機動部隊')) {\r\n return '1';\r\n } else if(phase > 1 && (f_type === '水上打撃部隊' || f_type === '空母機動部隊')) {\r\n sum('3toP');\r\n return 'P';\r\n }\r\n break;\r\n case '1':\r\n if(!isCom()) {\r\n sum('1toA');\r\n sum('AtoB');\r\n return 'B';\r\n } else {\r\n sum('1toL');\r\n sum('LtoM');\r\n sum('MtoB1');\r\n return 'B1';\r\n }\r\n break;\r\n case '2':\r\n if(CV + CVB < 3 && Ds > 2) {\r\n sum('2toH');\r\n return 'H';\r\n } else {\r\n sum('2toG');\r\n sum('GtoH');\r\n return 'H';\r\n }\r\n break;\r\n case 'B':\r\n if(CVs > 3) {\r\n sum('BtoB2');\r\n sum('B2toH1');\r\n sum('H1toH2');\r\n sum('H2toI');\r\n return 'I';\r\n } else if(CV + CVB > 2) {\r\n sum('BtoB2');\r\n sum('B2toH1');\r\n sum('H1toH2');\r\n sum('H2toI');\r\n return 'I';\r\n } else if(AV > 1) {\r\n sum('BtoB2');\r\n sum('B2toH1');\r\n sum('H1toH2');\r\n sum('H2toI');\r\n return 'I';\r\n } else if(LHA > 0) {\r\n sum('BtoB2');\r\n sum('B2toH1');\r\n sum('H1toH2');\r\n sum('H2toI');\r\n return 'I';\r\n } else if(BBs < 3 && Ds > 2) {\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('BtoB1');\r\n return 'B1';\r\n }\r\n break;\r\n case 'B1':\r\n if(!isCom()) {\r\n sum('B1toC');\r\n return 'C';\r\n } else if(f_type === '輸送護衛部隊') {\r\n sum('B1toP');\r\n return 'P';\r\n } else if(f_type === '水上打撃部隊') {\r\n sum('B1toN');\r\n return 'N';\r\n } else if(f_type === '空母機動部隊') {\r\n if(CVs + countAkitsuMaru() > 3) {\r\n sum('B1toN');\r\n return 'N';\r\n } else if(CV + CVB > 1) {\r\n sum('B1toN');\r\n return 'N';\r\n } else if(Ds < 2 && BBs > 3) {\r\n sum('B1toN');\r\n return 'N';\r\n } else {\r\n sum('B1toP');\r\n return 'P';\r\n }\r\n } else {\r\n sum('B1toP');\r\n return 'P';\r\n }\r\n break;\r\n case 'C3':\r\n if(f_seek[3] < 103) {\r\n sum('C3toE');\r\n return null;\r\n } else if(BBs + CV + CVB > 3) {\r\n sum('C3toD');\r\n sum('DtoF');\r\n return null;\r\n } else if(Ds < 2) {\r\n sum('C3toD');\r\n sum('DtoF');\r\n return null;\r\n } else {\r\n sum('C3toF');\r\n return null;\r\n }\r\n break;\r\n case 'H':\r\n if(Ds > 3 && f_speed !== '低速艦隊') {\r\n sum('HtoH2');\r\n sum('H2toI');\r\n return 'I';\r\n } else if(CV + CVB > 1) {\r\n sum('HtoB2');\r\n sum('B2toH1');\r\n sum('H1toH2');\r\n sum('H2toI');\r\n return 'I';\r\n } else {\r\n sum('HtoH1');\r\n sum('H1toH2');\r\n sum('H2toI');\r\n return 'I';\r\n }\r\n break;\r\n case 'I':\r\n if(f_seek[3] >= 82) {\r\n sum('ItoK');\r\n return null;\r\n } else {\r\n sum('ItoJ');\r\n return null;\r\n }\r\n break;\r\n case 'N':\r\n if(f_type === '水上打撃部隊') {\r\n sum('NtoO');\r\n sum('OtoP');\r\n return 'P';\r\n } else if(f_type === '空母機動部隊') {\r\n if(f_speed === '低速艦隊') {\r\n sum('NtoO');\r\n sum('OtoP');\r\n return 'P';\r\n } else {\r\n sum('NtoP');\r\n return 'P';\r\n }\r\n }\r\n break;\r\n case 'P':\r\n if(track.includes('1')) {\r\n sum('PtoQ');\r\n return 'Q';\r\n } else if(track.includes('3')) {\r\n if(countYamato() > 1) {\r\n sum('PtoT');\r\n sum('TtoV');\r\n return 'V';\r\n } else if(CV + CVB > 2) {\r\n sum('PtoT');\r\n sum('TtoV');\r\n return 'V';\r\n } else if(Ss > 0 && AS === 0) {\r\n sum('PtoT');\r\n sum('TtoV');\r\n return 'V';\r\n } else if(f_type === '水上打撃部隊' && f_speed === '低速艦隊') {\r\n sum('PtoT');\r\n sum('TtoV');\r\n return 'V';\r\n } else {\r\n sum('PtoU');\r\n sum('UtoV');\r\n return 'V';\r\n }\r\n }\r\n break;\r\n case 'Q':\r\n if(f_seek[1] >= 53) {\r\n sum('QtoS');\r\n return null;\r\n } else {\r\n sum('QtoR');\r\n return null;\r\n }\r\n break;\r\n case 'V':\r\n if(LHA > 0 && f_speed === '低速艦隊') {\r\n sum('VtoV1');\r\n return null;\r\n } else if(AV > 1 && f_speed === '低速艦隊') {\r\n sum('VtoV1');\r\n return null;\r\n } else if(BBs > 3 && f_speed === '低速艦隊') {\r\n sum('VtoV1');\r\n return null;\r\n } else if(BBs > 4) {\r\n sum('VtoV1');\r\n return null;\r\n } else if(BBCVs > 5) {\r\n sum('VtoV2');\r\n sum('V2toV3');\r\n return 'V3';\r\n } else if(BBs + CV + CVB > 4) {\r\n sum('VtoV2');\r\n sum('V2toV3');\r\n return 'V3';\r\n } else if(CV + CVB > 2) {\r\n sum('VtoV2');\r\n sum('V2toV3');\r\n return 'V3';\r\n } else if(Ss > 0 && AS === 0) {\r\n sum('VtoV2');\r\n sum('V2toV3');\r\n return 'V3';\r\n } else if(countYamato() > 1 && f_speed === '低速艦隊') {\r\n sum('VtoV2');\r\n sum('V2toV3');\r\n return 'V3';\r\n } else if(phase < 3) {\r\n sum('VtoV3');\r\n return 'V3';\r\n } else if(Ds < 4) {\r\n sum('VtoV3');\r\n return 'V3';\r\n } else if(CL > 1 && CA > 1) {\r\n sum('VtoX');\r\n return null;\r\n } else if(f_speed !== '低速艦隊') {\r\n sum('VtoX');\r\n return null;\r\n } else {\r\n sum('VtoV3');\r\n return 'V3';\r\n }\r\n break;\r\n case 'V3':\r\n if(f_seek[1] >= 72) {\r\n sum('V3toX');\r\n return null;\r\n } else {\r\n sum('V3toW');\r\n return null;\r\n }\r\n break;\r\n case 'C':\r\n if(active['59-3']['C'] === 'C1') {\r\n sum('CtoC1');\r\n return null;\r\n } else {\r\n sum('CtoC2');\r\n sum('C2toC3');\r\n return 'C3';\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n case 4: {\r\n const phase = Number(active['59-4']['1']);\r\n switch(edge) {\r\n case null:\r\n if(!isCom()) {\r\n return '1';\r\n } else {\r\n sum('2toT');\r\n return 'T';\r\n }\r\n break;\r\n case '1':\r\n if(Ss > 0) {\r\n sum('1toA1');\r\n sum('A1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else if(f_speed !== '低速艦隊') {\r\n if(BBs > 2) {\r\n sum('1toA1');\r\n sum('A1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else if(Ds > 1) {\r\n sum('1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else if(f_length < 5) {\r\n sum('1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else {\r\n sum('1toA1');\r\n sum('A1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n } else {\r\n if(CVs > 1) {\r\n sum('1toA1');\r\n sum('A1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else if(BBs > 0) {\r\n sum('1toA1');\r\n sum('A1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else if(CL + CT > 0 && Ds > 1) {\r\n sum('1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else if(f_length < 5) {\r\n sum('1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n } else {\r\n sum('1toA1');\r\n sum('A1toA');\r\n sum('AtoA2');\r\n return 'A2';\r\n }\r\n }\r\n break;\r\n case 'C':\r\n if(BBs + CV + CVB > 2) {\r\n sum('CtoI');\r\n return 'I';\r\n } else if(CV + CVB > 1) {\r\n sum('CtoI');\r\n return 'I';\r\n } else if(CVs > 2) {\r\n sum('CtoI');\r\n return 'I';\r\n } else if(Ds < 2) {\r\n sum('CtoI');\r\n return 'I';\r\n } else if(phase > 1 && BBs === 0) {\r\n sum('CtoM');\r\n return 'M';\r\n } else if(phase > 1 && f_length < 7 && BBs === 1 && CL > 0) {\r\n sum('CtoM');\r\n return 'M';\r\n } else {\r\n sum('CtoL');\r\n return null;\r\n }\r\n break;\r\n case 'F':\r\n if(true) {\r\n sum('FtoF1');\r\n sum('F1toG');\r\n return 'G';\r\n } else {}\r\n break;\r\n case 'G':\r\n if(true) {\r\n sum('GtoH');\r\n return null;\r\n } else {}\r\n break;\r\n case 'I':\r\n if(CV + CVB > 1) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else if(CL === 0 && Ds < 3) {\r\n sum('ItoJ');\r\n return 'J';\r\n } else if(true) {\r\n sum('ItoL');\r\n return null;\r\n } else {}\r\n break;\r\n case 'J':\r\n if(true) {\r\n sum('JtoL');\r\n return null;\r\n } else {}\r\n break;\r\n case 'M':\r\n if(CV + CVB > 0) {\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return 'Q';\r\n } else if(CVL > 1) {\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return 'Q';\r\n } else if(Ds > 3) {\r\n sum('MtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return 'Q';\r\n } else if(CL + CT > 0 && Ds === 3) {\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return 'Q';\r\n } else if(CL + CT > 0 && f_speed !== '低速艦隊') {\r\n sum('MtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return 'Q';\r\n } else {\r\n sum('MtoN');\r\n sum('NtoO');\r\n sum('OtoP');\r\n sum('PtoQ');\r\n return 'Q';\r\n }\r\n break;\r\n case 'Q':\r\n if(f_seek[3] >= 72) {\r\n sum('QtoS');\r\n return null;\r\n } else {\r\n sum('QtoR');\r\n return null;\r\n }\r\n break;\r\n case 'T':\r\n if(isFaster()) {\r\n sum('TtoT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(Ss > 0 && AS === 0) {\r\n sum('TtoT1');\r\n sum('T1toT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(BBs > 3) {\r\n sum('TtoT1');\r\n sum('T1toT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(CVs > 3) {\r\n sum('TtoT1');\r\n sum('T1toT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(CV + CVB > 2) {\r\n sum('TtoT1');\r\n sum('T1toT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(CL + CT + Ds < 4) {\r\n sum('TtoT1');\r\n sum('T1toT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(f_speed !== '低速艦隊') {\r\n sum('TtoT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else if(BBs < 3 && CL + CT > 1 && Ds > 3) {\r\n sum('TtoT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n } else {\r\n sum('TtoT1');\r\n sum('T1toT2');\r\n sum('T2toU');\r\n sum('UtoU1');\r\n sum('U1toU2');\r\n sum('U2toV');\r\n sum('VtoW');\r\n return 'W';\r\n }\r\n break;\r\n case 'W':\r\n if(f_seek[1] < 80) {\r\n sum('WtoX');\r\n return 'X';\r\n } else if(isFaster()) {\r\n sum('WtoZ');\r\n return null;\r\n } else if(countYamato() > 0) {\r\n sum('WtoX');\r\n return 'X';\r\n } else if(BBs > 3) {\r\n sum('WtoX');\r\n return 'X';\r\n } else if(BBs > 2 && CVs > 2) {\r\n sum('WtoX');\r\n return 'X';\r\n } else {\r\n sum('WtoZ');\r\n return null;\r\n }\r\n break;\r\n case 'X':\r\n if(f_seek[1] < 73) {\r\n sum('XtoK');\r\n return null;\r\n } else if(isFaster()) {\r\n sum('XtoZ');\r\n return null;\r\n } else if(countYamato() > 1) {\r\n sum('XtoY');\r\n sum('YtoZ');\r\n return null;\r\n } else {\r\n sum('XtoZ');\r\n return null;\r\n }\r\n break;\r\n case 'A2':\r\n if(active['59-4']['A2'] === 'B') {\r\n sum('A2toB');\r\n sum('BtoD');\r\n return 'D';\r\n } else {\r\n sum('A2toC');\r\n return 'C';\r\n }\r\n break;\r\n case 'D':\r\n if(active['59-4']['D'] === 'E') {\r\n sum('DtoE');\r\n return null;\r\n } else {\r\n sum('DtoF');\r\n return 'F';\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n case 5: {\r\n const phase = Number(active['59-5']['1']);\r\n switch(edge) {\r\n case null:\r\n if(!isCom()) {\r\n return '1';\r\n } else if(phase === 1 && isCom()) {\r\n return '2';\r\n } else if(phase > 1) {\r\n if(BB + CV + CVB > 2) {\r\n sum('3toM');\r\n sum('MtoM1');\r\n sum('M1toM2');\r\n return 'M2';\r\n } else if(CV + CVB > 1) {\r\n sum('3toM');\r\n sum('MtoM1');\r\n sum('M1toM2');\r\n return 'M2';\r\n } else {\r\n return '2';\r\n }\r\n }\r\n break;\r\n case '1':\r\n if(isFaster()) {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(f_speed === '低速艦隊') {\r\n sum('1toA1');\r\n return 'A1';\r\n } else if(BBs + CV + CVB > 0) {\r\n sum('1toA1');\r\n return 'A1';\r\n } else if(CVL > 1) {\r\n sum('1toA1');\r\n return 'A1';\r\n } else {\r\n sum('1toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n break;\r\n case '2':\r\n if(isFaster()) {\r\n sum('2toE');\r\n return 'E';\r\n } else if(Ss > 0 && AS === 0) {\r\n sum('2toD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(BBs + CV + CVB > 1) {\r\n sum('2toD');\r\n sum('DtoE');\r\n return 'E';\r\n } else if(Ds < 4) {\r\n sum('2toD');\r\n sum('DtoE');\r\n return 'E';\r\n } else {\r\n sum('2toE');\r\n return 'E';\r\n }\r\n break;\r\n case 'A1':\r\n if(Ss > 0) {\r\n sum('A1toA2');\r\n sum('A2toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(BBCVs > 2) {\r\n sum('A1toA2');\r\n sum('A2toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else if(BBs > 1) {\r\n sum('A1toA2');\r\n sum('A2toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n } else {\r\n sum('A1toA');\r\n sum('AtoB');\r\n sum('BtoC');\r\n return 'C';\r\n }\r\n break;\r\n case 'C':\r\n if(f_seek[3] >= 70) {\r\n sum('CtoC2');\r\n return null;\r\n } else {\r\n sum('CtoC1');\r\n return null;\r\n }\r\n break;\r\n case 'E':\r\n if(isFaster()) {\r\n sum('EtoG');\r\n return 'G';\r\n } else if(Ds > 5) {\r\n sum('EtoG');\r\n return 'G';\r\n } else if(Ds > 4 && CA > 1 && CV + CVB === 0 && BBs + CVL < 2 && f_speed !== '低速艦隊') {\r\n sum('EtoG');\r\n return 'G';\r\n } else {\r\n sum('EtoF');\r\n sum('FtoG');\r\n return 'G';\r\n }\r\n break;\r\n case 'J':\r\n if(true) {\r\n sum('JtoL');\r\n return null;\r\n } else {}\r\n break;\r\n case 'M2':\r\n if(isFaster()) {\r\n sum('M2toN');\r\n sum('NtoO');\r\n return 'O';\r\n } else if(f_type === '空母機動部隊') {\r\n sum('M2toN');\r\n sum('NtoO');\r\n return 'O';\r\n } else {\r\n sum('M2toM3');\r\n sum('M3toN');\r\n sum('NtoO');\r\n return 'O';\r\n }\r\n break;\r\n case 'O':\r\n if(isFaster()) {\r\n sum('OtoO2');\r\n return 'O2';\r\n } else if(countYamato() > 0) {\r\n sum('OtoO1');\r\n sum('O1toO2');\r\n return 'O2';\r\n } else if(CVs > 3) {\r\n sum('OtoO1');\r\n sum('O1toO2');\r\n return 'O2';\r\n } else if(CV + CVB > 2) {\r\n sum('OtoO1');\r\n sum('O1toO2');\r\n return 'O2';\r\n } else if(Ds < 4) {\r\n sum('OtoO1');\r\n sum('O1toO2');\r\n return 'O2';\r\n } else {\r\n sum('OtoO2');\r\n return 'O2';\r\n }\r\n break;\r\n case 'Q':\r\n if(isFaster()) {\r\n sum('QtoR');\r\n return null;\r\n } else if(countYamato() > 1) {\r\n sum('QtoR1');\r\n return 'R1';\r\n } else if(countYamato() === 1 && f_speed === '低速艦隊') {\r\n sum('QtoR1');\r\n return 'R1';\r\n } else if(BBs > 2) {\r\n sum('QtoR1');\r\n return 'R1';\r\n } else {\r\n sum('QtoR');\r\n return null;\r\n }\r\n break;\r\n case 'R1':\r\n if(countYamato() + countShipsByName('Iowa') < 2) {\r\n sum('R1toR');\r\n return null;\r\n } else if(f_speed !== '低速艦隊') {\r\n sum('R1toR');\r\n return null;\r\n } else if(f_speed === '低速艦隊') {\r\n sum('R1toR2');\r\n sum('R2toR');\r\n return null;\r\n }\r\n break;\r\n case 'S':\r\n if(countYamato() > 1) {\r\n sum('StoS2');\r\n return 'S2'; \r\n } else if(CV + CVB > 0) {\r\n sum('StoS2');\r\n return 'S2'; \r\n } else if(f_speed !== '低速艦隊') {\r\n if(CA > 1 && CVL < 2) {\r\n sum('StoT');\r\n return 'T';\r\n } else {\r\n sum('StoS1');\r\n sum('S1toT');\r\n return 'T'; \r\n }\r\n } else if(f_speed === '低速艦隊') {\r\n if(CL + CT > 2 && Ds > 2) {\r\n sum('StoS1');\r\n sum('S1toT');\r\n return 'T'; \r\n } else {\r\n sum('StoS2');\r\n return 'S2'; \r\n }\r\n }\r\n break;\r\n case 'S2':\r\n if(true) {\r\n sum('S2toS1');\r\n sum('S1toT');\r\n return 'T';\r\n } else {}\r\n break;\r\n case 'T':\r\n if(f_seek[1] >= 65) {\r\n sum('TtoV');\r\n return null;\r\n } else {\r\n sum('TtoU');\r\n return null;\r\n }\r\n break;\r\n case 'Z':\r\n if(CVs + countAkitsuMaru() > 2) {\r\n sum('ZtoY');\r\n return null;\r\n } else if(CAs > 3) {\r\n sum('ZtoY');\r\n return null;\r\n } else if(BBs > 3) {\r\n sum('ZtoZ1');\r\n return 'Z1';\r\n } else if(phase < 3) {\r\n if(isFaster()) {\r\n sum('ZtoY');\r\n return null;\r\n } else if(BBs < 3) {\r\n sum('ZtoY');\r\n return null;\r\n } else {\r\n sum('ZtoZ1');\r\n return 'Z1';\r\n }\r\n } else if(phase === 3) {\r\n if(isFaster()) {\r\n sum('ZtoZZ');\r\n return null;\r\n } else if(countYamato() === 0 && BBs < 3) {\r\n sum('ZtoZZ');\r\n return null;\r\n } else if(countYamato() === 1 && BBs < 3 && CAs > 1 && CL + CT > 1 && Ds > 3) {\r\n sum('ZtoZZ');\r\n return null;\r\n } else {\r\n sum('ZtoZ1');\r\n return 'Z1';\r\n }\r\n }\r\n break;\r\n case 'Z1':\r\n if(true) {\r\n sum('Z1toZZ');\r\n return null;\r\n } else {}\r\n break;\r\n case 'G':\r\n if(active['59-5']['G'] === 'H') {\r\n sum('GtoH');\r\n sum('HtoS');\r\n return 'S';\r\n } else {\r\n sum('GtoI');\r\n sum('ItoJ');\r\n return 'J';\r\n }\r\n break;\r\n case 'O2':\r\n if(active['59-5']['O2'] === 'P') {\r\n sum('O2toP');\r\n sum('PtoW');\r\n return 'W';\r\n } else {\r\n sum('O2toQ');\r\n return 'Q';\r\n }\r\n break;\r\n case 'W':\r\n if(active['59-5']['W'] === 'Z') {\r\n sum('WtoZ');\r\n return 'Z';\r\n } else {\r\n sum('WtoX');\r\n return null;\r\n }\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n break;\r\n }\r\n }\r\n \r\n // 演算開始\r\n // simControllerから叩くこと\r\n function startSim() {\r\n // measureTime(true);\r\n return new Promise((resolve) => {\r\n if(a_flag && f_flag) {\r\n area = localStorage.getItem('area');\r\n const elem = area.split('-');\r\n const world = Number(elem[0]);\r\n const map = Number(elem[1]);\r\n let edge = null;\r\n // 無限ループ防止\r\n let max_c = 10000; // 何回回すか\r\n const max_s = 150000;\r\n if(area.includes('58')) {\r\n max_c = 1; // イベは1回だけ\r\n }\r\n let safety = 0;\r\n let count = 0;\r\n while(count < max_c) {\r\n edge = branch(world, map, edge, false);\r\n if(edge === null) {\r\n count++;\r\n pushLog();\r\n track = [];\r\n }\r\n safety++;\r\n if(safety > max_s) {\r\n alert('無限ループ防止 バグった');\r\n console.log('無限ループ');\r\n console.log('以下諸元');\r\n console.log(`海域: ${world}-${map}`);\r\n console.log('艦種', com);\r\n console.log('最終航路', track);\r\n console.log(`safety: ${safety}`);\r\n console.log(`count: ${count}`);\r\n console.log(`ドラム缶: ${f_drum}`);\r\n console.log(`電探: ${f_radar}`);\r\n console.log(`大発系: ${f_craft}`);\r\n console.log(`寒甲: ${f_kanko}`);\r\n console.log(`f_speed: ${f_speed}`);\r\n console.log(rate);\r\n console.log('終わり');\r\n return;\r\n }\r\n }\r\n console.log('航路', rate);\r\n // 正直どういう挙動になってるのか分からない\r\n // 非同期でいい感じにやってくれてるならいいやって感じ\r\n drawMap(max_c);\r\n rate = {};\r\n t_logs = {};\r\n\r\n resolve();\r\n }\r\n });\r\n }\r\n\r\n // マップ描画\r\n function drawMap(max_c) {\r\n removePopupInfo();\r\n const map = map_info; // map.jsより\r\n const spots = map['spots'][area];\r\n const routes = map['route'][area];\r\n let elements = {\r\n nodes: [],\r\n edges: []\r\n };\r\n // nodes流し込み\r\n for (const key in spots) {\r\n if (spots.hasOwnProperty(key)) {\r\n // 座標,マスの種類\r\n const [x, y, label] = spots[key];\r\n elements.nodes.push({\r\n data: {id:key, name:key, label:label},\r\n position: {x, y}\r\n });\r\n }\r\n }\r\n // esges流し込み\r\n for (const key in routes) {\r\n if (routes.hasOwnProperty(key)) {\r\n const [source, target] = routes[key];\r\n // 通っていないルートはrateに無いので0に置き換え\r\n let ratio = ((rate[source + 'to' + target] / max_c) * 100).toFixed(1);\r\n ratio = isNaN(ratio) ? 0 : parseFloat(ratio);\r\n elements.edges.push({\r\n data: {\r\n source,\r\n target,\r\n ratio: ratio// 小数第二位以下四捨五入\r\n }\r\n });\r\n }\r\n }\r\n\r\n // スタイルシート\r\n const style = [\r\n { selector: 'node',\r\n style: {\r\n 'color': 'rgb(250,250,250)',\r\n 'font-weight': '100',\r\n 'text-outline-color': 'rgba(20,20,20)',\r\n 'text-outline-opacity': '.85',\r\n 'text-outline-width': '1.5px',\r\n 'content': 'data(name)',\r\n 'text-valign': 'center',\r\n 'text-halign': 'center',\r\n 'padding': '0pt',\r\n 'font-size': '15px',\r\n 'background-clip': 'none',// z-indexでedgesの下に潜り込ませるは上手くいかなかった\r\n }\r\n }, // マスの分類ごとに表示分岐\r\n { selector: 'node[label = \"st\"]', // 出撃\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/start.png`,\r\n 'font-weight': '600',\r\n 'text-outline-width': '2px',\r\n 'font-size': '20px',\r\n 'width': '48px',\r\n 'height': '48px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '1px', // 位置微調整\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"po\"]', // 港湾\r\n style: {\r\n 'background-image': `../media/nodes/port.png`,\r\n 'width': '48px',\r\n 'height': '48px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '5.7px',\r\n 'background-position-y': '5px'\r\n }\r\n },\r\n { selector: 'node[label = \"bo\"]', // ボス\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/boss.png`,\r\n 'width': '48px',\r\n 'height': '48px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '5px',\r\n 'background-position-y': '1px'\r\n }\r\n },\r\n { selector: 'node[label = \"ab\"]', // 航空戦\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/air-b.png`,\r\n 'width': '48px',\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '1px' // 位置微調整\r\n }\r\n },\r\n { selector: 'node[label = \"ad\"]', // 空襲\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/air-d.png`,\r\n 'width': '44px',\r\n 'height': '25px',\r\n 'background-opacity': 0,\r\n }\r\n },\r\n { selector: 'node[label = \"ac\"]', // 能動分岐\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/calm.png`,\r\n 'border-width': 3, // ボーダーの太さ\r\n 'border-color': '#2c4dff', // #ff3f87\r\n 'width': '27px',\r\n 'height': '27px',\r\n 'background-position-x': '0px',\r\n 'background-position-y': '-1px',\r\n }\r\n },\r\n { selector: 'node[label = \"en\"]', // 通常戦 基本設定\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/enemy.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"su\"]', // 対潜\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/enemy.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"ca\"]', // 気のせい\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/calm.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"wh\"]', // 渦潮\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/whirl.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"re\"]', // 資源\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/resource.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"ni\"]', // 夜戦\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/night.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"sc\"]', // 航空偵察\r\n style: {\r\n 'background-image': `${cdn}/media/nodes/scout.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"un\"]', // 不明\r\n style: {\r\n 'background-image': `../media/nodes/unknown.png`,\r\n 'width': '27px', // enemy系\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"as\"]', // 対潜空襲\r\n style: {\r\n 'background-image': `../media/nodes/airstrike_supported.png`,\r\n 'width': '48px',\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '-0.5px',\r\n 'background-position-y': '-1px'\r\n }\r\n },\r\n { selector: 'node[label = \"tl\"]', // 揚陸地点\r\n style: {\r\n 'background-image': `../media/nodes/transport_loadout.png`,\r\n 'width': '48px',\r\n 'height': '27px',\r\n 'background-opacity': 0,\r\n 'background-position-x': '12px',\r\n 'background-position-y': '1px'\r\n }\r\n },\r\n { selector: 'edge',\r\n style: {\r\n 'color': 'rgb(250,250,250)',\r\n 'font-weight': '100',\r\n 'text-outline-color': 'rgba(20,20,20)',\r\n 'text-outline-opacity': '.85',\r\n 'text-outline-width': '1.5px',\r\n 'width': '4px',\r\n 'curve-style': 'bezier', // こいつが無いと矢印にならないっぽい\r\n 'target-arrow-shape': 'triangle',\r\n 'content':'data(ratio)',\r\n 'events': 'no'\r\n }\r\n }, // 割合によって色分け\r\n { selector: 'edge[ratio = 100]',\r\n style: {\r\n 'line-color': 'rgb(220,20,60)',\r\n 'target-arrow-color': 'rgb(220,20,60)',\r\n }\r\n },\r\n { selector: 'edge[ratio < 100][ratio >= 80]',\r\n style: {\r\n 'line-color': 'rgb(255,99,71)',\r\n 'target-arrow-color': 'rgb(255,99,71)',\r\n }\r\n },\r\n { selector: 'edge[ratio < 80][ratio >= 60]',\r\n style: {\r\n 'line-color': 'rgb(255,165,0)',\r\n 'target-arrow-color': 'rgb(255,165,0)',\r\n }\r\n },\r\n { selector: 'edge[ratio < 60][ratio >= 40]',\r\n style: {\r\n 'line-color': 'rgb(255,215,0)',\r\n 'target-arrow-color': 'rgb(255,215,0)',\r\n }\r\n },\r\n { selector: 'edge[ratio < 40][ratio >= 20]',\r\n style: {\r\n 'line-color': 'rgb(255,215,0)',\r\n 'target-arrow-color': 'rgb(255,215,0)',\r\n }\r\n },\r\n { selector: 'edge[ratio < 20][ratio > 0]',\r\n style: {\r\n 'line-color': 'rgb(240,230,140)',\r\n 'target-arrow-color': 'rgb(240,230,140)',\r\n }\r\n },\r\n { selector: 'edge[ratio = 0]',\r\n style: {\r\n 'line-color': 'rgb(169,169,169)',\r\n 'content':'' // 0の場合表示なし\r\n }\r\n }\r\n ];\r\n\r\n const layout = {\r\n name:'preset'\r\n };\r\n\r\n // 出力\r\n cy = cytoscape_dist_cytoscape_min_js__WEBPACK_IMPORTED_MODULE_3___default()({\r\n // #cyに生成\r\n container: document.getElementById('cy'),\r\n elements: elements,\r\n style: style,\r\n layout:layout,\r\n autoungrabify: true, // nodeのドラッグ不可\r\n userZoomingEnabled: false\r\n });\r\n // 更新\r\n drew_area = area;\r\n console.log(`drew_area: ${drew_area}`);\r\n let node = null;\r\n cy.on('mouseup', function (e) {\r\n const tar = e.target;\r\n if(tar.data('name')) {\r\n node = tar.data('name');\r\n // ソースコード参照\r\n if(event && event.ctrlKey) {\r\n const url = `${location.origin}/source/?search=${drew_area}-${node}`;\r\n window.open(url);\r\n return;\r\n }\r\n }\r\n });\r\n // 分岐条件表示\r\n cy.on('mousedown', function (e) {\r\n const tar = e.target;\r\n if(tar.data('name')) {\r\n node = tar.data('name');\r\n // Phase\r\n // 2023夏はフェイズごとに記述したが以降は分からない\r\n let b_area = null;\r\n if(active.hasOwnProperty(drew_area)) {\r\n if(active[drew_area].hasOwnProperty('1') && (drew_area.includes('7') || drew_area.includes('57'))) {\r\n b_area = branch_info[`${drew_area}-${active[drew_area]['1']}`];\r\n } else {\r\n b_area = branch_info[drew_area];\r\n }\r\n } else {\r\n b_area = branch_info[drew_area];\r\n }\r\n if(b_area.hasOwnProperty(node)) {\r\n removePopupInfo();\r\n let text = b_area[node];\r\n // 改行、赤字置換\r\n text = text.replaceAll('$e', '
');\r\n text = text.replaceAll('$i', '    ');\r\n text = text.replaceAll('$co', '');\r\n text = text.replaceAll('$oc', '');\r\n text = text.replaceAll('$bo', '');\r\n text = text.replaceAll('$ob', '');\r\n text = text.replaceAll('$sw', ``);\r\n text = text.replaceAll('$or', ``);\r\n text = text.replaceAll('$ro', '');\r\n if(drew_area.includes('58')) {\r\n const blocks = text.split(/\\$bl(.*?)\\$lb/g).filter(Boolean);\r\n const split_area = drew_area.split('-');\r\n const world = Number(split_area[0]);\r\n const map = Number(split_area[1]);\r\n console.log(`world: ${world}`);\r\n console.log(`map: ${map}`);\r\n console.log(`node: ${node}`);\r\n // 先ず1周してtrackを作る\r\n let edge = null;\r\n // 無限ループ防止\r\n const safety = 0;\r\n let count = 0;\r\n while(count < 15) {\r\n edge = branch(world, map, edge, false);\r\n if(edge === null) {\r\n break;\r\n }\r\n if(count === 14) {\r\n alert('無限ループ防止 バグった');\r\n console.log('無限ループ');\r\n console.log('以下諸元');\r\n console.log(`海域: ${world}-${map}`);\r\n console.log('直後艦種');\r\n console.log(com);\r\n console.log('軌跡' + track);\r\n console.log(`safety: ${safety}`);\r\n console.log(`count: ${count}`);\r\n console.log(`ドラム缶: ${f_drum}`);\r\n console.log(`電探: ${f_radar}`);\r\n console.log(`大発系: ${f_craft}`);\r\n console.log(`寒甲: ${f_kanko}`);\r\n console.log(`f_speed: ${f_speed}`);\r\n console.log(rate);\r\n console.log('終わり');\r\n return;\r\n }\r\n count++;\r\n }\r\n let matchNum = branch(world, map, node, true);\r\n if(!matchNum && !isNaN(node)) {\r\n matchNum = branch(world, map, null, true);\r\n }\r\n console.log(`matchNum: ${matchNum}`);\r\n if(blocks[matchNum - 1]) {\r\n blocks[matchNum - 1] = `${blocks[matchNum - 1]}`;\r\n }\r\n text = blocks.join('');\r\n }\r\n text = text.replaceAll('/*', '');\r\n text = text.replaceAll('*/', '');\r\n popup(e, text);\r\n } else {\r\n removePopupInfo();\r\n }\r\n } else {\r\n removePopupInfo();\r\n }\r\n });\r\n // ポップアップ生成\r\n // eventとhtmlを渡す\r\n function popup(e, html) {\r\n // 選択したnodeを分かりやすくしたいがデザインが難しい\r\n // e.target.style.color = '#ff0000';\r\n\r\n // クリックした座標(cy基準)\r\n const position = e.target.renderedPosition();\r\n\r\n // cy領域の左上の座標を取得\r\n const cyContainer = cy.container().getBoundingClientRect();\r\n\r\n // htmlを作成\r\n html = `

${html}

`;\r\n const popup = document.createElement('div');\r\n popup.innerHTML = html;\r\n popup.id = 'popup-info';\r\n\r\n // 表示位置調整\r\n let top, left;\r\n\r\n if (position.x >= 650) {\r\n left = position.x + cyContainer.left - 260;\r\n top = position.y + cyContainer.top + 20;\r\n } else {\r\n left = position.x + cyContainer.left + 20;\r\n top = position.y + cyContainer.top - 10;\r\n }\r\n \r\n const style = popup.style;\r\n style.top = top + 'px';\r\n style.left = left + 'px';\r\n\r\n // 表示\r\n document.body.appendChild(popup);\r\n }\r\n\r\n // 図上で右クリック\r\n cy.contextMenus({\r\n menuItems: [\r\n {\r\n id: 'cy-ct-bg',\r\n content: '索敵無視',\r\n coreAsWell: true,\r\n show: true,\r\n onClickFunction: function () {\r\n if(is_ignore_seek) {\r\n f_seek = fs_copy;\r\n is_ignore_seek = false;\r\n } else {\r\n // 退避\r\n fs_copy = f_seek;\r\n f_seek = [999,999,999,999];\r\n is_ignore_seek = true;\r\n }\r\n reloadImportDisplay();\r\n simController();\r\n }\r\n }\r\n ]\r\n });\r\n // nodeを右クリックで獲得資源予測\r\n cy.on('cxttapstart', 'node', function(e) {\r\n removePopupInfo();\r\n const node = e.target.data('name');\r\n let content = '';\r\n let r_data = {\r\n fuel: null,\r\n max_fuel: 'unknown',\r\n ammo: null,\r\n max_ammo: 'unknown',\r\n steel: null,\r\n max_steel: 'unknown',\r\n imo: null,\r\n max_imo: 'unknown',\r\n is_nomal: true, // ドラム缶*2 + 大発系*3ならtrue(含ボーキのドラム缶*1.5)\r\n memo:'',\r\n };\r\n let c_data = {\r\n fuel: 0,\r\n ammo: 0,\r\n steel: 0,\r\n imo: 0\r\n };\r\n \r\n switch(drew_area) {\r\n case '1-2':\r\n if(node === 'B') {\r\n r_data.ammo = [10, 20];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '1-3':\r\n if(node === 'D') {\r\n r_data.fuel = [10, 20];\r\n } else if(node === 'G') {\r\n r_data.fuel = [10, 30];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '1-4':\r\n if(node === 'C') {\r\n r_data.steel = [10, 20];\r\n } else if(node === 'E') {\r\n r_data.ammo = [10, 20];\r\n } else if(node === 'G') {\r\n r_data.imo = [10, 20];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '1-6':\r\n if(node === 'G') {\r\n r_data.ammo = 20;\r\n r_data.max_ammo = 40;\r\n r_data.is_nomal = false;\r\n mold('ammo', 0 , 5);\r\n } else if(node === 'M') {\r\n r_data.fuel = 40;\r\n r_data.max_fuel = 80;\r\n r_data.is_nomal = false;\r\n mold('fuel', 0, 10);\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '2-1':\r\n if(node === 'B') {\r\n r_data.steel = [10, 30];\r\n } else if(node === 'E') {\r\n r_data.memo = '高速建造材:1';\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '2-2':\r\n if(node === 'A') {\r\n r_data.imo = [10, 20];\r\n } else if(node === 'F') {\r\n r_data.imo = [15, 35];\r\n } else if(node === 'J') {\r\n r_data.memo = '高速建造材:1';\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '2-3':\r\n if(node === 'D') {\r\n r_data.fuel = [15, 45];\r\n } else if(node === 'G') {\r\n r_data.ammo = [15, 45];\r\n } else if(node === 'H') {\r\n r_data.ammo = [35, 40];\r\n } else if(node === 'I') {\r\n r_data.fuel = [15, 45];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '2-4':\r\n if(node === 'A') {\r\n r_data.memo = '高速建造材:1
((上陸用舟艇+特型内火艇)4以上で+2個の確率が発生する?)';\r\n } else if(node === 'D') {\r\n r_data.fuel = [25, 60];\r\n } else if(node === 'G') {\r\n r_data.memo = '開発資材:1';\r\n } else if(node === 'N') {\r\n r_data.ammo = [20, 60];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '2-5':\r\n if(node === 'M') {\r\n r_data.fuel = 70;\r\n r_data.is_nomal = false;\r\n mold('fuel', 0, 0);\r\n } else if(node === 'N') {\r\n r_data.steel = [50, 60];\r\n r_data.is_nomal = false;\r\n mold('steel', 0, 0);\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '3-1':\r\n if(node === 'A') {\r\n r_data.ammo = [35, 140];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '3-2':\r\n if(node === 'B') {\r\n r_data.ammo = [50, 150];\r\n } else if(node === 'I') {\r\n r_data.memo = '家具箱(小):1';\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '3-3':\r\n if(node === 'D') {\r\n r_data.memo = '家具箱(中):1';\r\n } else if(node === 'H') {\r\n r_data.memo = '家具箱(大):1';\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '3-4':\r\n if(node === 'E') {\r\n r_data.imo = [25, 150];\r\n } else if(node === 'K') {\r\n r_data.memo = '家具箱(大):1';\r\n } else if(node === 'O') {\r\n r_data.memo = '家具箱(中):1';\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '3-5':\r\n if(node === 'J') {\r\n r_data.ammo = 50;\r\n r_data.is_nomal = false;\r\n mold('ammo', 10, 0);\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '4-1':\r\n if(node === 'B') {\r\n r_data.fuel = [40, 120];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '4-2':\r\n if(node === 'J') {\r\n r_data.imo = [40, 60];\r\n } else if(node === 'K') {\r\n r_data.steel = [20, 80];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '4-3':\r\n if(node === 'B') {\r\n r_data.fuel = [30, 90];\r\n } else if(node === 'J') {\r\n r_data.imo = [50, 100];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '4-4':\r\n if(node === 'C') {\r\n r_data.fuel = [60, 150];\r\n } else if(node === 'J') {\r\n r_data.steel = [40, 70];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '5-1':\r\n if(node === 'C') {\r\n r_data.steel = [25, 50];\r\n } else if(node === 'H') {\r\n r_data.ammo = [45, 70];\r\n r_data.is_nomal = false;\r\n mold('ammo', 0, 0);\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '5-2':\r\n if(node === 'G') {\r\n r_data.ammo = [20, 50];\r\n } else if(node === 'J') {\r\n r_data.imo = [40, 80];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '5-3':\r\n if(node === 'F') {\r\n r_data.ammo = [60, 80];\r\n } else if(node === 'H') {\r\n r_data.steel = [50, 80];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '5-4':\r\n if(node === 'I') {\r\n r_data.ammo = 60;\r\n r_data.max_ammo = 180;\r\n r_data.is_nomal = false;\r\n mold('ammo', 10, 15);\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '5-5':\r\n if(node === 'E') {\r\n r_data.fuel = 40;\r\n r_data.max_fuel = 180;\r\n r_data.is_nomal = false;\r\n mold('fuel', 15, 10);\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '7-1':\r\n if(node === 'E') {\r\n r_data.fuel = [10, 20];\r\n } else if(node === 'I') {\r\n r_data.fuel = [30, 50];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '7-2':\r\n if(node === 'K') {\r\n r_data.fuel = [25, 40];\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '7-3':\r\n if(node === 'H') {\r\n r_data.fuel = [30, 50];\r\n } else if(node === 'O') {\r\n r_data.imo = [40, 50];\r\n r_data.is_nomal = false;\r\n mold('imo', 2, 3);\r\n } else {\r\n return;\r\n }\r\n break;\r\n case '7-4':\r\n if(node === 'O') { // 7-4-Oはだいぶ特殊なのでフルスクラッチ\r\n let fuel = ft_drum * 8 + ft_craft * 7;\r\n fuel += com.BBV * 10 + com.CVL * 7 + com.AV * 6 + com.AS * 5 + com.LHA * 8 + com.AO * 22;\r\n let imo = ft_drum * 6 + ft_craft * 10;\r\n imo += com.BBV * 10 + com.CVL * 7 + com.AV * 6 + com.AS * 5 + com.LHA * 8 + com.AO * 22;\r\n content += `

`;\r\n content += `

base: 40

`;\r\n content += `

max: 200

`;\r\n content += `

add: ${fuel} = ${ft_drum} * 8 + ${ft_craft} * 7

`;\r\n content += `

+ 航空戦艦 ${com.BBV} * 10

`;\r\n content += `

+ 軽空母 ${com.CVL} * 7

`;\r\n content += `

+ 水上機母艦 ${com.AV} * 6

`;\r\n content += `

+ 潜水母艦 ${com.AS} * 5

`;\r\n content += `

+ 揚陸艦 ${com.LHA} * 8

`;\r\n content += `

+ 補給艦 ${com.AO} * 22

`;\r\n content += `

`;\r\n content += `

base: 20

`;\r\n content += `

max: 120

`;\r\n content += `

add: ${imo} = ${ft_drum} * 6 + ${ft_craft} * 10

`;\r\n content += `

+ 航空戦艦 ${com.BBV} * 10

`;\r\n content += `

+ 軽空母 ${com.CVL} * 4

`;\r\n content += `

+ 水上機母艦 ${com.AV} * 5

`;\r\n content += `

+ 潜水母艦 ${com.AS} * 5

`;\r\n content += `

+ 揚陸艦 ${com.LHA} * 7

`;\r\n content += `

+ 補給艦 ${com.AO} * 16

`;\r\n r_data.is_nomal = false;\r\n } else {\r\n return;\r\n }\r\n break;\r\n default:\r\n return;\r\n }\r\n if(r_data.is_nomal) {\r\n if(r_data.fuel) {\r\n mold('fuel', 2, 3);\r\n }\r\n if(r_data.ammo) {\r\n mold('ammo', 2, 3);\r\n }\r\n if(r_data.steel) {\r\n mold('steel', 2, 3);\r\n }\r\n if(r_data.imo) {\r\n mold('imo', 1.5, 2);\r\n }\r\n }\r\n if(r_data.memo) {\r\n content += `

${r_data.memo}

`;\r\n }\r\n popup(e, content);\r\n function mold(name, d_mag, c_mag) {\r\n c_data[name] = Math.trunc(ft_drum * d_mag) + ft_craft * c_mag;\r\n content += `

`;\r\n if(Array.isArray(r_data[name])) {\r\n content += `

base: ${r_data[name][0]} ~ ${r_data[name][1]}

`;\r\n } else {\r\n content += `

base: ${r_data[name]}

`;\r\n }\r\n if(name === 'imo') {\r\n content += `

add: ${c_data[name]} = Math.trunc(${ft_drum} * ${d_mag}) + ${ft_craft} * ${c_mag}

`;\r\n } else {\r\n content += `

add: ${c_data[name]} = ${ft_drum} * ${d_mag} + ${ft_craft} * ${c_mag}

`;\r\n }\r\n content += `

max: ${r_data[`max_${name}`]}

`;\r\n }\r\n });\r\n // 図上スクロールをページスクロールに変換\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#cy').on('wheel', function(e){\r\n e.preventDefault();\r\n e.stopPropagation();\r\n const delta = e.originalEvent.deltaY;\r\n // がくつくけどsmoothにすると連続スクロール時にもたる\r\n window.scrollBy(0, delta);\r\n });\r\n // measureTime(false, 'startSim&drawMap');\r\n console.log('ルート', t_logs);\r\n }\r\n // ※未使用\r\n // 演算と描画が完了したらinfo画面の情報を準備\r\n // 基地は計算しないからこれはこれで半端かも\r\n function preInfo(callback) {\r\n return new Promise((resolve) => {\r\n console.log('preInfo');\r\n // 値の大きい順に並びかえ\r\n t_logs = sortObjectByValues(t_logs);\r\n\r\n // l_mags > mags > mag みたいな感じ\r\n let l_costs = []; // 艦ごとの消費資源\r\n let max_costs = getMaxCosts(); // 各艦の最大消費資源\r\n let l_mags = []; // 何パーセント消費するか\r\n let l_sums = [[0, 0]]; // 消費資源合計\r\n let l_rems = [[100, 100]]; // 残資源割合\r\n let l_uzu_num = []; // 渦潮のindex\r\n if(t_logs.length) {\r\n for(let t_log of t_logs) { // 航路単位\r\n let mags = [];\r\n let rems = [];\r\n let nodes = t_log.split('e');\r\n for(let i;i < nodes.length;i++) { // 戦闘 or 渦潮単位\r\n let node = nodes[i];\r\n let mag = null;\r\n let type = map_info['spots'][drew_area][node][2];\r\n if(type === 'en') {\r\n mag = [20, 20];\r\n } else if(type === 'ni') {\r\n\r\n } else if(type === 'su') {\r\n\r\n } else if(type === 'ad') {\r\n\r\n } else if(type === 'ab') {\r\n\r\n } else if(type === 'wh') {\r\n uzu_num.push(i);\r\n } else {\r\n continue;\r\n }\r\n let rem = rems.at(-1);\r\n rems.push([[rem[0] - mag[0]], [rem[1] - mag[1]]]);\r\n mags.push(mag);\r\n }\r\n l_mags.push(mags);\r\n l_rems.push(rems);\r\n for(let mag of mags) {\r\n let costs = [];\r\n for(let q;q < max_costs.length;q++) {\r\n let max_cost = max_costs[q];\r\n if(f_lvs[q] > 99) {\r\n let fuel = Math.floor(max_cost[0] * 0.85) * mag[0];\r\n let ammo = Math.floor(max_cost[1] * 0.85) * mag[1];\r\n costs.push([fuel, ammo]);\r\n } else {\r\n let fuel = max_cost[0] * mag[0];\r\n let ammo = max_cost[1] * mag[1];\r\n costs.push([fuel, ammo]);\r\n }\r\n }\r\n l_costs.push(costs);\r\n }\r\n }\r\n for(let i;i < l_costs.length;i++) {\r\n let costs = l_costs[i];\r\n }\r\n }\r\n resolve();\r\n });\r\n }\r\n // 区間計測デバッグ用\r\n // is_start・・・開始ならtrue終了ならfalse\r\n function measureTime(is_start, text) {\r\n if(!text) text = '';\r\n if (is_start) {\r\n console.log('計測開始');\r\n s_time = performance.now(); // 開始時の時間を取得\r\n } else {\r\n console.log('計測終了');\r\n const seconds = performance.now() - s_time;\r\n console.log(`${text}: ${seconds}ms`);\r\n }\r\n }\r\n // popup-infoが存在すれば削除\r\n function removePopupInfo() {\r\n if(jquery__WEBPACK_IMPORTED_MODULE_0___default()('#popup-info')) {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#popup-info').remove();\r\n }\r\n }\r\n \r\n // 読み込み時にlocalstorageから諸々の設定を読込、反映\r\n // 上に置くとtrigger()が不発する 謎\r\n setup();\r\n function setup() {\r\n let a = localStorage.getItem('active');\r\n let s = localStorage.getItem('selected_type');\r\n let f = localStorage.getItem('fleet');\r\n // 能動分岐セット\r\n if(!a) {\r\n a = active;\r\n localStorage.setItem('active', JSON.stringify(a));\r\n } else {\r\n try {\r\n a = JSON.parse(a);\r\n // 全てのキーが存在するかチェック\r\n // 無いのがあればそこだけ初期値を設定\r\n for (const key in active) {\r\n if (!a.hasOwnProperty(key)) {\r\n a[key] = active[key];\r\n }\r\n }\r\n localStorage.setItem('active', JSON.stringify(a));\r\n } catch(e) {\r\n alert('データ異常:当該データを初期化します');\r\n a = active;\r\n localStorage.setItem('active', JSON.stringify(a));\r\n }\r\n }\r\n // html反映\r\n for(const key in a) {\r\n for(const key2 in a[key]) {\r\n const val = a[key][key2];\r\n const name = key + '-' + key2;\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('input[name=\"' + name + '\"][value=\"' + val + '\"]').prop('checked', true);\r\n active = a;\r\n }\r\n }\r\n // html反映\r\n const ar = localStorage.getItem('area');\r\n if(ar) {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#area-display').text(`海域: ${ar}`);\r\n setArea(ar);\r\n }\r\n if(s) {\r\n selected_type = Number(s);\r\n }\r\n // 艦隊セット\r\n // urlパラメータからの読み込みならlocalstorageに入れてパラメータなしでリロード\r\n // 入力チェックはsetFleetInfoあたりでやる\r\n let deck = getParam('predeck');\r\n if(deck) {\r\n deck = decodeURIComponent(deck);\r\n localStorage.setItem('fleet', deck);\r\n location.href = location.origin + location.pathname;\r\n } else if(f) {\r\n // 艦隊は文字列のまま貼る\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').val(f);\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#fleet-import').trigger('input');\r\n }\r\n }\r\n // URLから任意のパラメータを取得\r\n function getParam(name, url) {\r\n if (!url) {\r\n url = window.location.href;\r\n }\r\n name = name.replace(/[\\[\\]]/g, '\\\\$&');\r\n const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),\r\n results = regex.exec(url);\r\n if (!results) {\r\n return null;\r\n }\r\n if (!results[2]) {\r\n return '';\r\n }\r\n return decodeURIComponent(results[2].replace(/\\+/g, ' '));\r\n }\r\n\r\n /*\r\n key:海域\r\n char:node\r\n value:値\r\n 変数、ストレージ双方更新\r\n */\r\n function updateActive(key, char, value) {\r\n let elem = localStorage.getItem('active');\r\n if(elem) {\r\n elem = JSON.parse(elem);\r\n elem[key][char] = value;\r\n } else {\r\n elem = active;\r\n elem[key][char] = value;\r\n }\r\n active = elem;\r\n localStorage.setItem('active', JSON.stringify(elem));\r\n }\r\n // localStorage内を全削除\r\n function allClear() {\r\n const res = confirm('本当に?\\n特に問題はありませんが');\r\n if(res) {\r\n // ローカルストレージ全削除\r\n localStorage.clear();\r\n // リロード\r\n location.reload();\r\n }\r\n }\r\n // popupから能動分岐切り替え\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').on('click', '.remote-active', function() {\r\n const name = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val();\r\n const inputs = jquery__WEBPACK_IMPORTED_MODULE_0___default()(`input[name=\"${name}\"]`);\r\n if(inputs.eq(0).prop('checked')) {\r\n inputs.eq(1).prop('checked', true);\r\n inputs.eq(1).trigger('input');\r\n } else {\r\n inputs.eq(0).prop('checked', true);\r\n inputs.eq(0).trigger('input');\r\n }\r\n });\r\n // 海域入力画面表示\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#area-display').on('click', function() {\r\n document.getElementById('mask').style.display = 'block';\r\n document.getElementById('area-container').style.display = 'flex';\r\n document.getElementById('area-box').style.display = 'block';\r\n });\r\n // 海域選択画面非表示\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#area-container').on('click', function() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#mask').css('display', 'none');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#area-container').css('display', 'none');\r\n });\r\n // 設定画面表示\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#conf-icon-box').on('click', function() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#mask').css('display', 'block');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#conf-container').css('display', 'flex');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#conf-box').css('display', 'block');\r\n });\r\n // 設定画面非表示\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#conf-container').on('click', function() {\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#mask').css('display', 'none');\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#conf-container').css('display', 'none');\r\n });\r\n // バブリング阻止\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#area-box, #conf-box').on('click', function(e) {\r\n e.stopPropagation();\r\n });\r\n // localstorage全削除\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#all-clear').on('click', function() {\r\n allClear();\r\n });\r\n // オプションリスト折り畳み/展開\r\n document.getElementById('fold').addEventListener('click', function() {\r\n const optionUp = this.querySelector('#option-up');\r\n const optionDown = this.querySelector('#option-down');\r\n const listContainer = document.querySelectorAll('#option-box > .options');\r\n\r\n if (optionUp.style.display === 'none') {\r\n optionUp.style.display = 'block';\r\n optionDown.style.display = 'none';\r\n listContainer.forEach(function(item) {\r\n item.style.height = '';\r\n });\r\n } else {\r\n optionUp.style.display = 'none';\r\n optionDown.style.display = 'block';\r\n listContainer.forEach(function(item) {\r\n item.style.height = '22px';\r\n });\r\n }\r\n });\r\n\r\n // infomation ※未実装\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#infomation').on('click', function() {\r\n\r\n });\r\n // 連想配列を値の大きい順にソート\r\n function sortObjectByValues(obj) {\r\n if(obj.length > 1) {\r\n // オブジェクトをキーと値のペアを持つ配列に変換\r\n const entries = Object.entries(obj);\r\n // 配列を値の大きい順にソート\r\n const sortedEntries = entries.sort((a, b) => b[1] - a[1]);\r\n // ソートされた配列から新しいオブジェクトを再構築\r\n const sortedObject = Object.fromEntries(sortedEntries);\r\n return sortedObject;\r\n } else {\r\n return obj;\r\n }\r\n }\r\n // 艦の最大資源消費量を配列で返す\r\n function getMaxCosts() {\r\n let res = [];\r\n for(const s_id of f_ids) { // 艦\r\n const max_fuel = s_data.find(entry => entry.id === s_id).fuel;\r\n const max_ammo = s_data.find(entry => entry.id === s_id).ammo;\r\n res.push([max_fuel, max_ammo]);\r\n }\r\n return res;\r\n }\r\n // スクショ\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#screen-shot').on('click', function() {\r\n if(drew_area) {\r\n const now = new Date();\r\n let hours = now.getHours();\r\n let minutes = now.getMinutes();\r\n // 二桁の形式に変換\r\n hours = hours < 10 ? '0' + hours : hours;\r\n minutes = minutes < 10 ? '0' + minutes : minutes;\r\n const time = `${hours}${minutes}`;\r\n const fileName = `${drew_area}_${time}`;\r\n const deck = generateDeck();\r\n // gkcoi出力\r\n const g_speed = getFleetSpeedWithNum(f_speed);\r\n console.log('gkcoiへの引数');\r\n console.log('deck', deck);\r\n console.log(`g_speed: ${g_speed}`);\r\n console.log(`f_seek: ${f_seek}`);\r\n (0,gkcoi__WEBPACK_IMPORTED_MODULE_5__.generate)(deck, g_speed, f_seek).then((canvas) => {\r\n const g_blob = getGkcoiBlob(canvas);\r\n const cy_blob = getCyBlob();\r\n combineAndDownloadBlobs(cy_blob, g_blob, fileName);\r\n }).catch((error) => {\r\n console.error(error);\r\n alert('スクショ失敗: 未対応の艦が含まれるかも?');\r\n });\r\n }\r\n });\r\n // gkcoiに渡すデッキビルダー生成\r\n function generateDeck() {\r\n const res = {\r\n lang: 'jp',\r\n theme: 'dark',\r\n hqlv: i_json.hqlv\r\n };\r\n if(selected_type < 5) {\r\n desF(selected_type);\r\n } else {\r\n desF(1);\r\n desF(2);\r\n }\r\n function desF(num) {\r\n let n = 1; // deckに設定するf\r\n if(num === 2) {\r\n n = 2;\r\n }\r\n let s_length = f_length - f2_length;\r\n let f = {};\r\n for(let i = 0;i < s_length;i++) {\r\n const s_id = i_json[`f${num}`][`s${i + 1}`]['id'];\r\n const i_ship = i_json[`f${num}`][`s${i + 1}`];\r\n const s_ship = s_data.find((item) => item.id === s_id);\r\n const hp = s_ship.hp;\r\n const lv = i_ship.lv;\r\n const asw = getLFparam(s_ship, lv, 'ass');\r\n const los = getLFparam(s_ship, lv, 'seek');\r\n const luck = i_ship.luck;\r\n // 表示されないのは指定しない\r\n let ship = {\r\n id: s_id,\r\n lv: lv,\r\n hp: hp,\r\n fp: 0,\r\n tp: 0,\r\n aa: 0,\r\n ar: 0,\r\n asw: asw,\r\n ev: 0,\r\n los: los,\r\n luck: luck\r\n };\r\n let items = {};\r\n let j = 1;\r\n for(const key in i_ship.items) {\r\n let name = `i${j}`;\r\n if(key === 'ix') {\r\n name = 'ix';\r\n }\r\n items[name] = {\r\n id: i_ship.items[key].id,\r\n rf: i_ship.items[key].rf,\r\n mas: 7\r\n }\r\n j++;\r\n }\r\n ship.items = items;\r\n f[`s${i + 1}`] = ship;\r\n }\r\n res[`f${n}`] = f;\r\n }\r\n return res;\r\n }\r\n // 一次関数的に上昇するパラメータを計算して返す\r\n // 引数s_dataのjson,パラメータ名\r\n function getLFparam(ship, lv, param) {\r\n const max = ship[`max_${param}`];\r\n const min = ship[param];\r\n const res = new decimal_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](max).minus(min).times(lv).div(99).floor().plus(min);\r\n return parseInt(res);\r\n }\r\n // cytoscapeのblob取得\r\n function getCyBlob() {\r\n return cy.jpg({\r\n maxWidth:1293,\r\n quality:1,\r\n output: 'blob',\r\n full: true,\r\n bg:'#212121'\r\n });\r\n }\r\n // Canvasをblobで取得\r\n function getGkcoiBlob(canvas) {\r\n // CanvasからBase64形式の画像データを取得\r\n const dataUrl = canvas.toDataURL('image/jpeg');\r\n // Base64形式のデータからBlobオブジェクトを作成\r\n return dataURItoBlob(dataUrl);\r\n }\r\n // Data URIをBlobオブジェクトに変換\r\n function dataURItoBlob(dataURI) {\r\n const byteString = atob(dataURI.split(',')[1]);\r\n const ab = new ArrayBuffer(byteString.length);\r\n const ia = new Uint8Array(ab);\r\n for (let i = 0; i < byteString.length; i++) {\r\n ia[i] = byteString.charCodeAt(i);\r\n }\r\n return new Blob([ab], { type: 'image/jpeg' });\r\n }\r\n // blobから画像を生成して上限に連結(img1が上)幅はimg1に合わせる\r\n function combineAndDownloadBlobs(blob1, blob2, fileName) {\r\n const canvas = document.createElement('canvas');\r\n const context = canvas.getContext('2d');\r\n // 入力Blobの高さを取得\r\n let b1_height, b2_height;\r\n // BlobのためのImage要素を作成\r\n const img1 = new Image();\r\n const img2 = new Image();\r\n // 1つ目の画像の読み込みが完了したときの処理\r\n img1.onload = function() {\r\n b1_height = img1.height;\r\n // 2つ目の画像の読み込みが完了したときの処理\r\n img2.onload = function() {\r\n b2_height = img2.height;\r\n // 2つの画像の幅を比較し、大きい方に合わせる\r\n const max_width = Math.max(img1.width, img2.width);\r\n canvas.width = max_width;\r\n canvas.height = b1_height + b2_height;\r\n // 画像を描画\r\n context.drawImage(img1, 0, 0, max_width, b1_height);\r\n context.drawImage(img2, 0, b1_height, max_width, b2_height);\r\n const combinedImage = canvas.toDataURL(); // 画像をDataURLに変換\r\n const a = document.createElement('a');\r\n a.href = combinedImage;\r\n a.download = `${fileName}.jpg`;\r\n document.body.appendChild(a);\r\n a.click();\r\n document.body.removeChild(a);\r\n // BlobのURLを解放\r\n URL.revokeObjectURL(img1.src);\r\n URL.revokeObjectURL(img2.src);\r\n };\r\n // 2つ目の画像を読み込む\r\n img2.src = URL.createObjectURL(blob2);\r\n };\r\n // 1つ目の画像を読み込む\r\n img1.src = URL.createObjectURL(blob1);\r\n }\r\n // 数値から艦隊速度を文字列で取得\r\n function getFleetSpeedWithNum(text) {\r\n let res = 0;\r\n switch(text) {\r\n case '低速艦隊':\r\n res = 5;\r\n break;\r\n case '高速艦隊':\r\n res = 10;\r\n break;\r\n case '高速+艦隊':\r\n res = 15\r\n break;\r\n case '最速艦隊':\r\n res = 20;\r\n break;\r\n }\r\n return res;\r\n }\r\n // ※デバッグ用\r\n // 海域とNodeを指定して現在の編成での返り値を出力\r\n window.branch = branch;\r\n // キーボードショートカット\r\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).keydown(function(e) {\r\n switch(e.keyCode) {\r\n case 65:\r\n bruteForceTest();\r\n }\r\n });\r\n});\r\n\n\n//# sourceURL=webpack://compass/./src/js/main.js?"); /***/ }), diff --git a/compass/src/js/main.js b/compass/src/js/main.js index e9e35f8..3b92839 100644 --- a/compass/src/js/main.js +++ b/compass/src/js/main.js @@ -9880,18 +9880,26 @@ $(function() { } break; case 'I': - if(CVs + countAkitsuMaru() > 1) { + if(CV + CVB > 1) { sum('ItoJ'); sum('JtoL'); return 'L'; - } else if(DD < 4) { + } else if(Ds < 4) { sum('ItoJ'); sum('JtoL'); return 'L'; - } else if(f_speed !== '低速艦隊') { + } else if(CL + CT < 2 && f_speed === '低速艦隊') { + sum('ItoJ'); + sum('JtoL'); + return 'L'; + } else if(Ds + LHA < 6 && f_speed === '低速艦隊') { + sum('ItoJ'); + sum('JtoL'); + return 'L'; + } else if(BBs < 2) { sum('ItoL'); return 'L'; - } else if(CL + CT > 1 && Ds + LHA > 5) { + } else if(CVs + countAkitsuMaru() < 2) { sum('ItoL'); return 'L'; } else { @@ -9910,7 +9918,7 @@ $(function() { } break; case 'S': - if(f_seek[1] >= 58) { + if(f_seek[1] >= 59) { sum('StoU'); return null; } else { diff --git a/data/branch.js b/data/branch.js index de980f4..003bb27 100644 --- a/data/branch.js +++ b/data/branch.js @@ -555,13 +555,13 @@ let branch_info = { "A":"高速+以上の艦隊はA2$e駆逐4以上はA2$e駆逐3以上 かつ 高速艦隊はA2$eそれ以外はA1", "C":"$bo分岐点係数4$ob$e索敵値60以上はE$e索敵不足はD", "G":"輸送護衛部隊はI$e空母系+あきつ丸5以上はH$e戦艦級4以上はH$e空母3以上はH$e駆逐+海防2以下はH$e駆逐3の場合、$e$i低速艦隊はH$e$i揚陸艦1以上はI$e$i水母2以上はI$e$iそれ以外はK$e駆逐4以上の場合、$e$i揚陸艦1以上はI$e$i水母2以上はI$e$i戦艦級3 かつ 空母系1 かつ 軽巡+練巡2はI$e$i高速艦隊はK$e$i空母1以下 かつ 軽巡+練巡2以上はK$e$iそれ以外はH", - "I":"空母系+あきつ丸2以上はJ$e駆逐3以下はJ$e高速艦隊はL$e軽巡+練巡2以上 かつ 駆逐+海防+揚陸艦6以上はL$eそれ以外はJ", + "I":"空母2以上はJ$e駆逐+海防3以下はJ$e軽巡+練巡1以下 かつ 低速艦隊はJ$e駆逐+海防+揚陸艦5以下 かつ 低速艦隊はJ$e戦艦級1以下はL$e空母系+あきつ丸1以下はL$eそれ以外はJ", "R":"$bo分岐点係数2$ob$e索敵値68以上はW$eそれ以外はV", - "S":"$bo分岐点係数2$ob$e索敵値58以上はU$eそれ以外はT", + "S":"$bo分岐点係数2$ob$e索敵値59以上はU$eそれ以外はT", "L":"能動分岐$sw", "N":"能動分岐$sw", "P":"能動分岐$sw", - "date":"2024-08-19 16:22" + "date":"2024-09-01 14:00" }, "59-3":{ "0":"開始時点では通常艦隊(遊撃部隊不可)のみ出撃可(シミュでは判定しない)$e通常艦隊は1$e遊撃部隊は2$e輸送護衛部隊は1$e出撃地点3が未開放 かつ 空母機動部隊、水上打撃部隊は1$e出撃地点3が解放済み かつ 空母機動部隊、水上打撃部隊は3",