mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-07-13 21:31:22 +02:00
cleanupBlackJack
This commit is contained in:
+2
-1
@@ -718,8 +718,9 @@ def handleBlackJack(message, nodeID, deviceID):
|
||||
|
||||
# Create new player if not found
|
||||
if not player and nodeID != 0:
|
||||
logger.debug(f"System: BlackJack: New Player {nodeID}")
|
||||
jackTracker.append({'nodeID': nodeID, 'cmd': 'new', 'last_played': time.time()})
|
||||
msg += "Welcome to 🃏BlackJack!🃏\n"
|
||||
msg += "Welcome to 🃏BlackJack!♣️♦️\n"
|
||||
# Show high score if available
|
||||
highScore = loadHSJack()
|
||||
if highScore and highScore.get('nodeID', 0) != 0:
|
||||
|
||||
@@ -266,11 +266,15 @@ def playBlackJack(nodeID, message):
|
||||
next_card = jackTracker[i]['next_card']
|
||||
|
||||
if last_cmd is None:
|
||||
if p_chips.total < 1:
|
||||
p_chips.total = jack_starting_cash
|
||||
else:
|
||||
pass
|
||||
# create new player if not in tracker
|
||||
logger.debug(f"System: BlackJack: New Player {nodeID}")
|
||||
jackTracker.append({'nodeID': nodeID, 'cmd': 'new', 'last_played': time.time(), 'cash': jack_starting_cash,\
|
||||
'bet': 0, 'gameStats': {'p_win': p_win, 'd_win': d_win, 'draw': draw}, 'p_cards':p_cards, 'd_cards':d_cards, 'p_hand':p_hand.cards, 'd_hand':d_hand.cards, 'next_card':next_card})
|
||||
return f"Welcome to ♠️♥️BlackJack♣️♦️ you have {p_chips.total} chips. Whats your bet?"
|
||||
#logger.debug(f"System: BlackJack: New Player {nodeID}")
|
||||
#jackTracker.append({'nodeID': nodeID, 'cmd': 'new', 'last_played': time.time(), 'cash': jack_starting_cash,\
|
||||
## 'bet': 0, 'gameStats': {'p_win': p_win, 'd_win': d_win, 'draw': draw}, 'p_cards':p_cards, 'd_cards':d_cards, 'p_hand':p_hand.cards, 'd_hand':d_hand.cards, 'next_card':next_card})
|
||||
return f"You have {p_chips.total} chips. Whats your bet?"
|
||||
|
||||
if getLastCmdJack(nodeID) == "new":
|
||||
# Place Bet
|
||||
|
||||
Reference in New Issue
Block a user