a munch adventure
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

445 rindas
13 KiB

  1. (() => {
  2. function checkSuspicion(state, add = 0) {
  3. state.player.stats.suspicion.value += add;
  4. if (state.player.stats.suspicion.value >= 100) {
  5. print(["Geta spots you!", "You're snatched up and tossed into the fox's bowl of cereal."]);
  6. goToRoom("in-bowl", state);
  7. return false;
  8. }
  9. return true;
  10. }
  11. stories.push({
  12. "id": "unaware-geta",
  13. "name": "Geta's Breakfast",
  14. "tags": [
  15. "Player Prey",
  16. "Digestion",
  17. "Macro/Micro"
  18. ],
  19. "intro": {
  20. "start": "pepper-grinder",
  21. "setup": state => {
  22. state.player.stats.suspicion = { name: "Suspicion", type: "meter", value: 0, min: 0, max: 100, color: "rgb(100,100,100)" };
  23. state.info.time.value = 60 * 60 * 7 + 60 * 17;
  24. state.player.flags.caught = false;
  25. startTimer({
  26. id: "clock",
  27. func: state => {
  28. state.info.time.value += 1;
  29. state.info.time.value %= 86000;
  30. return true;
  31. },
  32. delay: 1000,
  33. loop: true,
  34. classes: [
  35. ]
  36. }, state);
  37. startTimer({
  38. id: "timeout",
  39. func: state => {
  40. if (state.info.time.value == 60 * 60 * 7 + 60 * 19) {
  41. print(["The fox is almost done with his breakfast..."]);
  42. }
  43. if (state.info.time.value >= 60 * 60 * 7 + 60 * 20) {
  44. print(["Time's up! In you go."]);
  45. goToRoom("maw", state);
  46. return false;
  47. }
  48. return true;
  49. },
  50. delay: 1000,
  51. loop: true,
  52. classes: [
  53. "free"
  54. ]
  55. }, state);
  56. },
  57. "intro": state => {
  58. print(["Game started"]);
  59. }
  60. },
  61. "sounds": [
  62. ],
  63. "preload": [
  64. ],
  65. "world": {
  66. "pepper-grinder": {
  67. "id": "pepper-grinder",
  68. "name": "Pepper Grinder",
  69. "desc": "You're hiding behind a pepper grinder",
  70. "move": (room, state) => {
  71. print(["You dart over to the pepper grinder, which looms over you like a greatwood."]);
  72. },
  73. "enter": (room, state) => {
  74. },
  75. "exit": (room, state) => {
  76. },
  77. "actions": [
  78. {
  79. name: "Tap",
  80. desc: "Bang on the pepper shaker",
  81. execute: (room, state) => {
  82. print(["You thump the pepper shaker, making a dull thud."]);
  83. checkSuspicion(state, 25);
  84. },
  85. show: [
  86. ],
  87. conditions: [
  88. ]
  89. },
  90. {
  91. name: "Wait",
  92. desc: "Wait for the fox to finish his breakfast. Surely you'll be able to escape after that...right?",
  93. execute: (room, state) => {
  94. state.info.time.value = 60 * 60 * 7 + 60 * 20;
  95. },
  96. show: [
  97. ],
  98. conditions: [
  99. ]
  100. },
  101. ],
  102. "exits": {
  103. "up": {
  104. "target": "bowl",
  105. "desc": "Walk up to the cereal bowl",
  106. "show": [
  107. ],
  108. "conditions": [
  109. ],
  110. "hooks": [
  111. (room, exit, state) => {
  112. return checkSuspicion(state, 10);
  113. }
  114. ]
  115. },
  116. },
  117. "hooks": [
  118. ],
  119. "data": {
  120. "stats": {
  121. }
  122. }
  123. },
  124. "bowl": {
  125. "id": "bowl",
  126. "name": "Behind the Bowl",
  127. "desc": "You're crouched behind Geta's bowl of cereal",
  128. "move": (room, state) => {
  129. print(["You scurry up to the looming bowl, staying low and out of Geta's sight."]);
  130. },
  131. "enter": (room, state) => {
  132. },
  133. "exit": (room, state) => {
  134. },
  135. "actions": [
  136. ],
  137. "exits": {
  138. "ascend": {
  139. "target": "in-bowl",
  140. "desc": "Climb into Geta's cereal",
  141. "show": [
  142. ],
  143. "conditions": [
  144. ],
  145. "hooks": [
  146. ]
  147. },
  148. "down": {
  149. "target": "pepper-grinder",
  150. "desc": "Run back behind the pepper grinder",
  151. "show": [
  152. ],
  153. "conditions": [
  154. ],
  155. "hooks": [
  156. ]
  157. },
  158. },
  159. "hooks": [
  160. ],
  161. "data": {
  162. "stats": {
  163. }
  164. }
  165. },
  166. "in-bowl": {
  167. "id": "in-bowl",
  168. "name": "Bowl",
  169. "desc": "You're in the cereal bowl...",
  170. "move": (room, state) => {
  171. print(["Why did you do that?"]);
  172. stopClassTimers("free", state);
  173. },
  174. "enter": (room, state) => {
  175. startTimer({
  176. id: "geta-eat",
  177. func: state => {
  178. if (Math.random() < 0.6) {
  179. print(["Geta scoops up a spoonful of cereal; you narrowly avoid being caught."]);
  180. return true;
  181. } else {
  182. print(["Geta scoops you up and slurps you into his maw."]);
  183. goToRoom("maw", state);
  184. return false;
  185. }
  186. },
  187. delay: 3000,
  188. loop: true,
  189. classes: [
  190. ]
  191. }, state);
  192. },
  193. "exit": (room, state) => {
  194. },
  195. "actions": [
  196. ],
  197. "exits": {
  198. },
  199. "hooks": [
  200. ],
  201. "data": {
  202. "stats": {
  203. }
  204. }
  205. },
  206. "maw": {
  207. "id": "maw",
  208. "name": "Geta's Maw",
  209. "desc": "You've been slurped up into the fox's jaws",
  210. "move": (room, state) => {
  211. stopClassTimers("free", state);
  212. },
  213. "enter": (room, state) => {
  214. startTimer({
  215. id: "swallow",
  216. func: state => {
  217. print(["It's too late to escape. You're swallowed down."]);
  218. goToRoom("throat", state);
  219. return true;
  220. },
  221. delay: 5000,
  222. loop: false,
  223. classes: [
  224. ]
  225. }, state);
  226. },
  227. "exit": (room, state) => {
  228. },
  229. "actions": [
  230. ],
  231. "exits": {
  232. },
  233. "hooks": [
  234. ],
  235. "data": {
  236. "stats": {
  237. }
  238. }
  239. },
  240. "throat": {
  241. "id": "throat",
  242. "name": "Geta's Gullet",
  243. "desc": "GULP!",
  244. "move": (room, state) => {
  245. },
  246. "enter": (room, state) => {
  247. startTimer({
  248. id: "gut",
  249. func: state => {
  250. print(["You slush down into Geta's stomach"]);
  251. goToRoom("stomach", state);
  252. return true;
  253. },
  254. delay: 7000,
  255. loop: false,
  256. classes: [
  257. ]
  258. }, state);
  259. },
  260. "exit": (room, state) => {
  261. },
  262. "actions": [
  263. {
  264. name: "Struggle",
  265. desc: "Try to climb back out!",
  266. execute: (room, state) => {
  267. print(["Nope"]);
  268. },
  269. show: [
  270. ],
  271. conditions: [
  272. ]
  273. },
  274. ],
  275. "exits": {
  276. },
  277. "hooks": [
  278. ],
  279. "data": {
  280. "stats": {
  281. }
  282. }
  283. },
  284. "stomach": {
  285. "id": "stomach",
  286. "name": "Geta's Stomach",
  287. "desc": "Glorp",
  288. "move": (room, state) => {
  289. },
  290. "enter": (room, state) => {
  291. startTimer({
  292. id: "digest",
  293. func: state => {
  294. print(["You're digested before too long."]);
  295. goToRoom("digested", state);
  296. return true;
  297. },
  298. delay: 10000,
  299. loop: false,
  300. classes: [
  301. ]
  302. }, state);
  303. },
  304. "exit": (room, state) => {
  305. },
  306. "actions": [
  307. {
  308. name: "Squirm",
  309. desc: "Rub at the walls of the fox's churning stomach",
  310. execute: (room, state) => {
  311. printRandom([
  312. ["You punch and kick at the walls"],
  313. ["A powerful churn grabs hold of you, stifling any attempts at struggling"],
  314. ["Your little thumps and kicks do little to faze your captor"]
  315. ]);
  316. },
  317. show: [
  318. ],
  319. conditions: [
  320. ]
  321. },
  322. ],
  323. "exits": {
  324. },
  325. "hooks": [
  326. ],
  327. "data": {
  328. "stats": {
  329. }
  330. }
  331. },
  332. "digested": {
  333. "id": "digested",
  334. "name": "Fat",
  335. "desc": "You're just fat now",
  336. "move": (room, state) => {
  337. },
  338. "enter": (room, state) => {
  339. },
  340. "exit": (room, state) => {
  341. },
  342. "actions": [
  343. {
  344. name: "Gurgle",
  345. desc: "Glorp",
  346. execute: (room, state) => {
  347. printRandom([
  348. ["Grrrrgle"],
  349. ["Glorp"],
  350. ["Glrrrrrrnnnnnn..."],
  351. ["Gwoooooorgle"]
  352. ]);
  353. },
  354. show: [
  355. ],
  356. conditions: [
  357. ]
  358. },
  359. ],
  360. "exits": {
  361. },
  362. "hooks": [
  363. ],
  364. "data": {
  365. "stats": {
  366. }
  367. }
  368. },
  369. }
  370. });
  371. })();