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