From 7a3f43a93742a50de0a2fae210f1c6e820c568cb Mon Sep 17 00:00:00 2001 From: Hex Ripley Date: Sat, 5 Apr 2025 18:37:47 -0700 Subject: [PATCH] Fix despair, add blank to result --- bot.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/bot.py b/bot.py index edddc4d..759789f 100644 --- a/bot.py +++ b/bot.py @@ -24,7 +24,7 @@ client = DiceBot() # Genesys dice definitions GENESYS_DICE = { 'g': [ # Green (Ability) - ('', ''), + ('n', ''), ('s', ''), ('s', ''), ('ss', ''), @@ -34,7 +34,7 @@ GENESYS_DICE = { ('aa', ''), ], 'y': [ # Yellow (Proficiency) - ('', ''), + ('n', ''), ('s', ''), ('s', ''), ('ss', ''), @@ -48,7 +48,7 @@ GENESYS_DICE = { ('t', ''), # Triumph counts as success ], 'p': [ # Purple (Difficulty) - ('', ''), + ('n', ''), ('f', ''), ('f,d', ''), ('d', ''), @@ -58,7 +58,7 @@ GENESYS_DICE = { ('f', ''), ], 'r': [ # Red (Challenge) - ('', ''), + ('n', ''), ('f', ''), ('f', ''), ('f,d', ''), @@ -69,11 +69,11 @@ GENESYS_DICE = { ('dd', ''), ('d,f', ''), ('d,f', ''), - ('d', ''), # Despair counts as failure + ('x', ''), # Despair counts as failure ], 'b': [ # Blue (Boost) - ('', ''), - ('', ''), + ('n', ''), + ('n', ''), ('s', ''), ('s,a', ''), ('aa', ''), @@ -117,6 +117,7 @@ def calculate_genesys_results(results: List[Tuple[str, str]]) -> Dict[str, int]: advantage = 0 triumph = 0 despair = 0 + blank = 0 for result, _ in results: for symbol in result.split(','): @@ -134,12 +135,15 @@ def calculate_genesys_results(results: List[Tuple[str, str]]) -> Dict[str, int]: elif symbol == 'x': despair += 1 success -= 1 + elif symbol == 'n': + blank += 1 return { 'success': success, 'advantage': advantage, 'triumph': triumph, - 'despair': despair + 'despair': despair, + 'blank': blank } @client.tree.command(name="roll", description="Roll traditional dice (e.g., 2d6 + 1d8)") @@ -205,8 +209,10 @@ async def genesys(interaction: discord.Interaction, dice: str): response.append(f"{net_results['triumph']} Triumph{'s' if net_results['triumph'] > 1 else ''}") if net_results['despair'] > 0: response.append(f"{net_results['despair']} Despair{'s' if net_results['despair'] > 1 else ''}") + if net_results['blank'] > 0: + response.append(f"{net_results['blank']} Blank") - await interaction.response.send_message(" | ".join(response) if response else "No symbols rolled") + await interaction.response.send_message(" | ".join(response) if response else "Neutral Result, No Blanks") except Exception as e: await interaction.response.send_message(f"Error: {str(e)}")