寻宝:修改掉落bug;修改战斗结果判断

This commit is contained in:
liangtongchuan
2020-12-02 13:13:09 +08:00
parent a001ec4478
commit 3515f99260
6 changed files with 88 additions and 33 deletions
@@ -17,7 +17,6 @@ import { RScriptRecordModel } from '../../../db/RScriptRecord';
import { updateWarStar, checkBattleHeroes, roleLevelup } from '../../../services/normalBattleService';
import { checkDungeonNum, checkDungeonAndIncrease } from '../../../services/dungeonService';
import { switchOnFunc } from '../../../services/funcSwitchService';
import { checkComBattleDrop } from '../../../services/comBattleService';
export default function(app: Application) {
return new NormalBattleHandler(app);
@@ -162,6 +161,10 @@ export class NormalBattleHandler {
if(!warInfo) {
return resResult(STATUS.BATTLE_MISS_INFO);
}
// 寻宝不使用通用战斗模块结算
if (warInfo.warType == WAR_TYPE.WARLOARDS) {
return resResult(STATUS.BATTLE_END_WRONG_TYPE);
}
if(!warInfo.hasOwnProperty('cost')) {
warInfo['cost'] = 0;
}
@@ -220,15 +223,6 @@ export class NormalBattleHandler {
return checkResult.resResult;
}
dungeonNum = Object.assign(dungeonNum, checkResult.data)
} else if (warInfo.warType == WAR_TYPE.WARLOARDS) {
let checkResult = await checkComBattleDrop(roleId, battleCode);
if (checkResult.status === -1) {
return checkResult.resResult;
}
// 寻宝会根据是否队长重新计算掉落
if (checkResult.fixReward) {
warReward.resetFixReward(checkResult.fixReward);
}
}
if(isSuccess) { // 挑战胜利