武将攻略:武将对比
This commit is contained in:
@@ -25,6 +25,9 @@ import { JewelModel } from "../../../db/Jewel";
|
||||
import { getHeroesAttributes } from "../../../services/playerCeService";
|
||||
import { sendMessageToUsersWithSuc, sendMessageToUserWithSuc } from "../../../services/pushService";
|
||||
import { PrivateMessageModel } from "../../../db/PrivateMessage";
|
||||
import { RoleCeModel } from "../../../db/RoleCe";
|
||||
import { CalCe } from "../../../services/role/calCe";
|
||||
import { getSchoolPoint } from "../../../services/roleService";
|
||||
|
||||
|
||||
export default function (app: Application) {
|
||||
@@ -730,14 +733,21 @@ export class FriendHandler {
|
||||
|
||||
let { roleId: hisRoleId, hids } = msg;
|
||||
|
||||
let role = await RoleModel.findByRoleId(hisRoleId, ROLE_SELECT.ATTR);
|
||||
let role = await RoleModel.findByRoleId(hisRoleId, 'title');
|
||||
if (!role) return resResult(STATUS.ROLE_NOT_FOUND);
|
||||
|
||||
let roleCe = await RoleCeModel.findByRoleId(hisRoleId);
|
||||
if (!roleCe) return resResult(STATUS.ROLE_NOT_FOUND);
|
||||
|
||||
let heroList = await HeroModel.findByHidRange(hids, hisRoleId, HERO_SELECT.HERO_DETAIL, true);
|
||||
if (heroList.length <= 0) return resResult(STATUS.HERO_NOT_FIND);
|
||||
|
||||
let jewels = await JewelModel.findMapbyRoleAndHids(hisRoleId, hids);
|
||||
|
||||
let school = await getSchoolPoint(hisRoleId);
|
||||
|
||||
let calCe = new CalCe(hisRoleId);
|
||||
calCe.setRoleCe(roleCe);
|
||||
let attrByHid = await getHeroesAttributes(hisRoleId);
|
||||
let list: HeroDetailParam[] = [];
|
||||
for (let hero of heroList) {
|
||||
@@ -747,9 +757,18 @@ export class FriendHandler {
|
||||
let heroParam = new HeroDetailParam(hero);
|
||||
heroParam.setAttributes(attributes);
|
||||
heroParam.setJewels(jewels);
|
||||
|
||||
heroParam.setRole(
|
||||
role.title,
|
||||
calCe.calSingleGlobalPartCe(hero.hid, 'scroll'),
|
||||
calCe.calSingleGlobalPartCe(hero.hid, 'teraph'),
|
||||
school
|
||||
);
|
||||
|
||||
list.push(heroParam);
|
||||
}
|
||||
|
||||
|
||||
return resResult(STATUS.SUCCESS, { list });
|
||||
}
|
||||
|
||||
|
||||
@@ -191,6 +191,7 @@ export class HeroHandler {
|
||||
let { curHero } = await calculateCeWithHero(HERO_SYSTEM_TYPE.STAR, roleId, serverId, sid, hid, update, { hid, hero, isUpStar });
|
||||
if (isUpStar) {
|
||||
await checkTaskInHeroStarUp(serverId, roleId, sid, curHero, oldStar); // 任务
|
||||
await SchoolModel.updateByHid(roleId, hid, { hid, star: update.star });
|
||||
}
|
||||
return resResult(STATUS.SUCCESS, { isUpStar, curHero: pick(curHero, ['hid', 'star', 'starStage', 'colorStar', 'colorStarStage']) });
|
||||
}
|
||||
@@ -236,6 +237,7 @@ export class HeroHandler {
|
||||
consumes: addConsumeToHero(hero.consumes, material)
|
||||
}
|
||||
|
||||
await SchoolModel.updateByHid(roleId, hid, { hid, star: update.quality });
|
||||
let { curHero } = await calculateCeWithHero(HERO_SYSTEM_TYPE.QUALITY, roleId, serverId, sid, hid, update, { hero });
|
||||
await checkTaskInHeroQUalityUp(serverId, roleId, sid, curHero);
|
||||
pushHeroQualityUpMsg(roleId, roleName, serverId, curHero);
|
||||
@@ -312,6 +314,7 @@ export class HeroHandler {
|
||||
|
||||
let { curHero } = await calculateCeWithHero(HERO_SYSTEM_TYPE.COLORSTAR, roleId, serverId, sid, hid, update, { hero, isUpStar });
|
||||
if (isUpStar) {
|
||||
await SchoolModel.updateByHid(roleId, hid, { hid, star: update.colorStar });
|
||||
await checkTaskInHeroWakeUp(serverId, roleId, sid, curHero, oldColorStar); // 任务
|
||||
}
|
||||
if (isWakeUp) pushHeroWakeUp(roleId, roleName, serverId, curHero); // 第一次觉醒
|
||||
|
||||
@@ -230,7 +230,7 @@ export class RoleHandler {
|
||||
return resResult(STATUS.ROLE_SCHOOL_POSITION_LOCKED);
|
||||
}
|
||||
|
||||
await SchoolModel.updateBySclAndPos(roleId, schoolId, positionId, { hid, isOpen })
|
||||
await SchoolModel.updateBySclAndPos(roleId, schoolId, positionId, { hid, isOpen, star: curHero?.star??0, quality: curHero?.quality??0, colorStar: curHero?.colorStar??0 });
|
||||
await calculateCeWithRole(HERO_SYSTEM_TYPE.SCHOOL, roleId, serverId, sid, {}, { schoolId, hero: curHero, schoolHid: hid, preSchoolHid: preHid });
|
||||
|
||||
// 任务
|
||||
|
||||
Reference in New Issue
Block a user