武将:修复初始bug

This commit is contained in:
luying
2021-07-12 15:34:36 +08:00
parent 30bd43d98e
commit 7b363caaae
2 changed files with 8 additions and 8 deletions

View File

@@ -95,7 +95,7 @@ export enum ABI_STAGE {
}
export enum ABI_JOB_STAGE {
START = 0,
START = 1,
END = 6
}
export const ATTR = {}

View File

@@ -240,16 +240,16 @@ export async function calculatetopLineup(role: RoleType, hid?: number, ce?: numb
* @param {number[]} removeSeidList 用于更新被动
*/
export function calHeroInitIncAttr(hero: HeroType, addSeidList: Array<number>, removeSeidList: Array<number>) {
try{
// try{
delete hero._id;
let heroAttrs = calHeroStarIncAttr(hero, hero, HERO_SYSTEM_TYPE.INIT, addSeidList, removeSeidList);
let curSkin = hero.skins.find(cur => cur.enable);
heroAttrs = calHeroWearSkinIncAttr(hero, curSkin ? curSkin.id : 0, 0, addSeidList, removeSeidList, true);
heroAttrs = calHeroWearSkinIncAttr(hero, gameData.hero.get(hero.hid)?.initialSkin||0, 0, addSeidList, removeSeidList, true);
heroAttrs = calHeroJobAttr(hero, hero, addSeidList, removeSeidList);
return heroAttrs;
}catch(e) {
console.error(e);
}
// }catch(e) {
// console.error(e);
// return [];
// }
}
/**
@@ -505,7 +505,7 @@ export function calHeroJobAttr(originHero: HeroType, hero: HeroUpdate, addSeidLi
lastJob = gameData.job.get(jobGradeAndClass.jobid);
}
for (let stage = ABI_JOB_STAGE.START; stage < ABI_JOB_STAGE.END; stage++) {
for (let stage = ABI_JOB_STAGE.START; stage <= ABI_JOB_STAGE.END; stage++) {
if(hero.jobStage >= stage) {
let targetAttrId = currentJob.ceAttr.get(stage).id;
let fixUp = currentJob.ceAttr.get(stage).attr * HERO_CE_RATIO;