远征:更新下一关状态
This commit is contained in:
@@ -217,6 +217,10 @@ export class ExpeditionBattleHandler {
|
||||
if (!expeditionRecord || !expeditionWarRecord) {
|
||||
return resResult(STATUS.EXPEDITION_MISS_WAR_RECORD);
|
||||
}
|
||||
if(expeditionWarRecord.battleStatus == EXPEDITION_WAR_RECORD_STATUS.SUCCESS) {
|
||||
return resResult(STATUS.EXPEDITION_DUPLICATE_CHALLENGE);
|
||||
}
|
||||
|
||||
// 更新敌人剩余状态及战斗状态
|
||||
expeditionWarRecord = await ExpeditionWarRecordModel.updateEnemiesStatus(expeditionCode, expeditionId, EXPEDITION_WAR_RECORD_STATUS.SUCCESS, []);
|
||||
// 更新点数
|
||||
@@ -236,6 +240,13 @@ export class ExpeditionBattleHandler {
|
||||
if (gameData.expedition.has(expeditionId + 1)) {
|
||||
await findOrCreateEnemies(roleId, expeditionRecord.myCe, expeditionCode, expeditionId + 1, EXPEDITION_WAR_RECORD_STATUS.WAITING);
|
||||
}
|
||||
|
||||
let expeditionWarRecords = await ExpeditionWarRecordModel.getRecordByCode(expeditionCode);
|
||||
let curLv = 0;
|
||||
if (expeditionWarRecords.length > 0) {
|
||||
curLv = expeditionWarRecords[expeditionWarRecords.length - 1].expeditionId;
|
||||
}
|
||||
|
||||
await checkTaskInSkipExpedition(serverId, roleId, sid, battleId);
|
||||
|
||||
return resResult(STATUS.SUCCESS, {
|
||||
@@ -243,7 +254,9 @@ export class ExpeditionBattleHandler {
|
||||
expeditionId,
|
||||
battleId,
|
||||
goods: reward,
|
||||
expeditionPoint: role.expeditionPoint
|
||||
expeditionPoint: role.expeditionPoint,
|
||||
expeditionWarRecord: expeditionWarRecords,
|
||||
curLv
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ export async function getExpeditionStatus(roleId: string, roleName: string, isEn
|
||||
*/
|
||||
export async function findOrCreateEnemies(roleId: string, myCe: number, expeditionCode: string, expeditionId: number, battleStatus: number) {
|
||||
|
||||
let expeditionWarRecord = await ExpeditionWarRecordModel.getRecordByCodeAndId(expeditionCode, expeditionId);
|
||||
let expeditionWarRecord = await ExpeditionWarRecordModel.updateStatus(expeditionCode, expeditionId, battleStatus);
|
||||
if(!expeditionWarRecord) { // 如果没有信息
|
||||
let curDicExpedition = gameData.expedition.get(expeditionId);
|
||||
if(curDicExpedition) {
|
||||
|
||||
Reference in New Issue
Block a user