From ae35f6152216e67c70e187830a7368b603fe261a Mon Sep 17 00:00:00 2001 From: DeSqBlocki Date: Sat, 22 Aug 2026 20:59:25 +0200 Subject: [PATCH] added cookie collect button --- buttons/crumbSaucer/collectCookies.js | 20 ++++++++++++++++++++ commands/applications/cookies.js | 2 +- utils/cookieHeist.js | 27 ++++++++++++++++----------- utils/crumbSaucer.js | 8 +++++++- 4 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 buttons/crumbSaucer/collectCookies.js diff --git a/buttons/crumbSaucer/collectCookies.js b/buttons/crumbSaucer/collectCookies.js new file mode 100644 index 0000000..a196b0b --- /dev/null +++ b/buttons/crumbSaucer/collectCookies.js @@ -0,0 +1,20 @@ +const { + collectCookies +} = require( + "../../commands/applications/cookies" +); + + +module.exports = { + name: + "crumbSaucerCollect", + + + async execute( + interaction + ) { + return collectCookies( + interaction + ); + } +}; \ No newline at end of file diff --git a/commands/applications/cookies.js b/commands/applications/cookies.js index 089bdb7..33a20bb 100644 --- a/commands/applications/cookies.js +++ b/commands/applications/cookies.js @@ -197,7 +197,7 @@ async function collect(interaction) { let amount = randomInteger( 1, - 200 + 1000 ); diff --git a/utils/cookieHeist.js b/utils/cookieHeist.js index b77b7a4..f68735f 100644 --- a/utils/cookieHeist.js +++ b/utils/cookieHeist.js @@ -48,7 +48,8 @@ const HEIST_METHODS = { maxStealAmount: 1500, minPenaltyPercent: 0.01, - maxPenaltyPercent: 0.04 + maxPenaltyPercent: 0.04, + maxPenaltyAmount: 750 }, Hack: { @@ -59,7 +60,8 @@ const HEIST_METHODS = { maxStealAmount: 3500, minPenaltyPercent: 0.03, - maxPenaltyPercent: 0.07 + maxPenaltyPercent: 0.07, + maxPenaltyAmount: 2000 }, Smash: { @@ -70,7 +72,8 @@ const HEIST_METHODS = { maxStealAmount: 7500, minPenaltyPercent: 0.06, - maxPenaltyPercent: 0.12 + maxPenaltyPercent: 0.12, + maxPenaltyAmount: 5000 } }; @@ -111,10 +114,10 @@ async function resolveCookieHeist( if ( type !== - "cookieHeist" + "cookieHeist" || ownerId !== - interaction.user.id + interaction.user.id ) { return temporaryEphemeralReply( interaction, @@ -132,7 +135,7 @@ async function resolveCookieHeist( const method = HEIST_METHODS[ - methodName + methodName ]; @@ -231,10 +234,10 @@ async function resolveCookieHeist( if ( playerCookies < - 1 + 1 || vaultCookies < - 1 + 1 ) { return interaction.editReply({ embeds: [ @@ -571,6 +574,8 @@ async function resolveCookieHeist( penaltyPercent ), + method.maxPenaltyAmount, + playerCookies ) ); @@ -858,7 +863,7 @@ function getHeistProgressText( methodName ) { switch ( - methodName + methodName ) { case "Sneak": return [ @@ -906,7 +911,7 @@ function getSuccessText( switch ( - methodName + methodName ) { case "Sneak": return ( @@ -950,7 +955,7 @@ function getFailureText( switch ( - methodName + methodName ) { case "Sneak": return [ diff --git a/utils/crumbSaucer.js b/utils/crumbSaucer.js index de1d9cc..b00e4e2 100644 --- a/utils/crumbSaucer.js +++ b/utils/crumbSaucer.js @@ -102,7 +102,13 @@ function buildMainMenuButtons() { .setCustomId("abort") .setLabel("Close") .setEmoji("✖️") - .setStyle(ButtonStyle.Secondary) + .setStyle(ButtonStyle.Secondary), + + new ButtonBuilder() + .setCustomId("crumbSaucerCollect") + .setLabel("Collect") + .setEmoji("🍪") + .setStyle(ButtonStyle.Success) ) ]; }