* replay hand with H or R
This commit is contained in:
SpudGunMan
2024-09-27 18:06:11 -07:00
parent 77a6e63210
commit 248977c5b5
4 changed files with 17 additions and 11 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ except Exception as e:
print ("\n Meshing-Around Database Admin Tool\n")
print ("System: bbs_messages")
print (bbs_messages)
print ("System: bbs_dm")
print ("\nSystem: bbs_dm")
print (bbs_dm)
print (f"\n\nGame HS tables\n")
print (f"lemon:{lemon_score}")
+2 -2
View File
@@ -373,7 +373,7 @@ def handleBlackJack(nodeID, message):
highScore = loadHSJack()
if highScore != 0:
if highScore['nodeID'] != 0:
msg += f" Ranking🥇:{get_name_from_number(highScore['nodeID'])} with {highScore['highScore']} chips. "
msg += f" HighScore🥇:{get_name_from_number(highScore['nodeID'])} with {highScore['highScore']} chips. "
time.sleep(1)
return msg
@@ -405,7 +405,7 @@ def handleVideoPoker(nodeID, message):
highScore = loadHSVp()
if highScore != 0:
if highScore['nodeID'] != 0:
msg += f" Ranking🥇:{get_name_from_number(highScore['nodeID'])} with {highScore['highScore']} chips. "
msg += f" HighScore🥇:{get_name_from_number(highScore['nodeID'])} with {highScore['highScore']} chips. "
if last_cmd != "":
logger.debug(f"System: VideoPoker: {nodeID} last command: {last_cmd}")
+13 -7
View File
@@ -280,6 +280,10 @@ def playBlackJack(nodeID, message):
if message.lower() == "b":
if bet_money == 0:
bet_money = 5
elif message.lower() == "r":
#resend the hand
msg += show_some(p_cards, d_cards, p_hand)
return msg
else:
try:
bet_money = int(message)
@@ -314,7 +318,7 @@ def playBlackJack(nodeID, message):
if getLastCmdJack(nodeID) == "betPlaced":
setLastCmdJack(nodeID, "playing")
msg += "(H)it,(S)tand,(F)orfit,(D)ouble"
msg += "(H)it,(S)tand,(F)orfit,(D)ouble,(R)esend,(L)eave table"
# save the game state
for i in range(len(jackTracker)):
@@ -356,18 +360,20 @@ def playBlackJack(nodeID, message):
setLastCmdJack(nodeID, "dealerTurn")
else:
return "You can't Double Down, dont have enough chips"
elif choice == "resend" or choice == "r":
msg += show_some(p_hand.cards, d_cards, p_hand)
else:
return "Invalid Choice please choose [H,S,F,D]"
return "(H)it,(S)tand,(F)orfit,(D)ouble,(R)esend,(L)eave table"
# Check if player bust
if player_bust(p_hand, p_chips):
d_win += 1
msg += "Player:BUST💥"
msg += "💥PlayerBUST💥"
setLastCmdJack(nodeID, "dealerTurn")
if getLastCmdJack(nodeID) == "playing":
msg += stats
msg += "[H,S,F,D,L]"
msg += "[H,S,F,D]"
# Save the game state
for i in range(len(jackTracker)):
@@ -412,7 +418,7 @@ def playBlackJack(nodeID, message):
d_hand.add_cards(d_card)
if dealer_bust(d_hand, p_hand, p_chips):
p_win += 1
msg += "Dealer:BUST💥"
msg += "💰DealerBUST💥"
break
# Show all cards
msg += show_all(p_hand.cards, d_hand.cards, p_hand, d_hand)
@@ -444,12 +450,12 @@ def playBlackJack(nodeID, message):
# check high score
highScore = loadHSJack()
if highScore != 0 and p_chips.total > highScore['highScore']:
msg += f"🎉New High Score! {p_chips.total} "
msg += f"💰💰High Score{p_chips.total} "
saveHSJack(nodeID, p_chips.total)
else:
msg += f"💰You have {p_chips.total} chips "
msg += "(B)et or (L)eave table."
msg += "place a bet?"
# Reset the game
setLastCmdJack(nodeID, "new")
+1 -1
View File
@@ -369,7 +369,7 @@ def playVideoPoker(nodeID, message):
vpTracker[i]['deck'] = deck
vpTracker[i]['drawCount'] = drawCount
msg += f"\nDeal new card? \nex: 1,3,4 or (N)o,(A)ll"
msg += f"\nDeal new card? \nex: 1,3,4 or (N)o,(A)ll (H)and"
setLastCmdVp(nodeID, "redraw")
return msg