远征:在功能开启前不随机对手
This commit is contained in:
@@ -106,6 +106,7 @@ import { Talent } from "../db/Hero";
|
||||
import { dicEquipStrengthAttr, loadEquipStrengthAttr } from './dictionary/DicEquipStrengthAttr';
|
||||
import { dicTowerGift, loadTowerGift } from './dictionary/DicTowerGift';
|
||||
import { dicTowerPvpSubAttr, loadTowerPvpSubAttr } from './dictionary/DicTowerPvpSubAttr';
|
||||
import { dicSystemOpenTime, loadSystemOpenTime } from "./dictionary/DicSystemOpenTime";
|
||||
|
||||
export const gameData = {
|
||||
daily: dicDaily,
|
||||
@@ -263,6 +264,7 @@ export const gameData = {
|
||||
talentPointOfJob: talentPointOfJob,
|
||||
equipStrengthAttr: dicEquipStrengthAttr,
|
||||
towerPvpSubAttr: dicTowerPvpSubAttr,
|
||||
sysOpenTime: dicSystemOpenTime,
|
||||
};
|
||||
|
||||
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
|
||||
@@ -1063,6 +1065,7 @@ function loadDatas() {
|
||||
loadHeroTalent();
|
||||
loadEquipStrengthAttr();
|
||||
loadTowerPvpSubAttr();
|
||||
loadSystemOpenTime();
|
||||
}
|
||||
|
||||
// 重载dicParam
|
||||
|
||||
43
shared/pubUtils/dictionary/DicSystemOpenTime.ts
Normal file
43
shared/pubUtils/dictionary/DicSystemOpenTime.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
// 兵种表
|
||||
import { readFileAndParse, parseNumberList } from '../util'
|
||||
import { FILENAME, } from '../../consts'
|
||||
const _ = require('lodash');
|
||||
|
||||
export interface DicSystemOpenTime {
|
||||
// 唯一id
|
||||
readonly id: number;
|
||||
// 开启关卡id
|
||||
readonly warId: number;
|
||||
// 开启玩家等级
|
||||
readonly lv: number;
|
||||
}
|
||||
|
||||
type KeysEnum<T> = { [P in keyof Required<T>]: true };
|
||||
const DicSystemOpenTimeKeys: KeysEnum<DicSystemOpenTime> = {id: true, warId: true, lv: true};
|
||||
|
||||
export const dicSystemOpenTime = new Map<number, DicSystemOpenTime>();
|
||||
|
||||
export function loadSystemOpenTime() {
|
||||
dicSystemOpenTime.clear();
|
||||
|
||||
let arr = readFileAndParse(FILENAME.DIC_SYSTEM_OPEN_TIME);
|
||||
|
||||
arr.forEach(o => {
|
||||
if(o.isPlayer) {
|
||||
o.seid = parseNumberList(o.seid);
|
||||
let { warId, lv } = parseLimit(o.limit);
|
||||
o.warId = warId;
|
||||
o.lv = lv;
|
||||
dicSystemOpenTime.set(o.jobid, _.pick(o, Object.keys(DicSystemOpenTimeKeys)));
|
||||
}
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
|
||||
function parseLimit(str: string) {
|
||||
let arr = parseNumberList(str);
|
||||
if(arr[0] == 0) {
|
||||
return { warId: arr[1], lv: 0 }
|
||||
}
|
||||
return { warId: 0, lv: arr[0] }
|
||||
}
|
||||
Reference in New Issue
Block a user