endgame cleanup

This commit is contained in:
SpudGunMan
2024-09-18 01:14:57 -07:00
parent e49e63f39a
commit bf52369d2d
2 changed files with 5 additions and 2 deletions

View File

@@ -371,6 +371,8 @@ def endGame(nodeID):
return msg
if cash < starting_cash:
msg = "You lost money, better go get a real job.💸"
logger.debug("System: DopeWars: Game Over for user: " + str(nodeID) + " with cash: " + str(cash))
return msg

View File

@@ -94,7 +94,7 @@ def start_lemonade(nodeID, message, celsius=False):
lemonadeScore[i]['value'] = score.value
lemonadeScore[i]['total'] = score.total
def endGame():
def endGame(nodeID):
# remove the player from the tracker
for i in range(len(lemonadeTracker)):
if lemonadeTracker[i]['nodeID'] == nodeID:
@@ -114,10 +114,11 @@ def start_lemonade(nodeID, message, celsius=False):
for i in range(len(lemonadeScore)):
if lemonadeScore[i]['nodeID'] == nodeID:
lemonadeScore.pop(i)
logger.debug("System: Lemonade: Game Over for " + str(nodeID))
# Check for end of game
if "end" in message.lower():
endGame()
endGame(nodeID)
return "Goodbye!👋"
title="Lemonade Stand🍋"