远征本主界面及匹配机器人

This commit is contained in:
luying
2020-10-13 19:16:58 +08:00
parent 682e95561d
commit 7652f63414
15 changed files with 568 additions and 17 deletions
+9 -3
View File
@@ -30,7 +30,6 @@ function parseTowerData() {
}
function initData (folder) {
console.log('加载文件夹:', folder);
if(!gamedata.hasOwnProperty(folder)) {
gamedata[folder] = {};
}
@@ -67,8 +66,15 @@ export function getGamedata(key) {
}
// 获取出兵表
export function getWarJsons(key: string) {
return gamedata['warJsons'][key];
export function getWarJsons(key: any) {
key = key + '';
let arr = key.split('&');
let index = Math.floor(Math.random() * arr.length);
key = arr[index];
return {
json: gamedata['warJsons'][key],
fileName: key
}
}
export function getWarById(warid: number) {