summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2022-10-04 12:41:34 -0400
committerTyler Murphy <tylermurphy534@gmail.com>2022-10-04 12:41:34 -0400
commit77144b15e7c303631f2beaebc493f7a495e4ccbe (patch)
treed61ccd919a681f0cf2910c62bd4e3193338961c1 /src/main
parentMerge branch 'master' of https://github.com/tylermurphy534/KenBotReborn (diff)
downloadken-77144b15e7c303631f2beaebc493f7a495e4ccbe.tar.gz
ken-77144b15e7c303631f2beaebc493f7a495e4ccbe.tar.bz2
ken-77144b15e7c303631f2beaebc493f7a495e4ccbe.zip
remove money after bet
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/net/tylermurphy/ken/command/game/Roulette.java4
-rw-r--r--src/main/java/net/tylermurphy/ken/command/game/Slots.java2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/net/tylermurphy/ken/command/game/Roulette.java b/src/main/java/net/tylermurphy/ken/command/game/Roulette.java
index 05a9d1b..1454275 100644
--- a/src/main/java/net/tylermurphy/ken/command/game/Roulette.java
+++ b/src/main/java/net/tylermurphy/ken/command/game/Roulette.java
@@ -45,7 +45,7 @@ public class Roulette {
default -> false;
};
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()
.setAuthor("Roulette")
.appendDescription("`Balance:` "+money+"\n")
@@ -59,7 +59,7 @@ public class Roulette {
}
private String getColor(int rand){
- boolean even = (rand&2)==1;
+ boolean even = (rand%2)==1;
if(rand<3) return "green";
if(rand<=10)
if(even) return "black";
diff --git a/src/main/java/net/tylermurphy/ken/command/game/Slots.java b/src/main/java/net/tylermurphy/ken/command/game/Slots.java
index 2ccdef1..1664eea 100644
--- a/src/main/java/net/tylermurphy/ken/command/game/Slots.java
+++ b/src/main/java/net/tylermurphy/ken/command/game/Slots.java
@@ -47,6 +47,7 @@ public class Slots {
.appendDescription("`Balance:` "+money+"\n")
.appendDescription("`Bet:` "+bet+"\n")
.appendDescription(slot1.emoji + slot2.emoji + slot3.emoji + "\n");
+ money -= bet;
if(slot1.emoji.equals(slot2.emoji) && slot1.emoji.equals(slot3.emoji)){
// 3 of a kind
money += bet * slot2.full_reward;
@@ -58,7 +59,6 @@ public class Slots {
builder.setFooter("2 of a kind! ("+slot.half_reward+"x)");
} else {
// Fail
- money -= bet;
builder.setFooter("None of a kind, loose bet.");
}
builder.appendDescription("`New Balance:` "+money);