资源:gamedata 去除一些不使用的parse
This commit is contained in:
@@ -15,10 +15,6 @@ const jobClassMaxGrades = new Map<number, {grade:number, jobid:number}>();
|
||||
const jobClassAndgrades = new Map<string, {jobid:number, unlockLevel:number}>();
|
||||
const levelInfos = new Map<number, {sum: number, cur: number}>();
|
||||
const heroLevelInfo = new Map<number, number>();
|
||||
const starRatioInfo = new Map<number, number>();
|
||||
const heroSkillInfo = new Map<number, any>()
|
||||
const seidInfo = new Map<number, any>();
|
||||
const olySeidInfo = new Map<number, any>();
|
||||
const expeditionInfo = new Map<number, any> ();
|
||||
const comBtlInfo = new Map<number, {quality: number, name: string, assistanceTime: number}>();
|
||||
const btlBossHpSum = new Map<number, number>();
|
||||
@@ -28,9 +24,6 @@ const goodInfo = new Map<number, any>();
|
||||
const blueprt = new Map<number, Array<number>>();
|
||||
const blueprtCompose = new Map<number, any>();
|
||||
const fiendShips = new Map<string, any>();
|
||||
const fashions = new Map<number, any>();
|
||||
const fiendShipHidAandIds = new Map<number, {actorId: number, level:number}>();
|
||||
const fiendShipLevelMaps = new Map<number, any>();
|
||||
const comBtlLvRange = new Map<number, Array<number>>();
|
||||
|
||||
interface dicStar {
|
||||
@@ -40,7 +33,6 @@ interface dicStar {
|
||||
advanceUpFragmentNum: number;
|
||||
ceAttr: Map<number, number>
|
||||
}
|
||||
const heroStarList = new Map<string, dicStar>();
|
||||
interface dicWake {
|
||||
id: number;
|
||||
quality: number;
|
||||
@@ -49,7 +41,6 @@ interface dicWake {
|
||||
consume: string;
|
||||
ceAttr: Map<number, number>
|
||||
}
|
||||
const heroWakeList = new Map<string, dicWake>();
|
||||
|
||||
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<number, number>();
|
||||
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<number, number>();
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user