🐞 fix(远征&巅峰): 获取对手装备上的天晶
This commit is contained in:
@@ -159,7 +159,6 @@ export async function matchPlayers(roleId: string, scale: number, range: number,
|
||||
let { star, lv, ce, skins, colorStar, quality, job, subHid = 0, subActorId = 0, ePlace = [] } = h;
|
||||
let artifact = h.artifact? artifacts.find(cur => cur.seqId == h.artifact): null;
|
||||
let skin = skins?.find(cur => cur.enable);
|
||||
let curJewels = jewels.filter(jewel => jewel.hid == h.hid);
|
||||
|
||||
let dicHero = gameData.hero.get(hero.hid);
|
||||
let attr = attrByHid.get(hero.hid);
|
||||
@@ -182,8 +181,7 @@ export async function matchPlayers(roleId: string, scale: number, range: number,
|
||||
artifact: artifact? [{ artifactId: artifact.artifactId, lv: artifact.lv }]: [],
|
||||
subHid,
|
||||
subActorId,
|
||||
ePlace,
|
||||
jewels: curJewels
|
||||
ePlace: ePlace.map(cur => ({ ...cur, jewel: jewels.find(ccur => cur.jewel == ccur.seqId) })),
|
||||
};
|
||||
|
||||
enemyObj.enemies.push({...json, ...heroInfo});
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user