增加寻宝返回字段; 增加形象字段

This commit is contained in:
liangtongchuan
2020-11-25 18:06:17 +08:00
parent 71c2d99cf4
commit 3f3c716dc6
3 changed files with 20 additions and 8 deletions

View File

@@ -52,7 +52,7 @@ export class ComBattleHandler {
if (!goodData || goodData.itid !== IT_TYPE.BLUEPRT) return resResult(STATUS.COM_BATTLE_BLUEPRT_INVALID);
// 检查藏宝图是否足够
let { consumeGoods, lv, headHid, topFiveCe } = await RoleModel.findByRoleId(roleId);
let { consumeGoods, lv, headHid, topFiveCe, sHid } = await RoleModel.findByRoleId(roleId);
if (lv < COM_TEAM_ENABLE_LV) return resResult(STATUS.COM_BATTLE_LV_NOT_ENOUGH);
let blueprt = consumeGoods.find(good => good.id === blueprtId && good.count >= 1);
if (!blueprt) return resResult(STATUS.COM_BATTLE_BLUEPRT_NOT_FOUND);
@@ -76,12 +76,14 @@ export class ComBattleHandler {
let roleStatus = new RoleStatus();
roleStatus.heroes = heroes;
roleStatus.isCap = true;
roleStatus.headHid = headHid;
roleStatus.headHid = headHid || 19;
roleStatus.topFiveCe = topFiveCe;
roleStatus.roleId = roleId;
roleStatus.isReady = true;
roleStatus.totalDmg = 0;
roleStatus.roleName = roleName;
roleStatus.lv = lv;
roleStatus.sHid = sHid || 19;
comTeam.roleStatus = [roleStatus];
this.teamMap.set(teamCode, comTeam);
@@ -108,7 +110,7 @@ export class ComBattleHandler {
let teamStatus = this.teamMap.get(teamCode);
if (!teamStatus || teamStatus.status !== 0 || teamStatus.roleIds.length === 3) return resResult(STATUS.COM_BATTLE_MEMBER_LIMIT);
if (teamStatus.roleIds.indexOf(roleId) !== -1) return resResult(STATUS.COM_BATTLE_DUP_ENTER);
let { lv, headHid, topFiveCe } = await Role.findByRoleId(roleId);
let { lv, headHid, topFiveCe, sHid } = await Role.findByRoleId(roleId);
let { quality } = getGoodById(teamStatus.blueprtId);
let { assistanceLevel, assistanceTime } = getComBtlSetByQuality(quality);
if (lv < COM_TEAM_ENABLE_LV) {
@@ -125,13 +127,15 @@ export class ComBattleHandler {
let roleStatus = new RoleStatus();
roleStatus.heroes = [];
roleStatus.isCap = false;
roleStatus.headHid = headHid || 1;
roleStatus.headHid = headHid || 19; // 默认给赵云
roleStatus.topFiveCe = topFiveCe || 0;
roleStatus.roleId = roleId;
roleStatus.roleName = roleName;
roleStatus.isFrd = isFrd;
roleStatus.isReady = false;
roleStatus.totalDmg = 0;
roleStatus.lv = lv;
roleStatus.sHid = sHid || 19;
const team = await ComBattleTeamModel.addRole(teamCode, roleStatus);
if (!team) {
return resResult(STATUS.COM_BATTLE_CREATE_ERR);
@@ -143,7 +147,7 @@ export class ComBattleHandler {
if (users.indexOf(roleId) === -1) {
channel.add(roleId, sid);
}
channel.pushMessage('onTeamJoin', {teamCode, roleInfo: {roleId, headHid: roleStatus.headHid, topFiveCe: roleStatus.topFiveCe}});
channel.pushMessage('onTeamJoin', {teamCode, roleInfo: roleStatus});
teamStatus.roleIds.push(roleId);
teamStatus.roleStatus.push(roleStatus);