✨ feat(副将): 设置副将

This commit is contained in:
luying
2022-12-08 15:36:55 +08:00
parent bdbac4b085
commit b684307818
12 changed files with 92 additions and 8 deletions
+6
View File
@@ -39,6 +39,8 @@ export class PvpHeroInfo {
quality?: number = 0; // 品质
@prop({ required: false, type: Talent, _id: false })
talent?: Talent[] = []; // 品质
@prop({ required: false })
subHid?: number = 0; // 副将
@prop({ required: true, _id: false })
attribute?: string; // 属性
@@ -54,6 +56,7 @@ export class PvpHeroInfo {
this.quality = hero.quality;
let skin = hero.skins?.find(cur => cur.enable);
if(skin) this.talent = skin.talent;
this.subHid = hero.subHid;
}
setRobotInfo(dicHero: DicHero, lv: number) {
@@ -145,6 +148,8 @@ export class PvpEnemies extends Enemies {
score: number;
@prop({ required: true, type: () => Talent, _id: false })
talent: Talent[];
@prop({ required: true })
subHid: number;
// score: 这个武将的军功
constructor(warjson: DicWarJson, heroInfo: PvpHeroInfo, score: number, ce: number) {
@@ -156,6 +161,7 @@ export class PvpEnemies extends Enemies {
this.score = score;
this.talent = heroInfo.talent;
this.job = heroInfo.job;
this.subHid = heroInfo.subHid;
}
}