关卡添加消耗品结算,奇遇的坐标改为点id
This commit is contained in:
@@ -11,6 +11,7 @@ import { getAp, setAp } from '../../../services/actionPointService';
|
||||
import { setBattleStatus, startEvent } from '../../../services/eventSercive';
|
||||
import { STATUS } from '../../../consts/statusCode';
|
||||
import { resResult } from '../../../pubUtils/util';
|
||||
import { HeroModel } from '../../../db/Hero';
|
||||
|
||||
export default function(app: Application) {
|
||||
return new NormalBattleHandler(app);
|
||||
@@ -101,7 +102,6 @@ export class NormalBattleHandler {
|
||||
|
||||
// 关卡结算,记录使用的武将,获得奖励
|
||||
async battleEnd(msg: {battleCode: string, battleId: number, isSuccess: boolean, star: number, heroes: Array<any>, }, session: BackendSession) {
|
||||
|
||||
const { battleCode, battleId, isSuccess, heroes, star } = msg;
|
||||
let roleId = session.get('roleId');
|
||||
let roleName = session.get('roleName');
|
||||
@@ -181,6 +181,12 @@ export class NormalBattleHandler {
|
||||
}, true);
|
||||
let { status } = updateResult;
|
||||
|
||||
let curHeroes = [];
|
||||
for(let hid of heroes) {
|
||||
let hero = await HeroModel.findByHidAndRole(hid, roleId);
|
||||
curHeroes.push(hero);
|
||||
}
|
||||
|
||||
// 主线关卡某个关卡触发事件开启
|
||||
let eventStatus = session.get('eventStatus')||0;
|
||||
if(battleId == EVENT_START_BATTLE && eventStatus == 0) {
|
||||
@@ -194,7 +200,29 @@ export class NormalBattleHandler {
|
||||
battleCode, battleId, status, towerStatus,
|
||||
goods: reward, towerBonus, towerReward,
|
||||
apJson,
|
||||
dailyNum
|
||||
dailyNum,
|
||||
kingExp: warInfo.kingExp,
|
||||
heroes: curHeroes,
|
||||
actordata: [
|
||||
{
|
||||
lv : 20,
|
||||
exp : 700,
|
||||
getExp : 1300,
|
||||
mostExp : 2000
|
||||
},
|
||||
{
|
||||
lv : 21,
|
||||
exp : 0,
|
||||
getExp : 3000,
|
||||
mostExp : 3000
|
||||
},
|
||||
{
|
||||
lv : 22,
|
||||
exp : 0,
|
||||
getExp : 700,
|
||||
mostExp : 4000,
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user