✨ feat(gvg): 开始挑战和结束挑战
This commit is contained in:
@@ -1,30 +1,31 @@
|
||||
import { prop } from "@typegoose/typegoose";
|
||||
import { ArtifactModelType } from "../../db/Artifact";
|
||||
import { Lineup } from "../../db/GVGVestigeRank";
|
||||
import { HeroType, Talent } from "../../db/Hero";
|
||||
import { RoleType } from "../../db/Role";
|
||||
import { gameData } from "../../pubUtils/data";
|
||||
import { EXTERIOR, GVG } from "../../pubUtils/dicParam";
|
||||
import { DicGVGVestige } from "../../pubUtils/dictionary/DicGVGVestige";
|
||||
import { dicWarJson, DicWarJson } from "../../pubUtils/dictionary/DicWarJson";
|
||||
import { DicWarJson } from "../../pubUtils/dictionary/DicWarJson";
|
||||
|
||||
export class OppPlayerHeroInfo {
|
||||
@prop({ required: true })
|
||||
hid: number; // 武将id
|
||||
hid: number; // 武将id
|
||||
@prop({ required: true })
|
||||
skinId: number; // 皮肤id
|
||||
skinId: number; // 皮肤id
|
||||
@prop({ required: true })
|
||||
quality: number; // 品质
|
||||
quality: number; // 品质
|
||||
@prop({ required: true })
|
||||
star: number; // 星级
|
||||
star: number; // 星级
|
||||
@prop({ required: true })
|
||||
colorStar: number; // 彩星
|
||||
@prop({ required: true })
|
||||
lv: number; // 等级
|
||||
lv: number; // 等级
|
||||
@prop({ required: true })
|
||||
dataId: number; // 出兵表上所占位置
|
||||
dataId: number; // 出兵表上所占位置
|
||||
@prop({ required: true })
|
||||
order: number; // 行动顺序
|
||||
order: number; // 行动顺序
|
||||
@prop({ required: true })
|
||||
ce: number; // 战力
|
||||
|
||||
setByWarJson(warJson: DicWarJson) {
|
||||
this.hid = warJson.actorId;
|
||||
@@ -46,13 +47,14 @@ export class OppPlayerHeroInfo {
|
||||
}
|
||||
}
|
||||
|
||||
setByDefenseHero(hero: HeroType, lineup: Lineup[]) {
|
||||
setByDefenseHero(hero: HeroType, lineup: {actorId: number, dataId: number, order: number}[]) {
|
||||
this.hid = hero.hid;
|
||||
this.skinId = hero.skinId;
|
||||
this.quality = hero.quality;
|
||||
this.star = hero.star;
|
||||
this.colorStar = hero.colorStar;
|
||||
this.lv = hero.lv;
|
||||
this.ce = hero.ce;
|
||||
let curLineup = lineup.find(cur => cur.actorId == hero.hid);
|
||||
if(curLineup) {
|
||||
this.dataId = curLineup.dataId;
|
||||
@@ -90,7 +92,7 @@ export class OppPlayerInfo {
|
||||
@prop({ required: true })
|
||||
isRobot: boolean = false; // 原排名
|
||||
|
||||
initByPlayer(rank: number, role: RoleType, heroes: HeroType[], lineup: Lineup[], isSuccess: boolean ) {
|
||||
initByPlayer(rank: number, role: RoleType, isSuccess: boolean ) {
|
||||
this.oldRank = rank;
|
||||
this.newRank = rank;
|
||||
this.roleId = role.roleId;
|
||||
@@ -101,13 +103,16 @@ export class OppPlayerInfo {
|
||||
this.title = role.title;
|
||||
this.lv = role.lv;
|
||||
this.isSuccess = isSuccess;
|
||||
this.isRobot = false;
|
||||
}
|
||||
|
||||
setPlayerHeroes(heroes: HeroType[], lineup: {actorId: number, dataId: number, order: number}[]) {
|
||||
for(let hero of heroes) {
|
||||
let obj = new OppPlayerHeroInfo();
|
||||
obj.setByDefenseHero(hero, lineup);
|
||||
this.ce += hero.ce;
|
||||
this.heroes.push(obj);
|
||||
}
|
||||
this.isRobot = false;
|
||||
}
|
||||
|
||||
initByRobot(dic: DicGVGVestige, heroes: OppPlayerHeroInfo[], isSuccess: boolean) {
|
||||
|
||||
Reference in New Issue
Block a user