升级,升星,升品,升彩星

This commit is contained in:
luying
2020-12-09 21:16:27 +08:00
parent bcb8f135a3
commit 92b5bf90bc
10 changed files with 248 additions and 39 deletions

View File

@@ -13,6 +13,7 @@ const heroInfos = new Map<number, any>();
const jobInfos = new Map<number, any>();
const jobClassMaxGrades = new Map<number, number>();
const levelInfos = new Map<number, {sum: number, cur: number}>();
const heroLevelInfo = new Map<number, number>();
const starRatioInfo = new Map<number, number>();
const heroSkillInfo = new Map<number, any>()
const seidInfo = new Map<number, any>();
@@ -118,6 +119,16 @@ function parseLevelInfo() {
});
}
function parseHeroLevelInfo() {
const jobFile = 'dic_zyz_charexp';
const levelData = gamedata['jsons'][jobFile] || [];
levelData.forEach(elem => {
if (elem && elem.level) {
heroLevelInfo.set(elem.level, elem.exp);
}
});
}
function parseStarRatio() {
const file = 'dic_star_ratio';
const data = gamedata['jsons'][file] || [];
@@ -256,6 +267,7 @@ function parseData() {
parseHeroData();
parseJobData();
parseLevelInfo();
parseHeroLevelInfo();
parseStarRatio();
parseHeroSkill();
parseSeidList();
@@ -336,6 +348,10 @@ export function getExpByLv(lv: number) {
return levelInfos.get(lv);
}
export function getHeroExpByLv(lv: number) {
return heroLevelInfo.get(lv);
}
export function getStarRatio(star: number) {
return starRatioInfo.get(star);
}

View File

@@ -104,6 +104,12 @@ const moment = require('moment');
result = { id: parseInt(id), weight: parseInt(weight) };
break;
}
case 'cost': {
let [id, count] = arr;
if(isNaN(id) || isNaN(count)) throw new Error('data table format wrong');
result = { id: parseInt(id), count: parseInt(count)};
break;
}
}
return result;
};