From a3f307d87e6ea0b638c92a31685c5cbdb4eb5b30 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Fri, 27 Dec 2024 18:12:33 +0000 Subject: [PATCH] Fix EffectHelper using Guid to find detail not name --- src/commands/drop.ts | 2 ++ src/helpers/EffectHelper.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/commands/drop.ts b/src/commands/drop.ts index 8d82d81..f28c83e 100644 --- a/src/commands/drop.ts +++ b/src/commands/drop.ts @@ -53,6 +53,8 @@ export default class Drop extends Command { const hasChanceUpEffect = await EffectHelper.HasEffect(interaction.user.id, "unclaimed"); + console.log(hasChanceUpEffect); + if (hasChanceUpEffect && Math.random() <= CardConstants.UnusedChanceUpChance) { randomCard = await CardDropHelperMetadata.GetRandomCardUnclaimed(interaction.user.id); } else { diff --git a/src/helpers/EffectHelper.ts b/src/helpers/EffectHelper.ts index 26aab8c..1033ada 100644 --- a/src/helpers/EffectHelper.ts +++ b/src/helpers/EffectHelper.ts @@ -37,16 +37,19 @@ export default class EffectHelper { const now = new Date(); if (!effect || effect.Unused == 0) { + console.log(1); return false; } - const effectDetail = EffectDetails.get(effect.Id); + const effectDetail = EffectDetails.get(effect.Name); if (!effectDetail) { + console.log(2); return false; } if (effect.WhenExpires && now < new Date(effect.WhenExpires.getMilliseconds() + effectDetail.cooldown)) { + console.log(3); return false; }