diff --git a/shared/consts/constModules/sysConst.ts b/shared/consts/constModules/sysConst.ts index 0bb2b5927..85ee38615 100644 --- a/shared/consts/constModules/sysConst.ts +++ b/shared/consts/constModules/sysConst.ts @@ -596,6 +596,7 @@ export const FILENAME = { DIC_GVG_VESTIGE_LEAGUE_RANK: 'dic_zyz_GVGVestigeLeagueRank', DIC_GK_GVG_VESTIGE: 'dic_zyz_gk_GVGVestige', DIC_GVG_AREA_POINT: 'dic_zyz_GVGAreaPoint', + DIC_GVG_BATTLE_RANK_REWARD: 'dic_zyz_GVGBattleRankReward', } export const WAR_RELATE_TABLES = [ diff --git a/shared/pubUtils/data.ts b/shared/pubUtils/data.ts index b8284ade3..2c9ddbf71 100644 --- a/shared/pubUtils/data.ts +++ b/shared/pubUtils/data.ts @@ -132,6 +132,7 @@ import { dicGVGVestige, loadGVGVestige } from './dictionary/DicGVGVestige'; import { DicGVGVestigeRange, dicGVGVestigeRange, loadGVGVestigeRange } from './dictionary/DicGVGVestigeRange'; import { DicGVGVestigeLeagueRank, dicGVGVestigeLeagueRank, loadGVGVestigeLeagueRank } from "./dictionary/DicGVGVestigeLeagueRank"; import { dicGVGAreaPoint, loadGVGAreaPoint } from "./dictionary/DicGVGAreaPoint"; +import { DicGVGBattleRankReward, dicGVGBattleRankReward, loadGVGBattleRankReward } from './dictionary/DicGVGBattleRankReward'; export const gameData = { daily: dicDaily, @@ -332,6 +333,7 @@ export const gameData = { gvgVestigeLeagueRank: dicGVGVestigeLeagueRank, gvgVestigeName: dicGVGVestigeName, gvgAreaPoint: dicGVGAreaPoint, + gvgBattleRankReward: dicGVGBattleRankReward, }; // 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据 @@ -1198,6 +1200,19 @@ export function getGVGVestigeLeagueRank(myLeagueRank: number) { return lastRank } +export function getGVGBattleRankReward(type: number, rank: number) { + let arr = gameData.gvgBattleRankReward.get(type)||[]; + let lastRank: DicGVGBattleRankReward; + for(let dic of arr) { + lastRank = dic; + let { min, max } = dic; + if(min <= rank && (max >= rank || max == -1)) { + return dic; + } + } + return lastRank +} + // 初始加载 function initDatas() { parseDicParam(); @@ -1410,6 +1425,7 @@ function loadDatas() { loadGVGVestigeRange(); loadGVGVestigeLeagueRank(); loadGVGAreaPoint(); + loadGVGBattleRankReward(); } // 重载dicParam diff --git a/shared/pubUtils/dictionary/DicGVGBattleRankReward.ts b/shared/pubUtils/dictionary/DicGVGBattleRankReward.ts new file mode 100644 index 000000000..2b278f9c6 --- /dev/null +++ b/shared/pubUtils/dictionary/DicGVGBattleRankReward.ts @@ -0,0 +1,30 @@ +// GVG城池 +import { FILENAME } from '../../consts' +import { RewardInter } from '../interface'; +import { parseGoodStr, readFileAndParse } from '../util' + +export interface DicGVGBattleRankReward { + // 排行榜类型 + readonly type: number; + // 最小排名 + readonly min: number; + // 最大排名 + readonly max: number; + // 奖励 + readonly reward: RewardInter[]; +} + +export const dicGVGBattleRankReward = new Map(); // type => DicGVGBattleRankReward[] +export function loadGVGBattleRankReward() { + dicGVGBattleRankReward.clear(); + + let arr = readFileAndParse(FILENAME.DIC_GVG_BATTLE_RANK_REWARD); + arr.forEach(o => { + if(!dicGVGBattleRankReward.has(o.type)) { + dicGVGBattleRankReward.set(o.type, []); + } + o.reward = parseGoodStr(o.reward); + dicGVGBattleRankReward.get(o.type)?.push(o); + }); + arr = undefined; +} \ No newline at end of file diff --git a/shared/resource/jsons/dic_zyz_GVGBattleRankReward.json b/shared/resource/jsons/dic_zyz_GVGBattleRankReward.json new file mode 100644 index 000000000..970d56124 --- /dev/null +++ b/shared/resource/jsons/dic_zyz_GVGBattleRankReward.json @@ -0,0 +1,170 @@ +[ + { + "id": 101, + "type": 1, + "min": 1, + "max": 1, + "reward": "71060&100" + }, + { + "id": 102, + "type": 1, + "min": 2, + "max": 3, + "reward": "71060&80" + }, + { + "id": 103, + "type": 1, + "min": 4, + "max": 10, + "reward": "71060&70" + }, + { + "id": 104, + "type": 1, + "min": 11, + "max": 20, + "reward": "71060&60" + }, + { + "id": 105, + "type": 1, + "min": 21, + "max": 50, + "reward": "71060&50" + }, + { + "id": 106, + "type": 1, + "min": 51, + "max": 100, + "reward": "71060&30" + }, + { + "id": 107, + "type": 1, + "min": 101, + "max": 200, + "reward": "71060&20" + }, + { + "id": 108, + "type": 1, + "min": 201, + "max": -1, + "reward": "71060&10" + }, + { + "id": 201, + "type": 2, + "min": 1, + "max": 1, + "reward": "71060&100" + }, + { + "id": 202, + "type": 2, + "min": 2, + "max": 2, + "reward": "71060&80" + }, + { + "id": 203, + "type": 2, + "min": 3, + "max": 3, + "reward": "71060&70" + }, + { + "id": 204, + "type": 2, + "min": 4, + "max": 5, + "reward": "71060&60" + }, + { + "id": 205, + "type": 2, + "min": 6, + "max": 10, + "reward": "71060&50" + }, + { + "id": 206, + "type": 2, + "min": 11, + "max": 20, + "reward": "71060&30" + }, + { + "id": 207, + "type": 2, + "min": 21, + "max": 50, + "reward": "71060&20" + }, + { + "id": 208, + "type": 2, + "min": 51, + "max": -1, + "reward": "71060&10" + }, + { + "id": 301, + "type": 3, + "min": 1, + "max": 1, + "reward": "71060&100" + }, + { + "id": 302, + "type": 3, + "min": 2, + "max": 2, + "reward": "71060&80" + }, + { + "id": 303, + "type": 3, + "min": 3, + "max": 3, + "reward": "71060&70" + }, + { + "id": 304, + "type": 3, + "min": 4, + "max": 5, + "reward": "71060&60" + }, + { + "id": 305, + "type": 3, + "min": 6, + "max": 10, + "reward": "71060&50" + }, + { + "id": 306, + "type": 3, + "min": 11, + "max": 20, + "reward": "71060&30" + }, + { + "id": 307, + "type": 3, + "min": 21, + "max": 50, + "reward": "71060&20" + }, + { + "id": 308, + "type": 3, + "min": 51, + "max": -1, + "reward": "71060&10" + } +] \ No newline at end of file