Files
ZYZ/shared/pubUtils/dictionary/DicGVGTech.ts
2023-02-17 10:58:06 +08:00

45 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// GVG千机阁
import { FILENAME } from '../../consts'
import { decodeArrayListStr, parseNumberList, readFileAndParse } from '../util'
export interface DicGVGTech {
// 唯一id
readonly id: number;
// 点名称
readonly name: string
// 激活后获得的内容
readonly content: string;
// 效果类型 1-资源产量上传 2-征战中原提升 3-激战期提升 4-复活cd减少 5-箭塔 6-攻城车
readonly type: number;
// 资源提升量啊复活cd减少量啊之类的值
readonly param: number[];
// 点排序
readonly nodeSort: number;
// 联军等级限制
readonly levelLimit: number;
// 前置id
readonly prepositionId: number[][];
// 所需的战功
readonly consume: number;
}
export const dicGVGTech = new Map<number, DicGVGTech>();
export function loadGVGTech() {
dicGVGTech.clear();
let arr = readFileAndParse(FILENAME.DIC_GVG_TECH);
arr.forEach(o => {
o.prepositionId = parsePrePositionId(o.prepositionId);
o.param = parseNumberList(o.param)
dicGVGTech.set(o.id, o);
});
arr = undefined;
}
function parsePrePositionId(str: string) {
let arr = decodeArrayListStr(str);
return arr.map(arr1 => {
return arr1.map(str => parseInt(str));
});
}