fix 初始武将战力
This commit is contained in:
@@ -121,7 +121,28 @@ export function calHeroInitIncAttr(hero: HeroType, addSeidList: Array<number>, 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) {
|
||||
|
||||
Reference in New Issue
Block a user