天赋:天赋点读表方式

This commit is contained in:
luying
2022-04-14 15:03:14 +08:00
parent ccd9bfd756
commit 722da7aae7
2 changed files with 146 additions and 144 deletions

View File

@@ -29,7 +29,7 @@ export interface DicJob {
readonly baseSubAttr: {id: number, val: number}[];
// 一共有多少阶升级
readonly maxStage: number;
// 到这一阶能获得多少天赋点
// 到这一阶多少天赋点
readonly talentPoint: number;
}
@@ -45,9 +45,10 @@ export function loadJob() {
dicJob.clear();
jobClassMaxGrades.clear();
jobClassAndgrades.clear();
talentPointOfJob.clear();
let arr = readFileAndParse(FILENAME.DIC_JOB);
let jobByJobClass = new Map<number, number[]>(); // jobClass => jobid[]
// let jobByJobClass = new Map<number, number[]>(); // jobClass => jobid[]
arr.forEach(o => {
if(o.isPlayer) {
@@ -63,24 +64,25 @@ export function loadJob() {
jobClassMaxGrades.set(o.job_class, {grade: o.grade,jobid: o.jobid});
}
jobClassAndgrades.set(o.job_class+'_'+o.grade,{unlockLevel:o.unlockLevel, jobid:o.jobid});
if(!jobByJobClass.has(o.job_class)) {
jobByJobClass.set(o.job_class, []);
}
jobByJobClass.get(o.job_class).push(o.jobid);
// if(!jobByJobClass.has(o.job_class)) {
// jobByJobClass.set(o.job_class, []);
// }
// jobByJobClass.get(o.job_class).push(o.jobid);
talentPointOfJob.set(o.jobid, o.talentPoint);
}
});
for(let [_, { job_class, talentPoint }] of dicJob) {
let jobs = jobByJobClass.get(job_class)||[];
for(let jobid of jobs) {
if(!talentPointOfJob.has(jobid)) {
talentPointOfJob.set(jobid, talentPoint);
} else {
talentPointOfJob.set(jobid, talentPointOfJob.get(jobid) + talentPoint);
}
}
}
// for(let [_, { job_class, talentPoint }] of dicJob) {
// let jobs = jobByJobClass.get(job_class)||[];
// for(let jobid of jobs) {
// if(!talentPointOfJob.has(jobid)) {
// talentPointOfJob.set(jobid, talentPoint);
// } else {
// talentPointOfJob.set(jobid, talentPointOfJob.get(jobid) + talentPoint);
// }
// }
// }
jobByJobClass = undefined;
// jobByJobClass = undefined;
arr = undefined;
}

File diff suppressed because it is too large Load Diff