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.
 
 
 
 

551 wiersze
16 KiB

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