a munch adventure
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

657 řádky
20 KiB

  1. (() => {
  2. function checkSuspicion(state, add = 0) {
  3. const old = getStat("suspicion", state);
  4. if (add >= 0) {
  5. add *= state.geta.awareness;
  6. }
  7. changeStat("suspicion", add, state);
  8. if (getStat("suspicion", state) >= 100) {
  9. print(["Geta spots you!", "You're snatched up and tossed into the fox's bowl of cereal."]);
  10. goToRoom("in-bowl", state);
  11. return false;
  12. } else if (getStat("suspicion", state) >= 75 && old < 75) {
  13. print(["The fox is very suspicious. You're going to get caught if you keep this up..."]);
  14. }
  15. return true;
  16. }
  17. stories.push({
  18. "id": "geta-unaware",
  19. "name": "Geta's Breakfast",
  20. "tags": [
  21. "Player Prey",
  22. "Digestion",
  23. "Macro/Micro"
  24. ],
  25. "intro": {
  26. "start": "pepper-grinder",
  27. "setup": state => {
  28. state.geta = {};
  29. state.geta.awareness = 1;
  30. state.player.stats.health = { name: "Health", type: "meter", value: 100, min: 0, max: 100, color: "rgb(255,55,55)" };
  31. state.player.stats.suspicion = { name: "Suspicion", type: "meter", value: 0, min: 0, max: 100, color: "rgb(100,100,100)" };
  32. state.info.time.value = 60 * 60 * 7 + 60 * 17;
  33. state.player.flags.caught = false;
  34. startTimer({
  35. id: "clock",
  36. func: state => {
  37. state.info.time.value += 1;
  38. state.info.time.value %= 86000;
  39. return true;
  40. },
  41. delay: 1000,
  42. loop: true,
  43. classes: [
  44. ]
  45. }, state);
  46. startTimer({
  47. id: "suspicion-decay",
  48. func: state => {
  49. checkSuspicion(state, -0.1);
  50. return true;
  51. },
  52. delay: 100,
  53. loop: true,
  54. classes: [
  55. "free"
  56. ]
  57. }, state);
  58. startTimer({
  59. id: "timeout",
  60. func: state => {
  61. if (state.info.time.value == 60 * 60 * 7 + 60 * 19) {
  62. print(["The fox is almost done with his breakfast..."]);
  63. }
  64. if (state.info.time.value >= 60 * 60 * 7 + 60 * 20) {
  65. print(["Time's up! In you go."]);
  66. goToRoom("maw", state);
  67. return false;
  68. }
  69. return true;
  70. },
  71. delay: 1000,
  72. loop: true,
  73. classes: [
  74. "free"
  75. ]
  76. }, state);
  77. startTimer({
  78. id: "geta-action",
  79. func: state => {
  80. const random = Math.random();
  81. if (random < 0.7) {
  82. print(["Geta slurps up a spoonful of cereal."]);
  83. } else if (random < 0.9) {
  84. state.geta.awareness = 0.1;
  85. print(["The fox yawns and stretches."]);
  86. startTimer({
  87. id: "yawn-end",
  88. func: state => {
  89. print(["Geta finishes his stretch"]);
  90. state.geta.awareness = 1;
  91. return true;
  92. },
  93. delay: 2000,
  94. loop: false,
  95. classes: [
  96. "free"
  97. ]
  98. }, state);
  99. } else {
  100. state.geta.awareness = 2;
  101. print(["Geta narrows his eyes and looks around the table. Something seems off to him..."]);
  102. startTimer({
  103. id: "squint-end",
  104. func: state => {
  105. print(["He goes back to his breakfast."]);
  106. state.geta.awareness = 1;
  107. return true;
  108. },
  109. delay: 4000,
  110. loop: false,
  111. classes: [
  112. "free"
  113. ]
  114. }, state);
  115. }
  116. return 5000
  117. },
  118. delay: 5000,
  119. loop: true,
  120. classes: [
  121. "free"
  122. ]
  123. }, state);
  124. },
  125. "intro": state => {
  126. print(["Game started", newline, "Exposition goes here later."]);
  127. }
  128. },
  129. "sounds": [
  130. "loop/stomach.ogg"
  131. ],
  132. "preload": [
  133. ],
  134. "world": {
  135. "pepper-grinder": {
  136. "id": "pepper-grinder",
  137. "name": "Pepper Grinder",
  138. "desc": "You're hiding behind a pepper grinder",
  139. "move": (room, state) => {
  140. print(["You dart over to the pepper grinder, which looms over you like a greatwood."]);
  141. },
  142. "enter": (room, state) => {
  143. },
  144. "exit": (room, state) => {
  145. },
  146. "actions": [
  147. {
  148. name: "Tap",
  149. desc: "Bang on the pepper shaker",
  150. execute: (room, state) => {
  151. print(["You thump the pepper shaker, making a dull thud."]);
  152. const safe = checkSuspicion(state, 25);
  153. if (safe && getStat("suspicion", state) > 50) {
  154. print(["Geta leans in to have a closer look. He's going to catch you if you don't move!"]);
  155. startTimer({
  156. id: "pepper-investigate",
  157. func: state => {
  158. if (state.player.location == "pepper-grinder") {
  159. print(["He catches you.", newline, "You're tossed into the fox's jaws."]);
  160. goToRoom("maw", state);
  161. } else {
  162. print(["You evaded the fox."]);
  163. }
  164. },
  165. delay: 3000,
  166. loop: false,
  167. classes: [
  168. "free"
  169. ]
  170. }, state);
  171. }
  172. },
  173. show: [
  174. ],
  175. conditions: [
  176. ]
  177. },
  178. {
  179. name: "Wait",
  180. desc: "Wait for the fox to finish his breakfast. Surely you'll be able to escape after that...right?",
  181. execute: (room, state) => {
  182. state.info.time.value = 60 * 60 * 7 + 60 * 20;
  183. },
  184. show: [
  185. ],
  186. conditions: [
  187. ]
  188. },
  189. ],
  190. "exits": {
  191. "up": {
  192. "target": "bowl",
  193. "desc": "Walk up to the cereal bowl",
  194. "show": [
  195. ],
  196. "conditions": [
  197. ],
  198. "hooks": [
  199. (room, exit, state) => {
  200. return checkSuspicion(state, 10);
  201. }
  202. ]
  203. },
  204. "left": {
  205. "target": "table",
  206. "desc": "Run out into the open",
  207. "show": [
  208. ],
  209. "conditions": [
  210. ],
  211. "hooks": [
  212. ]
  213. },
  214. },
  215. "hooks": [
  216. ],
  217. "data": {
  218. "stats": {
  219. }
  220. }
  221. },
  222. "bowl": {
  223. "id": "bowl",
  224. "name": "Behind the Bowl",
  225. "desc": "You're crouched behind Geta's bowl of cereal",
  226. "move": (room, state) => {
  227. print(["You scurry up to the looming bowl, staying low and out of Geta's sight."]);
  228. },
  229. "enter": (room, state) => {
  230. },
  231. "exit": (room, state) => {
  232. },
  233. "actions": [
  234. ],
  235. "exits": {
  236. "ascend": {
  237. "target": "in-bowl",
  238. "desc": "Climb into Geta's cereal",
  239. "show": [
  240. ],
  241. "conditions": [
  242. ],
  243. "hooks": [
  244. ]
  245. },
  246. "down": {
  247. "target": "pepper-grinder",
  248. "desc": "Run back behind the pepper grinder",
  249. "show": [
  250. ],
  251. "conditions": [
  252. ],
  253. "hooks": [
  254. (room, exit, state) => {
  255. return checkSuspicion(state, 15);
  256. }
  257. ]
  258. },
  259. },
  260. "hooks": [
  261. ],
  262. "data": {
  263. "stats": {
  264. }
  265. }
  266. },
  267. "table": {
  268. "id": "table",
  269. "name": "Table",
  270. "desc": "You're out in the open!",
  271. "move": (room, state) => {
  272. },
  273. "enter": (room, state) => {
  274. startTimer({
  275. id: "table-suspicion",
  276. func: state => {
  277. checkSuspicion(state, 1.5);
  278. return true;
  279. },
  280. delay: 100,
  281. loop: true,
  282. classes: [
  283. "free"
  284. ]
  285. }, state);
  286. },
  287. "exit": (room, state) => {
  288. stopTimer("table-suspicion", state);
  289. },
  290. "actions": [
  291. ],
  292. "exits": {
  293. "right": {
  294. "target": "pepper-grinder",
  295. "desc": "Run back to cover",
  296. "show": [
  297. ],
  298. "conditions": [
  299. ],
  300. "hooks": [
  301. ]
  302. },
  303. },
  304. "hooks": [
  305. ],
  306. "data": {
  307. "stats": {
  308. }
  309. }
  310. },
  311. "in-bowl": {
  312. "id": "in-bowl",
  313. "name": "Bowl",
  314. "desc": "You're in the cereal bowl...",
  315. "move": (room, state) => {
  316. print(["Why did you do that?"]);
  317. },
  318. "enter": (room, state) => {
  319. stopClassTimers("free", state);
  320. startTimer({
  321. id: "geta-eat",
  322. func: state => {
  323. if (Math.random() < 0.6) {
  324. print(["Geta scoops up a spoonful of cereal; you narrowly avoid being caught."]);
  325. return true;
  326. } else {
  327. print(["Geta scoops you up and slurps you into his maw."]);
  328. goToRoom("maw", state);
  329. return false;
  330. }
  331. },
  332. delay: 3000,
  333. loop: true,
  334. classes: [
  335. ]
  336. }, state);
  337. },
  338. "exit": (room, state) => {
  339. },
  340. "actions": [
  341. ],
  342. "exits": {
  343. },
  344. "hooks": [
  345. ],
  346. "data": {
  347. "stats": {
  348. }
  349. }
  350. },
  351. "maw": {
  352. "id": "maw",
  353. "name": "Geta's Maw",
  354. "desc": "You've been slurped up into the fox's jaws",
  355. "move": (room, state) => {
  356. },
  357. "enter": (room, state) => {
  358. stopClassTimers("free", state);
  359. startTimer({
  360. id: "swallow",
  361. func: state => {
  362. print(["It's too late to escape. You're swallowed down."]);
  363. stopTimer("maw-tease", state);
  364. goToRoom("throat", state);
  365. return true;
  366. },
  367. delay: Math.random() * 5000 + 6000,
  368. loop: false,
  369. classes: [
  370. ]
  371. }, state);
  372. startTimer({
  373. id: "maw-tease",
  374. func: state => {
  375. printRandom([
  376. ["Your captor teases you with a sharp, sloppy swallow, barely holding you back from plunging down that slick gullet."],
  377. ["You're sloshed to and fro, battered against the fox's gums by his undulating tongue."],
  378. ["Slobber drenches your body as you're smothered beneath Geta's hot tongue."]
  379. ]);
  380. return Math.random() * 2000 + 3000;
  381. },
  382. delay: 3000,
  383. loop: true,
  384. classes: [
  385. ]
  386. }, state);
  387. },
  388. "exit": (room, state) => {
  389. },
  390. "actions": [
  391. ],
  392. "exits": {
  393. },
  394. "hooks": [
  395. ],
  396. "data": {
  397. "stats": {
  398. }
  399. }
  400. },
  401. "throat": {
  402. "id": "throat",
  403. "name": "Geta's Gullet",
  404. "desc": "GULP!",
  405. "move": (room, state) => {
  406. },
  407. "enter": (room, state) => {
  408. startTimer({
  409. id: "throat-swallow",
  410. func: state => {
  411. print(["You slush down into Geta's stomach"]);
  412. goToRoom("stomach", state);
  413. return true;
  414. },
  415. delay: 7000,
  416. loop: false,
  417. classes: [
  418. ]
  419. }, state);
  420. },
  421. "exit": (room, state) => {
  422. },
  423. "actions": [
  424. {
  425. name: "Struggle",
  426. desc: "Try to climb back out!",
  427. execute: (room, state) => {
  428. print(["Nope"]);
  429. },
  430. show: [
  431. ],
  432. conditions: [
  433. ]
  434. },
  435. {
  436. name: "Give up",
  437. desc: "Dive down into Geta's stomach",
  438. execute: (room, state) => {
  439. print(["You submit to your predator."]);
  440. goToRoom("stomach", state);
  441. stopTimer("throat-swallow", state);
  442. },
  443. show: [
  444. ],
  445. conditions: [
  446. ]
  447. },
  448. ],
  449. "exits": {
  450. },
  451. "hooks": [
  452. ],
  453. "data": {
  454. "stats": {
  455. }
  456. }
  457. },
  458. "stomach": {
  459. "id": "stomach",
  460. "name": "Geta's Stomach",
  461. "desc": "Glorp",
  462. "move": (room, state) => {
  463. },
  464. "enter": (room, state) => {
  465. playLoop("loop/stomach.ogg");
  466. startTimer({
  467. id: "digest",
  468. func: state => {
  469. changeStat("health", -0.3, state);
  470. if (getStat("health", state) <= 0) {
  471. print(["You're digested before too long."]);
  472. goToRoom("digested", state);
  473. return false;
  474. }
  475. return true;
  476. },
  477. delay: 100,
  478. loop: true,
  479. classes: [
  480. ]
  481. }, state);
  482. },
  483. "exit": (room, state) => {
  484. },
  485. "actions": [
  486. {
  487. name: "Squirm",
  488. desc: "Rub at the walls of the fox's churning stomach",
  489. execute: (room, state) => {
  490. printRandom([
  491. ["You punch and kick at the walls"],
  492. ["A powerful churn grabs hold of you, stifling any attempts at struggling"],
  493. ["Your little thumps and kicks do little to faze your captor"]
  494. ]);
  495. },
  496. show: [
  497. ],
  498. conditions: [
  499. ]
  500. },
  501. ],
  502. "exits": {
  503. },
  504. "hooks": [
  505. ],
  506. "data": {
  507. "stats": {
  508. }
  509. }
  510. },
  511. "digested": {
  512. "id": "digested",
  513. "name": "Fat",
  514. "desc": "You're just fat now",
  515. "move": (room, state) => {
  516. },
  517. "enter": (room, state) => {
  518. },
  519. "exit": (room, state) => {
  520. },
  521. "actions": [
  522. {
  523. name: "Gurgle",
  524. desc: "Glorp",
  525. execute: (room, state) => {
  526. printRandom([
  527. ["Grrrrgle"],
  528. ["Glorp"],
  529. ["Glrrrrrrnnnnnn..."],
  530. ["Gwoooooorgle"]
  531. ]);
  532. },
  533. show: [
  534. ],
  535. conditions: [
  536. ]
  537. },
  538. ],
  539. "exits": {
  540. },
  541. "hooks": [
  542. ],
  543. "data": {
  544. "stats": {
  545. }
  546. }
  547. },
  548. }
  549. });
  550. })();