🐞 fix(练兵场): 修复练兵场表错误,以及添加该表验证
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { readFileAndParse, parseGoodStr } from '../util'
|
import { readFileAndParse, parseGoodStr, parseNumberList } from '../util'
|
||||||
import { FILENAME } from '../../consts'
|
import { FILENAME } from '../../consts'
|
||||||
type KeysEnum<T> = { [P in keyof Required<T>]: true };
|
type KeysEnum<T> = { [P in keyof Required<T>]: true };
|
||||||
import { RewardInter } from '../interface';
|
import { RewardInter } from '../interface';
|
||||||
@@ -34,11 +34,18 @@ export function loadArmyTrainJuDian() {
|
|||||||
|
|
||||||
let arr = readFileAndParse(FILENAME.DIC_ARMY_TRAIN_JU_DIAN);
|
let arr = readFileAndParse(FILENAME.DIC_ARMY_TRAIN_JU_DIAN);
|
||||||
arr.forEach(o => {
|
arr.forEach(o => {
|
||||||
|
|
||||||
o.trainInstances = o.gkid.split('|').map(element => {
|
o.trainInstances = o.gkid.split('|').map(element => {
|
||||||
let arr = element.split('&');
|
let arr = element.split('&');
|
||||||
|
if(isNaN(parseInt(arr[0])) || isNaN(parseInt(arr[1])) || isNaN(parseInt(arr[2]))) {
|
||||||
|
throw new Error(`${o.id} ${element}`)
|
||||||
|
}
|
||||||
return {hid: parseInt(arr[0]), gkId: parseInt(arr[1]), progress: parseInt(arr[2])};
|
return {hid: parseInt(arr[0]), gkId: parseInt(arr[1]), progress: parseInt(arr[2])};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let heroid = parseNumberList(o.heroid);
|
||||||
|
o.trainInstances.forEach(instance => {
|
||||||
|
if(heroid.indexOf(instance.hid) == -1) throw new Error(`${o.id} ${instance.hid}`)
|
||||||
|
})
|
||||||
o.jinjieReward = parseGoodStr(o.jinjieReward);
|
o.jinjieReward = parseGoodStr(o.jinjieReward);
|
||||||
dicArmyTrainJuDian.set(o.id,_.pick(o, Object.keys(DicArmyTrainJuDianKeys)));
|
dicArmyTrainJuDian.set(o.id,_.pick(o, Object.keys(DicArmyTrainJuDianKeys)));
|
||||||
|
|
||||||
|
|||||||
@@ -405,7 +405,7 @@
|
|||||||
"name": "试炼1-封龙出山",
|
"name": "试炼1-封龙出山",
|
||||||
"count": 4,
|
"count": 4,
|
||||||
"heroid": "53&50&54&44",
|
"heroid": "53&50&54&44",
|
||||||
"gkid": "53161&200|50&162&200|54&163&200|44&164&200",
|
"gkid": "53&161&200|50&162&200|54&163&200|44&164&200",
|
||||||
"soloRewardRatio": 1,
|
"soloRewardRatio": 1,
|
||||||
"jinjieReward": "40005&1600|31002&300"
|
"jinjieReward": "40005&1600|31002&300"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user