🐞 fix(共鸣系统): 修改鸣主排序,修改鸣主信息展示

This commit is contained in:
zhangxk
2023-10-12 21:17:49 +08:00
parent b6e6281744
commit e4e692458b
4 changed files with 78 additions and 46 deletions

View File

@@ -617,6 +617,9 @@ export class HeroHandler {
let { hid } = msg;
if(!isNumber(hid) && !hid) return resResult(STATUS.WRONG_PARMS);
let { dbResonanceMap } = await getResonanceDataMap(roleId);
if(dbResonanceMap.has(hid)) return resResult(STATUS.RESONANCE__HID_NOT_REBIRTH);
// 武将初始,但是皮肤这里不初始
let hero = await HeroModel.findByHidAndRole(hid, roleId);
if(!hero) return resResult(STATUS.HERO_NOT_FIND);
@@ -831,6 +834,10 @@ export class HeroHandler {
const { originHid, targetHid } = msg;
let { dbResonanceMap } = await getResonanceDataMap(roleId);
if(dbResonanceMap.has(originHid) || dbResonanceMap.has(targetHid)) return resResult(STATUS.RESONANCE__HID_NOT_REBIRTH);
let dbHeros = await HeroModel.findByHidsAndRole(roleId, [originHid, targetHid]);
if (dbHeros.length != 2) return resResult(STATUS.HERO_NOT_FIND);
const heroMap = dbHeros.reduce((map, obj) => { map.set(obj.hid, obj); return map; }, new Map<number, HeroType>());

View File

@@ -164,7 +164,7 @@ export class HeroHandler {
const resonances = await refreshResonanceData(roleId, serverId, sid);
return resResult(STATUS.SUCCESS, {
curHero: { ...pick(new HeroParam(curHero), ['hid', 'seqId', 'lv', 'exp', 'job', 'jobStage', 'skinId', 'skins', 'talent', 'usedTalentPoint', 'totalTalentPoint', 'connections', 'ePlace', 'ce']) },
curHero: { isResonance: false, ...pick(new HeroParam(curHero), ['hid', 'seqId', 'lv', 'exp', 'job', 'jobStage', 'skinId', 'skins', 'talent', 'usedTalentPoint', 'totalTalentPoint', 'connections', 'ePlace', 'ce']) },
...resonances,
})
}