战力:获取显示数据

This commit is contained in:
luying
2022-03-30 14:22:46 +08:00
parent ef731fc979
commit 9adbd08d3c
33 changed files with 205 additions and 1689 deletions
@@ -15,7 +15,6 @@ import { addItems, getFriendPointObject, handleCost } from "../../../services/ro
import { RewardInter } from "../../../pubUtils/interface";
import { FriendPresentLogModel } from '../../../db/FriendPresentLog';
import { HeroModel, EPlace } from "../../../db/Hero";
import { getPlayerMainAttribute } from "../../../services/pvpService";
import { FRIEND } from "../../../pubUtils/dicParam";
import { PlayerDetail, PlayerDetailHero } from "../../../domain/battleField/guild";
import { createPrivateMsg, pushMsgToRole, pushPresent } from "../../../services/chatService";
@@ -23,6 +22,7 @@ import { Rank } from "../../../services/rankService";
import { checkTaskWithRoles, checkTask } from "../../../services/task/taskService";
import { ComBattleTeamModel } from "../../../db/ComBattleTeam";
import { JewelModel } from "../../../db/Jewel";
import { getHeroesAttributes } from "../../../services/playerCeService";
export default function (app: Application) {
@@ -719,9 +719,12 @@ export class FriendHandler {
let jewels = await JewelModel.findMapbyRoleAndHids(hisRoleId, hids);
let attrByHid = await getHeroesAttributes(hisRoleId);
let list: HeroDetailParam[] = [];
for (let hero of heroList) {
let attributes = getPlayerMainAttribute(hero.attr, role.attr);
let attr = attrByHid.get(hero.hid);
if(!attr) continue;
let attributes = attr.getMainAttributes();
let heroParam = new HeroDetailParam(hero);
heroParam.setAttributes(attributes);
heroParam.setJewels(jewels);
@@ -16,7 +16,6 @@ import { isNumber, pick } from 'underscore';
import { updateEplaces } from '../../../services/equipService';
import { addConsumeToHero, checkUnlockTalentCondition, initSkinTalent, updateSkinTalent } from '../../../services/roleService';
import { JewelModel, jewelUpdate } from '../../../db/Jewel';
import { CalHeroCe } from '../../../services/role/_calCe';
import { HERO, REBORN } from '../../../pubUtils/dicParam';
import { createHero, createHeroes } from '../../../services/role/createHero';
import { CheckMeterial } from '../../../services/role/checkMaterial';
@@ -25,7 +25,7 @@ import Counter from '../../../db/Counter';
import { UserModel } from '../../../db/User';
import { checkFilterWords, reportTAEvent, treatRoleName } from '../../../services/sdkService';
import { createHeroes } from '../../../services/role/createHero';
import { calculateCeWithHero, calculateWithRole } from '../../../services/playerCeService';
import { calculateCeWithHero, calculateCeWithRole } from '../../../services/playerCeService';
export default function (app: Application) {
new HandlerService(app, {});
@@ -50,7 +50,7 @@ export class RoleHandler {
let checkName = await RoleModel.checkName(roleName, serverId);
if (checkName) return resResult(STATUS.NAME_HAS_USED);
let { resultHeroes: heroes } = await createHeroes(roleId, roleName, sid, serverId, DEFAULT_HEROES.map(hid => ({hid, count: 1})), { roleName, hasInit: true, title: role.title, teraphs: role.teraphs });
let { resultHeroes: heroes } = await createHeroes(roleId, roleName, sid, serverId, DEFAULT_HEROES.map(hid => ({hid, count: 1})), { roleName, hasInit: true, title: role.title, teraphs: role.teraphs, lv: DEFAULT_LV });
// role = await RoleModel.updateRoleInfo(roleId, { roleName, hasInit: true }); // 在算战力的时候一起更新
session.set('roleName', roleName);
session.push('roleName', () => { });
@@ -95,7 +95,7 @@ export class RoleHandler {
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
let update = { title: title + 1 }
let { curRole } = await calculateWithRole(HERO_SYSTEM_TYPE.TITLE, roleId, serverId, sid, update);
let { curRole } = await calculateCeWithRole(HERO_SYSTEM_TYPE.TITLE, roleId, serverId, sid, update);
// 任务
await checkTask(serverId, roleId, sid, TASK_TYPE.ROLE_TITLE, { oldTitle: title, title: update.title });
@@ -128,7 +128,7 @@ export class RoleHandler {
if (!result)
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
let { curRole } = await calculateWithRole(HERO_SYSTEM_TYPE.TERAPH, roleId, serverId, sid, { teraphs }, { teraphId: id });
let { curRole } = await calculateCeWithRole(HERO_SYSTEM_TYPE.TERAPH, roleId, serverId, sid, { teraphs }, { teraphId: id });
// 任务
await checkTask(serverId, roleId, sid, TASK_TYPE.ROLE_TERAPH_STRENGTHEN, { count });
@@ -171,7 +171,7 @@ export class RoleHandler {
let result = await handleCost(roleId, sid, consumes, ITEM_CHANGE_REASON.TERAPH_QUALITY_UP);
if (!result)
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
let { curRole } = await calculateWithRole(HERO_SYSTEM_TYPE.TERAPH_UP, roleId, serverId, sid, { teraphs }, { teraphId: id });
let { curRole } = await calculateCeWithRole(HERO_SYSTEM_TYPE.TERAPH_UP, roleId, serverId, sid, { teraphs }, { teraphId: id });
// 神像进阶,进阶一次就触发一次礼包弹框
await checkTask(serverId, roleId, sid, TASK_TYPE.ROLE_TERAPH_STAGE_UP);
@@ -228,7 +228,7 @@ export class RoleHandler {
}
await SchoolModel.updateBySclAndPos(roleId, schoolId, positionId, { hid, isOpen })
await calculateWithRole(HERO_SYSTEM_TYPE.SCHOOL, roleId, serverId, sid, {}, { schoolId, hero: curHero, schoolHid: hid, preSchoolHid: preHid });
await calculateCeWithRole(HERO_SYSTEM_TYPE.SCHOOL, roleId, serverId, sid, {}, { schoolId, hero: curHero, schoolHid: hid, preSchoolHid: preHid });
// 任务
await checkTask(serverId, roleId, sid, TASK_TYPE.ROLE_SCHOOL_PUT_HERO, { hid, preHid });