fix bug 远征显示下一关等
This commit is contained in:
@@ -39,7 +39,7 @@ export class ExpeditionBattleHandler {
|
||||
expeditionRecord = await ExpeditionRecordModel.createRecord({
|
||||
roleId, roleName, heroes: [], myCe
|
||||
});
|
||||
await findOrCreateEnemies(roleId, myCe, expeditionRecord.expeditionCode, 1);
|
||||
await findOrCreateEnemies(roleId, myCe, expeditionRecord.expeditionCode, 1, 0);
|
||||
}
|
||||
|
||||
// 每一关的挑战状态
|
||||
@@ -63,7 +63,7 @@ export class ExpeditionBattleHandler {
|
||||
curLv,
|
||||
expeditionWarRecord,
|
||||
pointRewards,
|
||||
heroes,
|
||||
heroes: heroes.map(cur => {return {"dataId": cur.seqId, "hp": cur.hp, "ap": cur.ap}}),
|
||||
resetCnt
|
||||
});
|
||||
}
|
||||
@@ -90,7 +90,7 @@ export class ExpeditionBattleHandler {
|
||||
let { expeditionCode, heroes } = await ExpeditionRecordModel.createRecord({
|
||||
roleId, roleName, heroes: [], myCe
|
||||
});
|
||||
await findOrCreateEnemies(roleId, myCe, expeditionCode, 1);
|
||||
await findOrCreateEnemies(roleId, myCe, expeditionCode, 1, 0);
|
||||
await RoleModel.increaseExpeditionResetCnt(roleId, needRefresh, curTime);
|
||||
let expeditionWarRecord = await ExpeditionWarRecordModel.getRecordByCode(expeditionCode);
|
||||
let curLv = 0;
|
||||
@@ -119,13 +119,13 @@ export class ExpeditionBattleHandler {
|
||||
|
||||
let { myCe } = await ExpeditionRecordModel.getExpeditionRecordByCode(expeditionCode);
|
||||
|
||||
let curExpeditionWarRecord = await findOrCreateEnemies(roleId, myCe, expeditionCode, expeditionId);
|
||||
let curExpeditionWarRecord = await findOrCreateEnemies(roleId, myCe, expeditionCode, expeditionId, 0);
|
||||
if(!curExpeditionWarRecord) {
|
||||
return resResult(STATUS.EXPEDITION_MATCH_NO_PLAYER);
|
||||
}
|
||||
let { battleId, enemyFrom, enemies, battleStatus, ce: curCe } = curExpeditionWarRecord;
|
||||
let nextCe = 0; // 下一关战力
|
||||
let nextExpeditionWarRecord = await findOrCreateEnemies(roleId, myCe, expeditionCode, expeditionId + 1);
|
||||
let nextExpeditionWarRecord = await findOrCreateEnemies(roleId, myCe, expeditionCode, expeditionId + 1, -1);
|
||||
if(nextExpeditionWarRecord) nextCe = nextExpeditionWarRecord.ce;
|
||||
|
||||
return resResult(STATUS.SUCCESS, {
|
||||
@@ -186,7 +186,7 @@ export class ExpeditionBattleHandler {
|
||||
}
|
||||
}, true);
|
||||
|
||||
let result = await ExpeditionWarRecordModel.updateStatus(expeditionCode, expeditionId, 0, battleCode);
|
||||
let result = await ExpeditionWarRecordModel.updateBattleCode(expeditionCode, expeditionId, 0, battleCode);
|
||||
|
||||
return resResult(STATUS.SUCCESS, {
|
||||
expeditionCode,
|
||||
@@ -259,6 +259,8 @@ export class ExpeditionBattleHandler {
|
||||
let reward = await warReward.saveReward(1);
|
||||
|
||||
let actordata = await roleLevelup(roleId, isSuccess?warInfo.kingExp:0);// 主公升级经验
|
||||
// 更新下一关状态
|
||||
await ExpeditionWarRecordModel.updateStatus(expeditionCode, expeditionId + 1, 0);
|
||||
|
||||
return resResult(STATUS.SUCCESS, {
|
||||
expeditionCode, expeditionId,
|
||||
|
||||
Reference in New Issue
Block a user