满足条件开启功能推送,详细功能校验暂缺
This commit is contained in:
@@ -3,7 +3,7 @@ import { BattleRecordModel } from '../../../db/BattleRecord';
|
||||
import { BattleSweepRecordModel } from '../../../db/BattleSweepRecord';
|
||||
import { getWarById, } from '../../../pubUtils/gamedata';
|
||||
import { genCode } from '../../../pubUtils/util';
|
||||
import { WAR_TYPE, EVENT_STATUS } from '../../../consts/consts';
|
||||
import { WAR_TYPE, EVENT_STATUS, FUNC_OPT_TYPE } from '../../../consts/consts';
|
||||
import { checkDaily, checkDailyAndIncrease } from '../../../services/dailyBattleService';
|
||||
import { checkTowerWar, towerBattleEnd } from '../../../services/battleService';
|
||||
import { WarReward } from '../../../services/warRewardService';
|
||||
@@ -16,6 +16,7 @@ import { RoleModel } from '../../../db/Role';
|
||||
import { RScriptRecordModel } from '../../../db/RScriptRecord';
|
||||
import { updateWarStar, checkBattleHeroes, roleLevelup } from '../../../services/normalBattleService';
|
||||
import { checkDungeonNum, checkDungeonAndIncrease } from '../../../services/dungeonService';
|
||||
import { switchOnFunc } from '../../../services/funcSwitchService';
|
||||
|
||||
export default function(app: Application) {
|
||||
return new NormalBattleHandler(app);
|
||||
@@ -224,7 +225,10 @@ export class NormalBattleHandler {
|
||||
// 是否首通
|
||||
let {warStar} = await RoleModel.findByRoleId(roleId);
|
||||
let condition1 = warStar.find(cur => cur.id == battleId);
|
||||
if(!condition1) warReward.setCondition(0, true);
|
||||
if(!condition1) {
|
||||
await switchOnFunc(roleId, FUNC_OPT_TYPE.BATTLE_END, battleId, this.app, session);
|
||||
warReward.setCondition(0, true);
|
||||
}
|
||||
// 是否首次3星
|
||||
if(star == 3 && (!condition1 || condition1.star != 3)) {
|
||||
warReward.setCondition(1, true);
|
||||
@@ -240,7 +244,7 @@ export class NormalBattleHandler {
|
||||
}, true);
|
||||
let { status } = updateResult;
|
||||
|
||||
let actordata = await roleLevelup(roleId, isSuccess?warInfo.kingExp:0);// 主公升级经验
|
||||
let actordata = await roleLevelup(roleId, isSuccess?warInfo.kingExp:0, this.app, session);// 主公升级经验
|
||||
|
||||
// 返回值:
|
||||
// towerStatus: false-本层未通过, true-本层已通过
|
||||
@@ -300,7 +304,7 @@ export class NormalBattleHandler {
|
||||
let warReward = new WarReward(roleId, roleName, battleId, true);
|
||||
let result = await warReward.saveReward(count);
|
||||
|
||||
let actordata = await roleLevelup(roleId, warInfo.kingExp * count)// 主公升级经验
|
||||
let actordata = await roleLevelup(roleId, warInfo.kingExp * count, this.app, session)// 主公升级经验
|
||||
|
||||
// 扫荡记录
|
||||
await BattleSweepRecordModel.saveBattleSweepRecordById(roleId, battleId, {
|
||||
|
||||
Reference in New Issue
Block a user