From ff36c4b36114edfe31059400480b63ef550f83a3 Mon Sep 17 00:00:00 2001 From: luying Date: Tue, 27 Jul 2021 15:42:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E6=88=90=EF=BC=9A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=B6=88=E8=80=97=E8=AF=BB=E5=8F=96=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/equipService.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/game-server/app/services/equipService.ts b/game-server/app/services/equipService.ts index ca53dc0e3..8470d1cf1 100644 --- a/game-server/app/services/equipService.ts +++ b/game-server/app/services/equipService.ts @@ -23,7 +23,6 @@ export function checkMaterialEnough(consumes: Array<{ id: number, count: number let jewelInfo = getJewelById(id); if (!jewelInfo || !jewelInfo.count) //筛选出特殊材料,特殊材料没有合成下一级需要的count数量 continue; - needConsumes.push({ id, count });//将该宝石加入消耗中 comJewelMap[id] = count + (comJewelMap[id] || 0); for (let i = jewelInfo.lvLimited; i < gidJewelInfo.lvLimited; i++) {//当前消耗的宝石升级到目标宝石的消耗 if (((comJewelMap[id] || 0) % jewelInfo.count != 0)) {//jewelInfo的count,表示宝石id合成下一级需要的数量 @@ -35,13 +34,15 @@ export function checkMaterialEnough(consumes: Array<{ id: number, count: number } comJewelMap[jewelInfo.nextJewelId] = comcount + (comJewelMap[jewelInfo.nextJewelId] || 0);//jewelInfo的nextJewelId,表示宝石id合成下一级的宝石good_id delete comJewelMap[id]; - if (!!jewelInfo.specialCount) - needConsumes.push({ count: jewelInfo.specialCount * comcount, id: jewelInfo.nextSpecialId });//消耗中曾加合成下一级需要的特殊消耗物品的数量 + for(let origin of gidJewelInfo.composeMaterial) { + needConsumes.push({ id: origin.id, count: origin.count * jewelCount }); + } id = jewelInfo.nextJewelId; jewelInfo = getJewelById(jewelInfo.nextJewelId); } } + console.log('*******', JSON.stringify(needConsumes)); if (comJewelMap[jewel] != jewelCount || Object.keys(comJewelMap).length != 1)//检查最终是否可以合成目标宝石jewel,以及对应的数量jewelCount return false; return needConsumes;