InsaneFirebat

FUNtoon Haikus+Slots

Mar 17th, 2023
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. haiku {
  2.  
  3. const haikus = [
  4. '"a month of practice / earns no sub-hour / lifetime Metroid love" -dekynff',
  5. '"summer query time / people who play sitting down / what even is that" -dekynff',
  6. '"she hunts what bounty / through forgotten waters / one hundred items" -dekynff',
  7. '"facing great evil / the elegant princess throws / seasonal veggie" -dekynff',
  8. '"wither springball; yet / as summer fades to autumn / cannot skip spazer" -dekynff',
  9. '"Screen For Be Right Back / Crusty Did Not Give Haiku / Placeholder Haiku" -JustNotAFox',
  10. 'Crateria "her gunship lands cold / she armored hero heads west / lonesome she will fight."',
  11. '(dream) "Thunder as you wake, / weather as I fall asleep / morning ritual."',
  12. '(dream) "The stars align and / everything else is a lie / come waning crescent."',
  13. '"the fallen princess / how quickly does she escape / it was all a dream" - dekynff and CrustaceanSeven',
  14. 'Maridia "meet me on main street / green rocked conjuring super / drops, ominous seas."',
  15. 'Tourian "nerves lock at golden / four, the mechanical life / vein awaits encased."',
  16. 'Escape "three minutes, and the / animals are dead. behe / spark to safer space."',
  17. 'Metroid "hatchling, her mission / to save--so sacrificed to / she, the new mother."',
  18. '(dream) "Two shoremen dance in / the distance, angrily calm / immersed in attack."',
  19. 'Reset "judging by these frames / already lost before kraid, / stress looms imminent."',
  20. 'ifb "to skip saves in a / race against the backdrop of / time loss, entices."',
  21. '(maybe) "we were never meant / to understand why moons cast / light on their captives."',
  22. '"spinning Samus and / floating Princess fly through air / nothing can stop them" -InsaneFirebat',
  23. 'Crystal "defensive, lucent / golden girl seeks cannon and / shovel paired with lust."',
  24. 'Steroids "virile dual-wielder / dog earing pages before / downing a mad dog."',
  25. 'wardrinker "sleeps nude in an oxygen / tent that he believes / gives him sexual powers!"',
  26. '"softly, even as / cleaning up brinstar, / sounds of etecoon laughter" -dekynff',
  27. '"gt, hundo, wart / C7s joy shared, each year / memorial day" -dekynff',
  28. '"into nothingness / woe, her mockball power spent / kojakt before kraid" -dekynff',
  29. '"The pixels deceive / Chip away at my sanity / Crustacean Seven" -Sephynomy',
  30. '"CrustaceanSeven / Best known for playing upright / She will not reset" -Uphier',
  31. '"Crustys favorite / The most out of character / Justin Bailey Suit" -GallopingConch',
  32. '"winter treats for all! / alas, our tasty turnips / prove unloved by Wart!" -dekynff',
  33. '"if something goes wrong / anything from big to small / pillows and foxes" -hokkaidoubare',
  34. '"This is a haiku / What is a haiku really? / Haiku is haiku" -Freyguy55',
  35. '"Haikus can be fun / but sometimes they dont make sense / refrigerator" -stovetop1321',
  36. '"Kraid is bad for prom / He throws his nails everywhere / his breath smells so bad" -Choccy_Soup',
  37. '"you always ask me / to provide you with haikus / why not make your own?" -FUNtoon',
  38. '"Bomb Torizo stands / Again a pixel triumphs / claws strike only air" -EXAKTScience_'
  39. ]
  40.  
  41. function getHaiku() {
  42. output = @haikus[random.randInt(0, len(@haikus)-1)]
  43. return output
  44. }
  45. }
  46.  
  47. slots {
  48. const num_reels = 5
  49. const slot1 = {
  50. 'Cacatac' : {
  51. 'odds': [1, 50],
  52. 'payout': 10,
  53. 'symbol': '🌵'
  54. },
  55. 'Zebbo' : {
  56. 'odds': [1, 50],
  57. 'payout': 10,
  58. 'symbol': '🐝'
  59. },
  60. 'Zero' : {
  61. 'odds': [1, 50],
  62. 'payout': 10,
  63. 'symbol': '🐛'
  64. },
  65. 'Reo' : {
  66. 'odds': [1, 50],
  67. 'payout': 10,
  68. 'symbol': '🦋'
  69. },
  70. 'Rinka' : {
  71. 'odds': [1, 100],
  72. 'payout': 20,
  73. 'symbol': 'â­•'
  74. },
  75. 'Crocomire' : {
  76. 'odds': [1, 500],
  77. 'payout': 100,
  78. 'symbol': '🐊'
  79. },
  80. 'Botwoon' : {
  81. 'odds': [1, 500],
  82. 'payout': 100,
  83. 'symbol': '🐍'
  84. },
  85. 'Ridley' : {
  86. 'odds': [1, 1000],
  87. 'payout': 200,
  88. 'symbol': '🐲'
  89. },
  90. 'MotherBrain' : {
  91. 'odds': [1, 1000],
  92. 'payout': 200,
  93. 'symbol': '🧠'
  94. },
  95. 'Phantoon' : {
  96. 'odds': [1, 2500],
  97. 'payout': 500,
  98. 'symbol': '👻'
  99. },
  100. 'Climb' : {
  101. 'odds': [1, 5000],
  102. 'payout': 1000,
  103. 'symbol': '🧗',
  104. 'num_allowed_in_losing_reel': 0
  105. },
  106. 'Any1Climb' : {
  107. 'odds': [1, 50],
  108. 'payout': 10,
  109. 'symbol': '🧗',
  110. 'num_allowed_in_losing_reel': 0,
  111. 'max_display_in_win': 1
  112. },
  113. 'Any2Climb' : {
  114. 'odds': [1, 250],
  115. 'payout': 50,
  116. 'symbol': '🧗',
  117. 'num_allowed_in_losing_reel': 0,
  118. 'max_display_in_win': 2
  119. }
  120. }
  121.  
  122. function build_symbol_list_and_weights(symbols_and_payouts) {
  123. denominators = []
  124. for (k, v in symbols_and_payouts) {
  125. for (n, d in symbols_and_payouts[k]['odds']) {
  126. denominators.append(d)
  127. }
  128. }
  129. denominator = math.lcm(denominators)
  130.  
  131. v = denominator
  132. out_keys = []
  133. out_weights = []
  134. out_losing_symbol_list = []
  135.  
  136. for (k, i in symbols_and_payouts) {
  137. var [n, d] = symbols_and_payouts[k]['odds']
  138. w = math.int(denominator / d) * n
  139. v -= w
  140.  
  141. out_keys.append(k)
  142. out_weights.append(w / denominator)
  143. out_losing_symbol_list = out_losing_symbol_list + [symbols_and_payouts[k]['symbol']]*symbols_and_payouts[k].get('num_allowed_in_losing_reel', @num_reels-1)
  144. }
  145.  
  146. out_keys.append(null)
  147. out_weights.append(v/denominator)
  148.  
  149. return { 'slot': symbols_and_payouts, 'keys': out_keys, 'weights': out_weights, 'losing_symbols': out_losing_symbol_list }
  150. }
  151.  
  152. const default_slot_machine = 'slot1'
  153. const slot_machines = {
  154. 'slot1': @build_symbol_list_and_weights(@slot1)
  155. }
  156.  
  157. function shuffleList(in_list) {
  158. for (i in range(len(in_list))) {
  159. in_list[i] = in_list[random.randInt(0, len(in_list)-1)]
  160. }
  161. return in_list
  162. }
  163.  
  164. function runSlot(slot_type: input) {
  165. slot_machine = (@slot_machines).get(slot_type, null)
  166. if (not slot_machine) {
  167. slot_machine = @slot_machines[@default_slot_machine]
  168. }
  169.  
  170. outcome = slot_machine['keys'].choose(slot_machine['weights'])
  171. if (not outcome) {
  172. # generate an invalid (non-winning) result here....
  173. output = ' '.join(slot_machine['losing_symbols'].choose(k:@num_reels))
  174. }
  175. else {
  176. win_disp_amt = slot_machine['slot'][outcome].get('max_display_in_win', @num_reels)
  177. disp = [slot_machine['slot'][outcome]['symbol']]*win_disp_amt
  178. extra_symbols_needed = @num_reels - win_disp_amt
  179.  
  180. if (extra_symbols_needed > 0) {
  181. disp.extend(slot_machine['losing_symbols'].filter($(sym) => sym and not (sym == slot_machine['slot'][outcome]['symbol'])).choose(k:extra_symbols_needed))
  182. }
  183.  
  184. output = ' '.join(disp.shuffle()) + " - you won %d points!" % [slot_machine['slot'][outcome]['payout']]
  185. }
  186.  
  187. return output
  188. }
  189. }
Add Comment
Please, Sign In to add comment