🐞 fix(gvg): 双方都在积分点时挑战替换据点
This commit is contained in:
@@ -106,7 +106,7 @@ export function checkMoveStatus(team: GVGTeamType, cityId: number, areaId: numbe
|
||||
if(team.pointId > 0) return STATUS.GVG_BATTLE_TEAM_IS_SELLTED;
|
||||
if(team.stopMoveTime > nowSeconds()) return STATUS.GVG_BATTLE_IS_MOVING;
|
||||
if(team.moveCdTime > nowSeconds()) return STATUS.GVG_BATTLE_IS_MOVING_CD;
|
||||
if(team.lockTime > nowSeconds()) return STATUS.GVG_BATTLE_TEAM_LOCK;
|
||||
if(team.lockTime > nowSeconds()) return STATUS.GVG_TEAM_DEFENSEING;
|
||||
if(team.restartTime > nowSeconds()) return STATUS.GVG_BATTLE_TEAM_REVIVE;
|
||||
let dicArea = gameData.gvgArea.get(areaId);
|
||||
if(!dicArea) return STATUS.DIC_DATA_NOT_FOUND;
|
||||
@@ -114,6 +114,15 @@ export function checkMoveStatus(team: GVGTeamType, cityId: number, areaId: numbe
|
||||
return STATUS.SUCCESS;
|
||||
}
|
||||
|
||||
export function checkSettleStatus(team: GVGTeamType) {
|
||||
if(!team) return STATUS.GVG_BATTLE_TEAM_NOT_FOUND;
|
||||
if(team.stopMoveTime > nowSeconds()) return STATUS.GVG_BATTLE_IS_MOVING;
|
||||
if(team.moveCdTime > nowSeconds()) return STATUS.GVG_BATTLE_IS_MOVING_CD;
|
||||
if(team.lockTime > nowSeconds()) return STATUS.GVG_TEAM_DEFENSEING;
|
||||
if(team.restartTime > nowSeconds()) return STATUS.GVG_BATTLE_TEAM_REVIVE;
|
||||
return STATUS.SUCCESS;
|
||||
}
|
||||
|
||||
export async function initRobots(configId: number, groupKey: string, city: GVGCityType | { cityId: number, guardLeague: string }) {
|
||||
let { cityId, guardLeague = '' } = city;
|
||||
if(guardLeague) return [];
|
||||
@@ -663,8 +672,13 @@ export async function pushTeamBeHurtMessage(team: GVGTeamType, replaceTeam?: GVG
|
||||
|
||||
if(team.curTeamBreak && team.originPointId > 0) {
|
||||
await sendMessageToGVGAreaByTeamWithSuc(team.groupKey, team.fromAreaId, PUSH_ROUTE.GVG_AREA_POINT_CHANGE, {
|
||||
cityId: team.cityId, areaId: team.fromAreaId, targetPointId: team.pointId, originPointId: team.originPointId, point: new GVGTeamInListOnPoint(team.originPointId, replaceTeam && !replaceTeam.curTeamBreak, replaceTeam)
|
||||
cityId: team.cityId, areaId: team.fromAreaId, targetPointId: team.originPointId, originPointId: replaceTeam?.pointId??0, point: new GVGTeamInListOnPoint(team.pointId, true, team)
|
||||
});
|
||||
if(!team.curTeamBreak) {
|
||||
await sendMessageToGVGAreaByTeamWithSuc(replaceTeam.groupKey, replaceTeam.fromAreaId, PUSH_ROUTE.GVG_AREA_POINT_CHANGE, {
|
||||
cityId: replaceTeam.cityId, areaId: replaceTeam.fromAreaId, targetPointId: replaceTeam.pointId, originPointId: replaceTeam.originPointId, point: new GVGTeamInListOnPoint(replaceTeam.pointId, true, replaceTeam)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if(team.curTeamBreak) {
|
||||
|
||||
Reference in New Issue
Block a user