✨ feat(远征&巅峰): 选择其他对手获取他的装备和宝物信息
This commit is contained in:
@@ -29,6 +29,7 @@ import { setPvpSettleSeasonNumToRemote } from './timeTaskService';
|
||||
import { ArtifactModel } from '../db/Artifact';
|
||||
import { getPVPGroupIdOfServer, getPvpServersByGroupId } from './serverService';
|
||||
import { findKeys } from './redisService';
|
||||
import { JewelModel } from '../db/Jewel';
|
||||
|
||||
/**
|
||||
* 返回对手三人信息
|
||||
@@ -232,8 +233,18 @@ async function generPlayerOppHis(pvpdefense: PvpDefenseType, roleId: string, pos
|
||||
let otherHeroes = new Array<PvpOtherHeroes>(); // 阵容外的所有武将信息
|
||||
let defCe = 0;
|
||||
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? await ArtifactModel.findbySeqId(role.roleId, dbHero.artifact): null;
|
||||
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) {
|
||||
@@ -242,7 +253,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);
|
||||
heroInfo.setHeroInfo(dbHero, artifact, curJewels);
|
||||
// heroInfo.setOutIndex(h.order);
|
||||
let attr = attrByHid.get(h.actorId);
|
||||
if(!attr) continue;
|
||||
@@ -258,7 +269,7 @@ async function generPlayerOppHis(pvpdefense: PvpDefenseType, roleId: string, pos
|
||||
}
|
||||
} else {
|
||||
let heroInfo = new PvpOtherHeroes(hs ? hs.score : 0);
|
||||
heroInfo.setHeroInfo(dbHero, artifact);
|
||||
heroInfo.setHeroInfo(dbHero, artifact, curJewels);
|
||||
otherHeroes.push(heroInfo);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user