From 9241eaf2445bbd91d399adb2aaced1f0064fe9bb Mon Sep 17 00:00:00 2001 From: luying Date: Wed, 14 Apr 2021 10:08:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=EF=BC=9Agamedata=20=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E4=B8=80=E4=BA=9B=E4=B8=8D=E4=BD=BF=E7=94=A8=E7=9A=84?= =?UTF-8?q?parse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/pubUtils/gamedata.ts | 205 ------------------------------------ 1 file changed, 205 deletions(-) diff --git a/shared/pubUtils/gamedata.ts b/shared/pubUtils/gamedata.ts index 5d5dddd3c..13496da8b 100644 --- a/shared/pubUtils/gamedata.ts +++ b/shared/pubUtils/gamedata.ts @@ -15,10 +15,6 @@ const jobClassMaxGrades = new Map(); const jobClassAndgrades = new Map(); const levelInfos = new Map(); const heroLevelInfo = new Map(); -const starRatioInfo = new Map(); -const heroSkillInfo = new Map() -const seidInfo = new Map(); -const olySeidInfo = new Map(); const expeditionInfo = new Map (); const comBtlInfo = new Map(); const btlBossHpSum = new Map(); @@ -28,9 +24,6 @@ const goodInfo = new Map(); const blueprt = new Map>(); const blueprtCompose = new Map(); const fiendShips = new Map(); -const fashions = new Map(); -const fiendShipHidAandIds = new Map(); -const fiendShipLevelMaps = new Map(); const comBtlLvRange = new Map>(); interface dicStar { @@ -40,7 +33,6 @@ interface dicStar { advanceUpFragmentNum: number; ceAttr: Map } -const heroStarList = new Map(); interface dicWake { id: number; quality: number; @@ -49,7 +41,6 @@ interface dicWake { consume: string; ceAttr: Map } -const heroWakeList = new Map(); function parseWarData() { let result = null; @@ -158,69 +149,6 @@ function parseHeroLevelInfo() { }); } -function parseStarRatio() { - const file = 'dic_star_ratio'; - const data = gamedata['jsons'][file] || []; - data.forEach(elem => { - if (elem && elem.star) { - starRatioInfo.set(elem.star, elem.ratio); - } - }); -} - -function parseHeroSkill() { - const file = 'dic_zyz_heroskill'; - const data = gamedata['jsons'][file] || []; - data.forEach(elem => { - if (elem && elem.skillid) { - let starSeidArr = new Array<{star: number, value: number}>(); - let colorStarSeidArr = new Array<{star: number, value: number}>(); - - (elem.starSeid as string).split('|').forEach(cur => { - if(cur) { - let a = cur.split('&'); - starSeidArr.push({star: parseInt(a[0]), value: parseInt(a[1])}); - } - }); - (elem.colorStarSeid as string).split('|').forEach(cur => { - if(cur) { - let a = cur.split('&'); - colorStarSeidArr.push({star: parseInt(a[0]), value: parseInt(a[1])}); - } - }); - - heroSkillInfo.set(elem.skillid, {starSeidArr, colorStarSeidArr}); - } - }); -} - -function parseSeidList() { - const file = 'dic_zyz_se'; - const data = gamedata['jsons'][file] || []; - data.forEach(elem => { - if (elem && elem.id) { - let {gainvalue} = elem; - let gainValueArr = (gainvalue as string).split('&'); - elem.gainValueArr = new Array(); - for(let g of gainValueArr) { - if(g === "") continue; - elem.gainValueArr.push(parseInt(g)); - } - seidInfo.set(elem.id, elem); - } - }); -} - -function parseOlySeidList() { - const file = 'dic_zyz_se_add'; - const data = gamedata['jsons'][file] || []; - data.forEach(elem => { - if (elem && elem.type) { - olySeidInfo.set(elem.type, elem); - } - }); -} - function parseExpedition() { const file = 'dic_expedition'; const data = gamedata['jsons'][file] || []; @@ -278,48 +206,6 @@ function parseBlueprtCompose() { }); } -function parseFashions() { - const file = 'dic_zyz_fashions'; - const data = gamedata['jsons'][file] || []; - data.forEach(elem => { - if (elem && elem.id) { - elem.actorAttrs = []; - let actorAttrs = elem.actorAttr.split('|'); - for (let attr of actorAttrs) { - let attrArr = attr.split('&'); - elem.actorAttrs.push({ - id: parseInt(attrArr[0]), - number: parseInt(attrArr[1]), - }); - } - fashions.set(elem.id, elem); - } - }); -} - -function parseFiendShips() { - const file = 'dic_zyz_friend_ship'; - const data = gamedata['jsons'][file] || []; - data.forEach(elem => { - if (elem && elem.id) { - elem.attributes = []; - elem.hids = elem.memberId.split('&'); - let attributes = elem.attribute.split('|'); - for (let attr of attributes) { - let attrArr = attr.split('&'); - elem.attributes.push({ - id: parseInt(attrArr[0]), - number: parseInt(attrArr[1]), - }); - } - delete elem.memberId; - fiendShips.set(elem.shipId + '_' + elem.level, elem); - let fiendShipHidAandId = fiendShipHidAandIds.get(elem.shipId); - if (!fiendShipHidAandId || fiendShipHidAandId.level < elem.level) - fiendShipHidAandIds.set(elem.shipId, {actorId: elem.actorId, level: elem.level}); - } - }); -} function parseFiendShipLevels() { const file = 'dic_zyz_friend_ship_level'; @@ -329,16 +215,6 @@ function parseFiendShipLevels() { }); } -function parseFiendShipLevelMaps() { - const file = 'dic_zyz_friend_ship_level'; - const data = gamedata['jsons'][file] || []; - data.forEach(elem => { - if (elem && elem.level) { - fiendShipLevelMaps.set(elem.level, elem); - } - }); -} - function initData (folder: string) { if(!gamedata.hasOwnProperty(folder)) { gamedata[folder] = {}; @@ -363,38 +239,6 @@ function initData (folder: string) { }); } -function parseHeroStar() { - const file = 'dic_zyz_hero_star'; - const data = gamedata['jsons'][file] || []; - data.forEach(elem => { - if (elem.id) { - let ceAttr = new Map(); - ceAttr.set(ABI_STAGE.HP, elem.hp_up); - ceAttr.set(ABI_STAGE.ATK, elem.atk_up); - ceAttr.set(ABI_STAGE.DEF, elem.def_up); - ceAttr.set(ABI_STAGE.MDEF, elem.mdef_up); - - heroStarList.set(`${elem.quality}_${elem.star}`,{ceAttr, ...elem}); - } - }); -} - - -function parseHeroWake() { - const file = 'dic_zyz_hero_wake'; - const data = gamedata['jsons'][file] || []; - data.forEach(elem => { - if (elem.id) { - let ceAttr = new Map(); - ceAttr.set(ABI_STAGE.HP, elem.hp_up); - ceAttr.set(ABI_STAGE.ATK, elem.atk_up); - ceAttr.set(ABI_STAGE.DEF, elem.def_up); - ceAttr.set(ABI_STAGE.MDEF, elem.mdef_up); - - heroWakeList.set(`${elem.quality}_${elem.star}`,{ceAttr, ...elem}); - } - }); -} function parseData() { parseWarData(); @@ -404,21 +248,12 @@ function parseData() { parseJobData(); parseLevelInfo(); parseHeroLevelInfo(); - parseStarRatio(); - parseHeroSkill(); - parseSeidList(); - parseOlySeidList(); parseExpedition(); parseComBtlData(); parseComBtlLvRange(); parseGood(); parseBlueprtCompose(); - parseFashions(); - parseFiendShips(); parseFiendShipLevels(); - parseFiendShipLevelMaps(); - parseHeroStar(); - parseHeroWake(); } initData('jsons'); // 加载一般json @@ -507,22 +342,6 @@ export function getHeroExpByLv(lv: number) { return heroLevelInfo.get(lv); } -export function getStarRatio(star: number) { - return starRatioInfo.get(star); -} - -export function getHeroSkillById(skillId: number) { - return heroSkillInfo.get(skillId); -} - -export function getSeidById(id: number) { - return seidInfo.get(id); -} - -export function getOlySeidByType(type: number) { - return olySeidInfo.get(type); -} - export function getExpeditionById(id: number) { return expeditionInfo.get(id); } @@ -609,35 +428,11 @@ export function getBlueprtComposeByQuality(quality: number) { return blueprtCompose.get(quality); } -export function getFashionsById(id:number) { - return fashions.get(id); -} - export function getFriendShipById(shipId: number, level: number) { return fiendShips.get(shipId +'_' + level); } -export function getHidAndLevelByShipId(shipId: number) { - return fiendShipHidAandIds.get(shipId); -} - -export function getFriendShipLevels() { - const file = 'dic_zyz_friend_ship_level'; - return gamedata['jsons'][file] || []; -} - export function getJobByGradeAndClass(jobClass: number, grade: number) { return jobClassAndgrades.get(jobClass +'_' + grade); } -export function getHeroStar(quality: number, star: number) { - return heroStarList.get(`${quality}_${star}`); -} - -export function getHeroWake(quality: number, star: number) { - return heroWakeList.get(`${quality}_${star}`); -} - -export function getFiendShipLevel(level: number) { - return fiendShipLevelMaps.get(level); -} \ No newline at end of file