a munch adventure
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.
 
 
 
 

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