🐞 fix(远征&巅峰): 获取对手装备上的天晶

This commit is contained in:
luying
2023-07-07 15:59:34 +08:00
parent 8d21c5ecbf
commit 02625de882
3 changed files with 11 additions and 19 deletions
+2 -7
View File
@@ -235,16 +235,11 @@ async function generPlayerOppHis(pvpdefense: PvpDefenseType, roleId: string, pos
let attrByHid = await getHeroesAttributes(role.roleId);
let hids = defenseHeroes.map(cur => cur.actorId);
console.log('#### hids', hids);
let artifacts = await ArtifactModel.findbyHids(role.roleId, hids);
let jewels = await JewelModel.findbyRoleAndHids(role.roleId, hids);
console.log('#### jewels', jewels.length);
for (let dbHero of dbHeroes) {
let artifact = dbHero.artifact? artifacts.find(cur => cur.seqId == dbHero.artifact): null;
let curJewels = jewels.filter(jewel => jewel.hid == dbHero.hid);
console.log('#### curJewels', dbHero.hid, curJewels.length)
let h = defenseHeroes.find(cur => cur.actorId == dbHero.hid); // 阵容里是否有这个武将
let hs = heroScores.find(cur => cur.hid == dbHero.hid); // 这个武将是否有这个得分
if (!!h) {
@@ -253,7 +248,7 @@ async function generPlayerOppHis(pvpdefense: PvpDefenseType, roleId: string, pos
let warJson = mapWarJson.find(cur => cur.dataId == h.dataId);
if (warJson && warJson.relation == 2) {
let heroInfo = new PvpHeroInfo();
heroInfo.setHeroInfo(dbHero, artifact, curJewels);
heroInfo.setHeroInfo(dbHero, artifact, dbHero.ePlace.map(cur => ({ ...cur, jewel: jewels.find(ccur => cur.jewel == ccur.seqId) })));
// heroInfo.setOutIndex(h.order);
let attr = attrByHid.get(h.actorId);
if(!attr) continue;
@@ -269,7 +264,7 @@ async function generPlayerOppHis(pvpdefense: PvpDefenseType, roleId: string, pos
}
} else {
let heroInfo = new PvpOtherHeroes(hs ? hs.score : 0);
heroInfo.setHeroInfo(dbHero, artifact, curJewels);
heroInfo.setHeroInfo(dbHero, artifact);
otherHeroes.push(heroInfo);
}
}