练兵场结算
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { readJsonFile, parseGoodStr } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
type KeysEnum<T> = { [P in keyof Required<T>]: true };
|
||||
import { RewardInter } from '../interface';
|
||||
const _ = require('lodash');
|
||||
|
||||
export interface DicArmyTrainJuDian {
|
||||
@@ -9,12 +10,15 @@ export interface DicArmyTrainJuDian {
|
||||
// 目标品质
|
||||
readonly trainInstances: Array<{hid: number, warId: number, progress: number}>;
|
||||
readonly heroRewards: Array<{id: number, count: number}>;
|
||||
// 进阶奖励
|
||||
readonly jinjieReward: RewardInter[];
|
||||
}
|
||||
|
||||
const DicArmyTrainJuDianKeys: KeysEnum<DicArmyTrainJuDian> = {
|
||||
id: true,
|
||||
trainInstances: true,
|
||||
heroRewards: true
|
||||
heroRewards: true,
|
||||
jinjieReward: true
|
||||
};
|
||||
|
||||
const str = readJsonFile(FILENAME.DIC_ARMY_TRAIN_JU_DIAN);
|
||||
@@ -26,7 +30,8 @@ arr.forEach(o => {
|
||||
let arr = element.split('&');
|
||||
return {hid: parseInt(arr[0]), warId: parseInt(arr[1]), progress: parseInt(arr[2])};
|
||||
});
|
||||
|
||||
o.jinjieReward = parseGoodStr(o.jinjieReward);
|
||||
|
||||
o.heroRewards = parseGoodStr(o.shilianReward);
|
||||
|
||||
dicArmyTrainJuDian.set(o.id,_.pick(o, Object.keys(DicArmyTrainJuDianKeys)));
|
||||
|
||||
@@ -80,8 +80,7 @@ export interface DicTrainBase {
|
||||
readonly difficultyRatio: number;
|
||||
// 据点奖励增长系数
|
||||
readonly judianRewardRatio: number;
|
||||
// 进阶奖励
|
||||
readonly jinjieReward: RewardInter[];
|
||||
|
||||
}
|
||||
|
||||
const DicTrainKeys: KeysEnum<DicTrainBase> = {
|
||||
@@ -90,7 +89,6 @@ const DicTrainKeys: KeysEnum<DicTrainBase> = {
|
||||
trainLevel: true,
|
||||
difficultyRatio: true,
|
||||
judianRewardRatio: true,
|
||||
jinjieReward: true
|
||||
};
|
||||
|
||||
// 捐献所
|
||||
@@ -200,7 +198,6 @@ const strTrain = readJsonFile(FILENAME.DIC_GUILD_TRAIN_BASE);
|
||||
let arrTrain = JSON.parse(strTrain);
|
||||
arrTrain.forEach(o => {
|
||||
setStructureConsume(o);
|
||||
o.jinjieReward = parseGoodStr(o.jinjieReward);
|
||||
dicTrainBase.set(o.level, _.pick(o, Object.keys(DicTrainKeys)));
|
||||
});
|
||||
arrTrain = undefined;
|
||||
|
||||
Reference in New Issue
Block a user