GUH
This commit is contained in:
parent
3024a3f489
commit
70e05a7de2
|
@ -108,7 +108,7 @@
|
|||
},
|
||||
{
|
||||
"name": "slots",
|
||||
"description": "Play the slots",
|
||||
"description": "Play the slots (Costs 3 coins)",
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
|
|
21
index.js
21
index.js
|
@ -511,13 +511,16 @@ client.on("interactionCreate", async interaction => {
|
|||
}]
|
||||
});
|
||||
// Check if they won or lost, if they won, give them the prize
|
||||
await checkAndModifyPoints(interaction.user.id, slotResults.coinDifference);
|
||||
if (slotResults.coinDifference > 0) {
|
||||
await checkAndModifyPoints(interaction.user.id, 3); // Give them the 3 coins back
|
||||
difference = await new Number(slotResults.coinDifference);
|
||||
await checkAndModifyPoints(interaction.user, difference);
|
||||
newBal = await checkPoints(interaction.user);
|
||||
if (difference > 0) {
|
||||
await checkAndModifyPoints(interaction.user, 3);
|
||||
if (slotResults.jackpot) {
|
||||
return await interaction.editReply({
|
||||
embeds: [{
|
||||
title: "Jackpot!",
|
||||
description: `:rotating_light: ${slotResults.spinResult[0]}${slotResults.spinResult[1]}${slotResults.spinResult[2]} :rotating_light:\nYou won the jackpot! (${slotResults.coinDifference} coins)`,
|
||||
description: `:rotating_light: ${slotResults.spinResult[0]}${slotResults.spinResult[1]}${slotResults.spinResult[2]} :rotating_light:\nYou won the jackpot! (${difference} coins)`,
|
||||
color: 0xffffff
|
||||
}]
|
||||
});
|
||||
|
@ -525,7 +528,7 @@ client.on("interactionCreate", async interaction => {
|
|||
return await interaction.editReply({
|
||||
embeds: [{
|
||||
title: "Triple!",
|
||||
description: `${slotResults.spinResult[0]}${slotResults.spinResult[1]}${slotResults.spinResult[2]}\nYou won ${slotResults.coinDifference} coins!`,
|
||||
description: `${slotResults.spinResult[0]}${slotResults.spinResult[1]}${slotResults.spinResult[2]}\nYou won ${difference} coins!`,
|
||||
color: 0x00ffff
|
||||
}]
|
||||
});
|
||||
|
@ -533,7 +536,7 @@ client.on("interactionCreate", async interaction => {
|
|||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: "Slots",
|
||||
description: `${slotResults.spinResult[0]}${slotResults.spinResult[1]}${slotResults.spinResult[2]}\nYou won ${slotResults.coinDifference} coins!`,
|
||||
description: `${slotResults.spinResult[0]}${slotResults.spinResult[1]}${slotResults.spinResult[2]}\nYou won ${difference} coins!`,
|
||||
color: 0x00ff00
|
||||
}]
|
||||
});
|
||||
|
@ -545,7 +548,7 @@ client.on("interactionCreate", async interaction => {
|
|||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: "Bombs!",
|
||||
description: `${slotResults.spinResult[0]}${slotResults.spinResult[1]}${slotResults.spinResult[2]}\nYou lost ${Math.abs(slotResults.coinDifference)} coins!\nYou now have ${await checkPoints(interaction.user)} coins.`,
|
||||
description: `${slotResults.spinResult[0]}${slotResults.spinResult[1]}${slotResults.spinResult[2]}\nYou lost ${Math.abs(difference)} coins!`,
|
||||
color: 0xff0000
|
||||
}]
|
||||
});
|
||||
|
@ -553,7 +556,7 @@ client.on("interactionCreate", async interaction => {
|
|||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: "Slots",
|
||||
description: `${slotResults.spinResult[0]}${slotResults.spinResult[1]}${slotResults.spinResult[2]}\nYou lost ${Math.abs(slotResults.coinDifference)} coins!\nYou now have ${await checkPoints(interaction.user)} coins.`,
|
||||
description: `${slotResults.spinResult[0]}${slotResults.spinResult[1]}${slotResults.spinResult[2]}\nYou lost ${Math.abs(difference)} coins!`,
|
||||
color: 0xff0000
|
||||
}]
|
||||
});
|
||||
|
@ -755,7 +758,7 @@ function playSlotMachine() {
|
|||
return counts;
|
||||
}, {});
|
||||
|
||||
let coinDifference = -3; // Default coin difference for no match
|
||||
let coinDifference = 0; // Default coin difference for no match, they just lose the play cost
|
||||
let triple = false;
|
||||
let jackpot = false;
|
||||
let bombs = false;
|
||||
|
|
Loading…
Reference in a new issue