a munch adventure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

169 lines
4.2 KiB

  1. stories.push({
  2. "id": "demo",
  3. "info": {
  4. "name": "Tech Demo",
  5. "desc": "Shows what the game engine can do",
  6. "tags": []
  7. },
  8. "intro": {
  9. "start": "Home",
  10. "setup": () => {
  11. state.info.time.value = 3600;
  12. state.player.stats.oofs = {name: "Oofs", type: "meter", value: 0, max: 10, get color() { return "rgb(" + (155 + this.value*10) + ",0,0)"}};
  13. state.player.stats.number = {name: "Number", type: "counter", value: 0, max: 10, color: "rgb(255,255,255)"};
  14. },
  15. "intro": () => {
  16. print(["don't fall down the stairs ok"]);
  17. }
  18. },
  19. "sounds": [
  20. "sfx/oof.ogg"
  21. ],
  22. "preload": [
  23. ],
  24. "world": {
  25. "Stairs": {
  26. "id": "Stairs",
  27. "name": "Stairs",
  28. "desc": "You can't actually get here"
  29. },
  30. "Home": {
  31. "id": "Home",
  32. "name": "Home",
  33. "desc": "Where the wifi autoconnects",
  34. "move": (room) => {
  35. print(["You go back to your living room"]);
  36. },
  37. "enter": (room) => {
  38. print(["*sound of you entering your house*"]);
  39. startTimer({
  40. id: "room-counter",
  41. func: () => {
  42. state.world["Home"].data.stats.number.value += 1;
  43. return true;
  44. },
  45. delay: 1000,
  46. loop: true,
  47. classes: [
  48. "Home"
  49. ],
  50. });
  51. },
  52. "exit": (room) => {
  53. print(["You are exiting your house"]);
  54. stopClassTimers("Home");
  55. },
  56. "actions": [
  57. {
  58. "name": "Squint",
  59. "desc": "Squint in a very aggressive manner",
  60. "execute": (room) => {
  61. state.player.rooms[room.id].squinted = true;
  62. print(["You stare at the wall and notice a secret door. But where is the key?"]);
  63. }
  64. },
  65. {
  66. "name": "Find Keys",
  67. "desc": "Find your keys",
  68. "execute": (room) => {
  69. state.player.items.keys.push("Locked Room");
  70. print(["You found your keys under the couch cushions"]);
  71. },
  72. "show": [
  73. (room) => {
  74. return state.player.rooms[room.id].squinted;
  75. },
  76. (room) => {
  77. return !state.player.items.keys.includes("Locked Room");
  78. }
  79. ]
  80. }
  81. ],
  82. "exits": {
  83. "up": {
  84. "target": "Locked Room",
  85. "desc": "It's locked!",
  86. "conditions": [
  87. (room) => {
  88. return state.player.items.keys.includes("Locked Room");
  89. }
  90. ],
  91. "show": [
  92. (room) => {
  93. return state.player.rooms[room.id].squinted;
  94. }
  95. ]
  96. },
  97. "descend": {
  98. "target": "Stairs",
  99. "desc": "Dare you go down the stairs?",
  100. "hooks": [
  101. (room, exit) => {
  102. console.log(state)
  103. print(["You're very concerned that you'll fall down all these stairs."]);
  104. return false;
  105. }
  106. ]
  107. }
  108. },
  109. "hooks": [
  110. (room) => {
  111. print(["This is a test of the hooks"]);
  112. return true;
  113. }
  114. ],
  115. "data": {
  116. "stats": {
  117. number: {name: "Seconds In Room", type: "counter", value: 0, color: "rgb(255,0,0)"}
  118. }
  119. }
  120. },
  121. "Locked Room": {
  122. "id": "Locked Room",
  123. "name": "Locked Room",
  124. "desc": "Super seecret",
  125. "move": (room) => {
  126. print(["You enter the locked room. wowie!"]);
  127. },
  128. "actions": [
  129. {
  130. name: "Oof",
  131. desc: "Oof",
  132. execute: (room) => {
  133. state.player.stats.oofs.value += 1;
  134. if (state.player.stats.oofs.value >= state.player.stats.oofs.max) {
  135. state.player.stats.oofs.value = state.player.stats.oofs.max;
  136. print(["Big oof"]);
  137. } else {
  138. print(["Oof"]);
  139. }
  140. playSfx("sfx/oof.ogg");
  141. }
  142. }
  143. ],
  144. "exits": {
  145. "down": {
  146. "target": "Home",
  147. "desc": "Back to home",
  148. "hooks": [
  149. (room, exit) => {
  150. print(["Potato"]);
  151. return true;
  152. }
  153. ]
  154. }
  155. },
  156. "data": {
  157. "stats": {
  158. }
  159. }
  160. }
  161. }
  162. });