寻宝:去掉业务逻辑中 reduceCe 的处理

This commit is contained in:
liangtongchuan
2021-02-20 11:10:42 +08:00
parent ace2ad896e
commit 4bbdcf18b2
2 changed files with 2 additions and 7 deletions

View File

@@ -11,7 +11,7 @@ import { getGoodById, getBlueprtComposeByQuality, getBluePrtByQuality, getWarByI
import Role, { RoleModel } from '../../../db/Role';
import { STATUS } from '../../../consts/statusCode';
import { Application, BackendSession } from 'pinus';
import { resResult, getRandomByLen, reduceCe } from '../../../pubUtils/util';
import { resResult, getRandomByLen } from '../../../pubUtils/util';
import { RoleStatus, ComBattleTeamModel, ComBattleTeamType } from '../../../db/ComBattleTeam';
import { ItemModel } from '../../../db/Item';
import { handleFixedReward, addItems, handleCost } from '../../../services/rewardService';
@@ -95,7 +95,6 @@ export class ComBattleHandler {
const roleInfo = await RoleModel.findByRoleId(roleId);
const { lv } = roleInfo;
let { topFiveCe = 1000 } = roleInfo;
topFiveCe = reduceCe(topFiveCe);
if (comBtlLvInvalid(lv, lvRange)) {
return resResult(STATUS.COM_BATTLE_ASSIST_LV_NOT_ENOUGH);
@@ -175,7 +174,6 @@ export class ComBattleHandler {
if (teamStatus.roleIds.indexOf(roleId) !== -1) return resResult(STATUS.COM_BATTLE_DUP_ENTER);
let { lv = 1, headHid = 19, topFiveCe = 0, sHid = 19 } = await Role.findByRoleId(roleId);
topFiveCe = reduceCe(topFiveCe);
let { quality } = getGoodById(teamStatus.blueprtId);
if (lv < COM_BTL_CONST.ENABLE_LV) {
return resResult(STATUS.COM_BATTLE_LV_NOT_ENOUGH);

View File

@@ -10,7 +10,7 @@ import { STATUS } from './../consts/statusCode';
import { COM_TEAM_STATUS, CURRENCY_BY_TYPE, CURRENCY_TYPE, FRIEND_DROP_TYPE, COM_BTL_CONST, FRIEND_DROP_MAX } from './../consts';
import { RoleStatus, ComBattleTeamModel, ComBattleTeamType } from './../db/ComBattleTeam';
import { getBluePrtByQuality, getComBtlSetByQuality, getRewardByBlueprtId, getWarById, getWarIdByBlueprtId, comBtlRangeInfo, getGoodById, comBtlRangeByLv, getBossHpByBlueprtId } from "../pubUtils/gamedata";
import { getRandEelm, getRandValue, resResult, ratioReward, getRandValueByMinMax, getRandomWithWeight, decodeStr, getRobotInfo, reduceCe } from "../pubUtils/util";
import { getRandEelm, getRandValue, resResult, ratioReward, getRandValueByMinMax, getRandomWithWeight, decodeStr, getRobotInfo } from "../pubUtils/util";
import { getRandRobot, transBossHpArr } from "./battleService";
import { difference, omit } from 'underscore';
import { Channel, ChannelService } from 'pinus';
@@ -474,7 +474,6 @@ async function teammateValid(roleInfo: Partial<RoleType>, roleId: string, roleId
if(isBlack) return false;
let { topFiveCe } = roleInfo;
topFiveCe = reduceCe(topFiveCe);
if (topFiveCe < ceLimit) return false;
return true;
@@ -576,7 +575,6 @@ export async function hasEnoughBlueprt(roleId: string, blueprtId: number) {
export function addRoleToTeam(comTeam: MemComBtlTeam, roleInfo: RoleType, isCap: boolean, isFrd: boolean) {
const { roleId, roleName, headHid = 19, sHid = 19, lv } = roleInfo;
let { topFiveCe = 1000 } = roleInfo;
topFiveCe = reduceCe(topFiveCe);
const roleSt = new RoleStatus(roleId, roleName, isCap, isFrd, headHid, sHid, topFiveCe, lv);
addRoleStToTeam(comTeam, roleSt);
}
@@ -673,7 +671,6 @@ export async function addRobotsLater(comTeam: MemComBtlTeam, roleInfo: RoleType,
const { teamCode } = teamStatus;
const { roleId, lv } = roleInfo;
let { topFiveCe = 1000 } = roleInfo;
topFiveCe = reduceCe(topFiveCe);
if (validToJoin(teamStatus)) {
const robotCnt = 3 - teamStatus.roleIds.length;