边窗:主线关卡奖励

This commit is contained in:
luying
2022-06-27 20:17:16 +08:00
parent 2e03348f53
commit eb4ecd7c94
8 changed files with 709 additions and 1 deletions

View File

@@ -106,6 +106,7 @@ import { dicTowerGift, loadTowerGift } from './dictionary/DicTowerGift';
import { dicTowerPvpSubAttr, loadTowerPvpSubAttr } from './dictionary/DicTowerPvpSubAttr';
import { dicSystemOpenTime, loadSystemOpenTime } from "./dictionary/DicSystemOpenTime";
import { dicRandomEffectPoolPlan, loadRandomEffectPoolPlan } from './dictionary/DicRandomEffectPoolPlan';
import { dicMainWarRewardByChapter, loadMainWarReward } from './dictionary/DicMainWarReward';
export const gameData = {
daily: dicDaily,
@@ -259,6 +260,7 @@ export const gameData = {
heroIdByWar: dicHeroIdByWar,
mainBox: dicMainStarBox,
mainBoxByChapter: dicMainStarBoxByChapter,
mainWarReward: dicMainWarRewardByChapter,
heroTalent: dicHeroTalent,
initTalents: initTalents,
talentPointOfJob: talentPointOfJob,
@@ -1140,6 +1142,7 @@ function loadDatas() {
loadTowerPvpSubAttr();
loadSystemOpenTime();
loadRandomEffectPoolPlan();
loadMainWarReward();
}
// 重载dicParam

View File

@@ -0,0 +1,33 @@
// 主线星级宝箱
import {readFileAndParse, parseGoodStr} from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';
export interface DicMainWarReward {
// id
readonly id: number;
// 章节id
readonly chapter: number;
// 主线类型
readonly warType: number;
// 关卡id
readonly warId: number;
// 奖励
readonly cityReward: RewardInter[];
}
export const dicMainWarRewardByChapter = new Map<string, DicMainWarReward[]>(); // chapter => ids;
export function loadMainWarReward() {
dicMainWarRewardByChapter.clear();
let arr = readFileAndParse(FILENAME.DIC_MAIN_WAR_REWARD);
arr.forEach(o => {
o.cityReward = parseGoodStr(o.cityReward);
if(!dicMainWarRewardByChapter.has(`${o.warType}_${o.chapter}`)) {
dicMainWarRewardByChapter.set(`${o.warType}_${o.chapter}`, []);
}
dicMainWarRewardByChapter.get(`${o.warType}_${o.chapter}`)?.push(o);
});
arr = undefined;
}