a munch adventure
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

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