巅峰演武:赛季防守阵容修改
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { Application, BackendSession, pinus, HandlerService, } from 'pinus';
|
||||
import { findIndex } from 'underscore';
|
||||
import { gameData, getPvpBoxBySeasonNumAndIndex } from '../../../pubUtils/data';
|
||||
import { refreshEnemies, getEnemies, refChallengeCnt, generPVPOppRecInfo, generMyRecInfo, sendLastSeasonRewardIfNotSent, refreshRefOppCnt, generPvpLineupCe, calLineupScore, checkPvpSeasonIsStart, checkPvpSeasonIsSummit } from '../../../services/pvpService';
|
||||
import { refreshEnemies, getEnemies, refChallengeCnt, generPVPOppRecInfo, generMyRecInfo, sendLastSeasonRewardIfNotSent, refreshRefOppCnt, generPvpLineupCe, calLineupScore, checkPvpSeasonIsStart, checkPvpSeasonIsSummit, getPvpSeasonStatus, checkPvpSeasonIsWaiting } from '../../../services/pvpService';
|
||||
import { RoleModel, RoleType } from '../../../db/Role';
|
||||
import { STATUS } from '../../../consts/statusCode';
|
||||
import { resResult, genCode, checkRoleIsRobot, robotIdComBack } from '../../../pubUtils/util';
|
||||
@@ -394,13 +394,16 @@ export class PvpHandler {
|
||||
|
||||
let list: pvpSaveDataReturn[] = [];
|
||||
for(let warId of (pvpConfig.warIds||[])) {
|
||||
let data = new pvpSaveDataReturn(warId);
|
||||
let curSaveData = saveDatas.find(cur => cur.warId == warId);
|
||||
data.setUserSaveData(curSaveData);
|
||||
if(pvpDefense.defense?.warId == warId) {
|
||||
data.setAsUsing();
|
||||
let dicWar = gameData.war.get(warId);
|
||||
if(dicWar && dicWar.selectView == 1) {
|
||||
let data = new pvpSaveDataReturn(warId);
|
||||
let curSaveData = saveDatas.find(cur => cur.warId == warId);
|
||||
data.setUserSaveData(curSaveData);
|
||||
if(pvpDefense.defense?.warId == warId) {
|
||||
data.setAsUsing();
|
||||
}
|
||||
list.push(data);
|
||||
}
|
||||
list.push(data);
|
||||
}
|
||||
return resResult(STATUS.SUCCESS, { list });
|
||||
}
|
||||
@@ -467,6 +470,9 @@ export class PvpHandler {
|
||||
let roleId = session.get('roleId');
|
||||
|
||||
let seasonNum: number = this.app.get('pvpSeasonNum');
|
||||
if(checkPvpSeasonIsWaiting()) { // 休赛期
|
||||
seasonNum ++;
|
||||
}
|
||||
let r = new Rank(REDIS_KEY.PVP_RANK, { seasonNum });
|
||||
let { ranks, myRank } = await r.getRankListWithMyRank({ roleId });
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import { RoleRankInfo } from '../domain/rank';
|
||||
import { reportTAEvent } from './sdkService';
|
||||
import { getVipPvpChallengeMaxCnt } from './activity/monthlyTicketService';
|
||||
import { getHeroesAttributes } from './playerCeService';
|
||||
import { setPvpSeasonNumToRemote, setPvpSettleSeasonNumToRemote } from './timeTaskService';
|
||||
import { setPvpSettleSeasonNumToRemote } from './timeTaskService';
|
||||
|
||||
/**
|
||||
* 返回对手三人信息
|
||||
@@ -259,10 +259,14 @@ async function matchRobot(chosenOpps: string[], role: RoleType, score: number, d
|
||||
let { lv: myLv, roleId } = role;
|
||||
let { id: pos, minLv, maxLv, ratio } = dicOpp;
|
||||
|
||||
let result = getRandSingleEelm(gameData.pvpWar);
|
||||
let pvpConfig = await PVPConfigModel.findCurPVPConfig();
|
||||
let range = pvpConfig?.warIds||[];
|
||||
let warId = getRandSingleEelm(range);
|
||||
if (!warId) return null;
|
||||
let result = gameData.war.get(warId);
|
||||
if (!result) return null;
|
||||
|
||||
let robotWarjson = gameData.warJson.get(result.war_id);
|
||||
let robotWarjson = gameData.warJson.get(result.dispatchJsonId);
|
||||
if (!robotWarjson) return null
|
||||
let heroes: PvpEnemies[] = [];
|
||||
let defCe = 0;
|
||||
@@ -568,6 +572,7 @@ export async function generPVPOppRecInfo(isSuccess: boolean, curOpp: OppPlayer,
|
||||
let { pvpSeasonResult } = await sendPVPRewardToUser(pvpDefense, pvpConfig.seasonNum, pvpConfig.seasonEndTime);
|
||||
reportTAEvent(roleId, TA_EVENT.PVP_SEASON_END, { top_rank: rank, hero_score: pvpSeasonResult.heroScores })
|
||||
}
|
||||
await PvpDefenseModel.resetDefense();
|
||||
let settledPvpConfig = await PVPConfigModel.setReward(pvpConfig.seasonNum);
|
||||
await setPvpSettleSeasonNumToRemote(settledPvpConfig);
|
||||
}
|
||||
@@ -733,4 +738,9 @@ export function checkPvpSeasonIsStart() {
|
||||
export function checkPvpSeasonIsSummit() {
|
||||
let status = getPvpSeasonStatus();
|
||||
return status == PVP_SEASON_STATUS.SUMMIT;
|
||||
}
|
||||
|
||||
export function checkPvpSeasonIsWaiting() {
|
||||
let status = getPvpSeasonStatus();
|
||||
return status == PVP_SEASON_STATUS.WAITING;
|
||||
}
|
||||
Reference in New Issue
Block a user