✨ feat(远征&巅峰): 选择其他对手获取他的装备和宝物信息
This commit is contained in:
@@ -4,6 +4,7 @@ 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 {
|
||||
@@ -20,6 +21,62 @@ class HeroArtifact {
|
||||
|
||||
@prop({ required: true })
|
||||
lv: number;
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
quality: number; // 品质 1-5 蓝紫橙红金
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
qualityStage: number; // 品质+n,0开始
|
||||
}
|
||||
|
||||
class Stone {
|
||||
@prop({ required: true })
|
||||
id: number;
|
||||
@prop({ required: true })
|
||||
stone: number;
|
||||
}
|
||||
|
||||
|
||||
class JewelSe {
|
||||
@prop({ required: true })
|
||||
id: number; // 随机属性位置id
|
||||
@prop({ required: true })
|
||||
seid: number; // 随机属性池id
|
||||
@prop({ required: true })
|
||||
rand: number; // 随机属性内需要随机的值
|
||||
}
|
||||
|
||||
class Jewel {
|
||||
@prop({ required: true })
|
||||
seqId: number; // 装备表自增 id
|
||||
@prop({ required: true })
|
||||
id: number; // 装备 id
|
||||
|
||||
@prop({ required: false, type: JewelSe, default: [], _id: false })
|
||||
rareSe: JewelSe[]; // 强化随机属性
|
||||
@prop({ required: false, type: JewelSe, default: [], _id: false })
|
||||
randSe: JewelSe[]; // 强化随机属性
|
||||
}
|
||||
|
||||
class EPlace {
|
||||
@prop({ required: true })
|
||||
id: number;
|
||||
@prop({ required: true })
|
||||
equipId: number;
|
||||
@prop({ required: true })
|
||||
lv: number = 0;
|
||||
@prop({ required: true })
|
||||
quality: number = 1;
|
||||
@prop({ required: true })
|
||||
qualityStage: number = 0;
|
||||
@prop({ required: true })
|
||||
star: number = 0;
|
||||
@prop({ required: true })
|
||||
starStage: number = 0;
|
||||
@prop({ required: true, type: Stone, _id: false })
|
||||
stones: Stone[];
|
||||
@prop({ required: false })
|
||||
jewel: number = 0;
|
||||
}
|
||||
|
||||
// 从玩家数据中覆盖warjson的部分字段
|
||||
@@ -60,7 +117,12 @@ export class PvpHeroInfo {
|
||||
@prop({ required: true, _id: false, type: HeroArtifact })
|
||||
artifact?: HeroArtifact[] = []; // 宝物
|
||||
|
||||
setHeroInfo(hero: HeroType, artifact: ArtifactModelType) {
|
||||
@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[]) {
|
||||
this.actorId = hero.hid;
|
||||
this.skinId = hero.skinId;
|
||||
this.actorName = hero.hName;
|
||||
@@ -73,7 +135,9 @@ export class PvpHeroInfo {
|
||||
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 })
|
||||
if(artifact) this.artifact.push(artifact);
|
||||
this.ePlace = hero.ePlace;
|
||||
this.jewels = jewels;
|
||||
}
|
||||
|
||||
setRobotInfo(dicHero: DicHero, lv?: number) {
|
||||
@@ -197,6 +261,8 @@ export class PvpEnemies extends Enemies {
|
||||
this.subHid = heroInfo.subHid;
|
||||
this.subActorId = heroInfo.subActorId;
|
||||
this.artifact = heroInfo.artifact||[];
|
||||
this.ePlace = heroInfo.ePlace||[];
|
||||
this.jewels = heroInfo.jewels||[];
|
||||
if(score != undefined) this.score = score;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user