装备:获得天晶石&合成装备

This commit is contained in:
luying
2022-02-15 18:46:56 +08:00
parent ecc55b3063
commit 465cc15e43
30 changed files with 506 additions and 283 deletions
+1 -19
View File
@@ -1,6 +1,6 @@
// 物品表
import { decodeArrayListStr, readFileAndParse, parseGoodStr, parseNumberList, decodeArrayStr } from '../util'
import { FILENAME, IT_TYPE, ABI_TYPE, GOOD_TYPE } from '../../consts'
import { FILENAME, IT_TYPE, ABI_TYPE } from '../../consts'
import { RewardInter } from '../interface';
const _ = require('lodash');
import { findWhere } from 'underscore';
@@ -108,14 +108,12 @@ const DicGoodsKeys: KeysEnum<DicGoods> = {
charLimited: true,
equipLvl: true
}
export const dicJewel = new Map<number, DicGoods>();
export const dicGoods = new Map<number, DicGoods>();
export const blueprtWithQuality = new Map<number, Array<number>>();
export const blueprtWithQualityAndStar = new Map<string, Array<number>>();
export const figureCondition = new Map<number, { params: number[], id: number, gid: number }[]>(); // type => {params, id, gid}
export function loadGoods() {
dicJewel.clear();
dicGoods.clear();
blueprtWithQuality.clear();
blueprtWithQualityAndStar.clear();
@@ -155,22 +153,6 @@ export function loadGoods() {
let arr2 = blueprtWithQuality.get(o.quality) || new Array<number>();
arr.push(o.good_id);
blueprtWithQuality.set(o.quality, arr2);
} else if (o.goodType == GOOD_TYPE.JEWEL) {
let material = o.composeMaterial[0];
if (!!material && !!material.id) {
let lastJewel = findWhere(arr, { good_id: material.id });
if (!!lastJewel) {
lastJewel.count = material.count;
lastJewel.nextJewelId = o.good_id;
if (!!o.specialMaterial.ids[0]) {
lastJewel.specialCount = o.specialMaterial.count;
lastJewel.nextSpecialId = o.specialMaterial.ids[0];
}
dicJewel.set(lastJewel.good_id, _.pick(lastJewel, Object.keys(DicGoodsKeys)));
}
} else {
dicJewel.set(o.good_id, _.pick(o, Object.keys(DicGoodsKeys)));
}
}
});