全局修改:topFive字段
This commit is contained in:
@@ -39,7 +39,7 @@ export function getRandBlueprtId(qualityArr: number[], cnt = 1) {
|
||||
return res;
|
||||
}
|
||||
|
||||
export function getRandComBtlRobots(topFiveCe: number, ceLimit: number, lv: number, cnt: number) {
|
||||
export function getRandComBtlRobots(topLineupCe: number, ceLimit: number, lv: number, cnt: number) {
|
||||
let robotHeroes = getRandRobot(cnt); // 随机几个阵容
|
||||
let robotInfos = []; // 随机几个机器人信息
|
||||
for (let i = 0; i < cnt; i++) {
|
||||
@@ -53,7 +53,7 @@ export function getRandComBtlRobots(topFiveCe: number, ceLimit: number, lv: numb
|
||||
if (ceLimit) {
|
||||
robotCe = getRandValueByMinMax(ceLimit * COM_BTL_CONST.ROBOT_CE_LIMIT_MIN, ceLimit * COM_BTL_CONST.ROBOT_CE_LIMIT_MAX, 0);
|
||||
} else {
|
||||
robotCe = getRandValue(topFiveCe || 0, COM_BTL_CONST.ROBOT_CE_RATIO, 0);
|
||||
robotCe = getRandValue(topLineupCe || 0, COM_BTL_CONST.ROBOT_CE_RATIO, 0);
|
||||
}
|
||||
const robotLv = getRandValue(lv, COM_BTL_CONST.ROBOT_CE_RATIO, 0);
|
||||
const imgHid = robot[Math.floor(Math.random() * robot.length)];
|
||||
@@ -473,8 +473,8 @@ async function teammateValid(roleInfo: Partial<RoleType>, roleId: string, roleId
|
||||
const isBlack = await teammateInBlackList(roleId, roleIds);
|
||||
if(isBlack) return false;
|
||||
|
||||
let { topFiveCe } = roleInfo;
|
||||
if (topFiveCe < ceLimit) return false;
|
||||
let { topLineupCe } = roleInfo;
|
||||
if (topLineupCe < ceLimit) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -490,12 +490,12 @@ async function teammateValid(roleInfo: Partial<RoleType>, roleId: string, roleId
|
||||
*/
|
||||
export async function getValidTeammateRoleSt(roleId: string, roleIds: string[], ceLimit: number, quality: number) {
|
||||
let roleInfo = await RoleModel.findByRoleId(roleId);
|
||||
let { roleName, headHid = 19, sHid = 19, topFiveCe, lv } = roleInfo;
|
||||
let { roleName, headHid = 19, sHid = 19, topLineupCe, lv } = roleInfo;
|
||||
const valid = await teammateValid(roleInfo, roleId, roleIds, ceLimit);
|
||||
if (!valid) return null;
|
||||
|
||||
let isFrd = await getFrd(roleId, quality);
|
||||
const result = new RoleStatus(roleId, roleName, false, isFrd, headHid, sHid, topFiveCe, lv);
|
||||
const result = new RoleStatus(roleId, roleName, false, isFrd, headHid, sHid, topLineupCe, lv);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -574,8 +574,8 @@ 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;
|
||||
const roleSt = new RoleStatus(roleId, roleName, isCap, isFrd, headHid, sHid, topFiveCe, lv);
|
||||
let { topLineupCe = 1000 } = roleInfo;
|
||||
const roleSt = new RoleStatus(roleId, roleName, isCap, isFrd, headHid, sHid, topLineupCe, lv);
|
||||
addRoleStToTeam(comTeam, roleSt);
|
||||
}
|
||||
|
||||
@@ -670,7 +670,7 @@ export async function addRobotsLater(comTeam: MemComBtlTeam, roleInfo: RoleType,
|
||||
const teamStatus = comTeam;
|
||||
const { teamCode } = teamStatus;
|
||||
const { roleId, lv } = roleInfo;
|
||||
let { topFiveCe = 1000 } = roleInfo;
|
||||
let { topLineupCe = 1000 } = roleInfo;
|
||||
|
||||
if (validToJoin(teamStatus)) {
|
||||
const robotCnt = 3 - teamStatus.roleIds.length;
|
||||
@@ -679,7 +679,7 @@ export async function addRobotsLater(comTeam: MemComBtlTeam, roleInfo: RoleType,
|
||||
setTimeout(async () => {
|
||||
const curTeamStatus = teamMap.get(teamCode);
|
||||
if (validToJoin(curTeamStatus)) {
|
||||
await addRobotsToTeam(curTeamStatus, roleId, topFiveCe, lv, teamMap, teamDisTimer, channel, 1);
|
||||
await addRobotsToTeam(curTeamStatus, roleId, topLineupCe, lv, teamMap, teamDisTimer, channel, 1);
|
||||
}
|
||||
}, joinTime);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user