添加特技战力计算
This commit is contained in:
@@ -26,6 +26,6 @@ let arr = JSON.parse(str);
|
||||
export const dicRandomEffectPool = new Map<number, DicRandomEffectPool>();
|
||||
|
||||
arr.forEach(o => {
|
||||
o.gainValueArr = parseNumberList(o.gainvalue)
|
||||
o.gainValueArr = parseNumberList(o.gainValue)
|
||||
dicRandomEffectPool.set(o.id, o);
|
||||
});
|
||||
@@ -16,6 +16,8 @@ export interface DicSe {
|
||||
readonly gainValueArr: Array<number>;
|
||||
// 最大触发数
|
||||
readonly maxOnlyNum: number;
|
||||
// 随机值位置
|
||||
readonly index: number;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +27,7 @@ let arr = JSON.parse(str);
|
||||
export const dicSe = new Map<number, DicSe>();
|
||||
|
||||
arr.forEach(o => {
|
||||
o.index = 0;
|
||||
o.gainValueArr = parseNumberList(o.gainvalue)
|
||||
dicSe.set(o.id, o);
|
||||
});
|
||||
38
shared/pubUtils/dictionary/DicSuit.ts
Normal file
38
shared/pubUtils/dictionary/DicSuit.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
// 镇念塔表
|
||||
import { decodeArrayListStr, readJsonFile } from '../util'
|
||||
import { FILENAME } from '../../consts';
|
||||
|
||||
export interface DicSuit {
|
||||
// 套装id
|
||||
readonly id: number;
|
||||
// 包含关卡
|
||||
readonly name: string;
|
||||
// 总件数
|
||||
readonly totalCount: number;
|
||||
// 套装效果
|
||||
readonly effect: Array<{ count: number, seid: number }>;
|
||||
}
|
||||
|
||||
const str = readJsonFile(FILENAME.DIC_SUIT);
|
||||
let arr = JSON.parse(str);
|
||||
|
||||
export const dicSuit = new Map<number, DicSuit>();
|
||||
|
||||
arr.forEach(o => {
|
||||
o.effect = parseSuitEffect(o.effect);
|
||||
dicSuit.set(o.id, o);
|
||||
});
|
||||
arr = undefined;
|
||||
|
||||
function parseSuitEffect(str: string) {
|
||||
let result = new Array<{ count: number, seid: number }>();
|
||||
if (!str) return result;
|
||||
let decodeArr = decodeArrayListStr(str);
|
||||
for (let [count, seid] of decodeArr) {
|
||||
if (isNaN(parseInt(count)) || isNaN(parseFloat(seid))) {
|
||||
throw new Error('data table format wrong');
|
||||
}
|
||||
result.push({ count: parseInt(count), seid: parseFloat(seid) });
|
||||
}
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user