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ů.
 
 
 
 

631 řádky
19 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": "unaware-geta",
  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. ],
  131. "preload": [
  132. ],
  133. "world": {
  134. "pepper-grinder": {
  135. "id": "pepper-grinder",
  136. "name": "Pepper Grinder",
  137. "desc": "You're hiding behind a pepper grinder",
  138. "move": (room, state) => {
  139. print(["You dart over to the pepper grinder, which looms over you like a greatwood."]);
  140. },
  141. "enter": (room, state) => {
  142. },
  143. "exit": (room, state) => {
  144. },
  145. "actions": [
  146. {
  147. name: "Tap",
  148. desc: "Bang on the pepper shaker",
  149. execute: (room, state) => {
  150. print(["You thump the pepper shaker, making a dull thud."]);
  151. checkSuspicion(state, 25);
  152. },
  153. show: [
  154. ],
  155. conditions: [
  156. ]
  157. },
  158. {
  159. name: "Wait",
  160. desc: "Wait for the fox to finish his breakfast. Surely you'll be able to escape after that...right?",
  161. execute: (room, state) => {
  162. state.info.time.value = 60 * 60 * 7 + 60 * 20;
  163. },
  164. show: [
  165. ],
  166. conditions: [
  167. ]
  168. },
  169. ],
  170. "exits": {
  171. "up": {
  172. "target": "bowl",
  173. "desc": "Walk up to the cereal bowl",
  174. "show": [
  175. ],
  176. "conditions": [
  177. ],
  178. "hooks": [
  179. (room, exit, state) => {
  180. return checkSuspicion(state, 10);
  181. }
  182. ]
  183. },
  184. "left": {
  185. "target": "table",
  186. "desc": "Run out into the open",
  187. "show": [
  188. ],
  189. "conditions": [
  190. ],
  191. "hooks": [
  192. ]
  193. },
  194. },
  195. "hooks": [
  196. ],
  197. "data": {
  198. "stats": {
  199. }
  200. }
  201. },
  202. "bowl": {
  203. "id": "bowl",
  204. "name": "Behind the Bowl",
  205. "desc": "You're crouched behind Geta's bowl of cereal",
  206. "move": (room, state) => {
  207. print(["You scurry up to the looming bowl, staying low and out of Geta's sight."]);
  208. },
  209. "enter": (room, state) => {
  210. },
  211. "exit": (room, state) => {
  212. },
  213. "actions": [
  214. ],
  215. "exits": {
  216. "ascend": {
  217. "target": "in-bowl",
  218. "desc": "Climb into Geta's cereal",
  219. "show": [
  220. ],
  221. "conditions": [
  222. ],
  223. "hooks": [
  224. ]
  225. },
  226. "down": {
  227. "target": "pepper-grinder",
  228. "desc": "Run back behind the pepper grinder",
  229. "show": [
  230. ],
  231. "conditions": [
  232. ],
  233. "hooks": [
  234. ]
  235. },
  236. },
  237. "hooks": [
  238. ],
  239. "data": {
  240. "stats": {
  241. }
  242. }
  243. },
  244. "table": {
  245. "id": "table",
  246. "name": "Table",
  247. "desc": "You're out in the open!",
  248. "move": (room, state) => {
  249. },
  250. "enter": (room, state) => {
  251. startTimer({
  252. id: "table-suspicion",
  253. func: state => {
  254. checkSuspicion(state, 1.5);
  255. return true;
  256. },
  257. delay: 100,
  258. loop: true,
  259. classes: [
  260. "free"
  261. ]
  262. }, state);
  263. },
  264. "exit": (room, state) => {
  265. stopTimer("table-suspicion", state);
  266. },
  267. "actions": [
  268. ],
  269. "exits": {
  270. "right": {
  271. "target": "pepper-grinder",
  272. "desc": "Run back to cover",
  273. "show": [
  274. ],
  275. "conditions": [
  276. ],
  277. "hooks": [
  278. ]
  279. },
  280. },
  281. "hooks": [
  282. ],
  283. "data": {
  284. "stats": {
  285. }
  286. }
  287. },
  288. "in-bowl": {
  289. "id": "in-bowl",
  290. "name": "Bowl",
  291. "desc": "You're in the cereal bowl...",
  292. "move": (room, state) => {
  293. print(["Why did you do that?"]);
  294. },
  295. "enter": (room, state) => {
  296. stopClassTimers("free", state);
  297. startTimer({
  298. id: "geta-eat",
  299. func: state => {
  300. if (Math.random() < 0.6) {
  301. print(["Geta scoops up a spoonful of cereal; you narrowly avoid being caught."]);
  302. return true;
  303. } else {
  304. print(["Geta scoops you up and slurps you into his maw."]);
  305. goToRoom("maw", state);
  306. return false;
  307. }
  308. },
  309. delay: 3000,
  310. loop: true,
  311. classes: [
  312. ]
  313. }, state);
  314. },
  315. "exit": (room, state) => {
  316. },
  317. "actions": [
  318. ],
  319. "exits": {
  320. },
  321. "hooks": [
  322. ],
  323. "data": {
  324. "stats": {
  325. }
  326. }
  327. },
  328. "maw": {
  329. "id": "maw",
  330. "name": "Geta's Maw",
  331. "desc": "You've been slurped up into the fox's jaws",
  332. "move": (room, state) => {
  333. },
  334. "enter": (room, state) => {
  335. stopClassTimers("free", state);
  336. startTimer({
  337. id: "swallow",
  338. func: state => {
  339. print(["It's too late to escape. You're swallowed down."]);
  340. stopTimer("maw-tease", state);
  341. goToRoom("throat", state);
  342. return true;
  343. },
  344. delay: Math.random() * 5000 + 6000,
  345. loop: false,
  346. classes: [
  347. ]
  348. }, state);
  349. startTimer({
  350. id: "maw-tease",
  351. func: state => {
  352. printRandom([
  353. ["Your captor teases you with a sharp, sloppy swallow, barely holding you back from plunging down that slick gullet."],
  354. ["You're sloshed to and fro, battered against the fox's gums by his undulating tongue."],
  355. ["Slobber drenches your body as you're smothered beneath Geta's hot tongue."]
  356. ]);
  357. return Math.random() * 2000 + 3000;
  358. },
  359. delay: 3000,
  360. loop: true,
  361. classes: [
  362. ]
  363. }, state);
  364. },
  365. "exit": (room, state) => {
  366. },
  367. "actions": [
  368. ],
  369. "exits": {
  370. },
  371. "hooks": [
  372. ],
  373. "data": {
  374. "stats": {
  375. }
  376. }
  377. },
  378. "throat": {
  379. "id": "throat",
  380. "name": "Geta's Gullet",
  381. "desc": "GULP!",
  382. "move": (room, state) => {
  383. },
  384. "enter": (room, state) => {
  385. startTimer({
  386. id: "throat-swallow",
  387. func: state => {
  388. print(["You slush down into Geta's stomach"]);
  389. goToRoom("stomach", state);
  390. return true;
  391. },
  392. delay: 7000,
  393. loop: false,
  394. classes: [
  395. ]
  396. }, state);
  397. },
  398. "exit": (room, state) => {
  399. },
  400. "actions": [
  401. {
  402. name: "Struggle",
  403. desc: "Try to climb back out!",
  404. execute: (room, state) => {
  405. print(["Nope"]);
  406. },
  407. show: [
  408. ],
  409. conditions: [
  410. ]
  411. },
  412. {
  413. name: "Give up",
  414. desc: "Dive down into Geta's stomach",
  415. execute: (room, state) => {
  416. print(["You submit to your predator."]);
  417. goToRoom("stomach", state);
  418. stopTimer("throat-swallow", state);
  419. },
  420. show: [
  421. ],
  422. conditions: [
  423. ]
  424. },
  425. ],
  426. "exits": {
  427. },
  428. "hooks": [
  429. ],
  430. "data": {
  431. "stats": {
  432. }
  433. }
  434. },
  435. "stomach": {
  436. "id": "stomach",
  437. "name": "Geta's Stomach",
  438. "desc": "Glorp",
  439. "move": (room, state) => {
  440. },
  441. "enter": (room, state) => {
  442. startTimer({
  443. id: "digest",
  444. func: state => {
  445. changeStat("health", -0.3, state);
  446. if (getStat("health", state) <= 0) {
  447. print(["You're digested before too long."]);
  448. goToRoom("digested", state);
  449. return false;
  450. }
  451. return true;
  452. },
  453. delay: 100,
  454. loop: true,
  455. classes: [
  456. ]
  457. }, state);
  458. },
  459. "exit": (room, state) => {
  460. },
  461. "actions": [
  462. {
  463. name: "Squirm",
  464. desc: "Rub at the walls of the fox's churning stomach",
  465. execute: (room, state) => {
  466. printRandom([
  467. ["You punch and kick at the walls"],
  468. ["A powerful churn grabs hold of you, stifling any attempts at struggling"],
  469. ["Your little thumps and kicks do little to faze your captor"]
  470. ]);
  471. },
  472. show: [
  473. ],
  474. conditions: [
  475. ]
  476. },
  477. ],
  478. "exits": {
  479. },
  480. "hooks": [
  481. ],
  482. "data": {
  483. "stats": {
  484. }
  485. }
  486. },
  487. "digested": {
  488. "id": "digested",
  489. "name": "Fat",
  490. "desc": "You're just fat now",
  491. "move": (room, state) => {
  492. },
  493. "enter": (room, state) => {
  494. },
  495. "exit": (room, state) => {
  496. },
  497. "actions": [
  498. {
  499. name: "Gurgle",
  500. desc: "Glorp",
  501. execute: (room, state) => {
  502. printRandom([
  503. ["Grrrrgle"],
  504. ["Glorp"],
  505. ["Glrrrrrrnnnnnn..."],
  506. ["Gwoooooorgle"]
  507. ]);
  508. },
  509. show: [
  510. ],
  511. conditions: [
  512. ]
  513. },
  514. ],
  515. "exits": {
  516. },
  517. "hooks": [
  518. ],
  519. "data": {
  520. "stats": {
  521. }
  522. }
  523. },
  524. }
  525. });
  526. })();