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.
 
 
 
 

99 lines
2.4 KiB

  1. stories.push({
  2. "id": "demo",
  3. "name": "Tech Demo",
  4. "intro": {
  5. "start": "Home"
  6. },
  7. "sounds": [
  8. "sfx/oof.ogg"
  9. ],
  10. "world": {
  11. "Home": {
  12. "id": "Home",
  13. "name": "Home",
  14. "desc": "Where the wifi autoconnects",
  15. "move": (room, state) => {
  16. print(["You go back to your living room"]);
  17. },
  18. "actions": [
  19. {
  20. "name": "Squint",
  21. "desc": "Squint in a very aggressive manner",
  22. "execute": (room, state) => {
  23. state.player.rooms[room.id].squinted = true;
  24. print(["You stare at the wall and notice a secret door. But where is the key?"]);
  25. }
  26. },
  27. {
  28. "name": "Find Keys",
  29. "desc": "Find your keys",
  30. "execute": (room, state) => {
  31. state.player.items.keys.push("Locked Room");
  32. print(["You found your keys under the couch cushions"]);
  33. },
  34. "show": [
  35. (room, state) => {
  36. return state.player.rooms[room.id].squinted;
  37. },
  38. (room, state) => {
  39. return !state.player.items.keys.includes("Locked Room");
  40. }
  41. ]
  42. }
  43. ],
  44. "exits": {
  45. "up": {
  46. "target": "Locked Room",
  47. "desc": "It's locked!",
  48. "conditions": [
  49. (room, state) => {
  50. return state.player.items.keys.includes("Locked Room");
  51. }
  52. ],
  53. "show": [
  54. (room, state) => {
  55. return state.player.rooms[room.id].squinted;
  56. }
  57. ]
  58. }
  59. },
  60. "hooks": [
  61. (room, state) => {
  62. print(["This is a test of the hooks"]);
  63. return true;
  64. }
  65. ]
  66. },
  67. "Locked Room": {
  68. "id": "Locked Room",
  69. "name": "Locked Room",
  70. "desc": "Super seecret",
  71. "move": (room, state) => {
  72. print(["You enter the locked room. wowie!"]);
  73. },
  74. "actions": [
  75. {
  76. name: "Oof",
  77. desc: "Oof",
  78. execute: (room, state) => {
  79. print(["Oof"]);
  80. playSfx("sfx/oof.ogg");
  81. }
  82. }
  83. ],
  84. "exits": {
  85. "down": {
  86. "target": "Home",
  87. "desc": "Back to home",
  88. "hooks": [
  89. (room, exit, state) => {
  90. print(["Potato"]);
  91. return true;
  92. }
  93. ]
  94. }
  95. }
  96. }
  97. }
  98. });