✨ feat(gvg): 概览
This commit is contained in:
@@ -19,6 +19,7 @@ import { LeagueRankInfo, RoleRankInfo } from "../../domain/rank";
|
||||
import { findKeys, getAllServerName } from "../redisService";
|
||||
import { sendMessageToGVGAreaByTeamWithSuc, sendMessageToGVGAreaWithSuc, sendMessageToGVGCityWithSuc } from "../pushService";
|
||||
import { sendMailToLeagueByContent } from "../mailService";
|
||||
import { GVGCityAreaPointModel } from "../../db/GVGCityAreaPoint";
|
||||
|
||||
|
||||
/**
|
||||
@@ -237,6 +238,7 @@ export async function initCatapult(cityId: number, groupId: number, serverType:
|
||||
|
||||
// 投石车投伤害
|
||||
export async function catapultHurt() {
|
||||
let { configId } = getGVGConfig();
|
||||
for(let [_key, teamObj] of getGVGBattleMap()) {
|
||||
let teams = teamObj.findCatapult();
|
||||
for(let catapult of teams) {
|
||||
@@ -245,13 +247,16 @@ export async function catapultHurt() {
|
||||
let relateArea = dicArea?.relateArea||[];
|
||||
let teamCodes = teamObj.findCatapultAttackTeam(relateArea, catapult.leagueCode);
|
||||
let dicGVGCity = gameData.gvgCity.get(catapult.cityId);
|
||||
let teams = await GVGTeamModel.attackByCatapult(teamCodes, catapult.captapultAtk, dicGVGCity.attackBirth)
|
||||
let teams = await GVGTeamModel.attackByCatapult(teamCodes, catapult.captapultAtk, dicGVGCity.attackBirth);
|
||||
teamObj.battleEnd(teams);
|
||||
await sendMessageToGVGAreaByTeamWithSuc(teamObj.groupId, teamObj.serverType, catapult.areaId, PUSH_ROUTE.GVG_TEAM_ATTACKED, {
|
||||
cityId: catapult.cityId, areaId: catapult.areaId, attackType: 1, teams: teams.map(team => new GVGTeamInList(team))
|
||||
});
|
||||
for(let team of teams) {
|
||||
await pushTeamBeHurtMessage(team);
|
||||
if(team.curTeamBreak && team.originPointId > 0) {
|
||||
await GVGCityAreaPointModel.leavePoint(configId, teamObj.groupId, teamObj.serverType, team.originPointId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user