Merge branch 'master' into feature/backend
# Conflicts: # game-server/app/servers/connector/handler/entryHandler.ts # game-server/app/servers/role/handler/itemHandler.ts # shared/consts/constModules/sysConst.ts # shared/pubUtils/util.ts # web-server/app.ts # web-server/app/service/Auth.ts
This commit is contained in:
@@ -6,7 +6,7 @@ import { difference } from 'underscore';
|
||||
* @Last Modified by: 梁桐川
|
||||
* @Last Modified time: 2021-08-27 17:47:56
|
||||
*/
|
||||
import { IT_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, COM_TEAM_STATUS, COM_BTL_CONST, CONSUME_TYPE, COM_BTL_QUALITY, MSG_SOURCE, QUALITY_TYPE, ROLE_SELECT, TASK_TYPE, KING_EXP_RATIO_TYPE } from './../../../consts';
|
||||
import { IT_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, COM_TEAM_STATUS, COM_BTL_CONST, CONSUME_TYPE, COM_BTL_QUALITY, MSG_SOURCE, QUALITY_TYPE, ROLE_SELECT, TASK_TYPE, KING_EXP_RATIO_TYPE, ITEM_CHANGE_REASON } from './../../../consts';
|
||||
import Role, { RoleModel } from '../../../db/Role';
|
||||
import { STATUS } from '../../../consts/statusCode';
|
||||
import { Application, BackendSession } from 'pinus';
|
||||
@@ -561,6 +561,7 @@ export class ComBattleHandler {
|
||||
let roleId = session.get('roleId');
|
||||
let roleName = session.get('roleName');
|
||||
let sid = session.get('sid');
|
||||
let ip = session.get('ip');
|
||||
|
||||
let { teamCode } = msg;
|
||||
let team = await ComBattleTeamModel.getTeamByCode(teamCode);
|
||||
@@ -578,7 +579,7 @@ export class ComBattleHandler {
|
||||
if (!warInfo) return resResult(STATUS.BATTLE_MISS_INFO);
|
||||
|
||||
let role = await RoleModel.findByRoleId(roleId, 'lv');
|
||||
let apJson = await setAp(roleId, role.lv, -1 * warInfo.cost, sid); // 扣除体力
|
||||
let apJson = await setAp(roleId, ip, role.lv, -1 * warInfo.cost, sid, ITEM_CHANGE_REASON.COM_BATTLE_END); // 扣除体力
|
||||
if(!apJson) {
|
||||
return resResult(STATUS.BATTLE_ACTION_POINT_LACK);
|
||||
}
|
||||
@@ -592,7 +593,7 @@ export class ComBattleHandler {
|
||||
// }
|
||||
|
||||
await ComBattleTeamModel.updateRewardSt(teamCode, roleId, true);
|
||||
const goods = await addItems(roleId, roleName, sid, roleSt.fixReward);
|
||||
const goods = await addItems(roleId, roleName, sid, roleSt.fixReward, ITEM_CHANGE_REASON.COM_BATTLE_END);
|
||||
let actordata = await roleLevelup(KING_EXP_RATIO_TYPE.BATTLE, roleId, warInfo.kingExp, session);// 主公升级经验
|
||||
// 任务
|
||||
await checkTaskWithGoods(roleId, sid, TASK_TYPE.COM_BATTLE_DROP, goods);
|
||||
@@ -799,13 +800,13 @@ export class ComBattleHandler {
|
||||
original.push(...dicCompose.coinNum);
|
||||
// 消耗藏宝图和寻宝币
|
||||
|
||||
let costResult = await handleCost(roleId, sid, original);
|
||||
let costResult = await handleCost(roleId, sid, original, ITEM_CHANGE_REASON.BLUEPRT_COMPOSE);
|
||||
if(!costResult) return resResult(STATUS.ROLE_MATERIAL_NOT_ENOUGH);
|
||||
|
||||
const targetList = gameData.blueprt.get(dicCompose.targetQuality);
|
||||
const target = getRandSingleEelm(targetList);
|
||||
const reward = [{id: target, count: 1}];
|
||||
const goods = await addItems(roleId, roleName, sid, reward);
|
||||
const goods = await addItems(roleId, roleName, sid, reward, ITEM_CHANGE_REASON.BLUEPRT_COMPOSE);
|
||||
if (dicCompose.targetQuality >= QUALITY_TYPE.ORANGE) {
|
||||
const { name } = gameData.goods.get(target);
|
||||
pushNormalItemMsg(roleId, roleName, serverId, MSG_SOURCE.ORANGE_BLUEPRT_COMPOSE, target, name);
|
||||
|
||||
Reference in New Issue
Block a user