diff --git a/shared/pubUtils/playerCe.ts b/shared/pubUtils/playerCe.ts index e072bfe49..0ac39d55c 100644 --- a/shared/pubUtils/playerCe.ts +++ b/shared/pubUtils/playerCe.ts @@ -121,7 +121,28 @@ export function calHeroInitIncAttr(hero: HeroType, addSeidList: Array, r calHeroJobStageUpIncAttr(hero2, [0], addSeidList, removeSeidList); - return res2 + let result: CeAttr = {}; + combineAttrResult(result, res1); + combineAttrResult(result, res2); + + return res1 +} + +function combineAttrResult(target: CeAttr, origin: CeAttr) { + + for(let attrName in origin) { + for(let attrKey in origin[attrName]) { + if(!target.hasOwnProperty(attrName)) { + target[attrName] = {}; + } + if(!target[attrName].hasOwnProperty(attrKey)) { + target[attrName][attrKey] = 0; + } + if(origin[attrName][attrKey] > target[attrName][attrKey]) { + target[attrName][attrKey] = origin[attrName][attrKey]; + } + } + } } export function calRoleInitIncAttr(heros: HeroType[], globalCeAttr: CeAttr) {