好友:武将详情

This commit is contained in:
luying
2022-02-18 11:30:42 +08:00
parent 13ad1c1f19
commit 2773d1d9db
5 changed files with 129 additions and 20 deletions
@@ -4,7 +4,7 @@ import { STATUS, ROLE_SELECT, FRIEND_DROP_TYPE, FRIEND_RELATION_TYPE, POPULATE_T
import { RoleModel, RoleType } from "../../../db/Role";
import { getTimeFun, getZeroPointD } from "../../../pubUtils/timeUtil";
import { FriendApplyModel } from "../../../db/FriendApply";
import { FriendListParam, FriendRecommendParams, BlackListParam, FriendValueListParam } from "../../../domain/roleField/friend";
import { FriendListParam, FriendRecommendParams, BlackListParam, FriendValueListParam, HeroDetailParam } from "../../../domain/roleField/friend";
import { FriendShipModel, FriendShipType } from "../../../db/FriendShip";
import { FriendRelationModel, Relation } from "../../../db/FriendRelation";
import { isRoleOnline, getServerName, getRoleOnlineInfo } from "../../../services/redisService";
@@ -24,6 +24,7 @@ import { createPrivateMsg, pushMsgToRole, pushPresent } from "../../../services/
import { Rank } from "../../../services/rankService";
import { checkTaskWithRoles, checkTask, checkActivityTask } from "../../../services/taskService";
import { ComBattleTeamModel } from "../../../db/ComBattleTeam";
import { JewelModel } from "../../../db/Jewel";
export default function (app: Application) {
@@ -730,24 +731,17 @@ export class FriendHandler {
let heroList = await HeroModel.findByHidRange(hids, hisRoleId, HERO_SELECT.HERO_DETAIL, true);
if (heroList.length <= 0) return resResult(STATUS.HERO_NOT_FIND);
let list = new Array();
// for (let { roleId, roleName, hid, hName, ce, lv, star, colorStar, quality, job, skinId, attr: heroAttrs, ePlace } of heroList) {
// let equips = await EquipModel.findListByHidAndRole(hisRoleId, hid, EQUIP_SELECT.HERO_DETAIL);
// let attributes = getPlayerMainAttribute(heroAttrs, role.attr);
// list.push({
// roleId, roleName, hid, hName, ce, lv, star, colorStar, quality, job, skinId,
// equips: equips.map(cur => {
// let curEplace = ePlace.find(ccur => cur.ePlaceId == ccur.id) || new EPlace();
// let { lv = 0, refineLv = 0 } = curEplace;
// return { ...cur, lv, refineLv }
// }), attributes
// });
// }
let jewels = await JewelModel.findMapbyRoleAndHids(hisRoleId, hids);
console.log(jewels);
let list: HeroDetailParam[] = [];
for (let hero of heroList) {
let attributes = getPlayerMainAttribute(hero.attr, role.attr);
let heroParam = new HeroDetailParam(hero);
heroParam.setAttributes(attributes);
heroParam.setJewels(jewels);
list.push(heroParam);
}
return resResult(STATUS.SUCCESS, { list });
}
+1 -1
View File
@@ -395,7 +395,7 @@ export function getPlayerAttribute(lv: number, heroAttrs: CeAttrData[] = [], rol
export function getPlayerMainAttribute(heroAttrs: CeAttrData[], roleAttrs: CeAttrDataRole[]) {
let newAttribute = new AttributeCal();
newAttribute.setByDbData(roleAttrs, heroAttrs);
let mainAttributes = newAttribute.getReduceAttributes();
let mainAttributes = newAttribute.getReduceMainAttributes();
return mainAttributes;
}