✨ feat(gvg): 使用诸葛连弩
This commit is contained in:
@@ -17,7 +17,7 @@ import { dispatch } from "../../pubUtils/dispatcher";
|
||||
import { Rank } from "../rankService";
|
||||
import { LeagueRankInfo, RoleRankInfo } from "../../domain/rank";
|
||||
import { findKeys, getAllServerName } from "../redisService";
|
||||
import { sendMessageToChannel, sendMessageToCityWithSuc, sendMessageToGVGAreaByTeamWithSuc, sendMessageToGVGAreaWithSuc, sendMessageToGVGCityWithSuc } from "../pushService";
|
||||
import { sendMessageToGVGAreaByTeamWithSuc, sendMessageToGVGAreaWithSuc, sendMessageToGVGCityWithSuc } from "../pushService";
|
||||
import { sendMailToLeagueByContent } from "../mailService";
|
||||
|
||||
|
||||
@@ -118,6 +118,7 @@ export function calBattleScoreByCe(isSuccess: boolean, lineupCe: number) {
|
||||
return isSuccess? winScore: 0;
|
||||
}
|
||||
|
||||
// 复活cd
|
||||
export async function getTechReviveMinus(configId: number, leagueCode: string) {
|
||||
let leaguePrepare = await GVGLeaguePrepareModel.findByLeague(configId, leagueCode);
|
||||
let minusCd = 0;
|
||||
@@ -125,7 +126,7 @@ export async function getTechReviveMinus(configId: number, leagueCode: string) {
|
||||
for(let techId of activeTech) {
|
||||
let dicTech = gameData.gvgTech.get(techId);
|
||||
if(dicTech && dicTech.type == GVG_TECH_TYPE.BATTLE_REVIVE_GAP) {
|
||||
minusCd = dicTech.param[0];
|
||||
minusCd += dicTech.param[0];
|
||||
}
|
||||
}
|
||||
let cd = GVG.GVG_DEFAULT_REVIVE_CD - minusCd;
|
||||
@@ -133,6 +134,20 @@ export async function getTechReviveMinus(configId: number, leagueCode: string) {
|
||||
return cd;
|
||||
}
|
||||
|
||||
// 诸葛连弩的伤害
|
||||
export async function getTechKnifeHurt(configId: number, leagueCode: string) {
|
||||
let leaguePrepare = await GVGLeaguePrepareModel.findByLeague(configId, leagueCode);
|
||||
let hurt = 0;
|
||||
let activeTech = leaguePrepare?.activeTech||[];
|
||||
for(let techId of activeTech) {
|
||||
let dicTech = gameData.gvgTech.get(techId);
|
||||
if(dicTech && dicTech.type == GVG_TECH_TYPE.BATTLE_ITEM_KNIFE) {
|
||||
if(dicTech.param[2] > hurt) hurt = dicTech.param[2];
|
||||
}
|
||||
}
|
||||
return hurt
|
||||
}
|
||||
|
||||
export function getGVGWarId(defenseTeam: GVGTeamType) {
|
||||
if(!defenseTeam.isRobot) return GVG.GVG_CITY_BGMAP_GKID; // 玩家防守地图
|
||||
if(!defenseTeam.isCatapult) return GVG.GVG_CATAPULT_WARJSON; // 投石车使用
|
||||
@@ -369,9 +384,10 @@ export async function gvgBattleEnd() {
|
||||
// —————————— 推送相关 —————————— //
|
||||
// 推送
|
||||
export async function battleEndSendMessage(groupId: number, serverType: number, cityId: number, defenseTeam: GVGTeamType, attackTeam: GVGTeamType) {
|
||||
let areaId = defenseTeam.curTeamBreak? defenseTeam.fromAreaId: defenseTeam.areaId;
|
||||
// 推送伤害
|
||||
await sendMessageToGVGAreaByTeamWithSuc(groupId, serverType, defenseTeam.areaId, PUSH_ROUTE.GVG_TEAM_ATTACKED, {
|
||||
cityId, areaId: defenseTeam.areaId, attackType: 3, teams: [new GVGTeamInList(defenseTeam), new GVGTeamInList(attackTeam)]
|
||||
await sendMessageToGVGAreaByTeamWithSuc(groupId, serverType, areaId, PUSH_ROUTE.GVG_TEAM_ATTACKED, {
|
||||
cityId, areaId, attackType: 3, teams: [new GVGTeamInList(defenseTeam), new GVGTeamInList(attackTeam)]
|
||||
});
|
||||
await pushTeamBeHurtMessage(defenseTeam, attackTeam);
|
||||
await pushTeamBeHurtMessage(attackTeam);
|
||||
@@ -381,15 +397,15 @@ export async function battleEndSendMessage(groupId: number, serverType: number,
|
||||
export async function pushTeamBeHurtMessage(team: GVGTeamType, replaceTeam?: GVGTeamType) {
|
||||
|
||||
if(team.curTeamBreak && team.originPointId > 0) {
|
||||
await sendMessageToGVGAreaByTeamWithSuc(team.groupId, team.serverType, team.originPointId, PUSH_ROUTE.GVG_AREA_POINT_CHANGE, {
|
||||
cityId: team.cityId, areaId: team.originPointId, point: new GVGTeamInListOnPoint(team.originPointId, replaceTeam && !replaceTeam.curTeamBreak, replaceTeam)
|
||||
await sendMessageToGVGAreaByTeamWithSuc(team.groupId, team.serverType, team.fromAreaId, PUSH_ROUTE.GVG_AREA_POINT_CHANGE, {
|
||||
cityId: team.cityId, areaId: team.fromAreaId, point: new GVGTeamInListOnPoint(team.originPointId, replaceTeam && !replaceTeam.curTeamBreak, replaceTeam)
|
||||
});
|
||||
}
|
||||
|
||||
await pushTeamMoveMessage(team);
|
||||
if(team.isRobot && team.isBroken) {
|
||||
await sendMessageToGVGAreaByTeamWithSuc(team.groupId, team.serverType, team.fromAreaId, PUSH_ROUTE.GVG_PLAYER_LEAVE_AREA, {
|
||||
cityId: team.cityId, areaId: team.areaId, teamCode: team.teamCode
|
||||
cityId: team.cityId, areaId: team.fromAreaId, teamCode: team.teamCode
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -402,7 +418,7 @@ export async function pushTeamMoveMessage(team: GVGTeamType) {
|
||||
});
|
||||
}
|
||||
if(team.areaId > 0) {
|
||||
await sendMessageToGVGAreaByTeamWithSuc(team.groupId, team.serverType, team.fromAreaId, PUSH_ROUTE.GVG_PLAYER_AREA_ADD, {
|
||||
await sendMessageToGVGAreaByTeamWithSuc(team.groupId, team.serverType, team.areaId, PUSH_ROUTE.GVG_PLAYER_AREA_ADD, {
|
||||
cityId: team.cityId, areaId: team.fromAreaId, player: new GVGTeamInList(team)
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user