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.
 
 
 
 

168 wiersze
4.2 KiB

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