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.
 
 
 
 

174 wiersze
4.3 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(["<b>don't fall down the stairs ok</b>"]);
  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. "conditions": [
  65. (room) => {
  66. return !state.player.rooms[room.id].squinted;
  67. }
  68. ]
  69. },
  70. {
  71. "name": "Find Keys",
  72. "desc": "Find your keys",
  73. "execute": (room) => {
  74. state.player.items.keys.push("Locked Room");
  75. print(["You found your keys under the couch cushions"]);
  76. },
  77. "show": [
  78. (room) => {
  79. return state.player.rooms[room.id].squinted;
  80. },
  81. (room) => {
  82. return !state.player.items.keys.includes("Locked Room");
  83. }
  84. ]
  85. }
  86. ],
  87. "exits": {
  88. "up": {
  89. "target": "Locked Room",
  90. "desc": "It's locked!",
  91. "conditions": [
  92. (room) => {
  93. return state.player.items.keys.includes("Locked Room");
  94. }
  95. ],
  96. "show": [
  97. (room) => {
  98. return state.player.rooms[room.id].squinted;
  99. }
  100. ]
  101. },
  102. "descend": {
  103. "target": "Stairs",
  104. "desc": "Dare you go down the stairs?",
  105. "hooks": [
  106. (room, exit) => {
  107. console.log(state)
  108. print(["You're very concerned that you'll fall down all these stairs."]);
  109. return false;
  110. }
  111. ]
  112. }
  113. },
  114. "hooks": [
  115. (room) => {
  116. print(["This is a test of the hooks"]);
  117. return true;
  118. }
  119. ],
  120. "data": {
  121. "stats": {
  122. number: {name: "Seconds In Room", type: "counter", value: 0, color: "rgb(255,0,0)"}
  123. }
  124. }
  125. },
  126. "Locked Room": {
  127. "id": "Locked Room",
  128. "name": "Locked Room",
  129. "desc": "Super seecret",
  130. "move": (room) => {
  131. print(["You enter the locked room. wowie!"]);
  132. },
  133. "actions": [
  134. {
  135. name: "Oof",
  136. desc: "Oof",
  137. execute: (room) => {
  138. state.player.stats.oofs.value += 1;
  139. if (state.player.stats.oofs.value >= state.player.stats.oofs.max) {
  140. state.player.stats.oofs.value = state.player.stats.oofs.max;
  141. print(["Big oof"]);
  142. } else {
  143. print(["Oof"]);
  144. }
  145. playSfx("sfx/oof.ogg");
  146. }
  147. }
  148. ],
  149. "exits": {
  150. "down": {
  151. "target": "Home",
  152. "desc": "Back to home",
  153. "hooks": [
  154. (room, exit) => {
  155. print(["Potato"]);
  156. return true;
  157. }
  158. ]
  159. }
  160. },
  161. "data": {
  162. "stats": {
  163. }
  164. }
  165. }
  166. }
  167. });