a munch adventure
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

692 líneas
22 KiB

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