寻宝:战力限制
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user