🐞 fix(gvg): 投石车定时任务

This commit is contained in:
luying
2023-02-15 22:03:05 +08:00
parent 4359bfd9cc
commit 7543baa8cb
17 changed files with 304 additions and 52 deletions

View File

@@ -1,4 +1,5 @@
import GVGTeam, { GVGTeamType } from "../../db/GVGTeam";
import { nowSeconds } from "../../pubUtils/timeUtil";
// 积分点分类统计1-3级积分点代表从小到大
export class LeagueCityPoint {
@@ -25,27 +26,14 @@ export class GVGTeamMem extends GVGTeam {
constructor(team: GVGTeamType) {
super();
this.roleId = team.roleId;
this.roleName = team.roleName;
this.serverId = team.serverId;
this.teamCode = team.teamCode;
this.index = team.index;
this.leagueCode = team.leagueCode;
this.guildCode = team.guildCode;
this.areaId = team.areaId;
this.fromAreaId = team.fromAreaId;
this.cityId = team.cityId;
this.pointId = team.pointId;
this.head = team.head;
this.spine = team.spine;
this.frame = team.frame;
this.durability = team.durability;
this.restartTime = team.restartTime;
this.attackTime = team.attackTime;
this.defenseTime = team.defenseTime;
this.startMoveTime = team.startMoveTime;
this.stopMoveTime = team.stopMoveTime;
this.score = team.score;
this.updateTeam(team);
}
public updateTeam(team: GVGTeamType) {
for(let key in team) {
this[key] = team[key];
}
this.isMoving = this.stopMoveTime > nowSeconds();
}
public setCity(cityId: number, areaId = 0, pointId = 0) {
@@ -60,11 +48,4 @@ export class GVGTeamMem extends GVGTeam {
this.startMoveTime = startMoveTime;
this.stopMoveTime = stopMoveTime;
}
public battleEnd(team: GVGTeamType) {
this.durability = team.durability;
this.restartTime = team.restartTime;
this.defenseTime = team.defenseTime;
this.stopMoveTime = team.stopMoveTime;
}
}