装备:装备精炼读取数据问题
This commit is contained in:
@@ -403,9 +403,11 @@ export async function getSumCe(roleId: string, num: number) {
|
|||||||
export async function getHeroesAttributes(roleId: string) {
|
export async function getHeroesAttributes(roleId: string) {
|
||||||
let roleCe = await RoleCeModel.findByRoleId(roleId);
|
let roleCe = await RoleCeModel.findByRoleId(roleId);
|
||||||
let attrByHid = new Map<number, AttributeCal>();
|
let attrByHid = new Map<number, AttributeCal>();
|
||||||
|
let heroAttrs = roleCe?.heroAttrs??[];
|
||||||
for(let { hid, attrs } of roleCe?.attributes??[]) {
|
for(let { hid, attrs } of roleCe?.attributes??[]) {
|
||||||
let cal = new AttributeCal();
|
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);
|
cal.setByWarJson(attrs);
|
||||||
attrByHid.set(hid, cal);
|
attrByHid.set(hid, cal);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -852,10 +852,11 @@ export function getEquipStarAttrByStage(equipId: number, star: number, starStage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
let preEquipStar = getPreEquipStar(equipId, star);
|
||||||
let equipStar = getEquipStarIdByEquipId(equipId, star);
|
let equipStar = getEquipStarIdByEquipId(equipId, star);
|
||||||
return {
|
return {
|
||||||
mainAttr: equipStar.mainAttr.get(starStage),
|
mainAttr: equipStar.mainAttr.get(starStage),
|
||||||
subAttr: equipStar.subAttr,
|
subAttr: preEquipStar?.subAttr||[],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user