寻宝:等级限制
This commit is contained in:
@@ -21,7 +21,7 @@ import { getTeamSearchByQuality, rmRoleFromQueue } from './redisService';
|
||||
import { addUserToChannel } from './roleService';
|
||||
import { ChannelUser } from '../domain/ChannelUser';
|
||||
import { checkActivityTask, checkTaskInComBattleEnd } from './taskService';
|
||||
import { getRewardByBlueprtId, gameData, comBtlRangeByLv, getBossHpByBlueprtId } from '../pubUtils/data';
|
||||
import { getRewardByBlueprtId, gameData, getBossHpByBlueprtId } from '../pubUtils/data';
|
||||
import { getFriendPointObject } from '../pubUtils/itemUtils';
|
||||
import { DicWar } from '../pubUtils/dictionary/DicWar';
|
||||
import { getZeroPointD } from '../pubUtils/timeUtil';
|
||||
@@ -355,10 +355,10 @@ export function clearRobotHurtTimer(teamStatus, robotHurtTimer: Map<string, Node
|
||||
* @returns
|
||||
*/
|
||||
export function comBtlLvInvalid(lv: number, lvRange: number) {
|
||||
const lvs = gameData.comBtlLvRange.get(lvRange);
|
||||
if (!lvs) return true;
|
||||
const minLv = lvs[0];
|
||||
return lv < minLv;
|
||||
const range = gameData.comBtlLvRange.get(lvRange);
|
||||
if (!range) return true;
|
||||
let { min, max } = range;
|
||||
return lv >= min && lv <= max;
|
||||
}
|
||||
|
||||
export async function dismissTeam(teamStatus: MemComBtlTeam, teamMap: Map<string, MemComBtlTeam>, roleId: string, teamDisTimer: Map<string, NodeJS.Timer>, channel) {
|
||||
@@ -550,8 +550,7 @@ export function blueprtIdValid(id: number) {
|
||||
* @returns
|
||||
*/
|
||||
export function createComTeamData(teamCode: string, pub: boolean, blueprtId: number, capId: string, ceLimit: number) {
|
||||
const { lvLimited, quality } = gameData.goods.get(blueprtId);
|
||||
const lvRange = comBtlRangeByLv(lvLimited);
|
||||
const { equipLvl, quality } = gameData.goods.get(blueprtId);
|
||||
const { bossHpSum, bossHpArr } = getBossHpByBlueprtId(blueprtId);
|
||||
const curRnd = 0;
|
||||
const roleCnt = 1;
|
||||
@@ -560,7 +559,7 @@ export function createComTeamData(teamCode: string, pub: boolean, blueprtId: num
|
||||
const bossHp = bossHpSum;
|
||||
const status = COM_TEAM_STATUS.DEFAULT;
|
||||
return {
|
||||
teamCode, pub, blueprtId, status, capId, ceLimit, bossHp, bossCurHp, quality, bossHpArr: transBossHpArr(bossHpArr), curRnd, roleCnt, timeout, lvRange
|
||||
teamCode, pub, blueprtId, status, capId, ceLimit, bossHp, bossCurHp, quality, bossHpArr: transBossHpArr(bossHpArr), curRnd, roleCnt, timeout, lvRange: equipLvl
|
||||
};
|
||||
}
|
||||
|
||||
@@ -617,8 +616,8 @@ export function addRoleStToTeam(comTeam: MemComBtlTeam, roleSt: RoleStatus) {
|
||||
* @returns
|
||||
*/
|
||||
export async function addValidSearchingRoles(comTeam: MemComBtlTeam, channelService: ChannelService) {
|
||||
const { quality, lvLimited } = gameData.goods.get(comTeam.blueprtId);
|
||||
let teammates = await getTeamSearchByQuality(quality, comBtlRangeByLv(lvLimited));
|
||||
const { quality, equipLvl } = gameData.goods.get(comTeam.blueprtId);
|
||||
let teammates = await getTeamSearchByQuality(quality, equipLvl);
|
||||
if (teammates && teammates.length) {
|
||||
for (let teammate of teammates) {
|
||||
const { roleId: teammateRoleId, sid } = teammate;
|
||||
|
||||
@@ -155,16 +155,6 @@ export const COM_BTL_CONST = {
|
||||
ASSIST_REWARD_RATIO: 0.5, // 队员奖励比例
|
||||
}
|
||||
|
||||
// 寻宝等级区间
|
||||
export const COM_BTL_LV_RANGE = [
|
||||
{ id: 1, minLv: 1, maxLv: 19 },
|
||||
{ id: 2, minLv: 20, maxLv: 39 },
|
||||
{ id: 3, minLv: 40, maxLv: 59 },
|
||||
{ id: 4, minLv: 60, maxLv: 79 },
|
||||
{ id: 5, minLv: 80, maxLv: 99 },
|
||||
{ id: 6, minLv: 100, maxLv: 100 },
|
||||
];
|
||||
|
||||
// 机器人名字随机
|
||||
export const COM_BATTLE_ROBOT_ID_NAME = [
|
||||
{ robotRoleId: 'cd9h0iy8', robotRoleName: '徐埋农' },
|
||||
|
||||
@@ -18,7 +18,7 @@ import { dicTowerTask, loadTowerTask } from "./dictionary/DicTowerTask";
|
||||
import { dicWar, dicWarPvp, dicDailyWarByType, loadWar } from "./dictionary/DicWar";
|
||||
import { dicWarJson, loadWarJson } from "./dictionary/DicWarJson";
|
||||
import { dicXunbao, loadXunbao } from "./dictionary/DicXunbao";
|
||||
import { SPECIAL_ATTR, COM_BTL_LV_RANGE } from "../consts";
|
||||
import { SPECIAL_ATTR } from "../consts";
|
||||
import { dicFashions, loadFashions } from "./dictionary/DicFashions";
|
||||
import { friendShips, friendShipHidAandIds, loadFriendShip } from "./dictionary/DicFriendShip";
|
||||
import { maxFriendShipLv, dicFriendShipLevelMap, loadFriendShipLevel } from "./dictionary/DicFriendShipLevel";
|
||||
@@ -207,7 +207,7 @@ export const gameData = {
|
||||
gachaTurntable: new Array<{quality: number, count: number}>(),
|
||||
heroTransPiece: new Map<number, number>(),
|
||||
giftPackage: dicGiftPackage,
|
||||
comBtlLvRange: new Map<number, Array<number>>(),
|
||||
comBtlLvRange: new Map<number, {min: number, max: number}>(),
|
||||
recruit: dicRecruit,
|
||||
rmb: dicRMB,
|
||||
activityType: dicActivityType,
|
||||
@@ -348,24 +348,10 @@ export function getRewardByBlueprtId(blueprtId: number) {
|
||||
}
|
||||
|
||||
function parseComBtlLvRange() {
|
||||
let map = new Map<number, Array<number>>()
|
||||
const lvRange = COM_BTL_LV_RANGE;
|
||||
const lvRange = decodeArrayListStr(param.TREASURE.TREASURE_ASSIST_LIMITED);
|
||||
lvRange.forEach(range => {
|
||||
const lvs = [];
|
||||
for (let lv = range.minLv; lv <= range.maxLv; lv++) {
|
||||
lvs.push(lv);
|
||||
}
|
||||
map.set(range.id, lvs);
|
||||
gameData.comBtlLvRange.set(parseInt(range[0]), { min: parseInt(range[1]), max: parseInt(range[2]) });
|
||||
});
|
||||
gameData.comBtlLvRange = map
|
||||
}
|
||||
|
||||
export function comBtlRangeByLv(lv: number) {
|
||||
for (let [k, v] of gameData.comBtlLvRange) {
|
||||
if (v.indexOf(lv) !== -1) {
|
||||
return k;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function comBtlRanges() {
|
||||
|
||||
Reference in New Issue
Block a user