秘境保存首通武将

This commit is contained in:
luying
2020-11-20 18:00:02 +08:00
parent 90a3c9f7d4
commit f30d4858e4
3 changed files with 24 additions and 1 deletions
@@ -15,7 +15,7 @@ export class DungeonBattleHandler {
// 获取关卡列表
async getData(msg: { }, session: BackendSession) {
let roleId = session.get('roleId');
let { dungeonCnt = 0, dungeonBuyCnt = 0, dungeonRefTime } = await RoleModel.findByRoleId(roleId);
let { dungeonCnt = 0, dungeonBuyCnt = 0, dungeonRefTime, dungeonHeroes=[] } = await RoleModel.findByRoleId(roleId);
let curTime = new Date();
if(shouldRefresh(dungeonRefTime, curTime, DUNGEON_CONST.REFRESH_TIME)) {
dungeonCnt = 0; dungeonBuyCnt = 0;
@@ -24,6 +24,7 @@ export class DungeonBattleHandler {
let nextCostGold = calculateNum(GOLD_COST_RATIO.DUNGRON_BUY_NUM, {num: dungeonBuyCnt + 1 }, 50);
return resResult(STATUS.SUCCESS, {
nextCostGold,
dungeonHeroes,
battleCount: DUNGEON_CONST.MAX_CNT + dungeonBuyCnt - dungeonCnt,
buyCount: DUNGEON_CONST.MAX_BUY_CNT - dungeonBuyCnt
});
@@ -212,6 +212,7 @@ export class NormalBattleHandler {
}
} else if (warInfo.warType == WAR_TYPE.MYSTERY || warInfo.warType == WAR_TYPE.MYSTERY_ELITE) {
let checkResult = await checkDungeonAndIncrease(roleId, 1, false);
await RoleModel.saveDungeonHero(roleId, battleId, heroes, isSuccess);
if(checkResult.status == -1) {
return checkResult.resResult;
}