41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
/**
|
|
* 试炼难度配置表
|
|
*/
|
|
|
|
import { parseGoodStr, readFileAndParse } from '../util'
|
|
import { FILENAME } from '../../consts'
|
|
import { RewardInter } from '../interface';
|
|
|
|
export interface DicRougeLayerPlan {
|
|
readonly id: number;
|
|
readonly planId: number; // 试炼类型
|
|
readonly layerIndex: number; // 层
|
|
readonly nodeNumPlan: number; // 每层可以随机的点的数量
|
|
readonly nodePlan: number; // 每层可以随机到的节点
|
|
readonly rewardPlan: number; // 每层可以赠送的奖励
|
|
readonly shopPlan: number; // 该层可以随机到的商店方案
|
|
readonly takeoutReward: RewardInter[]; //额外奖励
|
|
readonly spiritPlan: RewardInter[]; //英灵随机奖励
|
|
}
|
|
export const dicRougeLayerPlan = new Map<string, DicRougeLayerPlan>();
|
|
export const dicRougeLayerPlanByPlanId = new Map<number, DicRougeLayerPlan[]>();
|
|
|
|
export function loadRougeLayerPlan() {
|
|
dicRougeLayerPlan.clear();
|
|
dicRougeLayerPlanByPlanId.clear();
|
|
|
|
let arr = readFileAndParse(FILENAME.DIC_ROUGE_LAYER_PLAN);
|
|
|
|
arr.forEach(o => {
|
|
|
|
o.takeoutReward = parseGoodStr(o.takeoutReward);
|
|
o.spiritPlan = parseGoodStr(o.spiritPlan);
|
|
|
|
dicRougeLayerPlan.set(o.planId + '_' + o.layerIndex, o);
|
|
|
|
if (!dicRougeLayerPlanByPlanId.get(o.planId)) dicRougeLayerPlanByPlanId.set(o.planId, []);
|
|
dicRougeLayerPlanByPlanId.get(o.planId).push(o);
|
|
|
|
});
|
|
arr = undefined;
|
|
} |