寻宝:roleStatus.heroes格式修改

This commit is contained in:
luying
2021-08-13 20:16:12 +08:00
parent 96042737d3
commit 899fc4aef6
4 changed files with 55 additions and 13 deletions
+10 -2
View File
@@ -15,6 +15,7 @@ import { checkActivityTask, checkTask } from './taskService';
import { getRandExpedition, gameData } from '../pubUtils/data';
import { ItemInter, RewardInter } from '../pubUtils/interface';
import { getTimeFunM } from '../pubUtils/timeUtil';
import { ComRoleStatusHero } from '../db/ComBattleTeam';
/**
* 获取当前镇念塔状态
@@ -461,10 +462,17 @@ export function getRandRobot(cnt = 1, withAttr = false) {
const warInfo = gameData.warJson.get(info.warId);
if (!warInfo || !warInfo.length) continue;
let heroes = [];
let heroes: ComRoleStatusHero[] = [];
for (let hero of warInfo) {
if (hero && hero.relation === 2 && hero.actorId) {
heroes.push(hero.actorId);
let dicHero = gameData.hero.get(hero.actorId);
heroes.push({
id: hero.actorId,
star: hero.star,
colorStar: 0,
lv: hero.lv,
quality: dicHero.quality
});
}
}
robots.push(heroes);