🐞 fix(gvg): 守城顺序&投石车数据
This commit is contained in:
@@ -312,20 +312,15 @@ export default class GVGTeam extends BaseModel {
|
||||
}
|
||||
|
||||
// 投石车伤害
|
||||
public static async attackByCatapult(teamCodes: string[], inc: number, rebirthAreaId: number) {
|
||||
let teams: GVGTeamType[] = [];
|
||||
for(let teamCode of teamCodes) {
|
||||
let team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $inc: { durability: -inc } }, { new: true }).lean();
|
||||
let originPointId = team.pointId;
|
||||
if(team.durability <= 0) {
|
||||
team = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $set: { areaId: rebirthAreaId, pointId: 0, durability: team.maxDurability } }, { new: true }).lean();
|
||||
team.originPointId = originPointId;
|
||||
team.curTeamBreak = true;
|
||||
}
|
||||
teams.push(team);
|
||||
public static async attackByCatapult(teamCode: string, inc: number, rebirthAreaId: number, reviveCd: number) {
|
||||
let team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $inc: { durability: -inc } }, { new: true }).lean();
|
||||
let originPointId = team.pointId;
|
||||
if(team.durability <= 0) {
|
||||
team = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $set: { fromAreaId: team.areaId, areaId: rebirthAreaId, pointId: 0, durability: team.maxDurability, restartTime: nowSeconds() + reviveCd } }, { new: true }).lean();
|
||||
team.originPointId = originPointId;
|
||||
team.curTeamBreak = true;
|
||||
}
|
||||
return teams
|
||||
|
||||
return team;
|
||||
}
|
||||
|
||||
// 加积分
|
||||
|
||||
@@ -648,6 +648,7 @@ export class GVGCityMapInfo {
|
||||
|
||||
export class GVGTeamSpineInMap {
|
||||
spine: number = 0;
|
||||
roleId: string = '';
|
||||
roleName: string = '';
|
||||
serverName: string = '';
|
||||
startMoveTime: number = 0;
|
||||
@@ -664,6 +665,7 @@ export class GVGTeamSpineInMap {
|
||||
|
||||
constructor(obj: GVGTeamMem, serverNames: {[serverId: string]: string}) {
|
||||
this.spine = obj.spine;
|
||||
this.roleId = obj.roleId;
|
||||
this.roleName = obj.roleName;
|
||||
if(obj.serverId) this.serverName = serverNames[obj.serverId];
|
||||
this.startMoveTime = obj.startMoveTime;
|
||||
@@ -697,6 +699,8 @@ export class GVGTeamInList {
|
||||
leagueName: string;
|
||||
durability: number; // 耐久
|
||||
maxDurability: number; // 最大耐久
|
||||
restartTime: number;
|
||||
curTeamBreak: boolean;
|
||||
|
||||
constructor(team: GVGTeamType) {
|
||||
if(!team) return;
|
||||
@@ -711,6 +715,8 @@ export class GVGTeamInList {
|
||||
this.leagueName = team.leagueName;
|
||||
this.durability = team.durability;
|
||||
this.maxDurability = team.maxDurability;
|
||||
this.restartTime = team.restartTime;
|
||||
this.curTeamBreak = !!team.curTeamBreak;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user