天赋:天赋点读表方式

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