镇念塔:节点奖励
This commit is contained in:
@@ -104,6 +104,7 @@ import { dicMainStarBox, dicMainStarBoxByChapter, loadMainStarBox } from './dict
|
||||
import { dicHeroTalent, initTalents, loadHeroTalent } from './dictionary/DicHeroTalent';
|
||||
import { Talent } from "../db/Hero";
|
||||
import { dicEquipStrengthAttr, loadEquipStrengthAttr } from './dictionary/DicEquipStrengthAttr';
|
||||
import { dicTowerGift, loadTowerGift } from './dictionary/DicTowerGift';
|
||||
|
||||
export const gameData = {
|
||||
daily: dicDaily,
|
||||
@@ -127,6 +128,7 @@ export const gameData = {
|
||||
se: dicSe,
|
||||
tower: dicTower,
|
||||
towerTask: dicTowerTask,
|
||||
towerGift: dicTowerGift,
|
||||
war: dicWar,
|
||||
warJson: dicWarJson,
|
||||
dailyWarByType: dicDailyWarByType,
|
||||
@@ -974,6 +976,7 @@ function loadDatas() {
|
||||
loadSe();
|
||||
loadTower();
|
||||
loadTowerTask();
|
||||
loadTowerGift();
|
||||
loadWar();
|
||||
loadWarJson();
|
||||
loadXunbao();
|
||||
|
||||
34
shared/pubUtils/dictionary/DicTowerGift.ts
Normal file
34
shared/pubUtils/dictionary/DicTowerGift.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
// 物品表
|
||||
import { readFileAndParse, parseGoodStr, } from '../util'
|
||||
import { FILENAME, } from '../../consts'
|
||||
import { RewardInter } from '../interface';
|
||||
const _ = require('lodash');
|
||||
|
||||
export interface DicTowerGift {
|
||||
// 奖励id
|
||||
readonly id: number;
|
||||
// 镇念塔层数
|
||||
readonly towerLv: number;
|
||||
// 奖励
|
||||
readonly reward: RewardInter[];
|
||||
}
|
||||
|
||||
type KeysEnum<T> = { [P in keyof Required<T>]: true };
|
||||
const DicTowerGiftKeys: KeysEnum<DicTowerGift> = {
|
||||
id: true,
|
||||
towerLv: true,
|
||||
reward: true,
|
||||
}
|
||||
export const dicTowerGift = new Map<number, DicTowerGift>();
|
||||
|
||||
export function loadTowerGift() {
|
||||
dicTowerGift.clear();
|
||||
let arr = readFileAndParse(FILENAME.DIC_TOWER_GIFT);
|
||||
|
||||
arr.forEach(o => {
|
||||
o.reward = parseGoodStr(o.reward);
|
||||
dicTowerGift.set(o.id, _.pick(o, Object.keys(DicTowerGiftKeys)));
|
||||
});
|
||||
|
||||
arr = undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user