Эх сурвалжийг харах

Spent far too long finalizing the emojis...

Kirk Trombley 6 жил өмнө
parent
commit
c201154bb9
1 өөрчлөгдсөн 135 нэмэгдсэн , 3 устгасан
  1. 135 3
      src/plugins/hangguy.py

+ 135 - 3
src/plugins/hangguy.py

@@ -6,6 +6,136 @@ from sqlalchemy import Column, Integer, String, DateTime
 from command_system import as_plugin, RollbotResponse, RollbotFailure, ModelBase
 
 
+GUY_STAGES = [
+""
+,
+"""\
+😎
+"""
+,
+"""\
+😎
+👔
+"""
+,
+"""\
+😎
+👔
+⛽
+"""
+,
+"""\
+😎
+👔
+⛽
+⚡
+"""
+,
+"""\
+👍     😎
+          👔
+          ⛽
+          ⚡
+"""
+,
+"""\
+👍     😎
+🐛     👔
+          ⛽
+          ⚡
+"""
+,
+"""\
+🖕     😎
+🐛💤👔
+          ⛽
+          ⚡
+"""
+,
+"""\
+🖕     😎
+🐛💤👔🐛
+          ⛽
+          ⚡
+"""
+,
+"""\
+🖕     😟
+🐛💤👔🐛
+          ⛽ 👢
+          ⚡
+"""
+,
+"""\
+🖕     😟
+🐛💤👔🐛
+          ⛽ 👢
+          ⚡👊
+"""
+,
+"""\
+🖕     😨
+🐛💤👔🐛
+          ⛽  👢
+          ⚡8=👊
+"""
+,
+"""\
+🖕     😨
+🐛💤👔🐛
+          ⛽  👢
+          ⚡8=👊
+      🎸
+"""
+,
+"""\
+🖕     😰
+🐛💤👔🐛
+          ⛽  👢
+          ⚡8=👊
+      🎸
+  👢
+"""
+,
+"""\
+🖕     😰
+🐛💤👔🐛
+          ⛽  👢
+          ⚡8=👊
+      🎸    🌽
+  👢
+"""
+,
+"""\
+🖕     😰
+🐛💤👔🐛
+          ⛽  👢
+          ⚡8=👊
+      🎸    🌽
+  👢             👢
+"""
+,
+"""\
+🖕     😫
+🐛💤👔🐛
+          ⛽  👢
+          ⚡8=👊=D
+      🎸    🌽
+  👢             👢
+"""
+,
+"""\
+🖕     😵
+🐛💤👔🐛
+          ⛽  👢
+          ⚡8=👊=D💦
+      🎸    🌽
+  👢             👢
+"""
+,
+]
+
+
 class GameState(ModelBase):
     __tablename__ = "hangguy_game_state"
     group_id = Column(String, primary_key=True)
@@ -24,7 +154,7 @@ class GuyState(ModelBase):
 class DeadGuy(ModelBase):
     """
     Tracks "dead" and "retired" guys for record-keeping purposes.
-    If state >= 17, the guy was dead, otherwise it was retired.
+    If state >= len(GUY_STAGES) - 1, the guy was dead, otherwise it was retired.
     """
     __tablename__ = "hangguy_dead_guy"
     guy_id = Column(Integer, primary_key=True, autoincrement=True)
@@ -116,7 +246,7 @@ def end_guy(db, guy_state):
 
 
 def guy_is_dead(guy_state):
-    return guy_state.state >= 17
+    return guy_state.state >= (len(GUY_STAGES) - 1)
 
 
 def survival_msg(guy_state):
@@ -124,7 +254,9 @@ def survival_msg(guy_state):
 
 
 def render_guy(guy_state):
-    return str(guy_state.state) # TODO actually render guy
+    if 0 <= guy_state.state < len(GUY_STAGES):
+        return GUY_STAGES[guy_state.state]
+    return "INVALID GUY STATE " + str(guy_state.state)
 
 
 def render_game(game_state, guy_state):