Generates lunky hunky hero names in the spirit of MST3k's running joke in their Space Mutiny episode
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

212 lines
6.9KB

  1. import re
  2. import random
  3. from errbot import BotPlugin, botcmd, re_botcmd
  4. CONFIG_TEMPLATE = {
  5. 'HERO_NAMES_GROUP_1': ['Beat',
  6. 'Big',
  7. 'Blast',
  8. 'Bold',
  9. 'Bolt',
  10. 'Brick',
  11. 'Buck',
  12. 'Buff',
  13. 'Butch',
  14. 'Dean',
  15. 'Crud',
  16. 'Crunch',
  17. 'Burt',
  18. 'Dirk',
  19. 'Fist',
  20. 'Flint',
  21. 'Fridge',
  22. 'Gristle',
  23. 'Grind',
  24. 'Hack',
  25. 'Colt',
  26. 'Major',
  27. 'Fury',
  28. 'Lump',
  29. 'Punch',
  30. 'Duke',
  31. 'Blaze',
  32. 'Blade',
  33. 'Red',
  34. 'Punt',
  35. 'Reef',
  36. 'Roll',
  37. 'Rip',
  38. 'Grim',
  39. 'Jab',
  40. 'Slab',
  41. 'Scream',
  42. 'Coal',
  43. 'Slate',
  44. 'Smash',
  45. 'Fire',
  46. 'Smoke',
  47. 'Flash',
  48. 'Steel',
  49. 'Captain',
  50. 'Splint',
  51. 'Stump',
  52. 'Rage',
  53. 'Thick',
  54. 'Touch',
  55. 'Trunk',
  56. 'Whip',
  57. 'Zap'],
  58. 'HERO_NAMES_GROUP_2': ['Punch',
  59. 'Large',
  60. 'Hard',
  61. 'Thick',
  62. 'Big',
  63. 'Vander',
  64. 'Crank',
  65. 'Plank',
  66. 'Drink',
  67. 'Doom',
  68. 'Dead',
  69. 'Pound',
  70. 'Knuckle',
  71. 'Bone',
  72. 'Savage',
  73. 'Butt',
  74. 'Fire',
  75. 'Razor',
  76. 'Rock',
  77. 'Iron',
  78. 'Grunt',
  79. 'Grim',
  80. 'Mad',
  81. 'Thorn',
  82. 'Blow',
  83. 'Beef',
  84. 'Wrestle',
  85. 'Terror',
  86. 'Side',
  87. 'Rubble',
  88. 'Speed',
  89. 'Lightning',
  90. 'Grit',
  91. 'Slap',
  92. 'Blast',
  93. 'Fizzle',
  94. 'Scar',
  95. 'Granite',
  96. 'Steak',
  97. 'Tazer',
  98. 'Snarl',
  99. 'Bulk',
  100. 'Dagger',
  101. 'Squat',
  102. 'SaberFist',
  103. 'Slab',
  104. 'Lamp',
  105. 'Cram',
  106. 'Cannon',
  107. 'Tussle',
  108. 'Man',
  109. 'Chest',
  110. 'Gut',
  111. 'Rumble',
  112. 'Fury',
  113. 'Chunk',
  114. 'Wreck',
  115. 'Nail',
  116. 'Run',
  117. 'Rust',
  118. 'Slam',
  119. 'Slag',
  120. 'Thunder',
  121. 'Hazzard'],
  122. 'HERO_NAMES_GROUP_3': ['Beef',
  123. 'Huge',
  124. 'Cheese',
  125. 'Neck',
  126. 'Flank',
  127. 'Meat',
  128. 'Delt',
  129. 'Abs',
  130. 'Heart',
  131. 'Chest',
  132. 'Roar',
  133. 'Lots',
  134. 'Back',
  135. 'Nail',
  136. 'Lift',
  137. 'Fury',
  138. 'Meal',
  139. 'Stalk',
  140. 'Steak',
  141. 'Pec',
  142. 'Bone',
  143. 'Stag',
  144. 'Body',
  145. 'Fist',
  146. 'Broth',
  147. 'Groin',
  148. 'Shot',
  149. 'Cake',
  150. 'Iron',
  151. 'Chunk',
  152. 'Face',
  153. 'Head',
  154. 'Thrust',
  155. 'Crunch',
  156. 'Rock',
  157. 'Wad',
  158. 'Jaw',
  159. 'Muscle',
  160. 'Hair',
  161. 'Knob',
  162. 'man',
  163. 'Fast',
  164. 'Rod',
  165. 'Stone',
  166. 'Cheek',
  167. 'Lash']
  168. }
  169. class MyHero(BotPlugin):
  170. """Generates hero hunky names in the spirit of MST3k's running joke in their Space Mutiny episode"""
  171. min_err_version = '3.0.0' # Optional, but recommended
  172. HERO_NAMES_PREFIXES = ['Mc','von '],
  173. def get_configuration_template(self):
  174. return CONFIG_TEMPLATE
  175. def configure(self, configuration):
  176. if configuration is not None and configuration != {}:
  177. config = dict(chain(CONFIG_TEMPLATE.items(),
  178. configuration.items()))
  179. else:
  180. config = CONFIG_TEMPLATE
  181. super(MyHero, self).configure(config)
  182. def get_prefix(self):
  183. if not (random.randrange(0, 7) == 0): return ""
  184. return self.HERO_NAMES_PREFIXES[(random.randrange(0, 3) == 2)]
  185. def get_hero_name(self):
  186. # every once in a while, thrown one of these complete in-jokes
  187. if (random.randrange(0,100) == 50): return "Bob Johnson"
  188. if (random.randrange(0,250) == 50): return "Rowsdower"
  189. return "{n1} {p}{n2}{n3}".format(
  190. n1=random.choice(self.config['HERO_NAMES_GROUP_1']),
  191. p=self.get_prefix(),
  192. n2=random.choice(self.config['HERO_NAMES_GROUP_2']),
  193. n3=random.choice(self.config['HERO_NAMES_GROUP_3'])
  194. )
  195. @botcmd()
  196. def myhero(self, msg, args):
  197. """Generates a special hunky hero name for you"""
  198. return self.get_hero_name()
  199. @re_botcmd(pattern=r"space mutiny|hero", prefixed=False, flags=re.IGNORECASE)
  200. def listen_for_talk_of_heroes(self, msg, match):
  201. """Talk of heroes prompts a Space Hero Name..."""
  202. return self.get_hero_name()