寻宝:移除金色藏宝图相关代码
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { difference } from 'underscore';
|
||||
/*
|
||||
* @Author: 梁桐川
|
||||
* @Date: 2020-11-30 15:05:48
|
||||
* @Last Modified by: 梁桐川
|
||||
* @Last Modified time: 2020-12-03 21:36:00
|
||||
*/
|
||||
import { IT_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, COM_TEAM_STATUS, COM_BTL_CONST, GOOD_QUALITY, CONSUME_TYPE } from './../../../consts';
|
||||
import { getGoodById, getBossHpByBlueprtId, getComBtlSetByQuality, getBlueprtComposeByQuality, getBluePrtByQuality, getWarById, getWarIdByBlueprtId, comBtlRangeInfo, comBtlRangeByLv } from '../../../pubUtils/gamedata';
|
||||
import { IT_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, COM_TEAM_STATUS, COM_BTL_CONST, CONSUME_TYPE, COM_BTL_QUALITY, QUALITY_TYPE } from './../../../consts';
|
||||
import { getGoodById, getBossHpByBlueprtId, getBlueprtComposeByQuality, getBluePrtByQuality, getWarById, getWarIdByBlueprtId, comBtlRangeInfo, comBtlRangeByLv } from '../../../pubUtils/gamedata';
|
||||
import { ComBattleTeamModel, BossHp } from '../../../db/ComBattleTeam';
|
||||
import Role, { RoleModel } from '../../../db/Role';
|
||||
import { STATUS } from '../../../consts/statusCode';
|
||||
@@ -96,7 +97,7 @@ export class ComBattleHandler {
|
||||
console.log('createTeam msg: ', msg);
|
||||
// 检查藏宝图Id是否合法
|
||||
let goodData = getGoodById(blueprtId);
|
||||
if (!goodData || goodData.itid !== IT_TYPE.BLUEPRT) return resResult(STATUS.COM_BATTLE_BLUEPRT_INVALID);
|
||||
if (!goodData || goodData.itid !== IT_TYPE.BLUEPRT || COM_BTL_QUALITY.indexOf(goodData.quality) === -1) return resResult(STATUS.COM_BATTLE_BLUEPRT_INVALID);
|
||||
|
||||
// 检查藏宝图是否足够
|
||||
let { lv, headHid = 19, topFiveCe = 100, sHid = 19 } = await RoleModel.findByRoleId(roleId);
|
||||
@@ -211,6 +212,9 @@ export class ComBattleHandler {
|
||||
if (comBtlLvInvalid(lv, lvRange)) {
|
||||
return resResult(STATUS.COM_BATTLE_ASSIST_LV_NOT_ENOUGH);
|
||||
}
|
||||
if (difference(qualityArr, COM_BTL_QUALITY).length !== 0) {
|
||||
return resResult(STATUS.COM_BLUEPRT_QUALITY_ERROR);
|
||||
}
|
||||
|
||||
const team = await ComBattleTeamModel.getOtherTeamByQualityAndSt(roleId, qualityArr, COM_TEAM_STATUS.DEFAULT, lvRange, topFiveCe);
|
||||
// TODO: 有匹配的队伍还需要重新 joinTeam 加入,有失败可能,体验不好,需优化
|
||||
@@ -274,7 +278,7 @@ export class ComBattleHandler {
|
||||
let roleId = session.get('roleId');
|
||||
let sid = session.get('sid');
|
||||
|
||||
await rmRoleFromQueue(roleId, sid, GOOD_QUALITY, null);
|
||||
await rmRoleFromQueue(roleId, sid, COM_BTL_QUALITY, null);
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
|
||||
@@ -713,7 +717,9 @@ export class ComBattleHandler {
|
||||
if (memTeam) {
|
||||
({ roleStatus, status, bossHpArr } = memTeam);
|
||||
} else {
|
||||
({ roleStatus, status, bossHpArr } = await ComBattleTeamModel.getTeamByCode(teamCode));
|
||||
let dbTeam = await ComBattleTeamModel.getTeamByCode(teamCode);
|
||||
if (!dbTeam) return resResult(STATUS.COM_BATTLE_TEAM_INVALID);
|
||||
({ roleStatus, status, bossHpArr } = dbTeam);
|
||||
}
|
||||
return resResult(STATUS.SUCCESS, { teamInfo: {status, teamCode, roleStatus, bossHpArr} });
|
||||
}
|
||||
@@ -763,7 +769,7 @@ export class ComBattleHandler {
|
||||
let roleId = session.get('roleId');
|
||||
let cntMap = await getAssistTimesByQuality(roleId);
|
||||
let cnt = [];
|
||||
for (let i = 0; i < 5; ++i) {
|
||||
for (let i = 0; i < COM_BTL_QUALITY.length; ++i) {
|
||||
cnt[i] = cntMap.get(i + 1) || 0;
|
||||
}
|
||||
return resResult(STATUS.SUCCESS, {cnt});
|
||||
@@ -779,7 +785,7 @@ export class ComBattleHandler {
|
||||
let roleId = session.get('roleId');
|
||||
let cntMap = await getAssistTimesByQuality(roleId);
|
||||
let cnt = [];
|
||||
for (let i = 0; i < 5; ++i) {
|
||||
for (let i = 0; i < COM_BTL_QUALITY.length; ++i) {
|
||||
cnt[i] = cntMap.get(i + 1) || 0;
|
||||
}
|
||||
const blueprts = await ItemModel.findByRoleAndType(roleId, CONSUME_TYPE.BLUEPRT);
|
||||
|
||||
Reference in New Issue
Block a user