装备
This commit is contained in:
+13
-2
@@ -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;
|
||||
@@ -59,4 +59,6 @@ arr.forEach(o => {
|
||||
}
|
||||
jobClassAndgrades.set(o.job_class+'_'+o.grade,{unlockLevel:o.unlockLevel, jobid:o.jobid});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
arr = undefined;
|
||||
Reference in New Issue
Block a user