a munch adventure
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

612 rindas
18 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. stopClassTimers("free", state);
  334. },
  335. "enter": (room, state) => {
  336. startTimer({
  337. id: "swallow",
  338. func: state => {
  339. print(["It's too late to escape. You're swallowed down."]);
  340. goToRoom("throat", state);
  341. return true;
  342. },
  343. delay: 5000,
  344. loop: false,
  345. classes: [
  346. ]
  347. }, state);
  348. },
  349. "exit": (room, state) => {
  350. },
  351. "actions": [
  352. ],
  353. "exits": {
  354. },
  355. "hooks": [
  356. ],
  357. "data": {
  358. "stats": {
  359. }
  360. }
  361. },
  362. "throat": {
  363. "id": "throat",
  364. "name": "Geta's Gullet",
  365. "desc": "GULP!",
  366. "move": (room, state) => {
  367. },
  368. "enter": (room, state) => {
  369. startTimer({
  370. id: "throat-swallow",
  371. func: state => {
  372. print(["You slush down into Geta's stomach"]);
  373. goToRoom("stomach", state);
  374. return true;
  375. },
  376. delay: 7000,
  377. loop: false,
  378. classes: [
  379. ]
  380. }, state);
  381. },
  382. "exit": (room, state) => {
  383. },
  384. "actions": [
  385. {
  386. name: "Struggle",
  387. desc: "Try to climb back out!",
  388. execute: (room, state) => {
  389. print(["Nope"]);
  390. },
  391. show: [
  392. ],
  393. conditions: [
  394. ]
  395. },
  396. {
  397. name: "Give up",
  398. desc: "Dive down into Geta's stomach",
  399. execute: (room, state) => {
  400. print(["You submit to your predator."]);
  401. goToRoom("stomach", state);
  402. stopTimer("throat-swallow", state);
  403. },
  404. show: [
  405. ],
  406. conditions: [
  407. ]
  408. },
  409. ],
  410. "exits": {
  411. },
  412. "hooks": [
  413. ],
  414. "data": {
  415. "stats": {
  416. }
  417. }
  418. },
  419. "stomach": {
  420. "id": "stomach",
  421. "name": "Geta's Stomach",
  422. "desc": "Glorp",
  423. "move": (room, state) => {
  424. },
  425. "enter": (room, state) => {
  426. startTimer({
  427. id: "digest",
  428. func: state => {
  429. changeStat("health", -0.3, state);
  430. if (getStat("health", state) <= 0) {
  431. print(["You're digested before too long."]);
  432. goToRoom("digested", state);
  433. return false;
  434. }
  435. return true;
  436. },
  437. delay: 100,
  438. loop: true,
  439. classes: [
  440. ]
  441. }, state);
  442. },
  443. "exit": (room, state) => {
  444. },
  445. "actions": [
  446. {
  447. name: "Squirm",
  448. desc: "Rub at the walls of the fox's churning stomach",
  449. execute: (room, state) => {
  450. printRandom([
  451. ["You punch and kick at the walls"],
  452. ["A powerful churn grabs hold of you, stifling any attempts at struggling"],
  453. ["Your little thumps and kicks do little to faze your captor"]
  454. ]);
  455. },
  456. show: [
  457. ],
  458. conditions: [
  459. ]
  460. },
  461. ],
  462. "exits": {
  463. },
  464. "hooks": [
  465. ],
  466. "data": {
  467. "stats": {
  468. }
  469. }
  470. },
  471. "digested": {
  472. "id": "digested",
  473. "name": "Fat",
  474. "desc": "You're just fat now",
  475. "move": (room, state) => {
  476. },
  477. "enter": (room, state) => {
  478. },
  479. "exit": (room, state) => {
  480. },
  481. "actions": [
  482. {
  483. name: "Gurgle",
  484. desc: "Glorp",
  485. execute: (room, state) => {
  486. printRandom([
  487. ["Grrrrgle"],
  488. ["Glorp"],
  489. ["Glrrrrrrnnnnnn..."],
  490. ["Gwoooooorgle"]
  491. ]);
  492. },
  493. show: [
  494. ],
  495. conditions: [
  496. ]
  497. },
  498. ],
  499. "exits": {
  500. },
  501. "hooks": [
  502. ],
  503. "data": {
  504. "stats": {
  505. }
  506. }
  507. },
  508. }
  509. });
  510. })();