mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-06-23 11:31:15 +02:00
enhance
This commit is contained in:
+9
-12
@@ -272,24 +272,22 @@ def playVideoPoker(nodeID, message):
|
||||
try:
|
||||
bet = int(message)
|
||||
except ValueError:
|
||||
msg = "Please enter a valid bet amount. 1 to 5 coins."
|
||||
msg += "Please enter a valid bet amount. 1 to 5 coins."
|
||||
|
||||
# Check if bet is valid
|
||||
|
||||
if bet > player.bankroll:
|
||||
msg = "You can only bet the money you have. No strip poker here..."
|
||||
msg += "You can only bet the money you have. No strip poker here..."
|
||||
elif bet < 1:
|
||||
msg = "You must bet at least 1 coin."
|
||||
msg += "You must bet at least 1 coin."
|
||||
elif bet > 5:
|
||||
msg = "You can only bet up to 5 coins."
|
||||
|
||||
# take bet
|
||||
msg = player.bet(str(message))
|
||||
msg += "You can only bet up to 5 coins."
|
||||
|
||||
# if msg contains an error, return it
|
||||
if msg is not None and msg != '':
|
||||
return msg
|
||||
else:
|
||||
# Take the bet
|
||||
player.bet(str(message))
|
||||
# Bet placed, start the game
|
||||
setLastCmdVp(nodeID, "playing")
|
||||
|
||||
@@ -363,10 +361,9 @@ def playVideoPoker(nodeID, message):
|
||||
|
||||
if player.bankroll < 1:
|
||||
player.bankroll = vpStartingCash
|
||||
msg += "\nLooks 💸 like you're out of money. 🏧🪙 resetting ballance"
|
||||
|
||||
# check if player has new high score
|
||||
if player.bankroll > vpTracker[i]['highScore']:
|
||||
msg += "\nLooks 💸 like you're out of money. 💳 resetting ballance 🏧"
|
||||
elif player.bankroll > vpTracker[i]['highScore']:
|
||||
vpTracker[i]['highScore'] = player.bankroll
|
||||
msg += " 🎉HighScore! {} coins.".format(player.bankroll)
|
||||
else:
|
||||
msg += " Score is {} coins.".format(vpTracker[i]['highScore'])
|
||||
|
||||
Reference in New Issue
Block a user