Add extra bomb cooldown
This commit is contained in:
parent
a434ec9f49
commit
1300565017
95
index.js
95
index.js
|
@ -459,7 +459,6 @@ client.on("interactionCreate", async interaction => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
slotCooldowns[interaction.user.id] = Date.now() + (config.games.slots.cooldown * 60 * 1000);
|
|
||||||
|
|
||||||
// Check if they have enough money to play, 3 coins, if they do take it and continue
|
// Check if they have enough money to play, 3 coins, if they do take it and continue
|
||||||
balance = await checkPoints(interaction.user);
|
balance = await checkPoints(interaction.user);
|
||||||
|
@ -470,7 +469,12 @@ client.on("interactionCreate", async interaction => {
|
||||||
|
|
||||||
// Get the slot results, yes it's pre-defined, but it's not like it matters
|
// Get the slot results, yes it's pre-defined, but it's not like it matters
|
||||||
let slotResults = playSlotMachine();
|
let slotResults = playSlotMachine();
|
||||||
|
// If there is a slotResults.cooldownOverride use that instead
|
||||||
|
if (slotResults.cooldownOverride) {
|
||||||
|
slotCooldowns[interaction.user.id] = Date.now() + (slotResults.cooldownOverride * 60 * 1000);
|
||||||
|
} else {
|
||||||
|
slotCooldowns[interaction.user.id] = Date.now() + (config.games.slots.cooldown * 60 * 1000);
|
||||||
|
}
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: "Slots",
|
title: "Slots",
|
||||||
|
@ -755,55 +759,58 @@ function playSlotMachine() {
|
||||||
let jackpot = false;
|
let jackpot = false;
|
||||||
let bombs = false;
|
let bombs = false;
|
||||||
if (iconCounts['🍎'] === 2) {
|
if (iconCounts['🍎'] === 2) {
|
||||||
coinDifference = 1;
|
coinDifference = 1;
|
||||||
} else if (iconCounts['🍎'] === 3) {
|
} else if (iconCounts['🍎'] === 3) {
|
||||||
triple = true;
|
triple = true;
|
||||||
coinDifference = 2;
|
coinDifference = 2;
|
||||||
} else if (iconCounts['🍋'] === 2) {
|
} else if (iconCounts['🍋'] === 2) {
|
||||||
coinDifference = 3;
|
coinDifference = 3;
|
||||||
} else if (iconCounts['🍋'] === 3) {
|
} else if (iconCounts['🍋'] === 3) {
|
||||||
triple = true;
|
triple = true;
|
||||||
coinDifference = 5;
|
coinDifference = 5;
|
||||||
} else if (iconCounts['🍒'] === 2) {
|
} else if (iconCounts['🍒'] === 2) {
|
||||||
coinDifference = 5;
|
coinDifference = 5;
|
||||||
} else if (iconCounts['🍒'] === 3) {
|
} else if (iconCounts['🍒'] === 3) {
|
||||||
triple = true;
|
triple = true;
|
||||||
coinDifference = 7;
|
coinDifference = 7;
|
||||||
} else if (iconCounts['🍓'] === 2) {
|
} else if (iconCounts['🍓'] === 2) {
|
||||||
coinDifference = 7;
|
coinDifference = 7;
|
||||||
} else if (iconCounts['🍓'] === 3) {
|
} else if (iconCounts['🍓'] === 3) {
|
||||||
triple = true;
|
triple = true;
|
||||||
coinDifference = 9;
|
coinDifference = 9;
|
||||||
} else if (iconCounts['⭐'] === 2) {
|
} else if (iconCounts['⭐'] === 2) {
|
||||||
coinDifference = 9;
|
coinDifference = 9;
|
||||||
} else if (iconCounts['⭐'] === 3) {
|
} else if (iconCounts['⭐'] === 3) {
|
||||||
triple = true;
|
triple = true;
|
||||||
coinDifference = 12;
|
coinDifference = 12;
|
||||||
} else if (iconCounts['🌵'] === 2) {
|
} else if (iconCounts['🌵'] === 2) {
|
||||||
coinDifference = 9;
|
coinDifference = 9;
|
||||||
} else if (iconCounts['🌵'] === 3) {
|
} else if (iconCounts['🌵'] === 3) {
|
||||||
jackpot = true;
|
jackpot = true;
|
||||||
coinDifference = 12;
|
coinDifference = 12;
|
||||||
} else if (iconCounts['💣'] === 2) {
|
} else if (iconCounts['💣'] === 2) {
|
||||||
bombs = true;
|
bombs = true;
|
||||||
coinDifference = -5;
|
coinDifference = -5;
|
||||||
} else if (iconCounts['💣'] === 3) {
|
} else if (iconCounts['💣'] === 3) {
|
||||||
bombs = true;
|
bombs = true;
|
||||||
coinDifference = -8;
|
coinDifference = -8;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iconCounts['💣'] === 1) {
|
if (iconCounts['💣'] === 1) {
|
||||||
bombs = true;
|
bombs = true;
|
||||||
jackpot = false;
|
jackpot = false;
|
||||||
triple = false;
|
triple = false;
|
||||||
coinDifference = -1;
|
coinDifference = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var cooldownOverride = 6 * iconCounts('💣'); // Change the cooldown to 6 minutes per bomb
|
||||||
|
|
||||||
const result = {
|
const result = {
|
||||||
jackpot,
|
jackpot,
|
||||||
triple,
|
triple,
|
||||||
bombs,
|
bombs,
|
||||||
spinResult,
|
spinResult,
|
||||||
|
cooldownOverride,
|
||||||
coinDifference
|
coinDifference
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue