addItem goodType修改
This commit is contained in:
@@ -13,7 +13,7 @@ import { Application, BackendSession } from 'pinus';
|
||||
import { resResult, getRandomByLen, calculateNum, getRandValue, ratioReward } from '../../../pubUtils/util';
|
||||
import { RoleStatus } from '../../../db/ComBattleTeam';
|
||||
import { ItemModel } from '../../../db/Item';
|
||||
import { handleFixedReward, handleReward } from '../../../services/rewardService';
|
||||
import { handleFixedReward, addItems } from '../../../services/rewardService';
|
||||
import { checkRoleInQueue, getTeamSearchByQuality, rmRoleFromQueue, setTeamSearchReq } from '../../../services/redisService';
|
||||
import { transBossHpArr } from '../../../services/battleService';
|
||||
import { getRandBlueprtId, getRandComBtlRobots, checkComBattleResult, clearComBtlTimer, getRealReward, getAssistTimesByQuality, getFrd } from '../../../services/comBattleService';
|
||||
@@ -692,7 +692,8 @@ export class ComBattleHandler {
|
||||
*/
|
||||
async comBattleEnd(msg: {teamCode: string}, session: BackendSession) {
|
||||
let roleId = session.get('roleId');
|
||||
let roleName = session.get('roleId');
|
||||
let roleName = session.get('roleName');
|
||||
let sid = session.get('sid');
|
||||
let { teamCode } = msg;
|
||||
let team = await ComBattleTeamModel.getTeamByCode(teamCode);
|
||||
if (!team || team.status !== COM_TEAM_STATUS.WIN) return resResult(STATUS.COM_BATTLE_REWARD_ERR);
|
||||
@@ -718,10 +719,10 @@ export class ComBattleHandler {
|
||||
}
|
||||
|
||||
await ComBattleTeamModel.updateRewardSt(teamCode, roleId, true);
|
||||
const goods = await handleFixedReward(roleId, roleName, roleSt.fixReward, 1);
|
||||
const goods = await handleFixedReward(roleId, roleName, sid, roleSt.fixReward, 1);
|
||||
let actordata = await roleLevelup(roleId, warInfo.kingExp, this.app, session);// 主公升级经验
|
||||
|
||||
return resResult(STATUS.SUCCESS, { ...goods, ...actordata, teamInfo: {status, teamCode, roleStatus, bossHpArr} });
|
||||
return resResult(STATUS.SUCCESS, { goods, ...actordata, teamInfo: {status, teamCode, roleStatus, bossHpArr} });
|
||||
}
|
||||
|
||||
async getComBtlStatus(msg: {teamCode: string}, session: BackendSession) {
|
||||
@@ -780,6 +781,8 @@ export class ComBattleHandler {
|
||||
async composeBlueprt(msg: {original: Array<{id: number, count: number}>}, session: BackendSession) {
|
||||
const roleId = session.get('roleId');
|
||||
const roleName = session.get('roleName');
|
||||
const sid = session.get('sid');
|
||||
|
||||
const { original } = msg;
|
||||
|
||||
// 原材料检查
|
||||
@@ -817,9 +820,9 @@ export class ComBattleHandler {
|
||||
const targetList = getBluePrtByQuality(dicCompose.targetQuality);
|
||||
const target = getRandomByLen(targetList);
|
||||
const reward = [{gid: target, count: 1}];
|
||||
const goods = await handleReward(roleId, roleName, reward);
|
||||
const goods = await addItems(roleId, roleName, sid, reward);
|
||||
|
||||
|
||||
return resResult(STATUS.SUCCESS, { ...goods, costGold: 0 });
|
||||
return resResult(STATUS.SUCCESS, { goods, costGold: 0 });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user