宝石类型
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user