diff --git a/game-server/app/servers/battle/handler/comBattleHandler.ts b/game-server/app/servers/battle/handler/comBattleHandler.ts index 6d00072be..db0fba5da 100644 --- a/game-server/app/servers/battle/handler/comBattleHandler.ts +++ b/game-server/app/servers/battle/handler/comBattleHandler.ts @@ -61,8 +61,12 @@ export class ComBattleHandler { if (!enoughBlueprt) return resResult(STATUS.COM_BATTLE_BLUEPRT_NOT_ENOUGH); const roleInfo = await RoleModel.findByRoleId(roleId, null, true); - const { lv } = roleInfo; + const { lv, topLineupCe } = roleInfo; if (lv < COM_BTL_CONST.ENABLE_LV) return resResult(STATUS.COM_BATTLE_LV_NOT_ENOUGH); + if(ceLimit && ceLimit > topLineupCe * (1 + COM_BTL_CONST.ROBOT_CE_RATIO)) { + return resResult(STATUS.COM_BATTLE_CREATE_CE_LIMIT) + } + let channelService = this.app.get('channelService'); let channel = channelService.getChannel(teamCode, true); diff --git a/game-server/app/services/comBattleService.ts b/game-server/app/services/comBattleService.ts index 76cba9ebd..8e69e2d1e 100644 --- a/game-server/app/services/comBattleService.ts +++ b/game-server/app/services/comBattleService.ts @@ -54,8 +54,8 @@ export function getRandComBtlRobots(topLineupCe: number, ceLimit: number, lv: nu if (robotHeroes && robotInfos && robotHeroes.length && robotInfos.length && robotInfos.length === robotHeroes.length) { robotHeroes.forEach((robot, idx) => { let robotCe = 0; - if (ceLimit) { - robotCe = getRandValueByMinMax(ceLimit * COM_BTL_CONST.ROBOT_CE_LIMIT_MIN, ceLimit * COM_BTL_CONST.ROBOT_CE_LIMIT_MAX, 0); + if (ceLimit && ceLimit > 0) { + robotCe = getRandValueByMinMax(ceLimit, (topLineupCe || 0) * (1 + COM_BTL_CONST.ROBOT_CE_RATIO), 0); } else { robotCe = getRandValue(topLineupCe || 0, COM_BTL_CONST.ROBOT_CE_RATIO, 0); } diff --git a/shared/consts/constModules/battleConst.ts b/shared/consts/constModules/battleConst.ts index 20fb58283..82b849ced 100644 --- a/shared/consts/constModules/battleConst.ts +++ b/shared/consts/constModules/battleConst.ts @@ -132,8 +132,6 @@ export const COM_BTL_CONST = { ROBOT_HURT_RAND_RATE: 0.05, // 每个机器人消耗 boss 血量百分比浮动范围 FRDCNT_DROP: 10, // 每场情谊点掉落 ROBOT_CE_RATIO: 0.2, // 没有战力限制的情况下机器人战力上下浮动百分比 - ROBOT_CE_LIMIT_MIN: 1.05, // 有战力限制的情况下机器人战力最小倍数 - ROBOT_CE_LIMIT_MAX: 1.15, // 有战力限制的情况下机器人战力最大倍数 ASSIST_TIME: 60 * 1000, // 助战匹配机器人的等待时长 MIN_CAP_TIME: 40 * 1000, // 队长匹配机器人的等待时长 MAX_CAP_TIME: 55 * 1000, // 队长匹配机器人的等待时长 diff --git a/shared/consts/statusCode.ts b/shared/consts/statusCode.ts index 0a90936ab..6b45fc9bc 100644 --- a/shared/consts/statusCode.ts +++ b/shared/consts/statusCode.ts @@ -123,6 +123,7 @@ export const STATUS = { COM_BATTLE_SET_FRD_ERR: { code: 20630, simStr: '设置情谊助战异常' }, COM_BATTLE_BLACKLIST: { code: 20633, simStr: '队伍中存在黑名单玩家' }, COM_BATTLE_BE_KICKED: { code: 20634, simStr: '您已被队伍踢出,无法加入'}, + COM_BATTLE_CREATE_CE_LIMIT: { code: 20635, simStr: '你的战力不足,不可设置该级别限制' }, // 共斗藏宝图合成 COM_BLUEPRT_QUALITY_CANNOT_COMPOSE: { code: 20630, simStr: '该品质藏宝图不可合成' }, COM_BLUEPRT_COUNT_ERROR: { code: 20631, simStr: '材料数量不足' },