装备:装备精炼读取数据问题

This commit is contained in:
luying
2022-05-09 18:50:44 +08:00
parent 274783ad25
commit c83f4737e6
2 changed files with 5 additions and 2 deletions

View File

@@ -403,9 +403,11 @@ export async function getSumCe(roleId: string, num: number) {
export async function getHeroesAttributes(roleId: string) {
let roleCe = await RoleCeModel.findByRoleId(roleId);
let attrByHid = new Map<number, AttributeCal>();
let heroAttrs = roleCe?.heroAttrs??[];
for(let { hid, attrs } of roleCe?.attributes??[]) {
let cal = new AttributeCal();
cal.setLv(roleCe.roleLv);
let heroAttr = heroAttrs.find(cur => cur.hid == hid);
if(heroAttr) cal.setLv(heroAttr.lv);
cal.setByWarJson(attrs);
attrByHid.set(hid, cal);
}

View File

@@ -852,10 +852,11 @@ export function getEquipStarAttrByStage(equipId: number, star: number, starStage
}
}
} else {
let preEquipStar = getPreEquipStar(equipId, star);
let equipStar = getEquipStarIdByEquipId(equipId, star);
return {
mainAttr: equipStar.mainAttr.get(starStage),
subAttr: equipStar.subAttr,
subAttr: preEquipStar?.subAttr||[],
}
}
}