合成藏宝图,消耗品单独开表

This commit is contained in:
luying
2020-11-25 20:31:42 +08:00
parent 3f3c716dc6
commit 169ba8cea7
17 changed files with 282 additions and 215 deletions
+16
View File
@@ -22,6 +22,7 @@ const btlBossHp = new Map<number, number>();
const blueprtBossHp = new Map<number, number>();
const goodInfo = new Map<number, any>();
const blueprt = new Map<number, Array<number>>();
const blueprtCompose = new Map<number, any>();
function parseWarData() {
let result = null;
@@ -208,6 +209,16 @@ function parseGood() {
});
}
function parseBlueprtCompose() {
const file = 'dic_blueprt_compose';
const data = gamedata['jsons'][file] || [];
data.forEach(elem => {
if (elem && elem.quality) {
blueprtCompose.set(elem.quality, elem);
}
});
}
function initData (folder: string) {
if(!gamedata.hasOwnProperty(folder)) {
gamedata[folder] = {};
@@ -246,6 +257,7 @@ function parseData() {
parseExpedition();
parseComBtlData();
parseGood();
parseBlueprtCompose();
}
initData('jsons'); // 加载一般json
@@ -372,4 +384,8 @@ export function getBossHpByBlueprtId(blueprtId: number) {
}
export function hasExpeditionById(id: number) {
return expeditionInfo.has(id);
}
export function getBlueprtComposeByQuality(quality: number) {
return blueprtCompose.get(quality);
}
+2 -1
View File
@@ -169,7 +169,8 @@ export function decodeIdCntArrayStr(str: string, multi: number) {
return ce;
}
export function getRandomByLen(arr: Array<any>) {
export function getRandomByLen(arr: Array<number>):number
export function getRandomByLen(arr: Array<any>): any {
let len = arr.length;
return arr[Math.floor(Math.random() * len)]
}