🐞 fix(副将): 保存副将同时返回皮肤id和武将id

This commit is contained in:
luying
2023-03-31 10:36:02 +08:00
parent f900179fbb
commit c865c475ff
9 changed files with 20 additions and 7 deletions
+6
View File
@@ -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;
}