Skip to content

Commit

Permalink
Merge pull request #199 from RikyTales/free-christmas-hatch
Browse files Browse the repository at this point in the history
Everyone gets a guaranteed hatch on Christmas
  • Loading branch information
mmerfort authored Dec 25, 2023
2 parents 6a0975c + 509cef6 commit c1a8c22
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/commands/NFD.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit c1a8c22

Please sign in to comment.