feat(远征&巅峰): 选择其他对手获取他的装备和宝物信息

This commit is contained in:
luying
2023-07-06 11:24:31 +08:00
parent 9c8d2fa589
commit 636fb00a6e
5 changed files with 98 additions and 9 deletions

View File

@@ -12,6 +12,7 @@ import * as dicParam from '../pubUtils/dicParam';
import { getHeroesAttributes, getSumCe } from './playerCeService';
import { checkSystemIsOpen } from './roleService';
import { ArtifactModel } from '../db/Artifact';
import { JewelModel } from '../db/Jewel';
/**
* 获取远征关卡列表
@@ -144,6 +145,10 @@ export async function matchPlayers(roleId: string, scale: number, range: number,
enemyObj.enemyId = roleId;
enemyObj.ce = topLineupCe;
let hids = topLineup.map(cur => cur.hid);
let artifacts = await ArtifactModel.findbyHids(roleId, hids);
let jewels = await JewelModel.findbyRoleAndHids(roleId, hids);
let heroIndex = 0;
for(let json of dicWarJson) {
if(json.relation == 2) {
@@ -151,9 +156,10 @@ export async function matchPlayers(roleId: string, scale: number, range: number,
if(hero) {
let h = <HeroType>hero.hero;
if(h) {
let { star, lv, ce, skins, colorStar, quality, job, subHid = 0, subActorId = 0 } = h;
let artifact = h.artifact? await ArtifactModel.findbySeqId(role.roleId, h.artifact): null;
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);
@@ -175,7 +181,9 @@ export async function matchPlayers(roleId: string, scale: number, range: number,
talent: skin? skin.talent: [],
artifact: artifact? [{ artifactId: artifact.artifactId, lv: artifact.lv }]: [],
subHid,
subActorId
subActorId,
ePlace,
jewels: curJewels
};
enemyObj.enemies.push({...json, ...heroInfo});