a munch adventure
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

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