feat(gvg): 保存阵容、刷新对手、战报

This commit is contained in:
luying
2023-02-17 10:58:06 +08:00
parent ddce23d7fd
commit 31a286d82e
13 changed files with 9712 additions and 2799 deletions
+15
View File
@@ -1,5 +1,6 @@
import { prop } from "@typegoose/typegoose";
import { ArtifactModelType } from "../../db/Artifact";
import { GVGVestigeRecType } from "../../db/GVGVestigeRec";
import { HeroType, Talent } from "../../db/Hero";
import { RoleType } from "../../db/Role";
import { gameData } from "../../pubUtils/data";
@@ -203,9 +204,23 @@ export class OppDetailHeroData {
}
export class OppDetailData{
roleId: string; // 对手的id
isRobot: boolean;
vestigeId: number;
battleCode: string;
status: number;
time: number;
heroes: OppDetailHeroData[] = [];
lineupCe: number = 0;
constructor(rec: GVGVestigeRecType, obj: {status: number, time: number}) {
this.vestigeId = rec.vestigeId;
this.battleCode = rec.battleCode;
this.roleId = rec.defenseRoleId;
this.isRobot = rec.defenseInfo.isRobot;
this.status = obj.status;
this.time = obj.time;
}
setByPlayer(dicWarJson: DicWarJson[], defenseHeroes: OppPlayerHeroInfo[], heroes: HeroType[], artifacts: ArtifactModelType[]) {
for(let warJson of dicWarJson) {
+6
View File
@@ -77,6 +77,9 @@ export class GVGMainData {
// 内政相关
resources: LeagueResource = new LeagueResource(); // 联盟的物资
activeTech: number[] = []; // 已激活了的科技树的id
maxMemberCnt: number; // 进入备战期总玩家人数
producerCnt: number; // 贤臣人数
fighterCnt: number; // 猛将人数
sumTime: number = 0; // 今日贡献结算时间 10位时间戳
@@ -109,6 +112,9 @@ export class GVGMainData {
this.lv = leaguePrepare.lv;
this.resources = leaguePrepare.resources;
this.activeTech = leaguePrepare.activeTech||[];
this.maxMemberCnt = leaguePrepare.maxMemberCnt;
this.producerCnt = leaguePrepare.producerCnt;
this.fighterCnt = leaguePrepare.fighterCnt;
}
setPlayerInfo(userData: GVGUserDataType, auth: number, canPrepare: boolean, canChooseJob: boolean, items: GVGItem[], tasks: GVGTask[]) {