a munch adventure
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

169 Zeilen
5.2 KiB

  1. (() => {
  2. function devour(state, count) {
  3. state.player.stats.stomach.value += count;
  4. playRandomSfx("swallow");
  5. }
  6. function digest(state, count) {
  7. if (count === undefined) {
  8. count = state.player.stats.stomach.value / 200 + 2;
  9. }
  10. count = Math.min(state.player.stats.stomach.value, count);
  11. count = Math.floor(count);
  12. state.player.stats.stomach.value -= count;
  13. state.player.stats.digested.value += count;
  14. state.player.stats.gas.value += count * 3;
  15. }
  16. sfxGroups = {
  17. "swallow": [
  18. "sfx/swallows/swallow-1.ogg",
  19. "sfx/swallows/swallow-2.ogg",
  20. "sfx/swallows/swallow-3.ogg",
  21. "sfx/swallows/swallow-4.ogg",
  22. "sfx/swallows/swallow-5.ogg",
  23. "sfx/swallows/swallow-6.ogg",
  24. "sfx/swallows/swallow-7.ogg",
  25. ]
  26. }
  27. function playRandomSfx(category) {
  28. const choice = Math.floor(Math.random() * sfxGroups[category].length);
  29. playSfx(sfxGroups[category][choice]);
  30. }
  31. stories.push({
  32. id: "mass-vore",
  33. name: "Mass Vore",
  34. tags: [
  35. "Player Predator",
  36. "Macro/Micro",
  37. "Digestion"
  38. ],
  39. sounds: [
  40. "sfx/belches/belch.ogg",
  41. "sfx/swallows/swallow-1.ogg",
  42. "sfx/swallows/swallow-2.ogg",
  43. "sfx/swallows/swallow-3.ogg",
  44. "sfx/swallows/swallow-4.ogg",
  45. "sfx/swallows/swallow-5.ogg",
  46. "sfx/swallows/swallow-6.ogg",
  47. "sfx/swallows/swallow-7.ogg",
  48. "loop/stomach/stomach.ogg"
  49. ],
  50. preload: [
  51. "loop/stomach/stomach.ogg"
  52. ],
  53. intro: {
  54. start: "city",
  55. setup: state => {
  56. state.player.stats.fullness = {
  57. name: "Fullness",
  58. type: "meter",
  59. get value() {
  60. return state.player.stats.gas.value + state.player.stats.stomach.value;
  61. },
  62. min: 0,
  63. max: 10000,
  64. color: "rgb(200,20,100)"
  65. };
  66. state.player.stats.gas = {
  67. name: "Gas",
  68. type: "meter",
  69. value: 0,
  70. min: 0,
  71. get max() {
  72. return 10000 - state.player.stats.stomach.value;
  73. },
  74. color: "rgb(10,200,100)"
  75. }
  76. state.player.stats.stomach = {
  77. name: "Stomach",
  78. type: "meter",
  79. value: 0,
  80. min: 0,
  81. max: 10000,
  82. color: "rgb(255,10,150)"
  83. }
  84. state.player.stats.digested = {
  85. name: "Digested",
  86. type: "counter",
  87. value: 0,
  88. color: "rgb(255,10,150)"
  89. }
  90. startTimer({
  91. id: "belch",
  92. func: state => {
  93. if (state.player.stats.gas.value > state.player.stats.gas.max) {
  94. print(["BUURRRRRP!"]);
  95. playSfx("sfx/belches/belch.ogg");
  96. state.player.stats.gas.value /= 3;
  97. }
  98. return true;
  99. },
  100. delay: 100,
  101. loop: true,
  102. classes: [
  103. ]
  104. }, state);
  105. startTimer({
  106. id: "digestion",
  107. func: state => {
  108. digest(state);
  109. let vol = state.player.stats.fullness.value / state.player.stats.fullness.max
  110. vol = Math.sqrt(vol);
  111. playLoop("loop/stomach/stomach.ogg", vol);
  112. return true;
  113. },
  114. delay: 1000/60,
  115. loop: true,
  116. classes: [
  117. ]
  118. }, state);
  119. },
  120. intro: state => {
  121. print(["Munch time"]);
  122. }
  123. },
  124. world: {
  125. "city": {
  126. id: "",
  127. name: "",
  128. desc: "",
  129. move: (room, state) => {
  130. },
  131. enter: (room, state) => {
  132. },
  133. exit: (room, state) => {
  134. },
  135. hooks: [
  136. ],
  137. actions: [
  138. {
  139. name: "Eat",
  140. desc: "Munch!",
  141. execute: (room, state) => {
  142. const victims = Math.floor((0.5 + Math.random()) * 500);
  143. print(["You scoop up " + victims + " people and swallow them down."]);
  144. devour(state, victims);
  145. }
  146. }
  147. ],
  148. exits: {
  149. }
  150. }
  151. }
  152. });
  153. })();