武将:一键训练
This commit is contained in:
@@ -463,17 +463,18 @@ export function calHeroTrainIncAttr(originHero: HeroType, update: HeroUpdate) {
|
||||
let { job = oldJob, jobStage = oldJobStage } = update;
|
||||
|
||||
let dicJob = gameData.job.get(job);
|
||||
|
||||
if (dicJob.grade >= 1) {
|
||||
let jobGradeAndClass = getJobByGradeAndClass(dicJob.job_class, dicJob.grade - 1);
|
||||
let lastJob = gameData.job.get(jobGradeAndClass.jobid);
|
||||
let targetAttrId = dicJob.ceAttr.get(jobStage).id;
|
||||
let inc = (dicJob.ceAttr.get(jobStage).attr - lastJob.ceAttr.get(jobStage).attr) * HERO_CE_RATIO;
|
||||
updateHeroAttr(heroAttrs, targetAttrId, { inc: { fixUp: inc } });
|
||||
} else {
|
||||
let targetAttrId = dicJob.ceAttr.get(jobStage).id;
|
||||
let inc = dicJob.ceAttr.get(jobStage).attr * HERO_CE_RATIO;
|
||||
updateHeroAttr(heroAttrs, targetAttrId, { inc: { fixUp: inc } });
|
||||
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; i++) {
|
||||
if(oldJobStage < i && jobStage >= i) {
|
||||
let lastAttr = dicLastJob? dicLastJob.ceAttr.get(i).attr: 0;
|
||||
let targetAttrId = dicJob.ceAttr.get(i).id;
|
||||
let targetAttrValue = dicJob.ceAttr.get(i).attr;
|
||||
let inc = (targetAttrValue - lastAttr) * HERO_CE_RATIO;
|
||||
console.log('*******', targetAttrId, targetAttrValue, lastAttr, inc )
|
||||
updateHeroAttr(heroAttrs, targetAttrId, { inc: { fixUp: inc } });
|
||||
}
|
||||
}
|
||||
return heroAttrs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user