远征:更新下一关状态
This commit is contained in:
@@ -217,6 +217,10 @@ export class ExpeditionBattleHandler {
|
|||||||
if (!expeditionRecord || !expeditionWarRecord) {
|
if (!expeditionRecord || !expeditionWarRecord) {
|
||||||
return resResult(STATUS.EXPEDITION_MISS_WAR_RECORD);
|
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, []);
|
expeditionWarRecord = await ExpeditionWarRecordModel.updateEnemiesStatus(expeditionCode, expeditionId, EXPEDITION_WAR_RECORD_STATUS.SUCCESS, []);
|
||||||
// 更新点数
|
// 更新点数
|
||||||
@@ -236,6 +240,13 @@ export class ExpeditionBattleHandler {
|
|||||||
if (gameData.expedition.has(expeditionId + 1)) {
|
if (gameData.expedition.has(expeditionId + 1)) {
|
||||||
await findOrCreateEnemies(roleId, expeditionRecord.myCe, expeditionCode, expeditionId + 1, EXPEDITION_WAR_RECORD_STATUS.WAITING);
|
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);
|
await checkTaskInSkipExpedition(serverId, roleId, sid, battleId);
|
||||||
|
|
||||||
return resResult(STATUS.SUCCESS, {
|
return resResult(STATUS.SUCCESS, {
|
||||||
@@ -243,7 +254,9 @@ export class ExpeditionBattleHandler {
|
|||||||
expeditionId,
|
expeditionId,
|
||||||
battleId,
|
battleId,
|
||||||
goods: reward,
|
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) {
|
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) { // 如果没有信息
|
if(!expeditionWarRecord) { // 如果没有信息
|
||||||
let curDicExpedition = gameData.expedition.get(expeditionId);
|
let curDicExpedition = gameData.expedition.get(expeditionId);
|
||||||
if(curDicExpedition) {
|
if(curDicExpedition) {
|
||||||
|
|||||||
Reference in New Issue
Block a user