a munch adventure
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

108 linhas
2.6 KiB

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