全局修改:topFive字段

This commit is contained in:
luying
2021-02-25 13:36:10 +08:00
parent 47c3c093f2
commit 56efab8cb7
17 changed files with 224 additions and 224 deletions
@@ -94,7 +94,7 @@ export class ComBattleHandler {
const { qualityArr, lvRange = 1 } = msg;
const roleInfo = await RoleModel.findByRoleId(roleId);
const { lv } = roleInfo;
let { topFiveCe = 1000 } = roleInfo;
let { topLineupCe = 1000 } = roleInfo;
if (comBtlLvInvalid(lv, lvRange)) {
return resResult(STATUS.COM_BATTLE_ASSIST_LV_NOT_ENOUGH);
@@ -103,7 +103,7 @@ export class ComBattleHandler {
return resResult(STATUS.COM_BLUEPRT_QUALITY_ERROR);
}
const teams = await ComBattleTeamModel.getOtherTeamByQualityAndSt(roleId, qualityArr, COM_TEAM_STATUS.DEFAULT, lvRange, topFiveCe);
const teams = await ComBattleTeamModel.getOtherTeamByQualityAndSt(roleId, qualityArr, COM_TEAM_STATUS.DEFAULT, lvRange, topLineupCe);
const team: ComBattleTeamType = await oneTeamNotInBlack(teams, roleId);
if (team && team.roleIds.length < 3 && team.status === COM_TEAM_STATUS.DEFAULT && team.roleIds.indexOf(roleId) === -1) {
return resResult(STATUS.SUCCESS, {teamCode: team.teamCode});
@@ -130,7 +130,7 @@ export class ComBattleHandler {
addUserToChannel(channel, new ChannelUser(roleId, sid));
// 创建并添加机器人
await addRobotsToTeam(comTeam, roleId, topFiveCe, lv, thiz.teamMap, thiz.teamDisTimer, channel, 2);
await addRobotsToTeam(comTeam, roleId, topLineupCe, lv, thiz.teamMap, thiz.teamDisTimer, channel, 2);
await ComBattleTeamModel.createTeam(comTeam);
thiz.teamMap.set(teamCode, comTeam);
@@ -172,14 +172,14 @@ export class ComBattleHandler {
if (!teamStatus || teamStatus.status !== COM_TEAM_STATUS.DEFAULT) return resResult(STATUS.COM_BATTLE_TEAM_INVALID);
if (teamIsFullToStart(teamStatus)) return resResult(STATUS.COM_BATTLE_MEMBER_LIMIT);
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);
let { lv = 1, headHid = 19, topLineupCe = 0, sHid = 19 } = await Role.findByRoleId(roleId);
let { quality } = getGoodById(teamStatus.blueprtId);
if (lv < COM_BTL_CONST.ENABLE_LV) {
return resResult(STATUS.COM_BATTLE_LV_NOT_ENOUGH);
} else if (comBtlLvInvalid(lv, teamStatus.lvRange)) {
return resResult(STATUS.COM_BATTLE_ASSIST_LV_NOT_ENOUGH);
} else if (topFiveCe < teamStatus.ceLimit) {
} else if (topLineupCe < teamStatus.ceLimit) {
return resResult(STATUS.COM_BATTLE_CE_LIMIT);
}
@@ -189,7 +189,7 @@ export class ComBattleHandler {
// 加入队伍
if (!validToJoin(teamStatus, roleId)) return resResult(STATUS.COM_BATTLE_TEAM_INVALID);
let roleStatus = new RoleStatus(roleId, roleName, false, isFrd, headHid, sHid, topFiveCe, lv);
let roleStatus = new RoleStatus(roleId, roleName, false, isFrd, headHid, sHid, topLineupCe, lv);
const team = await ComBattleTeamModel.addRole(teamCode, roleStatus);
if (!team) {
return resResult(STATUS.COM_BATTLE_JOIN_ERR);
@@ -357,8 +357,8 @@ export class ComBattleHandler {
}
}
if (!roleSt) return;
let { topFiveCe, lv } = roleSt;
await addRobotsToTeam(curTeamStatus, roleId, topFiveCe, lv, thiz.teamMap, thiz.teamDisTimer, channel, 3 - curTeamStatus.roleIds.length);
let { topLineupCe, lv } = roleSt;
await addRobotsToTeam(curTeamStatus, roleId, topLineupCe, lv, thiz.teamMap, thiz.teamDisTimer, channel, 3 - curTeamStatus.roleIds.length);
}
}, COM_BTL_CONST.ASSIST_TIME);
return resResult(STATUS.SUCCESS);
@@ -643,11 +643,11 @@ export class FriendHandler {
let dbHeroes = await HeroModel.findByRole(oppoRoleId);
let role = await RoleModel.findByRoleId(oppoRoleId, null, true);
let { topFive, topFiveCe, towerLv } = role;
let { topLineup, topLineupCe, towerLv } = role;
let heroes = new Array<PlayerDetailHero>();
for(let {hid, lv, star, colorStar, quality } of dbHeroes) {
let hasHero = topFive.find(cur => cur.hid == hid);
let hasHero = topLineup.find(cur => cur.hid == hid);
if(hasHero) {
heroes.push({
actorId: hid, lv, star, colorStar, quality,
@@ -657,7 +657,7 @@ export class FriendHandler {
}
let rank = await getMyRank(REDIS_KEY.PVP_RANK, 0, oppoRoleId);//去redis中获取排名
result = new PlayerDetail({...role, defCe: topFiveCe, heroes});
result = new PlayerDetail({...role, defCe: topLineupCe, heroes});
result.setWarStar(role.warStar, rank, towerLv);
return resResult(STATUS.SUCCESS, result);
@@ -72,8 +72,8 @@ export class RoleHandler {
async getRoleInfo(msg: {targetRoleId: string}, session: BackendSession) {
let { targetRoleId } = msg;
let { roleId, roleName, headHid = 1, ce = 0, topFive, topFiveCe = 0 } = await RoleModel.findByRoleId(targetRoleId);
return resResult(STATUS.SUCCESS, { roleId, roleName, headHid, ce, topFive, topFiveCe });
let { roleId, roleName, headHid = 1, ce = 0, topLineup, topLineupCe = 0 } = await RoleModel.findByRoleId(targetRoleId);
return resResult(STATUS.SUCCESS, { roleId, roleName, headHid, ce, topLineup, topLineupCe });
}
//爵位