养成:修复武将升阶的时候战力反而下降的问题

This commit is contained in:
luying
2022-06-08 13:17:16 +08:00
parent 4e027b5047
commit 83bc909fd8
2 changed files with 35 additions and 21 deletions
+4 -16
View File
@@ -159,23 +159,11 @@ export class CalCe {
// 职业基础
public setJob(hid: number, job: number, jobStage: number) {
this.data.clearHeroAttrByHid(hid, 'job');
this.data.clearHeroAttrByHid(hid, 'subBase');
const dicJob = gameData.job.get(job);
let lastJob = getJobByGradeAndClass(dicJob.job_class, dicJob.grade - 1);
let dicLastJob = lastJob? gameData.job.get(lastJob.jobid): null;
for(let i = 1; i <= (dicJob.maxStage||dicLastJob.maxStage); i++) {
if(jobStage >= i) {
let { id, attr } = dicJob.ceAttr.get(i);
let heroAttr = this.data.getHeroAttrByHidAndId(hid, id);
heroAttr.job = attr;
} else {
if(dicLastJob) {
let { id, attr } = dicLastJob.ceAttr.get(i);
let heroAttr = this.data.getHeroAttrByHidAndId(hid, id);
heroAttr.job = attr;
}
}
let ceAttr = dicJob.ceAttr.get(jobStage)||[];
for(let { id, attr } of ceAttr) {
let heroAttr = this.data.getHeroAttrByHidAndId(hid, id);
heroAttr.job = attr;
}
for(let { id, val } of dicJob.baseSubAttr) {
let heroAttr = this.data.getHeroAttrByHidAndId(hid, id);