🐞 fix(远征&巅峰): 获取对手装备上的天晶

This commit is contained in:
luying
2023-07-07 15:59:34 +08:00
parent 8d21c5ecbf
commit 02625de882
3 changed files with 11 additions and 19 deletions
+8 -9
View File
@@ -4,7 +4,6 @@ import Hero, { HeroType } from '../db/Hero';
import { nowSeconds } from '../pubUtils/timeUtil';
import { DicHero } from '../pubUtils/dictionary/DicHero';
import { ArtifactModelType } from '../db/Artifact';
import { JewelType } from '../db/Jewel';
class Talent {
@@ -16,6 +15,10 @@ class Talent {
class HeroArtifact {
@prop({ required: true })
id: number;
@prop({ required: true })
artifactId: number;
@@ -75,8 +78,8 @@ class EPlace {
starStage: number = 0;
@prop({ required: true, type: Stone, _id: false })
stones: Stone[];
@prop({ required: false })
jewel: number = 0;
@prop({ required: false, _id: false })
jewel: Jewel = null;
}
// 从玩家数据中覆盖warjson的部分字段
@@ -119,10 +122,8 @@ export class PvpHeroInfo {
@prop({ required: false, type: EPlace, _id: false })
ePlace: EPlace[]; // 战力
@prop({ required: false, type: Jewel, _id: false })
jewels: Jewel[]; // 天晶
setHeroInfo(hero: HeroType, artifact: ArtifactModelType, jewels: JewelType[]) {
setHeroInfo(hero: HeroType, artifact: ArtifactModelType, ePlace: EPlace[] = []) {
this.actorId = hero.hid;
this.skinId = hero.skinId;
this.actorName = hero.hName;
@@ -136,8 +137,7 @@ export class PvpHeroInfo {
this.subHid = hero.subHid;
this.subActorId = hero.subActorId;
if(artifact) this.artifact.push(artifact);
this.ePlace = hero.ePlace;
this.jewels = jewels;
this.ePlace = ePlace;
}
setRobotInfo(dicHero: DicHero, lv?: number) {
@@ -262,7 +262,6 @@ export class PvpEnemies extends Enemies {
this.subActorId = heroInfo.subActorId;
this.artifact = heroInfo.artifact||[];
this.ePlace = heroInfo.ePlace||[];
this.jewels = heroInfo.jewels||[];
if(score != undefined) this.score = score;
}
}