From 1a079a190c5657a4bdbe5fe589468b522ec43327 Mon Sep 17 00:00:00 2001 From: zhangxk Date: Thu, 7 Sep 2023 15:47:52 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E7=A8=B7=E4=B8=8B=E5=AD=A6?= =?UTF-8?q?=E5=AE=AB):=20=E4=BF=AE=E5=A4=8D=E6=B3=95=E9=98=B5=E5=BD=B1?= =?UTF-8?q?=E5=93=8D=E8=A1=80=E9=87=8F,=20=E4=BF=AE=E6=94=B9=E5=9C=A3?= =?UTF-8?q?=E7=89=A9usecount=E5=BD=B1=E5=93=8D=E6=B3=95=E9=98=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/battle/rougeEffectService.ts | 7 ++++--- game-server/app/services/battle/rougeTechService.ts | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/game-server/app/services/battle/rougeEffectService.ts b/game-server/app/services/battle/rougeEffectService.ts index 219815d31..46ebbb2f7 100644 --- a/game-server/app/services/battle/rougeEffectService.ts +++ b/game-server/app/services/battle/rougeEffectService.ts @@ -350,7 +350,7 @@ export class RougeEffect { this.updateHolyMapUseCount(this.holyMap.get(cardCode)); } - + return addRatio; } @@ -661,8 +661,9 @@ export async function checkCanReRandomReward(roleId: string, gameCode: string, r } -export function getHolyCardIsUse(holy: { cardId: number, useCount: number }) { - const { useCount = 0, cardId } = (holy || {}); +export function getHolyCardIsUse(holy: { cardId: number, useCount: number, cardCode:string}) { + const { useCount = 0, cardId, cardCode } = (holy || {}); + if(!cardCode) return true;//法阵不存在cardCode if (!cardId) return; const holyCardData = gameData.rougeHolyCard.get(cardId) if (!holyCardData) return; diff --git a/game-server/app/services/battle/rougeTechService.ts b/game-server/app/services/battle/rougeTechService.ts index 7b39608cb..aef89f45a 100644 --- a/game-server/app/services/battle/rougeTechService.ts +++ b/game-server/app/services/battle/rougeTechService.ts @@ -45,18 +45,18 @@ async function calCircleCe(roleId: string, unlockedTech: number[], circles: Circ export async function updateEffectId(techData: RougelikeTechType) { let effectIds = getTechEffectIdsByData(techData); if(!compareNumberArray(effectIds, techData.effectIds||[])) { + await RougelikeTechModel.updateEffectId(techData.roleId, effectIds); if (hasMaxHpUpdate(effectIds, techData.effectIds||[])) { const dbRecord = await RougelikeRecordModel.findByRoleIdAndStatus(techData.roleId, ROUGE_LIKE_STATUS.SUCCESS) if(dbRecord) await updateMaxHp(techData.roleId, dbRecord.gameCode, dbRecord.type, dbRecord.grade) } - await RougelikeTechModel.updateEffectId(techData.roleId, effectIds); } } function hasMaxHpUpdate(effectIds: number[], oldEffectIds: number[]) { let newEffectIds: number[] = []; for(let effectId of effectIds) { - if (oldEffectIds.includes(effectId)) newEffectIds.push(effectId); + if (!oldEffectIds.includes(effectId)) newEffectIds.push(effectId); } for(let effectId of newEffectIds) { let dicRougeEffect = gameData.rougeEffect.get(effectId);