军团:试炼表修改
This commit is contained in:
@@ -4,40 +4,58 @@ type KeysEnum<T> = { [P in keyof Required<T>]: true };
|
||||
import { RewardInter } from '../interface';
|
||||
const _ = require('lodash');
|
||||
|
||||
|
||||
export interface DicArmyTrainJuDian {
|
||||
|
||||
readonly id: number;
|
||||
// 目标品质
|
||||
readonly trainInstances: Array<{hid: number, warId: number, progress: number}>;
|
||||
readonly heroRewards: Array<{id: number, count: number}>;
|
||||
// 进阶奖励
|
||||
readonly trainLv: number;
|
||||
// 训练场多个难度组成的gk,每个难度一个warId,而这个gkId指trainGk_info这张表的id
|
||||
readonly trainInstances: Array<{hid: number, gkId: number, progress: number}>;
|
||||
// 进阶奖励
|
||||
readonly jinjieReward: RewardInter[];
|
||||
readonly soloRewardRatio: number;
|
||||
}
|
||||
|
||||
const DicArmyTrainJuDianKeys: KeysEnum<DicArmyTrainJuDian> = {
|
||||
id: true,
|
||||
trainLv: true,
|
||||
trainInstances: true,
|
||||
heroRewards: true,
|
||||
jinjieReward: true,
|
||||
soloRewardRatio: true
|
||||
};
|
||||
|
||||
export const dicArmyTrainJuDian = new Map<number, DicArmyTrainJuDian>();
|
||||
export const dicLastGuildTrainIdOfLv = new Map<number, number>(); // 每级试炼场等级的最后据点id
|
||||
export const dicFirstGuildTrainIdOfLv = new Map<number, number>(); // 每级试炼场等级的最先据点id
|
||||
export function loadArmyTrainJuDian() {
|
||||
dicLastGuildTrainIdOfLv.clear();
|
||||
dicFirstGuildTrainIdOfLv.clear();
|
||||
|
||||
let arr = readFileAndParse(FILENAME.DIC_ARMY_TRAIN_JU_DIAN);
|
||||
|
||||
arr.forEach(o => {
|
||||
|
||||
o.trainInstances = o.gkid.split('|').map(element => {
|
||||
let arr = element.split('&');
|
||||
return {hid: parseInt(arr[0]), warId: parseInt(arr[1]), progress: parseInt(arr[2])};
|
||||
return {hid: parseInt(arr[0]), gkId: 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)));
|
||||
|
||||
if(!dicLastGuildTrainIdOfLv.has(o.trainLv)) {
|
||||
dicLastGuildTrainIdOfLv.set(o.trainLv, o.id);
|
||||
} else {
|
||||
if(dicLastGuildTrainIdOfLv.get(o.trainLv) < o.id) {
|
||||
dicLastGuildTrainIdOfLv.set(o.trainLv, o.id);
|
||||
}
|
||||
}
|
||||
|
||||
if(!dicFirstGuildTrainIdOfLv.has(o.trainLv)) {
|
||||
dicFirstGuildTrainIdOfLv.set(o.trainLv, o.id);
|
||||
} else {
|
||||
if(dicFirstGuildTrainIdOfLv.get(o.trainLv) > o.id) {
|
||||
dicLastGuildTrainIdOfLv.set(o.trainLv, o.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
38
shared/pubUtils/dictionary/DicGuildTrainInfo.ts
Normal file
38
shared/pubUtils/dictionary/DicGuildTrainInfo.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { readFileAndParse, 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 DicGuildTrainInfo {
|
||||
|
||||
readonly id: number;
|
||||
readonly trainId: number;
|
||||
readonly trainLv: number; // 试炼场等级
|
||||
readonly heroId: number;
|
||||
readonly heroRewards: RewardInter[]; // 翻牌子的奖励,随机其中一个
|
||||
|
||||
}
|
||||
|
||||
const DicGuildTrainInfoKeys: KeysEnum<DicGuildTrainInfo> = {
|
||||
id: true,
|
||||
trainId: true,
|
||||
trainLv: true,
|
||||
heroId: true,
|
||||
heroRewards: true
|
||||
};
|
||||
|
||||
export const dicGuildTrainInfo = new Map<string, DicGuildTrainInfo>();
|
||||
export function loadGuildTrainInfo() {
|
||||
|
||||
let arr = readFileAndParse(FILENAME.DIC_ARMY_TRAIN_INFO);
|
||||
|
||||
arr.forEach(o => {
|
||||
o.heroId = o.heroid;
|
||||
o.heroRewards = parseGoodStr(o.shilianReward); // TODO 这个改到
|
||||
|
||||
dicGuildTrainInfo.set(`${o.trainId}_${o.heroId}`,_.pick(o, Object.keys(DicGuildTrainInfoKeys)));
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
@@ -83,8 +83,6 @@ export interface DicTrainBase {
|
||||
readonly difficultyRatio: number;
|
||||
// 据点奖励增长系数
|
||||
readonly judianRewardRatio: number;
|
||||
|
||||
readonly shilianRewardRatio: number;
|
||||
}
|
||||
|
||||
const DicTrainKeys: KeysEnum<DicTrainBase> = {
|
||||
@@ -92,8 +90,7 @@ const DicTrainKeys: KeysEnum<DicTrainBase> = {
|
||||
level: true,
|
||||
trainLevel: true,
|
||||
difficultyRatio: true,
|
||||
judianRewardRatio: true,
|
||||
shilianRewardRatio: true
|
||||
judianRewardRatio: true
|
||||
};
|
||||
|
||||
// 捐献所
|
||||
|
||||
Reference in New Issue
Block a user