合成装备
This commit is contained in:
@@ -4,6 +4,11 @@ import { FILENAME, IT_TYPE, ABI_TYPE } from '../../consts'
|
||||
import { RewardInter } from '../interface';
|
||||
const _ = require('lodash');
|
||||
|
||||
export interface SpecialMaterial {
|
||||
readonly ids: number[];
|
||||
readonly count: number;
|
||||
}
|
||||
|
||||
export interface DicGoods {
|
||||
// 物品id
|
||||
readonly good_id: number;
|
||||
@@ -13,10 +18,12 @@ export interface DicGoods {
|
||||
readonly lvLimted: number;
|
||||
// 合成装备需要的碎片数
|
||||
readonly pieces: number;
|
||||
// 对应的碎片id
|
||||
readonly pieceId: number;
|
||||
// 合成材料
|
||||
readonly composeMaterial: Array<RewardInter>;
|
||||
// 特殊材料
|
||||
readonly specialMaterial: Array<{id: number[], count: number}>;
|
||||
readonly specialMaterial: SpecialMaterial;
|
||||
// 分解所得
|
||||
readonly decomposeItem: Array<RewardInter>;
|
||||
// 物品品质
|
||||
@@ -67,7 +74,8 @@ const DicGoodsKeys: KeysEnum<DicGoods> = {
|
||||
goodsAbilityUp: true,
|
||||
suitId: true,
|
||||
specialAttr: true,
|
||||
value: true
|
||||
value: true,
|
||||
pieceId: true
|
||||
}
|
||||
|
||||
export const dicGoods = new Map<number, DicGoods>();
|
||||
@@ -133,15 +141,16 @@ function parseAbilityUp(json) {
|
||||
}
|
||||
|
||||
function parseSpecialMaterial(str: string) {
|
||||
let specialAttr = new Array<{id: number[], count: number}>();
|
||||
if(str) {
|
||||
let decodeArr = decodeArrayStr(str);
|
||||
if(decodeArr.length >= 2) {
|
||||
let ids = parseNumberList(decodeArr[0]);
|
||||
let count = parseInt(decodeArr[0]);
|
||||
if(isNaN(count)) return specialAttr;
|
||||
specialAttr.push({id: ids, count});
|
||||
}
|
||||
let specialAttr = {ids: new Array<number>(), count: 0}
|
||||
if(!str) return specialAttr;
|
||||
|
||||
let decodeArr = decodeArrayStr(str);
|
||||
if(decodeArr.length >= 2) {
|
||||
let ids = parseNumberList(decodeArr[0]);
|
||||
let count = parseInt(decodeArr[0]);
|
||||
if(isNaN(count)) return specialAttr;
|
||||
specialAttr.ids = ids;
|
||||
specialAttr.count = count;
|
||||
}
|
||||
return specialAttr;
|
||||
}
|
||||
Reference in New Issue
Block a user