remove money after bet

This commit is contained in:
Tyler Murphy 2022-10-04 12:41:34 -04:00
parent 642f801ae4
commit 77144b15e7
2 changed files with 3 additions and 3 deletions

View file

@ -45,7 +45,7 @@ public class Roulette {
default -> false; default -> false;
}; };
int rate = getWinRate(guess); int rate = getWinRate(guess);
int balance = win ? money -bet + bet * rate : money - bet; int balance = win ? money - bet + bet * rate : money - bet;
EmbedBuilder builder = Ken.getInstance().getDefaultEmbed() EmbedBuilder builder = Ken.getInstance().getDefaultEmbed()
.setAuthor("Roulette") .setAuthor("Roulette")
.appendDescription("`Balance:` "+money+"\n") .appendDescription("`Balance:` "+money+"\n")
@ -59,7 +59,7 @@ public class Roulette {
} }
private String getColor(int rand){ private String getColor(int rand){
boolean even = (rand&2)==1; boolean even = (rand%2)==1;
if(rand<3) return "green"; if(rand<3) return "green";
if(rand<=10) if(rand<=10)
if(even) return "black"; if(even) return "black";

View file

@ -47,6 +47,7 @@ public class Slots {
.appendDescription("`Balance:` "+money+"\n") .appendDescription("`Balance:` "+money+"\n")
.appendDescription("`Bet:` "+bet+"\n") .appendDescription("`Bet:` "+bet+"\n")
.appendDescription(slot1.emoji + slot2.emoji + slot3.emoji + "\n"); .appendDescription(slot1.emoji + slot2.emoji + slot3.emoji + "\n");
money -= bet;
if(slot1.emoji.equals(slot2.emoji) && slot1.emoji.equals(slot3.emoji)){ if(slot1.emoji.equals(slot2.emoji) && slot1.emoji.equals(slot3.emoji)){
// 3 of a kind // 3 of a kind
money += bet * slot2.full_reward; money += bet * slot2.full_reward;
@ -58,7 +59,6 @@ public class Slots {
builder.setFooter("2 of a kind! ("+slot.half_reward+"x)"); builder.setFooter("2 of a kind! ("+slot.half_reward+"x)");
} else { } else {
// Fail // Fail
money -= bet;
builder.setFooter("None of a kind, loose bet."); builder.setFooter("None of a kind, loose bet.");
} }
builder.appendDescription("`New Balance:` "+money); builder.appendDescription("`New Balance:` "+money);