From ca30f67f2ef81ca65d46e5670cd7c7a7d56e1872 Mon Sep 17 00:00:00 2001 From: Riccardo Fano Date: Mon, 25 Dec 2023 11:03:20 +0100 Subject: [PATCH] Everyone gets a guaranteed hatch on christmas --- src/commands/NFD.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/commands/NFD.ts b/src/commands/NFD.ts index 92fc807..d219731 100644 --- a/src/commands/NFD.ts +++ b/src/commands/NFD.ts @@ -148,7 +148,7 @@ class NFD { // Roll the hatch check const res = roll_dy_x_TimesPick_z(4, 1, 1) - if (res <= this.MAXIMUM_FAILED_HATCHES - ownerRecordPrev.consecutiveFails) { + if (res <= this.MAXIMUM_FAILED_HATCHES - ownerRecordPrev.consecutiveFails && !this.isTodayChristmas()) { this.updateDBfailedMint(ownerMember.id) const nowtime = Date.now() const nextMint = @@ -188,6 +188,12 @@ class NFD { }) } + private isTodayChristmas(): boolean { + const today = new Date() + // Day is between 1 and 31 while month is between 0 and 11 + return today.getDate() == 25 && today.getMonth() == 11 + } + @Slash({ name: 'view', description: 'View an existing dino.' }) @SlashGroup('dino') async view(