🐞 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;
|
||||
}
|
||||
|
||||
// 加积分
|
||||
|
||||
Reference in New Issue
Block a user