聊天:部分系统推送(宝石和藏宝图合成,秘境遗迹首通,天梯指定关)

This commit is contained in:
liangtongchuan
2021-03-10 20:34:00 +08:00
parent 1978e56007
commit 0589356c82
5 changed files with 64 additions and 13 deletions
@@ -4,9 +4,9 @@ import { difference } from 'underscore';
* @Author: 梁桐川
* @Date: 2020-11-30 15:05:48
* @Last Modified by: 梁桐川
* @Last Modified time: 2020-12-03 21:36:00
* @Last Modified time: 2021-03-10 20:15:30
*/
import { IT_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, COM_TEAM_STATUS, COM_BTL_CONST, CONSUME_TYPE, COM_BTL_QUALITY, MSG_SOURCE } 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 } from './../../../consts';
import { getGoodById, getBlueprtComposeByQuality, getBluePrtByQuality, getWarById, getWarIdByBlueprtId } from '../../../pubUtils/gamedata';
import Role, { RoleModel } from '../../../db/Role';
import { STATUS } from '../../../consts/statusCode';
@@ -21,7 +21,7 @@ import { setAp } from '../../../services/actionPointService';
import { roleLevelup } from '../../../services/normalBattleService';
import { addUserToChannel } from '../../../services/roleService';
import { ChannelUser } from '../../../domain/ChannelUser';
import { pushComBtlTeamMsg } from '../../../services/chatService';
import { pushComBtlTeamMsg, pushNormalEquipMsg } from '../../../services/chatService';
export default function(app: Application) {
return new ComBattleHandler(app);
@@ -674,6 +674,7 @@ export class ComBattleHandler {
const roleId = session.get('roleId');
const roleName = session.get('roleName');
const sid = session.get('sid');
const serverId = session.get('serverId');
const { original } = msg;
@@ -712,6 +713,10 @@ export class ComBattleHandler {
const target = getRandomByLen(targetList);
const reward = [{id: target, count: 1}];
const goods = await addItems(roleId, roleName, sid, reward);
if (dicCompose.targetQuality >= QUALITY_TYPE.ORANGE) {
const { name } = getGoodById(target);
pushNormalEquipMsg(roleId, roleName, serverId, MSG_SOURCE.ORANGE_BLUEPRT_COMPOSE, target, name);
}
return resResult(STATUS.SUCCESS, { goods, costGold: 0 });
}