宝石类型

This commit is contained in:
mamengke01
2020-12-18 18:30:19 +08:00
parent 009537d1c7
commit f01ef54240
5 changed files with 30 additions and 15 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ const itid_array = [
{ id: 34, name: '代币', table: 'item', type: CONSUME_TYPE.POINT },
{ id: 39, name: '时装', table: 'hero', type: CONSUME_TYPE.SKIN },
{ id: 40, name: '装备碎片', table: 'item', type: CONSUME_TYPE.PIECE },
{ id: 41, name: '宝石', table: 'item', type: CONSUME_TYPE.JEWEL }
{ id: 42, name: '宝石', table: 'item', type: CONSUME_TYPE.JEWEL }
];
export const ITID = new Map<number, {id: number, name: string, table: string, type?: number, isCurrency?: boolean}>();
+6 -3
View File
@@ -1,5 +1,5 @@
import { dicHero } from "./dictionary/DicHero";
import { dicGoods, blueprt } from "./dictionary/DicGoods";
import { dicGoods, blueprt, jewels } from "./dictionary/DicGoods";
import { dicBlueprtCompose } from "./dictionary/DicBlueprtCompose";
import { dicBlueprtPossibility } from "./dictionary/DicBlueprtPossibility";
import { dicDaily } from "./dictionary/DicDaily";
@@ -66,7 +66,8 @@ export const gameData = {
friendShipLevelMap: dicFriendShipLevelMap,
randomEffectPool: dicRandomEffectPool,
strengthenCost: dicStrengthenCost,
refine: dicRefine
refine: dicRefine,
jewels: jewels
};
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
@@ -180,4 +181,6 @@ export function getFriendShipById(shipId: number, level: number) {
export function getGoodById(gid:number) {
return gameData.goods.get(gid);
}
export function getJewelById(gid:number) {
return gameData.jewels.get(gid);
}
+11 -9
View File
@@ -86,7 +86,7 @@ const DicGoodsKeys: KeysEnum<DicGoods> = {
export const dicGoods = new Map<number, DicGoods>();
export const blueprt = new Map<number, Array<number>>();
export const jewels = new Map<number, Array<number>>();
export const jewels = new Map<number, DicGoods>();
let jewelsMap = {};
arr.forEach(o => {
o.goodsAbility = parseAbility(o);
@@ -107,14 +107,16 @@ arr.forEach(o => {
}
});
// for (let key in jewelsMap) {
// let jewel = jewelsMap[key];
// let material = jewel.composeMaterial[0];
// let nextJewel = jewelsMap[material.id];
// nextJewel.count = material.count;
// nextJewel.nextJewelId = material.id;
// jewels.set(jewel.good_id, _.pick(nextJewel, Object.keys(DicGoodsKeys)));
// }
for (let key in jewelsMap) {
let jewel = jewelsMap[key];
let material = jewel.composeMaterial[0];
if (!!material && !!material.id) {
let nextJewel = jewelsMap[material.id];
nextJewel.count = material.count;
nextJewel.nextJewelId = material.id;
jewels.set(jewel.good_id, _.pick(nextJewel, Object.keys(DicGoodsKeys)));
}
}
jewelsMap = undefined;
arr = undefined;