feat(gvg): 复活队伍

This commit is contained in:
luying
2023-02-17 16:45:24 +08:00
parent 40cffb7cc3
commit 8595c8d4ae
9 changed files with 114 additions and 33 deletions

View File

@@ -118,11 +118,19 @@ export function calBattleScoreByCe(isSuccess: boolean, lineupCe: number) {
return isSuccess? winScore: 0;
}
export async function teamBreak(city: GVGCityType, team: GVGTeamType) {
if(team.durability > 0) return team
let areaId = getBirthAreaOfCity(city, team.leagueCode);
team = await GVGTeamModel.teamBreak(team.teamCode, team.isRobot, team.maxDurability, areaId);
return team;
export async function getTechReviveMinus(configId: number, leagueCode: string) {
let leaguePrepare = await GVGLeaguePrepareModel.findByLeague(configId, leagueCode);
let minusCd = 0;
let activeTech = leaguePrepare?.activeTech||[];
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];
}
}
let cd = GVG.GVG_DEFAULT_REVIVE_CD - minusCd;
if(cd < 0) cd = 0;
return cd;
}
export function getGVGWarId(defenseTeam: GVGTeamType) {