mirror of
https://github.com/Xameren/Casino.git
synced 2025-02-04 08:29:24 +01:00
Updated code
\ Made code for the slots and horse betting less if-elif-else-y and added a menu() for Daily rewards + Lowered the chances of "X" on slots
This commit is contained in:
parent
8fe2e78103
commit
d0be9b38dc
1 changed files with 32 additions and 67 deletions
99
Casino.py
99
Casino.py
|
@ -18,7 +18,7 @@ RouletteWheelColors = ["🟩", "🟥", "⬛", "🟥", "⬛", "🟥", "⬛", "
|
||||||
RouletteRed = [1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36]
|
RouletteRed = [1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36]
|
||||||
RouletteBlack = [2, 4, 6, 8, 10, 11, 13, 15, 17, 20, 22, 24, 26, 28, 29, 31, 33, 35]
|
RouletteBlack = [2, 4, 6, 8, 10, 11, 13, 15, 17, 20, 22, 24, 26, 28, 29, 31, 33, 35]
|
||||||
|
|
||||||
SlotSymbols = ["❌", "🍒", "🔔", "🍋", "❌", "🍒", "🔔", "🍋", "💎"] # Intended for Slot Mashines
|
SlotSymbols = ["❌", "🍒", "🔔", "🍋", "🍒", "🔔", "🍋", "💎"] # Intended for Slot Mashines
|
||||||
|
|
||||||
# Keno. No list to implement
|
# Keno. No list to implement
|
||||||
# Horse betting. No list to implement
|
# Horse betting. No list to implement
|
||||||
|
@ -361,24 +361,12 @@ def Slots():
|
||||||
xpwin += winxp
|
xpwin += winxp
|
||||||
|
|
||||||
|
|
||||||
if slot == "🍒":
|
conditions = ["🍒", "🍋", "🔔", "💎", "🍒2", "🍋2", "🔔2", "💎2"]
|
||||||
win_win_slots(1.25, 3)
|
MoneyMultiplier = [1.25, 1.5, 1.75, 2, 3, 4, 5, 10]
|
||||||
elif slot == "🍋":
|
XpMultiplier = [3, 4, 5, 10, 10, 15, 20, 25]
|
||||||
win_win_slots(1.5, 4)
|
for index in range(8):
|
||||||
elif slot == "🔔":
|
if slot == conditions[index]:
|
||||||
win_win_slots(1.75, 5)
|
win_win_slots(MoneyMultiplier[index], XpMultiplier[index])
|
||||||
elif slot == "💎":
|
|
||||||
win_win_slots(2, 10)
|
|
||||||
elif slot == "🍒2":
|
|
||||||
win_win_slots(3, 10)
|
|
||||||
elif slot == "🍋2":
|
|
||||||
win_win_slots(4, 15)
|
|
||||||
elif slot == "🔔2":
|
|
||||||
win_win_slots(5, 20)
|
|
||||||
elif slot == "💎2":
|
|
||||||
win_win_slots(10, 25)
|
|
||||||
else:
|
|
||||||
print("som mes up")
|
|
||||||
for _ in range(12):
|
for _ in range(12):
|
||||||
decor_print = "/"
|
decor_print = "/"
|
||||||
decor_1 = "/"
|
decor_1 = "/"
|
||||||
|
@ -566,14 +554,16 @@ def HorseBettin():
|
||||||
|
|
||||||
random_float_1 = round(random.uniform(1, 2), 2)
|
random_float_1 = round(random.uniform(1, 2), 2)
|
||||||
random_float_2 = round(random.uniform(1, 2), 2)
|
random_float_2 = round(random.uniform(1, 2), 2)
|
||||||
|
random_float_3 = round(random.uniform(1, 2), 2)
|
||||||
|
random_float_4 = round(random.uniform(1, 2), 2)
|
||||||
|
|
||||||
print("🐎 Welcome to horse betting 🐎\n")
|
print("🐎 Welcome to horse betting 🐎\n")
|
||||||
print("The point of the game is to bet on the horse that will win the race\nYour winnings are calculated using the odds of winning (bet*odds)\n")
|
print("The point of the game is to bet on the horse that will win the race\nYour winnings are calculated using the odds of winning (bet*odds)\n")
|
||||||
print("Current odds:")
|
print("Current odds:")
|
||||||
print("Horse 1: ", round(random_float_1,2))
|
print("Horse 1: ", round(random_float_1,2))
|
||||||
print("Horse 2: ", round((random_float_2 + 0.15),2))
|
print("Horse 2: ", round((random_float_2),2))
|
||||||
print("Horse 3: ", round((random_float_1 + 0.15),2))
|
print("Horse 3: ", round((random_float_3),2))
|
||||||
print("Horse 4: ", round((random_float_2),2))
|
print("Horse 4: ", round((random_float_4),2))
|
||||||
print(f"\nCurrent balance: {money}")
|
print(f"\nCurrent balance: {money}")
|
||||||
print("Pick a horse you will bet on")
|
print("Pick a horse you will bet on")
|
||||||
|
|
||||||
|
@ -634,42 +624,19 @@ def HorseBettin():
|
||||||
print("Horse 4: [", Horse4progressleft, "🏇", Horse4progressright, "]")
|
print("Horse 4: [", Horse4progressleft, "🏇", Horse4progressright, "]")
|
||||||
print(cooleffecthorsetexttitle)
|
print(cooleffecthorsetexttitle)
|
||||||
|
|
||||||
if Horse1progressright == "":
|
for index in range(4):
|
||||||
horsiewinner == "Horse 1"
|
horseright = [Horse1progressright, Horse2progressright, Horse3progressright, Horse4progressright]
|
||||||
print("# Horse 1 won the race! #")
|
horses = ["Horse 1", "Horse 2", "Horse 3", "Horse 4"]
|
||||||
if horsiechooseinput == 1:
|
floats = [random_float_1, random_float_2, random_float_3, random_float_4]
|
||||||
winhorsebetting(horsiebetinput, random_float_1, "Horse 1")
|
if horseright[index] == "":
|
||||||
break
|
horsiewinner = horses[index]
|
||||||
else:
|
if horsiechooseinput == index + 1:
|
||||||
losehorsebetting(horsiebetinput, "Horse 1")
|
winhorsebetting(horsiebetinput, floats[index], horsiewinner)
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
losehorsebetting(horsiebetinput, horsiewinner)
|
||||||
|
break
|
||||||
|
|
||||||
if Horse2progressright == "":
|
|
||||||
horsiewinner == "Horse 2"
|
|
||||||
if horsiechooseinput == 2:
|
|
||||||
winhorsebetting(horsiebetinput, random_float_2+0.15, "Horse 2")
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
losehorsebetting(horsiebetinput, "Horse 2")
|
|
||||||
break
|
|
||||||
|
|
||||||
if Horse3progressright == "":
|
|
||||||
horsiewinner == "Horse 3"
|
|
||||||
if horsiechooseinput == 3:
|
|
||||||
winhorsebetting(horsiebetinput, random_float_1+0.15, "Horse 3")
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
losehorsebetting(horsiebetinput, "Horse 3")
|
|
||||||
break
|
|
||||||
|
|
||||||
if Horse4progressright == "":
|
|
||||||
horsiewinner == "Horse 4"
|
|
||||||
if horsiechooseinput == 4:
|
|
||||||
winhorsebetting(horsiebetinput, random_float_2, "Horse 4")
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
losehorsebetting(horsiebetinput, "Horse 4")
|
|
||||||
break
|
|
||||||
round(money, 0)
|
round(money, 0)
|
||||||
print("Your current balance:", money)
|
print("Your current balance:", money)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
@ -929,6 +896,9 @@ def Crash():
|
||||||
|
|
||||||
def dailyreward():
|
def dailyreward():
|
||||||
global money, xp, lastrewardtime, json_datetime
|
global money, xp, lastrewardtime, json_datetime
|
||||||
|
def menu():
|
||||||
|
print("\033[H\033[J", end="")
|
||||||
|
print("Your daily reward is...")
|
||||||
print("\033[H\033[J", end="")
|
print("\033[H\033[J", end="")
|
||||||
|
|
||||||
currenttime = datetime.now()
|
currenttime = datetime.now()
|
||||||
|
@ -946,8 +916,7 @@ def dailyreward():
|
||||||
if timediff.days >= 1:
|
if timediff.days >= 1:
|
||||||
print("Spin a wheel which gives you a random amount of money or XP.\nThe more levels that you have, the bigger the payout\n\nPress enter to continue")
|
print("Spin a wheel which gives you a random amount of money or XP.\nThe more levels that you have, the bigger the payout\n\nPress enter to continue")
|
||||||
input()
|
input()
|
||||||
print("\033[H\033[J", end="")
|
menu()
|
||||||
print("Your daily reward is...")
|
|
||||||
decordaily = ""
|
decordaily = ""
|
||||||
for _ in range(5):
|
for _ in range(5):
|
||||||
print("\033[H\033[J", end="")
|
print("\033[H\033[J", end="")
|
||||||
|
@ -961,25 +930,21 @@ def dailyreward():
|
||||||
bigrandom = random.randint(1, 2)
|
bigrandom = random.randint(1, 2)
|
||||||
if bigrandom == 1:
|
if bigrandom == 1:
|
||||||
randmoney = random.choice(dailyrewardlistmoney)
|
randmoney = random.choice(dailyrewardlistmoney)
|
||||||
print("\033[H\033[J", end="")
|
menu()
|
||||||
print("Your daily reward is...")
|
|
||||||
print(f"[ {randmoney*level} $ ]")
|
print(f"[ {randmoney*level} $ ]")
|
||||||
else:
|
else:
|
||||||
randxp = random.choice(dailyrewardlistXP)
|
randxp = random.choice(dailyrewardlistXP)
|
||||||
print("\033[H\033[J", end="")
|
menu()
|
||||||
print("Your daily reward is...")
|
|
||||||
print(f"[ {randxp*level} XP ]")
|
print(f"[ {randxp*level} XP ]")
|
||||||
sleepytime += 0.1
|
sleepytime += 0.1
|
||||||
time.sleep(sleepytime)
|
time.sleep(sleepytime)
|
||||||
if bigrandom == 1:
|
if bigrandom == 1:
|
||||||
money += randmoney*level
|
money += randmoney*level
|
||||||
print("\033[H\033[J", end="")
|
menu()
|
||||||
print("Your daily reward is...")
|
|
||||||
print(f"> {randmoney*level} $ <")
|
print(f"> {randmoney*level} $ <")
|
||||||
else:
|
else:
|
||||||
xp += randxp*level
|
xp += randxp*level
|
||||||
print("\033[H\033[J", end="")
|
menu()
|
||||||
print("Your daily reward is...")
|
|
||||||
print(f"> {randxp*level} XP <")
|
print(f"> {randxp*level} XP <")
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
lastrewardtime = datetime.now()
|
lastrewardtime = datetime.now()
|
||||||
|
|
Loading…
Add table
Reference in a new issue