diff --git a/game-server/app/servers/role/handler/heroHandler.ts b/game-server/app/servers/role/handler/heroHandler.ts index ea3680a3f..538d85fcf 100644 --- a/game-server/app/servers/role/handler/heroHandler.ts +++ b/game-server/app/servers/role/handler/heroHandler.ts @@ -791,7 +791,7 @@ export class HeroHandler { // 设置副将 const { preHid, curHero } = await HeroModel.setSubHero(roleId, hid, subSkinId, subHid); - return resResult(STATUS.SUCCESS, { preHid, curHero: pick(curHero, ['hid', 'subHid']) }); + return resResult(STATUS.SUCCESS, { preHid, curHero: pick(curHero, ['hid', 'subHid', 'subActorId']) }); } // ! debug接口 一键全武将 diff --git a/shared/consts/constModules/selectConst.ts b/shared/consts/constModules/selectConst.ts index 00ffc2b60..d85ed3ba3 100644 --- a/shared/consts/constModules/selectConst.ts +++ b/shared/consts/constModules/selectConst.ts @@ -19,7 +19,7 @@ export enum ROLE_SELECT { export enum HERO_SELECT { ENTRY = '-_id -attr -__v', - HERO_DETAIL = 'roleId roleName hid hName ce lv star colorStar quality job skins attr ePlace skinId connections artifact subHid', + HERO_DETAIL = 'roleId roleName hid hName ce lv star colorStar quality job skins attr ePlace skinId connections artifact subHid subActorId', // 排行榜中lineup字段 RANK_LINEUP = 'seqId roleId hid star colorStar lv quality job ce updatedAt skinId' } @@ -57,7 +57,7 @@ export enum FRIEND_SHIP_SELECT { GET_FRIEND_VALUE = 'friendValue friendLv' } -export const ENTERY_ROLE_PICK = ['roleId', 'roleName', 'serverId', 'ce', 'topLineupCe', 'coin', 'lv', 'exp', 'vLv', 'gold', 'heros', 'jewels', 'artifacts', 'consumeGoods', 'title', 'teraphs', 'showLineup', 'heads', 'head', 'frames', 'frame', 'spines', 'spine', 'hasGuild', 'guildCode', 'todayZeroPoint', 'apJson', 'skins', 'totalPay', 'guide', 'hasInit', 'renameCnt', 'totalCost', 'guildName', 'isVip', 'createTime', 'ipLocation', 'activityItems']; +export const ENTERY_ROLE_PICK = ['roleId', 'roleName', 'serverId', 'ce', 'topLineupCe', 'coin', 'lv', 'exp', 'vLv', 'gold', 'heros', 'jewels', 'artifacts', 'consumeGoods', 'title', 'teraphs', 'showLineup', 'heads', 'head', 'frames', 'frame', 'spines', 'spine', 'hasGuild', 'guildCode', 'todayZeroPoint', 'apJson', 'skins', 'totalPay', 'guide', 'hasInit', 'renameCnt', 'totalCost', 'guildName', 'isVip', 'createTime', 'ipLocation', 'activityItems', 'customerLink']; export enum SURVEY_SELECT { FIND = '-__v -_id -surveyName -roleIndex -reward -mailContent -receivedRole -createdAt -updatedAt' diff --git a/shared/db/GVGTeam.ts b/shared/db/GVGTeam.ts index 31943917c..2a8a21e45 100644 --- a/shared/db/GVGTeam.ts +++ b/shared/db/GVGTeam.ts @@ -354,7 +354,6 @@ export default class GVGTeam extends BaseModel { } public static async removeBySub(roleId: string, subHid: number, ce: number) { - console.log('removeBySub', roleId, subHid, ce) await GVGTeamModel.updateMany({ roleId, 'lineup.actorId': subHid }, { $pull: { lineup: { actorId: subHid } }, $inc: { lineupCe: -ce } }); } } diff --git a/shared/db/LadderMatch.ts b/shared/db/LadderMatch.ts index 3013be692..cdee5a38d 100644 --- a/shared/db/LadderMatch.ts +++ b/shared/db/LadderMatch.ts @@ -56,7 +56,7 @@ export default class LadderMatch extends BaseModel { public static async findByRoleIdAndInclude(roleId: string) { const result: LadderMatchType = await LadderMatchModel.findOne({ roleId }) .populate('role', 'roleId roleName head frame spine heads frames spines title lv updatedAt') - .populate('defense.heroes.hero', 'hid skinId quality star colorStar lv skins job artifact subHid') + .populate('defense.heroes.hero', 'hid skinId quality star colorStar lv skins job artifact subHid subActorId') .lean(); return result; } @@ -78,7 +78,7 @@ export default class LadderMatch extends BaseModel { public static async updateByRoleIdAndInclude(roleId: string, params: LadderUpdateInter) { const defense: LadderMatchType = await LadderMatchModel.findOneAndUpdate({ roleId }, { $set: params}, { new: true }) .populate('role', 'roleId roleName head frame spine heads frames spines title lv updatedAt') - .populate('defense.heroes.hero', 'hid skinId quality star colorStar lv skins job artifact subHid') + .populate('defense.heroes.hero', 'hid skinId quality star colorStar lv skins job artifact subHid subActorId') .lean(); return defense; } @@ -98,7 +98,7 @@ export default class LadderMatch extends BaseModel { public static async lock(serverId: number, roleId: string, rank: number) { const defense: LadderMatchType = await LadderMatchModel.findOneAndUpdate({ serverId, roleId, rank, locked: 0 }, { $set: { locked: 1 }}, { new: true }) .populate('role', 'roleId roleName head frame spine heads frames spines title lv updatedAt') - .populate('defense.heroes.hero', 'hid skinId quality star colorStar lv skins job artifact subHid') + .populate('defense.heroes.hero', 'hid skinId quality star colorStar lv skins job artifact subHid subActorId') .lean(); return defense; } diff --git a/shared/domain/battleField/ladder.ts b/shared/domain/battleField/ladder.ts index ac24fec13..410c6163b 100644 --- a/shared/domain/battleField/ladder.ts +++ b/shared/domain/battleField/ladder.ts @@ -359,6 +359,7 @@ export class LadderOppDetailHeroReturn { spine: string = ''; // 动画 talent: Talent[] = []; subHid: number = 0; // 副将 + subActorId: number = 0; artifact: HeroArtifact[] = []; constructor(warJson: DicWarJson, defensHero: LadderDefenseHero, artifacts: ArtifactModelType[]) { @@ -390,6 +391,7 @@ export class LadderOppDetailHeroReturn { if(skin) this.talent = skin.talent; this.job = hero.job; this.subHid = hero.subHid; + this.subActorId = hero.subActorId; let artifact = artifacts.find(cur => cur.seqId == hero.artifact); if(artifact) this.artifact.push({ artifactId: artifact.artifactId, lv: artifact.lv }); } diff --git a/shared/domain/dbGeneral.ts b/shared/domain/dbGeneral.ts index 7c8473939..b1826b0ce 100644 --- a/shared/domain/dbGeneral.ts +++ b/shared/domain/dbGeneral.ts @@ -52,6 +52,8 @@ export class PvpHeroInfo { talent?: Talent[] = []; // 品质 @prop({ required: false }) subHid?: number = 0; // 副将 + @prop({ required: false }) + subActorId?: number = 0; // 副将 @prop({ required: true, _id: false }) attribute?: string; // 属性 @@ -70,6 +72,7 @@ export class PvpHeroInfo { let skin = hero.skins?.find(cur => cur.enable); if(skin) this.talent = skin.talent; this.subHid = hero.subHid; + this.subActorId = hero.subActorId; if(artifact) this.artifact.push({ artifactId: artifact.artifactId, lv: artifact.lv }) } @@ -176,6 +179,8 @@ export class PvpEnemies extends Enemies { talent: Talent[]; @prop({ required: true }) subHid: number; + @prop({ required: true }) + subActorId: number; @prop({ required: true, type: () => HeroArtifact, _id: false }) artifact: HeroArtifact[] = []; // 宝物 @@ -190,6 +195,7 @@ export class PvpEnemies extends Enemies { this.talent = heroInfo.talent; this.job = heroInfo.job; this.subHid = heroInfo.subHid; + this.subActorId = heroInfo.subActorId; this.artifact = heroInfo.artifact||[]; if(score != undefined) this.score = score; } diff --git a/shared/domain/gvgField/gvgDb.ts b/shared/domain/gvgField/gvgDb.ts index 5bc323c8b..a2152688d 100644 --- a/shared/domain/gvgField/gvgDb.ts +++ b/shared/domain/gvgField/gvgDb.ts @@ -171,6 +171,7 @@ export class OppDetailHeroData { spine: string = ''; // 动画 talent: Talent[] = []; subHid: number = 0; // 副将 + subActorId: number = 0; artifact: HeroArtifact[] = []; constructor(warJson: DicWarJson, defensHero: OppPlayerHeroInfo, hero: HeroType, artifacts: ArtifactModelType[]) { @@ -201,6 +202,7 @@ export class OppDetailHeroData { if(skin) this.talent = skin.talent; this.job = hero.job; this.subHid = hero.subHid; + this.subActorId = hero.subActorId; let artifact = artifacts.find(cur => cur.seqId == hero.artifact); if(artifact) this.artifact.push({ artifactId: artifact.artifactId, lv: artifact.lv }); } diff --git a/shared/domain/roleField/friend.ts b/shared/domain/roleField/friend.ts index 74adb6935..42d588991 100644 --- a/shared/domain/roleField/friend.ts +++ b/shared/domain/roleField/friend.ts @@ -206,6 +206,7 @@ export class HeroDetailParam { school: number; }; subHid: number = 0; + subActorId: number = 0; artifacts: {artifactId: number, lv: number }[] = [] constructor(hero: HeroType) { @@ -228,6 +229,7 @@ export class HeroDetailParam { } this.connections = hero.connections; this.subHid = hero.subHid; + this.subActorId = hero.subActorId; } setAttributes(attributes: {hp: number, atk: number, def: number, mdef: number}) { diff --git a/shared/domain/roleField/hero.ts b/shared/domain/roleField/hero.ts index 8111f7d29..3b0c3c65d 100644 --- a/shared/domain/roleField/hero.ts +++ b/shared/domain/roleField/hero.ts @@ -63,6 +63,7 @@ export class HeroParam { artifact: number = 0; subHid: number = 0; + subActorId: number = 0; talent: Talent[] = []; usedTalentPoint: number = 0; totalTalentPoint: number = 0; @@ -98,6 +99,7 @@ export class HeroParam { this.ePlace = hero.ePlace; this.artifact = hero.artifact; this.subHid = hero.subHid; + this.subActorId = hero.subActorId; } }