pvp:刷新
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import { prop, mongoose, Ref } from '@typegoose/typegoose';
|
||||
import { DicWarJson } from '../pubUtils/dictionary/DicWarJson';
|
||||
import Hero, { HeroType, Talent } from '../db/Hero';
|
||||
import Hero, { HeroType } from '../db/Hero';
|
||||
import { nowSeconds } from '../pubUtils/timeUtil';
|
||||
import { DicHero } from '../pubUtils/dictionary/DicHero';
|
||||
|
||||
|
||||
class Talent {
|
||||
@prop({ required: true })
|
||||
id: number; // 天赋表id
|
||||
@prop({ required: true })
|
||||
level: number; // 激活等级
|
||||
}
|
||||
// 从玩家数据中覆盖warjson的部分字段
|
||||
export class PvpHeroInfo {
|
||||
@prop({ required: true })
|
||||
@@ -17,6 +24,8 @@ export class PvpHeroInfo {
|
||||
@prop({ required: false })
|
||||
star?: number = 0; // 角色星级
|
||||
@prop({ required: false })
|
||||
job?: number = 0; // 角色职业
|
||||
@prop({ required: false })
|
||||
lv?: number = 0; // 角色等级
|
||||
@prop({ required: false })
|
||||
skill?: string = "0"; // 技能
|
||||
@@ -28,7 +37,7 @@ export class PvpHeroInfo {
|
||||
colorStar?: number = 0; // 觉醒
|
||||
@prop({ required: false })
|
||||
quality?: number = 0; // 品质
|
||||
@prop({ required: false })
|
||||
@prop({ required: false, type: Talent, _id: false })
|
||||
talent?: Talent[] = []; // 品质
|
||||
|
||||
@prop({ required: true, _id: false })
|
||||
@@ -40,6 +49,7 @@ export class PvpHeroInfo {
|
||||
this.actorName = hero.hName;
|
||||
this.star = hero.star;
|
||||
this.lv = hero.lv;
|
||||
this.job = hero.job;
|
||||
this.colorStar = hero.colorStar;
|
||||
this.quality = hero.quality;
|
||||
let skin = hero.skins?.find(cur => cur.enable);
|
||||
@@ -51,12 +61,14 @@ export class PvpHeroInfo {
|
||||
this.skinId = dicHero.heroId;
|
||||
this.actorName = dicHero.name;
|
||||
this.quality = dicHero.quality;
|
||||
this.job = dicHero.jobid;
|
||||
if(dicHero.quality == 4) {
|
||||
this.star = 6;
|
||||
this.colorStar = dicHero.initialStars;
|
||||
} else {
|
||||
this.star = dicHero.initialStars;
|
||||
}
|
||||
|
||||
this.lv = lv;
|
||||
}
|
||||
|
||||
@@ -133,8 +145,10 @@ export class PvpEnemies extends Enemies {
|
||||
@prop({ required: true })
|
||||
lv: number;
|
||||
@prop({ required: true })
|
||||
score: number;
|
||||
job: number;
|
||||
@prop({ required: true })
|
||||
score: number;
|
||||
@prop({ required: true, type: () => Talent, _id: false })
|
||||
talent: Talent[];
|
||||
|
||||
// score: 这个武将的军功
|
||||
@@ -146,6 +160,7 @@ export class PvpEnemies extends Enemies {
|
||||
this.lv = heroInfo.lv;
|
||||
this.score = score;
|
||||
this.talent = heroInfo.talent;
|
||||
this.job = heroInfo.job;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user