武将养成

This commit is contained in:
mamengke01
2020-12-09 14:50:45 +08:00
parent 514688975c
commit 4d5428f37b
5 changed files with 540 additions and 442 deletions

View File

@@ -11,6 +11,7 @@ const towerInfos = new Map<number, any>();
const towerTaskInfos = new Map<number, any>();
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 starRatioInfo = new Map<number, number>();
const heroSkillInfo = new Map<number, any>()
@@ -96,6 +97,10 @@ function parseJobData() {
jobsData.forEach(elem => {
if (elem && elem.jobid) {
jobInfos.set(elem.jobid, elem);
let maxLevel = jobClassMaxGrades.get(elem.job_class)||0;
if (maxLevel < elem.grade) {
jobClassMaxGrades.set(elem.job_class, elem.grade);
}
}
});
}
@@ -311,6 +316,10 @@ export function getJobInfoById(jid: number) {
const jobInfo = jobInfos.get(jid);
return jobInfo;
}
export function getMaxGradeByjobClass(jobClass: number) {
const maxGrade = jobClassMaxGrades.get(jobClass);
return maxGrade;
}
export function getLvByExp(exp: number) {
let curLv = 0;