Browse Source

reformatting

Kirk Trombley 4 years ago
parent
commit
bd01d5f292
1 changed files with 43 additions and 60 deletions
  1. 43 60
      commands/commands/hangguy.py

+ 43 - 60
commands/commands/hangguy.py

@@ -10,132 +10,114 @@ from rollbot.injection import Data, Config, Subcommand, Lazy, Args, Origin, Send
 
 KEY = "HANG_GUY_SINGLETON"
 GUY_STAGES = [
-""
-,
-"""\
+    "",
+    """\
 ๐Ÿ˜Ž
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ˜Ž
 ๐Ÿ‘”
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ˜Ž
 ๐Ÿ‘”
 โ›ฝ
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ˜Ž
 ๐Ÿ‘”
 โ›ฝ
 โšก
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ‘     ๐Ÿ˜Ž
           ๐Ÿ‘”
           โ›ฝ
           โšก
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ‘     ๐Ÿ˜Ž
 ๐Ÿ›     ๐Ÿ‘”
           โ›ฝ
           โšก
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ–•     ๐Ÿ˜Ž
 ๐Ÿ›๐Ÿ’ค๐Ÿ‘”
           โ›ฝ
           โšก
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ–•     ๐Ÿ˜Ž
 ๐Ÿ›๐Ÿ’ค๐Ÿ‘”๐Ÿ›
           โ›ฝ
           โšก
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ–•     ๐Ÿ˜Ÿ
 ๐Ÿ›๐Ÿ’ค๐Ÿ‘”๐Ÿ›
           โ›ฝ ๐Ÿ‘ข
           โšก
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ–•     ๐Ÿ˜Ÿ
 ๐Ÿ›๐Ÿ’ค๐Ÿ‘”๐Ÿ›
           โ›ฝ ๐Ÿ‘ข
           โšก๐Ÿ‘Š
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ–•     ๐Ÿ˜จ
 ๐Ÿ›๐Ÿ’ค๐Ÿ‘”๐Ÿ›
           โ›ฝ  ๐Ÿ‘ข
           โšก8=๐Ÿ‘Š
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ–•     ๐Ÿ˜จ
 ๐Ÿ›๐Ÿ’ค๐Ÿ‘”๐Ÿ›
           โ›ฝ  ๐Ÿ‘ข
           โšก8=๐Ÿ‘Š
       ๐ŸŽธ
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ–•     ๐Ÿ˜ฐ
 ๐Ÿ›๐Ÿ’ค๐Ÿ‘”๐Ÿ›
           โ›ฝ  ๐Ÿ‘ข
           โšก8=๐Ÿ‘Š
       ๐ŸŽธ
   ๐Ÿ‘ข
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ–•     ๐Ÿ˜ฐ
 ๐Ÿ›๐Ÿ’ค๐Ÿ‘”๐Ÿ›
           โ›ฝ  ๐Ÿ‘ข
           โšก8=๐Ÿ‘Š
       ๐ŸŽธ    ๐ŸŒฝ
   ๐Ÿ‘ข
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ–•     ๐Ÿ˜ฐ
 ๐Ÿ›๐Ÿ’ค๐Ÿ‘”๐Ÿ›
           โ›ฝ  ๐Ÿ‘ข
           โšก8=๐Ÿ‘Š
       ๐ŸŽธ    ๐ŸŒฝ
   ๐Ÿ‘ข             ๐Ÿ‘ข
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ–•     ๐Ÿ˜ซ
 ๐Ÿ›๐Ÿ’ค๐Ÿ‘”๐Ÿ›
           โ›ฝ  ๐Ÿ‘ข
           โšก8=๐Ÿ‘Š=D
       ๐ŸŽธ    ๐ŸŒฝ
   ๐Ÿ‘ข             ๐Ÿ‘ข
-"""
-,
-"""\
+""",
+    """\
 ๐Ÿ–•     ๐Ÿ˜ต
 ๐Ÿ›๐Ÿ’ค๐Ÿ‘”๐Ÿ›
           โ›ฝ  ๐Ÿ‘ข
           โšก8=๐Ÿ‘Š=D๐Ÿ’ฆ
       ๐ŸŽธ    ๐ŸŒฝ
   ๐Ÿ‘ข             ๐Ÿ‘ข
-"""
-,
+""",
 ]
 
 
@@ -181,7 +163,7 @@ class HangGuy:
 
         if not self.is_active():
             return guy
-        
+
         return f"{guy}\n{' '.join(self.game_state)}\nBad Guesses: {', '.join(self.bad_guesses)}"
 
 
@@ -211,11 +193,11 @@ async def hangguy(
 ):
     if len(cmd.args) == 0:
         RollbotFailure.INVALID_ARGUMENTS.raise_exc(detail="Must provide subcommand or guess")
-    
+
     game = await store.load_or(KEY)
     is_active = game.is_active()
 
-    subc = cmd.get_subcommand(inherit_bang=False) # get subcommand, requiring bang
+    subc = cmd.get_subcommand(inherit_bang=False)  # get subcommand, requiring bang
 
     if subc is None or cmd.bang != subc.bang:
         if game.is_active():
@@ -233,7 +215,9 @@ async def hangguy(
                         game.guy_state += 1
                         prefix = "Bad guess!"
                     else:
-                        game.game_state = "".join(guess if i in find else s for i, s in enumerate(game.game_state))
+                        game.game_state = "".join(
+                            guess if i in find else s for i, s in enumerate(game.game_state)
+                        )
                         prefix = f"Great! '{guess}' appears {len(find)} time{'' if len(find) == 1 else 's'}!"
             elif game.puzzle.split() == guess.split():
                 prefix = "You've guessed the full phrase!"
@@ -248,14 +232,14 @@ async def hangguy(
                 game.end_game()
                 game.guy_lifetime += 1
                 txt += f"\nThe game is over, and the guy lives on!\n{game.survival_msg()}"
-            
+
             if game.is_dead():
                 game.end_game()
                 dead = DeadGuy.from_guy(game)
                 game.reset_guy()
                 await dead_store.save(f"{uuid4().hex}-{datetime.now().isoformat()}", dead_guy)
                 txt += f"\noh god oh fuck, the guy is dead!\nYou failed to guess {game.puzzle}\nThe guy has been buried."
-            
+
             await store.save(KEY, game)
             return txt
         RollbotFailure.MISSING_SUBCOMMAND.raise_exc(
@@ -290,7 +274,6 @@ async def hangguy(
     if subc.name == "view" and not is_active:
         return f"{game.survival_msg()}\n" + game.render()
 
-
     if is_active:
         RollbotFailure.INVALID_SUBCOMMAND.raise_exc(
             detail="The only in-game subcommands are !cancel to end the game and !alert to alert the main chat."