This commit is contained in:
mamengke01
2020-12-18 21:32:39 +08:00
parent e5af16be8e
commit 8bbee53433
10 changed files with 597 additions and 126 deletions
+13 -2
View File
@@ -28,7 +28,7 @@ import { dicHeroWake } from "./dictionary/DicHeroWake";
import { dicRandomEffectPool } from './dictionary/DicRandomEffectPool';
import { dicStrengthenCost } from './dictionary/DicStrengthenCost';
import { dicRefine } from './dictionary/DicRefine';
import { dicHeroEquip } from './dictionary/DicHeroEquip';
export const gameData = {
blurprtCompose: dicBlueprtCompose,
blueprtPossibility: dicBlueprtPossibility,
@@ -67,7 +67,8 @@ export const gameData = {
randomEffectPool: dicRandomEffectPool,
strengthenCost: dicStrengthenCost,
refine: dicRefine,
jewels: jewels
jewels: jewels,
dicHeroEquip: dicHeroEquip
};
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
@@ -181,6 +182,16 @@ export function getFriendShipById(shipId: number, level: number) {
export function getGoodById(gid:number) {
return gameData.goods.get(gid);
}
export function getJewelById(gid:number) {
return gameData.jewels.get(gid);
}
export function getHeroEquipByClassId(classId:number) {
return gameData.dicHeroEquip.get(classId);
}
export function getHeroJob(jobId: number) {
const job = gameData.job.get(jobId);
return job;
}
@@ -0,0 +1,24 @@
// 藏宝图合成表
import { readJsonFile, parseNumberList } from '../util'
import { FILENAME } from '../../consts'
const _ = require('lodash');
export interface DicHeroEquip {
readonly itId: number;
readonly classId: Array<number>;
}
const str = readJsonFile(FILENAME.DIC_HERO_EQUIP);
let arr = JSON.parse(str);
type KeysEnum<T> = { [P in keyof Required<T>]: true };
const DicHeroEquipKeys: KeysEnum<DicHeroEquip> = {
itId: true,
classId: true
}
export const dicHeroEquip = new Map<number, DicHeroEquip>();
arr.forEach(o => {
o.classId = parseNumberList(o.classId);
dicHeroEquip.set(o.itId, _.pick(o, Object.keys(DicHeroEquipKeys)));
});
arr = undefined;
+3 -1
View File
@@ -59,4 +59,6 @@ arr.forEach(o => {
}
jobClassAndgrades.set(o.job_class+'_'+o.grade,{unlockLevel:o.unlockLevel, jobid:o.jobid});
});
});
arr = undefined;