2024-04-15 16:50:54 +00:00
|
|
|
import { lib, game, ui, get, ai, _status } from "../../noname.js";
|
|
|
|
game.import("play", function () {
|
2017-04-15 00:25:50 +00:00
|
|
|
return {
|
2024-04-15 16:50:54 +00:00
|
|
|
name: "boss",
|
|
|
|
init: function () {
|
|
|
|
if (get.mode() == "tafang") return;
|
|
|
|
var storage = localStorage.getItem("boss_storage_playpackconfig");
|
|
|
|
try {
|
|
|
|
storage = JSON.parse(storage) || {};
|
|
|
|
} catch (e) {
|
|
|
|
storage = {};
|
2017-09-15 07:45:38 +00:00
|
|
|
}
|
2024-04-15 16:50:54 +00:00
|
|
|
if (get.mode() != "boss") {
|
|
|
|
lib.characterPack.mode_extension_boss = storage.boss || {};
|
|
|
|
for (var i in lib.characterPack.mode_extension_boss) {
|
|
|
|
lib.characterPack.mode_extension_boss[i][4].push(
|
|
|
|
"mode:boss"
|
|
|
|
);
|
|
|
|
lib.character[i] = lib.characterPack.mode_extension_boss[i];
|
|
|
|
if (
|
|
|
|
typeof lib.character[i][2] != "number" &&
|
|
|
|
(typeof lib.character[i][2] != "string" ||
|
|
|
|
lib.character[i][2].indexOf("/") == -1)
|
|
|
|
) {
|
|
|
|
lib.character[i][2] = Infinity;
|
2017-09-15 07:45:38 +00:00
|
|
|
}
|
2024-04-15 16:50:54 +00:00
|
|
|
if (!lib.config.boss_enableai_playpackconfig) {
|
2016-12-19 09:40:20 +00:00
|
|
|
lib.config.forbidai.push(i);
|
|
|
|
}
|
|
|
|
}
|
2017-09-15 07:45:38 +00:00
|
|
|
}
|
2024-04-15 16:50:54 +00:00
|
|
|
var list2 = storage.versus || {};
|
|
|
|
if (
|
|
|
|
get.mode() != "versus" ||
|
|
|
|
get.config("versus_mode") != "jiange"
|
|
|
|
) {
|
|
|
|
lib.characterPack.mode_extension_jiange = list2;
|
|
|
|
for (var i in list2) {
|
|
|
|
lib.characterPack.mode_extension_jiange[i] = list2[i];
|
|
|
|
lib.characterPack.mode_extension_jiange[i][4].push(
|
|
|
|
"mode:versus"
|
|
|
|
);
|
|
|
|
lib.character[i] = list2[i];
|
|
|
|
if (typeof lib.character[i][2] != "number") {
|
|
|
|
lib.character[i][2] = Infinity;
|
2017-09-15 07:45:38 +00:00
|
|
|
}
|
2024-04-15 16:50:54 +00:00
|
|
|
if (!lib.config.boss_enableai_playpackconfig) {
|
2017-09-15 07:45:38 +00:00
|
|
|
lib.config.forbidai.push(i);
|
2016-12-19 09:40:20 +00:00
|
|
|
}
|
|
|
|
}
|
2024-04-15 16:50:54 +00:00
|
|
|
lib.characterIntro.boss_liedixuande = lib.characterIntro.liubei;
|
|
|
|
lib.characterIntro.boss_gongshenyueying =
|
|
|
|
lib.characterIntro.huangyueying;
|
|
|
|
lib.characterIntro.boss_tianhoukongming =
|
|
|
|
lib.characterIntro.shen_zhugeliang;
|
|
|
|
lib.characterIntro.boss_yuhuoshiyuan =
|
|
|
|
lib.characterIntro.pangtong;
|
|
|
|
lib.characterIntro.boss_qiaokuijunyi =
|
|
|
|
lib.characterIntro.zhanghe;
|
|
|
|
lib.characterIntro.boss_jiarenzidan =
|
|
|
|
lib.characterIntro.caozhen;
|
|
|
|
lib.characterIntro.boss_duanyuzhongda =
|
|
|
|
lib.characterIntro.simayi;
|
|
|
|
lib.characterIntro.boss_juechenmiaocai =
|
|
|
|
lib.characterIntro.xiahouyuan;
|
|
|
|
} else if (_status.mode != "jiange") {
|
|
|
|
for (var i in list2) {
|
|
|
|
lib.character[i] = list2[i];
|
|
|
|
if (!lib.config.boss_enableai_playpackconfig) {
|
2017-09-15 07:45:38 +00:00
|
|
|
lib.config.forbidai.push(i);
|
2017-04-15 00:25:50 +00:00
|
|
|
}
|
|
|
|
}
|
2017-09-15 07:45:38 +00:00
|
|
|
}
|
2024-04-15 16:50:54 +00:00
|
|
|
var list = storage.translate || {};
|
|
|
|
list.mode_extension_boss_character_config = "挑战武将";
|
|
|
|
list.mode_extension_jiange_character_config = "剑阁武将";
|
2016-09-23 15:23:19 +00:00
|
|
|
|
2024-04-15 16:50:54 +00:00
|
|
|
for (var i in list) {
|
|
|
|
lib.translate[i] = lib.translate[i] || list[i];
|
2016-09-23 15:23:19 +00:00
|
|
|
}
|
2017-04-15 00:25:50 +00:00
|
|
|
},
|
2024-04-15 16:50:54 +00:00
|
|
|
arenaReady: function () {
|
|
|
|
if (get.mode() == "tafang") return;
|
|
|
|
var storage = localStorage.getItem("boss_storage_playpackconfig");
|
|
|
|
try {
|
|
|
|
storage = JSON.parse(storage) || {};
|
|
|
|
} catch (e) {
|
|
|
|
storage = {};
|
2017-09-15 07:45:38 +00:00
|
|
|
}
|
2024-04-15 16:50:54 +00:00
|
|
|
if (!storage.translate) {
|
|
|
|
storage.translate = {};
|
2017-09-15 07:45:38 +00:00
|
|
|
}
|
2024-04-15 16:50:54 +00:00
|
|
|
var loadversus = function () {
|
|
|
|
if (get.mode() != "versus") {
|
|
|
|
game.loadModeAsync("versus", function (mode) {
|
|
|
|
for (var i in mode.translate) {
|
|
|
|
lib.translate[i] =
|
|
|
|
lib.translate[i] || mode.translate[i];
|
|
|
|
storage.translate[i] = mode.translate[i];
|
2017-04-15 00:25:50 +00:00
|
|
|
}
|
2024-04-15 16:50:54 +00:00
|
|
|
for (var i in mode.skill) {
|
|
|
|
if (lib.skill[i]) console.log(i);
|
|
|
|
if (i != "versus_ladder") {
|
|
|
|
lib.skill[i] = mode.skill[i];
|
2019-12-07 12:48:38 +00:00
|
|
|
}
|
|
|
|
}
|
2024-04-15 16:50:54 +00:00
|
|
|
for (var ii in mode.skill) {
|
|
|
|
if (ii != "versus_ladder") {
|
2019-12-07 12:48:38 +00:00
|
|
|
game.finishSkill(ii);
|
2017-04-15 00:25:50 +00:00
|
|
|
}
|
|
|
|
}
|
2024-04-15 16:50:54 +00:00
|
|
|
storage.versus = {};
|
|
|
|
for (var i in mode.jiangeboss) {
|
|
|
|
if (mode.jiangeboss[i][4].includes("bossallowed")) {
|
|
|
|
storage.versus[i] = mode.jiangeboss[i];
|
2017-09-15 07:45:38 +00:00
|
|
|
}
|
|
|
|
}
|
2024-04-15 16:50:54 +00:00
|
|
|
localStorage.setItem(
|
|
|
|
"boss_storage_playpackconfig",
|
|
|
|
JSON.stringify(storage)
|
|
|
|
);
|
2017-04-15 00:25:50 +00:00
|
|
|
});
|
2024-04-15 16:50:54 +00:00
|
|
|
} else {
|
|
|
|
localStorage.setItem(
|
|
|
|
"boss_storage_playpackconfig",
|
|
|
|
JSON.stringify(storage)
|
|
|
|
);
|
2017-09-15 07:45:38 +00:00
|
|
|
}
|
2017-04-15 00:25:50 +00:00
|
|
|
};
|
2024-04-15 16:50:54 +00:00
|
|
|
if (get.mode() != "boss") {
|
|
|
|
game.loadModeAsync("boss", function (mode) {
|
|
|
|
for (var i in mode.translate) {
|
|
|
|
lib.translate[i] =
|
|
|
|
lib.translate[i] || mode.translate[i];
|
|
|
|
storage.translate[i] = mode.translate[i];
|
2016-12-19 09:40:20 +00:00
|
|
|
}
|
2024-04-15 16:50:54 +00:00
|
|
|
for (var i in mode.skill) {
|
|
|
|
if (lib.skill[i]) console.log(i);
|
|
|
|
lib.skill[i] = mode.skill[i];
|
2019-12-07 12:48:38 +00:00
|
|
|
}
|
2024-04-15 16:50:54 +00:00
|
|
|
for (var ii in mode.skill) {
|
|
|
|
if (ii != "versus_ladder") {
|
2019-12-07 12:48:38 +00:00
|
|
|
game.finishSkill(ii);
|
|
|
|
}
|
2016-12-19 09:40:20 +00:00
|
|
|
}
|
2024-04-15 16:50:54 +00:00
|
|
|
storage.boss = {};
|
|
|
|
for (var i in mode.characterPack.mode_boss) {
|
|
|
|
if (
|
|
|
|
mode.characterPack.mode_boss[i][4].includes(
|
|
|
|
"bossallowed"
|
|
|
|
)
|
|
|
|
) {
|
|
|
|
storage.boss[i] = mode.characterPack.mode_boss[i];
|
2017-09-15 07:45:38 +00:00
|
|
|
}
|
|
|
|
}
|
2017-04-15 00:25:50 +00:00
|
|
|
loadversus();
|
2016-12-19 09:40:20 +00:00
|
|
|
});
|
2024-04-15 16:50:54 +00:00
|
|
|
} else {
|
2016-12-19 09:40:20 +00:00
|
|
|
loadversus();
|
2017-04-15 00:25:50 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|
2017-04-14 23:35:56 +00:00
|
|
|
});
|