feat(稷下学宫): ff931afe4到7421822f6

This commit is contained in:
luying
2023-08-30 11:02:52 +08:00
parent 59a334d673
commit 05cbe318e9
102 changed files with 147876 additions and 715 deletions
+3 -1
View File
@@ -41,10 +41,12 @@ export interface DicHero {
readonly urType: number;
// 武将id
readonly actorId: number;
readonly hp: number;
}
type KeysEnum<T> = { [P in keyof Required<T>]: true };
const DicHeroKeys: KeysEnum<DicHero> = {heroId: true, name: true, quality: true, camp: true, jobClass: true, jobid: true, skill: true, pieceId: true, initialStar: true, initialColorStar: true, pieceCount: true, baseAbilityArr: true, baseAbilityUpArr: true, initialSkin: true, recruit: true, face_id: true, talentId: true, urType: true, actorId: true };
const DicHeroKeys: KeysEnum<DicHero> = {heroId: true, name: true, quality: true, camp: true, jobClass: true, jobid: true, skill: true, pieceId: true, initialStar: true, initialColorStar: true, pieceCount: true, baseAbilityArr: true, baseAbilityUpArr: true, initialSkin: true, recruit: true, face_id: true, talentId: true, urType: true, actorId: true, hp: true };
export const dicHero = new Map<number, DicHero>();
export function loadHero() {
dicHero.clear();
@@ -0,0 +1,25 @@
/**
* 流派类型配置表
*/
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougeAuthorType {
readonly id: number;
readonly authorType: number; // 流派类型
// readonly holyCard: number; // 圣物奖励
}
export const dicRougeAuthorType = new Map<number, DicRougeAuthorType>();
export function loadRougeAuthorType() {
dicRougeAuthorType.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_AUTHOR_TYPE);
arr.forEach(o => {
dicRougeAuthorType.set(o.authorType, o);
});
arr = undefined;
}
@@ -0,0 +1,28 @@
/**
* 挑战类型配置表
*/
import { parseNumberList, readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougeChallenge {
readonly id: number;
readonly challengeId: number; // 挑战
readonly type: number; // 挑战的类型,具体是啥需要一个文档
readonly effectId: number[]; // 挑战达成的参数
readonly condition: number; // 客户端显示的 x/n,里面的n
}
export const dicRougeChallenge = new Map<number, DicRougeChallenge>();
export function loadRougeChallenge() {
dicRougeChallenge.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_CHALLANGE);
arr.forEach(o => {
o.effectId = parseNumberList(o.effectId);
dicRougeChallenge.set(o.challengeId, o);
});
arr = undefined;
}
@@ -0,0 +1,28 @@
/**
* 挑战关随机配置表
*/
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougeChallengePlan {
readonly id: number;
readonly planId: number;
readonly challengeId: number; // 挑战关卡的id dicRougeChallenge的id
readonly weight: number; // 权重
}
export const dicRougeChallengePlan = new Map<number, DicRougeChallengePlan[]>();
export function loadRougeChallengePlan() {
dicRougeChallengePlan.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_CHALLANGE_PLAN);
arr.forEach(o => {
if (!dicRougeChallengePlan.has(o.planId)) {
dicRougeChallengePlan.set(o.planId, []);
}
dicRougeChallengePlan.get(o.planId).push(o);
});
arr = undefined;
}
@@ -0,0 +1,39 @@
/**
* 角色卡配置表
*/
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougeChara {
readonly id: number;
readonly heroId: number; // 角色id
readonly charaType: number; // 1-普通卡 2-高级卡
readonly initial: number; // 是否能被初始随机到
readonly initCardCnt: number; // 初始获得多少特性卡装在身上
readonly recruitConsume: number; // 试炼币购买
}
export const dicRougeChara = new Map<number, DicRougeChara>();
export const dicRougeCharaByInitial = new Map<number, DicRougeChara[]>();
export function loadRougeChara() {
dicRougeChara.clear();
dicRougeCharaByInitial.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_CHARA);
arr.forEach(o => {
dicRougeChara.set(o.id, o);
if (!dicRougeCharaByInitial.has(o.initial)) {
dicRougeCharaByInitial.set(o.initial, []);
}
dicRougeCharaByInitial.get(o.initial).push(o);
});
arr = undefined;
}
@@ -0,0 +1,47 @@
/**
* 圣物效果配置表
*/
import { decodeArrayListStr, readFileAndParse } from '../util'
import { ABI_TYPE, FILENAME, ROUGE_EFFECT_TYPE } from '../../consts'
export interface DicRougeEffect {
readonly id: number;
readonly effectId: number;
readonly effectType: number; // 效果的类型,具体什么type写个文档
readonly effectParam: number[]; // 效果的具体参数,不同的type对这个param的解释不同需要分别定义,用&连接
}
export const dicRougeEffect = new Map<number, DicRougeEffect>();
export function loadRougeEffect() {
dicRougeEffect.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_EFFECT);
arr.forEach(o => {
o.effectParam = parseEffectParam(o.effectType, o.effectParam);
// console.log('effectParam', o.effectParam)
// if (!dicRougeEffect.has(o.effectType)) {
// dicRougeEffect.set(o.effectType, []);
// }
// dicRougeEffect.get(o.effectType).push(o);
dicRougeEffect.set(o.effectId, o);
});
arr = undefined;
}
function parseEffectParam(effectType: number, str: string) {
let arr = decodeArrayListStr(str);
switch(effectType) {
case ROUGE_EFFECT_TYPE.HOLY_CHARA_MAIN_ATTR_UP:
case ROUGE_EFFECT_TYPE.HOLY_CHARA_MAIN_ATTR_UP:
case ROUGE_EFFECT_TYPE.HOLY_CHARA_MAIN_ATTR_UP:
case ROUGE_EFFECT_TYPE.HOLY_CHARA_MAIN_ATTR_UP:
{
arr = arr.filter(cur => cur[0] == ABI_TYPE.ABI_HP.toString());
break;
}
}
return arr.length > 0? arr[0].map(cur => parseFloat(cur)): [];
}
@@ -0,0 +1,32 @@
/**
* 圣物效果配置表
*/
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
const _ = require('lodash');
export interface DicRougeEffectType {
readonly id: number;
readonly effectType: number; // 效果的类型,具体什么type写个文档
readonly kind: number;
}
type KeysEnum<T> = { [P in keyof Required<T>]: true };
const DicRougeEffectTypeKeys: KeysEnum<DicRougeEffectType> = {
id: true,
effectType: true,
kind: true,
}
export const dicRougeEffectType = new Map<number, DicRougeEffectType>();
export function loadRougeEffectType() {
dicRougeEffectType.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_EFFECT_TYPE);
arr.forEach(o => {
dicRougeEffectType.set(o.effectType, _.pick(o, Object.keys(DicRougeEffectTypeKeys)));
});
arr = undefined;
}
@@ -0,0 +1,29 @@
/**
* 随机事件配置表
*/
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougeEventOption {
readonly id: number;
readonly randomEventId: number; // 事件id
readonly optionGroup: number; // 一组选项的组id
readonly title: string //标题
readonly index: number; // 选项在他这组里的索引
readonly text: string; // 选项
readonly afterGroup: number; // 选了这个选项之后的选项组
readonly holyCardPlan: number; // 奖励的圣物
}
export const dicRougeEventOption = new Map<number, DicRougeEventOption>();
export function loadRougeEventOption() {
dicRougeEventOption.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_EVENT_OPTION);
arr.forEach(o => {
dicRougeEventOption.set(o.id, o);
});
arr = undefined;
}
@@ -0,0 +1,38 @@
/**
* 圣物
*/
import { parseGoodStr, parseNumberList, readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';
export interface DicRougeHolyCard {
readonly id: number;
readonly name: string;
readonly imageName: string;
readonly quality: number; // 品质
readonly authorType: number; // 所属百家流派
readonly skillId: number; // ?待解释,可能是战场技能
readonly content: string;
readonly useCount: number;
readonly label: number; // 当获得同标签的百家特性卡达到X个,同标签的圣物获得概率增加
readonly purchasePrice: number; // 试炼币购买
readonly collectReward: RewardInter[];
readonly effectId: number[];
readonly getLimit: number; //获取上限
}
export const dicRougeHolyCard = new Map<number, DicRougeHolyCard>();
export function loadRougeHolyCard() {
dicRougeHolyCard.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_HOLY_CARD);
arr.forEach(o => {
o.collectReward = parseGoodStr(o.collectReward);
o.effectId = parseNumberList(o.effectId);
dicRougeHolyCard.set(o.id, o);
});
arr = undefined;
}
@@ -0,0 +1,28 @@
/**
* 每层可以随机的点的数量的池子
*/
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougeLayerNodeNumPlan {
readonly id: number;
readonly nodeNumPlanId: number; // 随机方案,dicRougeLayer的nodeNumPlan引用
readonly nodeNum: number; // 节点数量
readonly weight: number; // 他的权重
}
export const dicRougeLayerNodeNumPlan = new Map<number, DicRougeLayerNodeNumPlan[]>();
export function loadRougeLayerNodeNumPlan() {
dicRougeLayerNodeNumPlan.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_LAYER_NODE_NUM_PLAN);
arr.forEach(o => {
if (!dicRougeLayerNodeNumPlan.get(o.nodeNumPlanId)) dicRougeLayerNodeNumPlan.set(o.nodeNumPlanId, []);
dicRougeLayerNodeNumPlan.get(o.nodeNumPlanId).push(o);
});
arr = undefined;
}
@@ -0,0 +1,30 @@
/**
* 试炼难度配置表
*/
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougeLayerNodePlan {
readonly id: number;
readonly nodePlanId: number; // 随机方案,dicRougeLayer的nodePlan引用
readonly nodeId: number; // 节点的类型,引用的是 dicRougeNode 表的nodeId
readonly weight: number;
}
// export const dicRougeLayerNodePlan = new Map<string, DicRougeLayerNodePlan>();
export const dicRougeLayerNodePlan = new Map<number, DicRougeLayerNodePlan[]>();
export function loadRougeLayerNodePlan() {
dicRougeLayerNodePlan.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_LAYER_NODE_PLAN);
arr.forEach(o => {
if (!dicRougeLayerNodePlan.get(o.nodePlanId)) dicRougeLayerNodePlan.set(o.nodePlanId, []);
dicRougeLayerNodePlan.get(o.nodePlanId).push(o);
});
arr = undefined;
}
@@ -0,0 +1,39 @@
/**
* 试炼难度配置表
*/
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: number; //英灵随机奖励
}
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);
dicRougeLayerPlan.set(o.planId + '_' + o.layerIndex, o);
if (!dicRougeLayerPlanByPlanId.get(o.planId)) dicRougeLayerPlanByPlanId.set(o.planId, []);
dicRougeLayerPlanByPlanId.get(o.planId).push(o);
});
arr = undefined;
}
@@ -0,0 +1,41 @@
/**
* 每层可随机到的奖励
*/
import { parseGoodStr, readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougeLayerRewardPlan {
readonly id: number;
readonly planId: number;
readonly nodeType: number; // 精英关、普通关、boss关、挑战、随机事件、休整点
readonly charaPlan: number; // 角色卡
readonly charaRandomNum: number; // 玩家可以随机出多少奖励
readonly charaChooseNum: number; // 玩家可以从随机出的里选择多少奖励
readonly charaPassivePlan: number; // 高级卡自带的特性卡
readonly passiveCardPlan: number; // 特性卡
readonly passiveCardRandomNum: number; // 玩家可以随机出多少奖励
readonly passiveCardChooseNum: number; // 玩家可以从随机出的里选择多少奖励
readonly holyCardPlan: number; // 圣物
readonly holyCardRandomNum: number; // 玩家可以随机出多少奖励
readonly holyCardChooseNum: number; // 玩家可以从随机出的里选择多少奖励
readonly coin: number; // 试炼币
readonly score: number; // 学分
readonly tech: number; // 科技点
// readonly goods: RewardInter[]; // 灵石 物品表id&count
}
export const dicRougeLayerRewardPlan = new Map<string, DicRougeLayerRewardPlan>();
export function loadRougeLayerRewardPlan() {
dicRougeLayerRewardPlan.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_LAYER_REWARD_PLAN);
arr.forEach(o => {
o.goods = parseGoodStr(o.goods);
dicRougeLayerRewardPlan.set(o.planId + '_' + o.nodeType, o);
});
arr = undefined;
}
@@ -0,0 +1,26 @@
/**
* 关卡配置表
*/
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougeNode {
readonly id: number;
readonly nodeId: number; // 关卡id
readonly nodeType: number; // 试炼类型 普通关、精英关、boss关、挑战点、问号点、休整点、商店
readonly param: number; // 普通关、精英关、boss关的对应关卡id
}
export const dicRougeNode = new Map<number, DicRougeNode>();
export function loadRougeNode() {
dicRougeNode.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_NODE);
arr.forEach(o => {
dicRougeNode.set(o.nodeId, o);
});
arr = undefined;
}
@@ -0,0 +1,25 @@
/**
* 随机事件图鉴
*/
import { parseGoodStr, readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';
export interface DicRougeOptionGroup {
readonly id: number;
readonly optionGroup: number; // 一组选项的组id
readonly collectReward: RewardInter[]; // 图鉴收集奖励(同Group只领取一次奖励)
}
export const dicRougeOptionGroup = new Map<number, DicRougeOptionGroup>();
export function loadRougeOptionGroup() {
dicRougeOptionGroup.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_OPTION_GROUP);
arr.forEach(o => {
o.collectReward = parseGoodStr(o.collectReward);
dicRougeOptionGroup.set(o.optionGroup, o);
});
arr = undefined;
}
@@ -0,0 +1,44 @@
/**
* 特性卡
*/
import { parseNumberList, readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougePassiveCard {
readonly id: number;
readonly group: number; // 同样的group之间才可以特训
readonly lv: number; // 特训等级,可以初始获得不同等级
readonly name: string;
readonly quality: number; // 品质
readonly authorType: number; // 所属百家流派,在该流派试炼中出现概率提升
readonly seid: string; // 纯战场、服务器不读
readonly content: string;
readonly passiveLabel: number[]; // 关联其他特性卡,获得这个特性卡之后他relationId的概率提升
readonly holyLabel: number[]; // 关联圣物,获得这个特性卡之后圣物概率提升
readonly strengthConsume: number; // 强化消耗
readonly price: number; // 试炼币购买
readonly getLimit: number; //获取上限
}
export const dicRougePassiveCard = new Map<number, DicRougePassiveCard>();
export const dicRougePassiveCardByGroup = new Map<number, DicRougePassiveCard[]>();
export function loadRougePassiveCard() {
dicRougePassiveCard.clear();
dicRougePassiveCardByGroup.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_PASSIVE_CARD);
arr.forEach(o => {
o.passiveLabel = parseNumberList(o.passiveLabel);
o.holyLabel = parseNumberList(o.holyLabel);
dicRougePassiveCard.set(o.id, o);
if (!dicRougePassiveCardByGroup.has(o.group)) {
dicRougePassiveCardByGroup.set(o.group, []);
}
dicRougePassiveCardByGroup.get(o.group).push(o);
});
arr = undefined;
}
@@ -0,0 +1,32 @@
/**
* 特性卡奖励卡池方案
*/
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougePassiveCardPlan {
readonly id: number;
readonly planId: number; // 方案编号
readonly cardId: number; // 角色卡id
readonly weight: number; // 权重
}
export const dicRougePassiveCardPlan = new Map<number, DicRougePassiveCardPlan[]>();
export function loadRougePassiveCardPlan() {
dicRougePassiveCardPlan.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_PASSIVE_CARD_PLAN);
arr.forEach(o => {
if (!dicRougePassiveCardPlan.has(o.planId)) {
dicRougePassiveCardPlan.set(o.planId, []);
}
dicRougePassiveCardPlan.get(o.planId).push(o);
});
arr = undefined;
}
@@ -0,0 +1,27 @@
/**
* 特性卡
*/
import { parseGoodStr, readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';
export interface DicRougePassiveCollect {
readonly id: number;
readonly num: number; // 收集数量
readonly collectReward: RewardInter[]; // 奖励
}
export const dicRougePassiveCollect = new Map<number, DicRougePassiveCollect>();
export function loadRougePassiveCollect() {
dicRougePassiveCollect.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_PASSIVE_COLLECT);
arr.forEach(o => {
o.collectReward = parseGoodStr(o.reward);
dicRougePassiveCollect.set(o.id, o);
});
arr = undefined;
}
@@ -0,0 +1,32 @@
/**
* 问好点随机配置表
*/
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougeQuestionMarkPlan {
readonly id: number;
readonly questionMarkPlanId: number; // 问号点随机方案编号
readonly questionMarkIndex: number; // 方案内node编号
readonly nodeType: number; // 关卡类型 普通关、精英关、boss关、挑战点问号点、休整点、商店
readonly param: number; // 普通关、精英关对应的warId
readonly weight: number; //随机权重
}
export const dicRougeQuestionMarkPlan = new Map<number, DicRougeQuestionMarkPlan[]>();
export function loadRougeQuestionMarkPlan() {
dicRougeQuestionMarkPlan.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_QUESTION_MARK_PLAN);
arr.forEach(o => {
if (!dicRougeQuestionMarkPlan.get(o.questionMarkPlanId)) dicRougeQuestionMarkPlan.set(o.questionMarkPlanId, []);
dicRougeQuestionMarkPlan.get(o.questionMarkPlanId).push(o);
});
arr = undefined;
}
@@ -0,0 +1,28 @@
/**
* 随机关卡配置表
*/
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougeRandomEventPlan {
readonly id: number;
readonly planId: number;
readonly randomEventId: number; // 随机关卡的id dicRougeEventOption中的randomEventId
readonly weight: number; // 权重
}
export const dicRougeRandomEventPlan = new Map<number, DicRougeRandomEventPlan[]>();
export function loadRougeRandomEventPlan() {
dicRougeRandomEventPlan.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_RANDOM_EVENT_PLAN);
arr.forEach(o => {
if (!dicRougeRandomEventPlan.has(o.planId)) {
dicRougeRandomEventPlan.set(o.planId, []);
}
dicRougeRandomEventPlan.get(o.planId).push(o);
});
arr = undefined;
}
@@ -0,0 +1,27 @@
/**
* 随机事件图鉴
*/
import { parseGoodStr, readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';
export interface DicRougeScoreReward {
readonly index: number;
readonly score: number; // 积分
readonly reward: RewardInter[]; // 图鉴收集奖励(同Group只领取一次奖励)
}
export const dicRougeScoreReward = new Map<number, DicRougeScoreReward>();
export const dicRougeScoreNum = { num: 0 }
export function loadRougeScoreReward() {
dicRougeScoreReward.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_SCORE_REWARD);
arr.forEach(o => {
o.reward = parseGoodStr(o.reward);
dicRougeScoreReward.set(o.index, o);
dicRougeScoreNum.num++;
});
arr = undefined;
}
@@ -0,0 +1,28 @@
/**
* 试炼类型配置表
*/
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougeShopPlan {
readonly id: number;
readonly planId: number;
readonly passivecardPlanId: number; // 特性卡
readonly passiveCardRandomNum: number; // 玩家可以在商店随机出多少奖励
readonly holyCardPlanId: number; // 圣物
readonly holyCardRandomNum: number; // 玩家可以商店随机出多少奖励
}
export const dicRougeShopPlan = new Map<number, DicRougeShopPlan>();
export function loadRougeShopPlan() {
dicRougeShopPlan.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_SHOP_PLAN);
arr.forEach(o => {
dicRougeShopPlan.set(o.planId, o);
});
arr = undefined;
}
@@ -0,0 +1,30 @@
/**
* 技能卡
*/
import { parseGoodStr, readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';
export interface DicRougeSkillCard {
readonly id: number;
readonly name: string;
readonly quality: number; // 品质
readonly skillType: number; // 技能类型
readonly authorType: number; // 所属百家流派,在该流派试炼中出现概率提升
readonly skillId: number; // 战场技能
readonly collectReward: RewardInter[];
}
export const dicRougeSkillCard = new Map<number, DicRougeSkillCard>();
export function loadRougeSkillCard() {
dicRougeSkillCard.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_SKILL_CARD);
arr.forEach(o => {
o.collectReward = parseGoodStr(o.collectReward);
dicRougeSkillCard.set(o.id, o);
});
arr = undefined;
}
@@ -0,0 +1,47 @@
/**
* 科技树配置
*/
import { parseGoodStr, parseNumberList, readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';
const _ = require('lodash');
export interface DicRougeTech {
readonly id: number;
readonly techId: number; // 科技点
readonly rowId: number; // 列
readonly index: number; // 第几个
readonly preTechId: number[]; // 前置节点
readonly cost: RewardInter[]; // 消耗的科技点
}
type KeysEnum<T> = { [P in keyof Required<T>]: true };
const DicRougeTechKeys: KeysEnum<DicRougeTech> = {
id: true,
techId: true,
rowId: true,
index: true,
preTechId: true,
cost: true,
}
export const dicRougeTech = new Map<number, DicRougeTech>();
export const dicRougeTechIdByRow = new Map<number, number[]>();
export function loadRougeTech() {
dicRougeTech.clear();
dicRougeTechIdByRow.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_TECH);
arr.forEach(o => {
o.preTechId = parseNumberList(o.preTechId);
o.cost = parseGoodStr(o.cost);
dicRougeTech.set(o.techId, _.pick(o, Object.keys(DicRougeTechKeys)));
if(!dicRougeTechIdByRow.has(o.rowId)) dicRougeTechIdByRow.set(o.rowId, []);
dicRougeTechIdByRow.get(o.rowId)?.push(o.techId);
});
arr = undefined;
}
@@ -0,0 +1,29 @@
/**
* 科技树法阵配置
*/
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougeTechCircle {
readonly id: number;
readonly techId: number; // 科技树
readonly circleId: number; // 对应法阵id
}
export const dicRougeTechCircle = new Map<number, number>();
export const dicRougeTechCircleByTechId = new Map<number, number[]>();
export function loadRougeTechCircle() {
dicRougeTechCircle.clear();
dicRougeTechCircleByTechId.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_TECH_CIRCLE);
arr.forEach(o => {
if(!dicRougeTechCircle.has(o.circleId)) dicRougeTechCircle.set(o.circleId, o.techId);
if(!dicRougeTechCircleByTechId.has(o.techId)) dicRougeTechCircleByTechId.set(o.techId, []);
if(!dicRougeTechCircleByTechId.get(o.techId).includes(o.circleId)) dicRougeTechCircleByTechId.get(o.techId).push(o.circleId);
});
arr = undefined;
}
@@ -0,0 +1,37 @@
/**
* 科技树法阵配置
*/
import { parseNumberList, readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
const _ = require('lodash');
export interface DicRougeTechLevel {
readonly techId: number; // 对应等级
readonly level: number; // 等级
readonly ce: number; // 战力
readonly techEffectIds: number[]; // 加成
}
type KeysEnum<T> = { [P in keyof Required<T>]: boolean };
const DicRougeTechCircleKeys: KeysEnum<DicRougeTechLevel> = {
techId: true,
level: true,
ce: true,
techEffectIds: true,
}
export const dicRougeTechLevel = new Map<number, DicRougeTechLevel[]>();
export function loadRougeTechLevel() {
dicRougeTechLevel.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_TECH_LEVEL);
arr.forEach(o => {
o.techEffectIds = parseNumberList(o.techEffectId);
if(!dicRougeTechLevel.has(o.techId)) dicRougeTechLevel.set(o.techId, []);
dicRougeTechLevel.get(o.techId)?.push(_.pick(o, Object.keys(DicRougeTechCircleKeys)));
});
arr = undefined;
}
@@ -0,0 +1,22 @@
/**
* 试炼类型配置表
*/
export interface DicRougeType {
readonly id: number;
readonly type: number; // 试炼类型
readonly grade: number; // 共有多少难度
}
export const dicRougeType = new Map<number, DicRougeType>();
export function loadRougeType() {
dicRougeType.clear();
// let arr = readFileAndParse(FILENAME.DIC_ROUGE_TYPE);
// arr.forEach(o => {
// dicRougeType.set(o.type, o);
// });
// arr = undefined;
}
@@ -0,0 +1,41 @@
/**
* 试炼难度配置表
*/
import { parseGoodStr, readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';
export interface DicRougeTypeGrade {
readonly id: number;
readonly type: number; // 试炼类型
readonly gradeIndex: number; // 难度
readonly lvLimit: number; // 等级限制
readonly limitId: number; //解锁需要的前置id
readonly buyRewardPlan: number; // 该试炼给的英灵奖励方案(dic_spiritPlan的id
readonly layerCount: number; // 共有多少层
readonly layerPlan: number; // 每一层的配置,dicRougeLayerPlan的planId
readonly challengePlan: number; // 这个试炼会随机出的挑战关卡的池子
readonly randomEventPlan: number; // 该试炼随机事件的随机池方案
readonly firstReward: RewardInter[]; // 首通奖励
readonly heroValue: number;
}
export const dicRougeTypeGrade = new Map<string, DicRougeTypeGrade>();
export const dicRougeTypeGradeById = new Map<number, DicRougeTypeGrade>();
export function loadRougeTypeGrade() {
dicRougeTypeGrade.clear();
dicRougeTypeGradeById.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_TYPE_GRADE);
arr.forEach(o => {
o.firstReward = parseGoodStr(o.firstReward);
dicRougeTypeGrade.set(o.type + '_' + o.gradeIndex, o);
dicRougeTypeGradeById.set(o.id, o);
});
arr = undefined;
}
@@ -0,0 +1,28 @@
/**
* 英灵随机奖励配置表
*/
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicSpiritPlan {
readonly id: number;
readonly planId: number;
readonly spiritId: number;
readonly weight: number;
}
export const dicSpiritPlan = new Map<number, DicSpiritPlan[]>();
export function loadSpiritPlan() {
dicSpiritPlan.clear();
let arr = readFileAndParse(FILENAME.DIC_SPIRIT_PLAN);
arr.forEach(o => {
if (!dicSpiritPlan.has(o.planId)) dicSpiritPlan.set(o.planId, []);
dicSpiritPlan.get(o.planId).push(o);
});
arr = undefined;
}