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.
 
 
 
 

96 lines
2.3 KiB

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