@strixit/storyscript 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. package/.env +1 -0
  2. package/CodeSnippets/StoryScriptSnippets.code-snippets +573 -0
  3. package/LICENSE.txt +21 -0
  4. package/LiveTemplates/StoryScript.xml +271 -0
  5. package/README.md +9 -2
  6. package/baseViteConfig.js +112 -0
  7. package/clientFiles/currentGameName.js +1 -0
  8. package/clientFiles/gitignore +12 -0
  9. package/clientFiles/tsconfig.json +34 -0
  10. package/clientFiles/vite.config.ts +14 -0
  11. package/clientFiles/vitest.config.ts +29 -0
  12. package/dist/src/Engine/Actions/index.d.ts +2 -0
  13. package/dist/src/Engine/Actions/open.d.ts +6 -0
  14. package/dist/src/Engine/Actions/openWithKey.d.ts +7 -0
  15. package/dist/src/Engine/EntityCreatorFunctions.d.ts +18 -0
  16. package/dist/src/Engine/Interfaces/action.d.ts +37 -0
  17. package/dist/src/Engine/Interfaces/autoplayStep.d.ts +11 -0
  18. package/dist/src/Engine/Interfaces/barrier.d.ts +16 -0
  19. package/dist/src/Engine/Interfaces/barrierAction.d.ts +19 -0
  20. package/dist/src/Engine/Interfaces/character.d.ts +48 -0
  21. package/dist/src/Engine/Interfaces/combatSetup.d.ts +9 -0
  22. package/dist/src/Engine/Interfaces/combatTurn.d.ts +37 -0
  23. package/dist/src/Engine/Interfaces/combatWinnings.d.ts +6 -0
  24. package/dist/src/Engine/Interfaces/combinations/activeCombination.d.ts +14 -0
  25. package/dist/src/Engine/Interfaces/combinations/combinable.d.ts +18 -0
  26. package/dist/src/Engine/Interfaces/combinations/combinationAction.d.ts +41 -0
  27. package/dist/src/Engine/Interfaces/combinations/combinationMatchResult.d.ts +14 -0
  28. package/dist/src/Engine/Interfaces/combinations/combinations.d.ts +17 -0
  29. package/dist/src/Engine/Interfaces/combinations/combine.d.ts +22 -0
  30. package/dist/src/Engine/Interfaces/combinations/combineResult.d.ts +18 -0
  31. package/dist/src/Engine/Interfaces/combinations/gameCombinations.d.ts +40 -0
  32. package/dist/src/Engine/Interfaces/compiledLocation.d.ts +33 -0
  33. package/dist/src/Engine/Interfaces/conversations/conversation.d.ts +44 -0
  34. package/dist/src/Engine/Interfaces/conversations/conversationLogEntry.d.ts +13 -0
  35. package/dist/src/Engine/Interfaces/conversations/conversationNode.d.ts +22 -0
  36. package/dist/src/Engine/Interfaces/conversations/conversationReply.d.ts +49 -0
  37. package/dist/src/Engine/Interfaces/createCharacter/createCharacter.d.ts +20 -0
  38. package/dist/src/Engine/Interfaces/createCharacter/createCharacterAttribute.d.ts +18 -0
  39. package/dist/src/Engine/Interfaces/createCharacter/createCharacterAttributeEntry.d.ts +18 -0
  40. package/dist/src/Engine/Interfaces/createCharacter/createCharacterQuestion.d.ts +18 -0
  41. package/dist/src/Engine/Interfaces/createCharacter/createCharacterQuestionEntry.d.ts +22 -0
  42. package/dist/src/Engine/Interfaces/createCharacter/createCharacterStep.d.ts +40 -0
  43. package/dist/src/Engine/Interfaces/customCursor.d.ts +8 -0
  44. package/dist/src/Engine/Interfaces/defaultEquipment.d.ts +19 -0
  45. package/dist/src/Engine/Interfaces/definitions.d.ts +40 -0
  46. package/dist/src/Engine/Interfaces/destination.d.ts +31 -0
  47. package/dist/src/Engine/Interfaces/dynamicStyle.d.ts +10 -0
  48. package/dist/src/Engine/Interfaces/enemy.d.ts +46 -0
  49. package/dist/src/Engine/Interfaces/enumerations/actionStatus.d.ts +18 -0
  50. package/dist/src/Engine/Interfaces/enumerations/actionType.d.ts +9 -0
  51. package/dist/src/Engine/Interfaces/enumerations/equipmentType.d.ts +51 -0
  52. package/dist/src/Engine/Interfaces/enumerations/gameState.d.ts +11 -0
  53. package/dist/src/Engine/Interfaces/enumerations/playState.d.ts +10 -0
  54. package/dist/src/Engine/Interfaces/enumerations/targetType.d.ts +9 -0
  55. package/dist/src/Engine/Interfaces/equipment.d.ts +43 -0
  56. package/dist/src/Engine/Interfaces/feature.d.ts +37 -0
  57. package/dist/src/Engine/Interfaces/featureCollection.d.ts +7 -0
  58. package/dist/src/Engine/Interfaces/game.d.ts +148 -0
  59. package/dist/src/Engine/Interfaces/gameEvents.d.ts +7 -0
  60. package/dist/src/Engine/Interfaces/groupableItem.d.ts +32 -0
  61. package/dist/src/Engine/Interfaces/helpers.d.ts +50 -0
  62. package/dist/src/Engine/Interfaces/index.d.ts +78 -0
  63. package/dist/src/Engine/Interfaces/interfaceTexts.d.ts +140 -0
  64. package/dist/src/Engine/Interfaces/item.d.ts +96 -0
  65. package/dist/src/Engine/Interfaces/key.d.ts +16 -0
  66. package/dist/src/Engine/Interfaces/location.d.ts +78 -0
  67. package/dist/src/Engine/Interfaces/maps/map.d.ts +45 -0
  68. package/dist/src/Engine/Interfaces/maps/mapLocation.d.ts +23 -0
  69. package/dist/src/Engine/Interfaces/party.d.ts +33 -0
  70. package/dist/src/Engine/Interfaces/person.d.ts +25 -0
  71. package/dist/src/Engine/Interfaces/quest.d.ts +51 -0
  72. package/dist/src/Engine/Interfaces/rules/characterRules.d.ts +84 -0
  73. package/dist/src/Engine/Interfaces/rules/combatRules.d.ts +46 -0
  74. package/dist/src/Engine/Interfaces/rules/combinationRules.d.ts +15 -0
  75. package/dist/src/Engine/Interfaces/rules/demoMode.d.ts +15 -0
  76. package/dist/src/Engine/Interfaces/rules/encounterRules.d.ts +4 -0
  77. package/dist/src/Engine/Interfaces/rules/explorationRules.d.ts +42 -0
  78. package/dist/src/Engine/Interfaces/rules/generalRules.d.ts +62 -0
  79. package/dist/src/Engine/Interfaces/rules/rules.d.ts +31 -0
  80. package/dist/src/Engine/Interfaces/rules/setupRules.d.ts +56 -0
  81. package/dist/src/Engine/Interfaces/rules/titleScreen.d.ts +16 -0
  82. package/dist/src/Engine/Interfaces/saveGame.d.ts +33 -0
  83. package/dist/src/Engine/Interfaces/scoreEntry.d.ts +13 -0
  84. package/dist/src/Engine/Interfaces/services/autoplayService.d.ts +19 -0
  85. package/dist/src/Engine/Interfaces/services/characterService.d.ts +17 -0
  86. package/dist/src/Engine/Interfaces/services/combatService.d.ts +26 -0
  87. package/dist/src/Engine/Interfaces/services/combinationService.d.ts +9 -0
  88. package/dist/src/Engine/Interfaces/services/commandService.d.ts +64 -0
  89. package/dist/src/Engine/Interfaces/services/conversationService.d.ts +5 -0
  90. package/dist/src/Engine/Interfaces/services/dataSerializer.d.ts +4 -0
  91. package/dist/src/Engine/Interfaces/services/dataService.d.ts +33 -0
  92. package/dist/src/Engine/Interfaces/services/dataSynchronizer.d.ts +3 -0
  93. package/dist/src/Engine/Interfaces/services/gameService.d.ts +10 -0
  94. package/dist/src/Engine/Interfaces/services/index.d.ts +16 -0
  95. package/dist/src/Engine/Interfaces/services/itemService.d.ts +14 -0
  96. package/dist/src/Engine/Interfaces/services/localStorageService.d.ts +6 -0
  97. package/dist/src/Engine/Interfaces/services/locationService.d.ts +8 -0
  98. package/dist/src/Engine/Interfaces/services/soundService.d.ts +5 -0
  99. package/dist/src/Engine/Interfaces/services/tradeService.d.ts +9 -0
  100. package/dist/src/Engine/Interfaces/soundPlayer.d.ts +30 -0
  101. package/dist/src/Engine/Interfaces/sprite.d.ts +23 -0
  102. package/dist/src/Engine/Interfaces/stateList.d.ts +9 -0
  103. package/dist/src/Engine/Interfaces/statistics.d.ts +13 -0
  104. package/dist/src/Engine/Interfaces/stock.d.ts +39 -0
  105. package/dist/src/Engine/Interfaces/trade.d.ts +62 -0
  106. package/dist/src/Engine/ServiceFactory.d.ts +52 -0
  107. package/dist/src/Engine/Services/AutoplayService.d.ts +11 -0
  108. package/dist/src/Engine/Services/CharacterService.d.ts +21 -0
  109. package/dist/src/Engine/Services/CombatService.d.ts +16 -0
  110. package/dist/src/Engine/Services/CombinationService.d.ts +15 -0
  111. package/dist/src/Engine/Services/CommandService.d.ts +24 -0
  112. package/dist/src/Engine/Services/ConversationService.d.ts +26 -0
  113. package/dist/src/Engine/Services/DataSerializer.d.ts +17 -0
  114. package/dist/src/Engine/Services/DataService.d.ts +16 -0
  115. package/dist/src/Engine/Services/DataSynchronizer.d.ts +12 -0
  116. package/dist/src/Engine/Services/GameService.d.ts +28 -0
  117. package/dist/src/Engine/Services/HelperService.d.ts +18 -0
  118. package/dist/src/Engine/Services/ItemService.d.ts +21 -0
  119. package/dist/src/Engine/Services/LocalStorageService.d.ts +7 -0
  120. package/dist/src/Engine/Services/LocationService.d.ts +25 -0
  121. package/dist/src/Engine/Services/SoundService.d.ts +13 -0
  122. package/dist/src/Engine/Services/TradeService.d.ts +17 -0
  123. package/dist/src/Engine/Services/index.d.ts +17 -0
  124. package/dist/src/Engine/Services/serializationData.d.ts +8 -0
  125. package/dist/src/Engine/Services/sharedFunctions.d.ts +21 -0
  126. package/dist/src/Engine/arrayAndFunctionExtensions.d.ts +3 -0
  127. package/dist/src/Engine/defaultTexts.d.ts +7 -0
  128. package/dist/src/Engine/gameEvents.d.ts +10 -0
  129. package/dist/src/Engine/index.d.ts +8 -0
  130. package/dist/src/Engine/stateProperties.d.ts +6 -0
  131. package/dist/src/Engine/utilityFunctions.d.ts +25 -0
  132. package/dist/src/UI/Composables/CustomCursor.d.ts +2 -0
  133. package/dist/src/UI/Composables/LocationMap.d.ts +26 -0
  134. package/dist/src/UI/Composables/Sound.d.ts +7 -0
  135. package/dist/src/UI/Composables/TextFeatures.d.ts +8 -0
  136. package/dist/src/UI/Composables/VisualFeatures.d.ts +7 -0
  137. package/dist/src/UI/Composables/index.d.ts +7 -0
  138. package/dist/src/UI/Composables/playStateWatch.d.ts +2 -0
  139. package/dist/src/UI/StateStore.d.ts +14256 -0
  140. package/dist/src/UI/error.d.ts +6 -0
  141. package/dist/src/UI/helpers.d.ts +3 -0
  142. package/dist/src/UI/index.d.ts +6 -0
  143. package/dist/src/UI/main.d.ts +1 -0
  144. package/dist/src/UI/startup.d.ts +2 -0
  145. package/dist/src/constants.d.ts +17 -0
  146. package/dist/src/index.d.ts +3 -0
  147. package/dist/storyscript.css +9566 -0
  148. package/dist/storyscript.js +9659 -0
  149. package/dist/storyscript.js.map +1 -0
  150. package/dist/storyscript.mjs +9569 -0
  151. package/dist/storyscript.mjs.map +1 -0
  152. package/electron.cjs +44 -0
  153. package/index.html +14 -0
  154. package/package.json +118 -4
  155. package/scripts/cli.js +268 -0
  156. package/scripts/createAsset.js +117 -0
  157. package/scripts/createGame.js +40 -0
  158. package/scripts/helpers.js +21 -0
  159. package/scripts/postbuild.js +179 -0
  160. package/scripts/setupTesting.js +17 -0
  161. package/shims-vue.d.ts +1 -0
  162. package/src/Engine/Actions/index.ts +2 -0
  163. package/src/Engine/Actions/open.ts +12 -0
  164. package/src/Engine/Actions/openWithKey.ts +23 -0
  165. package/src/Engine/EntityCreatorFunctions.ts +602 -0
  166. package/src/Engine/Interfaces/action.ts +43 -0
  167. package/src/Engine/Interfaces/autoplayStep.ts +13 -0
  168. package/src/Engine/Interfaces/barrier.ts +18 -0
  169. package/src/Engine/Interfaces/barrierAction.ts +21 -0
  170. package/src/Engine/Interfaces/character.ts +58 -0
  171. package/src/Engine/Interfaces/combatSetup.ts +10 -0
  172. package/src/Engine/Interfaces/combatTurn.ts +45 -0
  173. package/src/Engine/Interfaces/combatWinnings.ts +7 -0
  174. package/src/Engine/Interfaces/combinations/activeCombination.ts +16 -0
  175. package/src/Engine/Interfaces/combinations/combinable.ts +21 -0
  176. package/src/Engine/Interfaces/combinations/combinationAction.ts +45 -0
  177. package/src/Engine/Interfaces/combinations/combinationMatchResult.ts +16 -0
  178. package/src/Engine/Interfaces/combinations/combinations.ts +19 -0
  179. package/src/Engine/Interfaces/combinations/combine.ts +25 -0
  180. package/src/Engine/Interfaces/combinations/combineResult.ts +21 -0
  181. package/src/Engine/Interfaces/combinations/gameCombinations.ts +48 -0
  182. package/src/Engine/Interfaces/compiledLocation.ts +37 -0
  183. package/src/Engine/Interfaces/conversations/conversation.ts +47 -0
  184. package/src/Engine/Interfaces/conversations/conversationLogEntry.ts +14 -0
  185. package/src/Engine/Interfaces/conversations/conversationNode.ts +26 -0
  186. package/src/Engine/Interfaces/conversations/conversationReply.ts +59 -0
  187. package/src/Engine/Interfaces/createCharacter/createCharacter.ts +23 -0
  188. package/src/Engine/Interfaces/createCharacter/createCharacterAttribute.ts +21 -0
  189. package/src/Engine/Interfaces/createCharacter/createCharacterAttributeEntry.ts +21 -0
  190. package/src/Engine/Interfaces/createCharacter/createCharacterQuestion.ts +21 -0
  191. package/src/Engine/Interfaces/createCharacter/createCharacterQuestionEntry.ts +25 -0
  192. package/src/Engine/Interfaces/createCharacter/createCharacterStep.ts +47 -0
  193. package/src/Engine/Interfaces/customCursor.ts +5 -0
  194. package/src/Engine/Interfaces/defaultEquipment.ts +32 -0
  195. package/src/Engine/Interfaces/definitions.ts +48 -0
  196. package/src/Engine/Interfaces/destination.ts +37 -0
  197. package/src/Engine/Interfaces/dynamicStyle.ts +11 -0
  198. package/src/Engine/Interfaces/enemy.ts +54 -0
  199. package/src/Engine/Interfaces/enumerations/actionStatus.ts +20 -0
  200. package/src/Engine/Interfaces/enumerations/actionType.ts +9 -0
  201. package/src/Engine/Interfaces/enumerations/equipmentType.ts +61 -0
  202. package/src/Engine/Interfaces/enumerations/gameState.ts +11 -0
  203. package/src/Engine/Interfaces/enumerations/playState.ts +10 -0
  204. package/src/Engine/Interfaces/enumerations/targetType.ts +9 -0
  205. package/src/Engine/Interfaces/equipment.ts +44 -0
  206. package/src/Engine/Interfaces/feature.ts +43 -0
  207. package/src/Engine/Interfaces/featureCollection.ts +8 -0
  208. package/src/Engine/Interfaces/game.ts +201 -0
  209. package/src/Engine/Interfaces/gameEvents.ts +11 -0
  210. package/src/Engine/Interfaces/groupableItem.ts +37 -0
  211. package/src/Engine/Interfaces/helpers.ts +55 -0
  212. package/src/Engine/Interfaces/index.ts +158 -0
  213. package/src/Engine/Interfaces/interfaceTexts.ts +142 -0
  214. package/src/Engine/Interfaces/item.ts +111 -0
  215. package/src/Engine/Interfaces/key.ts +18 -0
  216. package/src/Engine/Interfaces/location.ts +92 -0
  217. package/src/Engine/Interfaces/maps/map.ts +55 -0
  218. package/src/Engine/Interfaces/maps/mapLocation.ts +28 -0
  219. package/src/Engine/Interfaces/party.ts +40 -0
  220. package/src/Engine/Interfaces/person.ts +29 -0
  221. package/src/Engine/Interfaces/quest.ts +60 -0
  222. package/src/Engine/Interfaces/rules/characterRules.ts +96 -0
  223. package/src/Engine/Interfaces/rules/combatRules.ts +52 -0
  224. package/src/Engine/Interfaces/rules/combinationRules.ts +17 -0
  225. package/src/Engine/Interfaces/rules/demoMode.ts +18 -0
  226. package/src/Engine/Interfaces/rules/encounterRules.ts +5 -0
  227. package/src/Engine/Interfaces/rules/explorationRules.ts +47 -0
  228. package/src/Engine/Interfaces/rules/generalRules.ts +80 -0
  229. package/src/Engine/Interfaces/rules/rules.ts +46 -0
  230. package/src/Engine/Interfaces/rules/setupRules.ts +65 -0
  231. package/src/Engine/Interfaces/rules/titleScreen.ts +19 -0
  232. package/src/Engine/Interfaces/saveGame.ts +39 -0
  233. package/src/Engine/Interfaces/scoreEntry.ts +14 -0
  234. package/src/Engine/Interfaces/services/autoplayService.ts +23 -0
  235. package/src/Engine/Interfaces/services/characterService.ts +35 -0
  236. package/src/Engine/Interfaces/services/combatService.ts +30 -0
  237. package/src/Engine/Interfaces/services/combinationService.ts +10 -0
  238. package/src/Engine/Interfaces/services/commandService.ts +75 -0
  239. package/src/Engine/Interfaces/services/conversationService.ts +7 -0
  240. package/src/Engine/Interfaces/services/dataSerializer.ts +4 -0
  241. package/src/Engine/Interfaces/services/dataService.ts +39 -0
  242. package/src/Engine/Interfaces/services/dataSynchronizer.ts +9 -0
  243. package/src/Engine/Interfaces/services/gameService.ts +17 -0
  244. package/src/Engine/Interfaces/services/index.ts +33 -0
  245. package/src/Engine/Interfaces/services/itemService.ts +25 -0
  246. package/src/Engine/Interfaces/services/localStorageService.ts +6 -0
  247. package/src/Engine/Interfaces/services/locationService.ts +13 -0
  248. package/src/Engine/Interfaces/services/soundService.ts +7 -0
  249. package/src/Engine/Interfaces/services/tradeService.ts +15 -0
  250. package/src/Engine/Interfaces/soundPlayer.ts +30 -0
  251. package/src/Engine/Interfaces/sprite.ts +27 -0
  252. package/src/Engine/Interfaces/stateList.ts +13 -0
  253. package/src/Engine/Interfaces/statistics.ts +14 -0
  254. package/src/Engine/Interfaces/stock.ts +46 -0
  255. package/src/Engine/Interfaces/trade.ts +72 -0
  256. package/src/Engine/ServiceFactory.ts +167 -0
  257. package/src/Engine/Services/AutoplayService.ts +59 -0
  258. package/src/Engine/Services/CharacterService.ts +291 -0
  259. package/src/Engine/Services/CombatService.ts +266 -0
  260. package/src/Engine/Services/CombinationService.ts +197 -0
  261. package/src/Engine/Services/CommandService.ts +197 -0
  262. package/src/Engine/Services/ConversationService.ts +406 -0
  263. package/src/Engine/Services/DataSerializer.ts +326 -0
  264. package/src/Engine/Services/DataService.ts +93 -0
  265. package/src/Engine/Services/DataSynchronizer.ts +216 -0
  266. package/src/Engine/Services/GameService.ts +554 -0
  267. package/src/Engine/Services/HelperService.ts +94 -0
  268. package/src/Engine/Services/ItemService.ts +294 -0
  269. package/src/Engine/Services/LocalStorageService.ts +24 -0
  270. package/src/Engine/Services/LocationService.ts +380 -0
  271. package/src/Engine/Services/SoundService.ts +54 -0
  272. package/src/Engine/Services/TradeService.ts +176 -0
  273. package/src/Engine/Services/index.ts +17 -0
  274. package/src/Engine/Services/serializationData.ts +8 -0
  275. package/src/Engine/Services/sharedFunctions.ts +296 -0
  276. package/src/Engine/arrayAndFunctionExtensions.ts +269 -0
  277. package/src/Engine/defaultTexts.ts +162 -0
  278. package/src/Engine/gameEvents.ts +51 -0
  279. package/src/Engine/index.ts +9 -0
  280. package/src/Engine/stateProperties.ts +9 -0
  281. package/src/Engine/utilityFunctions.ts +238 -0
  282. package/src/Games/_GameTemplate/character.ts +31 -0
  283. package/src/Games/_GameTemplate/customTexts.ts +8 -0
  284. package/src/Games/_GameTemplate/interfaces/action.ts +5 -0
  285. package/src/Games/_GameTemplate/interfaces/combatSetup.ts +7 -0
  286. package/src/Games/_GameTemplate/interfaces/combatTurn.ts +8 -0
  287. package/src/Games/_GameTemplate/interfaces/destination.ts +5 -0
  288. package/src/Games/_GameTemplate/interfaces/enemy.ts +11 -0
  289. package/src/Games/_GameTemplate/interfaces/equipment.ts +5 -0
  290. package/src/Games/_GameTemplate/interfaces/feature.ts +9 -0
  291. package/src/Games/_GameTemplate/interfaces/game.ts +22 -0
  292. package/src/Games/_GameTemplate/interfaces/interfaceTexts.ts +5 -0
  293. package/src/Games/_GameTemplate/interfaces/item.ts +18 -0
  294. package/src/Games/_GameTemplate/interfaces/key.ts +10 -0
  295. package/src/Games/_GameTemplate/interfaces/location.ts +22 -0
  296. package/src/Games/_GameTemplate/interfaces/map.ts +16 -0
  297. package/src/Games/_GameTemplate/interfaces/party.ts +8 -0
  298. package/src/Games/_GameTemplate/interfaces/person.ts +11 -0
  299. package/src/Games/_GameTemplate/interfaces/quest.ts +9 -0
  300. package/src/Games/_GameTemplate/locations/Start.html +5 -0
  301. package/src/Games/_GameTemplate/locations/start.ts +12 -0
  302. package/src/Games/_GameTemplate/rules.ts +60 -0
  303. package/src/Games/_GameTemplate/types.ts +55 -0
  304. package/src/Games/_GameTemplate/ui/styles/game.css +3 -0
  305. package/src/Games/_GameTemplate/webroot/favicon.ico +0 -0
  306. package/src/Games/_GameTemplate/webroot/gameinfo.json +10 -0
  307. package/src/Games/_GameTemplate/webroot/logo192.png +0 -0
  308. package/src/Games/_GameTemplate/webroot/logo512.png +0 -0
  309. package/src/Tests/Games/_GameTemplate/specs/rules.test.ts +9 -0
  310. package/src/UI/Components/AppShell.vue +43 -0
  311. package/src/UI/Components/Autoplay.vue +32 -0
  312. package/src/UI/Components/Combinations.vue +37 -0
  313. package/src/UI/Components/Common/Collapsible.vue +50 -0
  314. package/src/UI/Components/Common/ModalDialog.vue +54 -0
  315. package/src/UI/Components/Common/Sprite.vue +53 -0
  316. package/src/UI/Components/Description.vue +23 -0
  317. package/src/UI/Components/Encounter/Combat/Combat.vue +89 -0
  318. package/src/UI/Components/Encounter/Combat/CombatActions.vue +26 -0
  319. package/src/UI/Components/Encounter/Combat/CombatParticipant.vue +22 -0
  320. package/src/UI/Components/Encounter/Combat/CombatTargetSelect.vue +55 -0
  321. package/src/UI/Components/Encounter/Combat/CombatWin.vue +33 -0
  322. package/src/UI/Components/Encounter/Conversation.vue +66 -0
  323. package/src/UI/Components/Encounter/Encounter.vue +39 -0
  324. package/src/UI/Components/Encounter/Enemy.vue +30 -0
  325. package/src/UI/Components/Encounter/Trade/Stock.vue +58 -0
  326. package/src/UI/Components/Encounter/Trade/Trade.vue +24 -0
  327. package/src/UI/Components/Exploration/ActionLog.vue +17 -0
  328. package/src/UI/Components/Exploration/Destination.vue +66 -0
  329. package/src/UI/Components/Exploration/Exploration.vue +67 -0
  330. package/src/UI/Components/Exploration/Ground.vue +22 -0
  331. package/src/UI/Components/Exploration/LocationMap.vue +42 -0
  332. package/src/UI/Components/Exploration/LocationText.vue +39 -0
  333. package/src/UI/Components/Exploration/LocationVisual.vue +38 -0
  334. package/src/UI/Components/GameContainer.vue +49 -0
  335. package/src/UI/Components/GameMenu.vue +111 -0
  336. package/src/UI/Components/GameState/GameOver.vue +20 -0
  337. package/src/UI/Components/GameState/HighScores.vue +22 -0
  338. package/src/UI/Components/GameState/Intro.vue +17 -0
  339. package/src/UI/Components/GameState/TitleScreen.vue +42 -0
  340. package/src/UI/Components/GameState/Victory.vue +28 -0
  341. package/src/UI/Components/Navigation.vue +94 -0
  342. package/src/UI/Components/Party/Backpack.vue +68 -0
  343. package/src/UI/Components/Party/BuildCharacter.vue +64 -0
  344. package/src/UI/Components/Party/CharacterSheet.vue +57 -0
  345. package/src/UI/Components/Party/CreateCharacter.vue +46 -0
  346. package/src/UI/Components/Party/Equipment.vue +48 -0
  347. package/src/UI/Components/Party/EquipmentSlot.vue +31 -0
  348. package/src/UI/Components/Party/LevelUp.vue +27 -0
  349. package/src/UI/Components/Party/Party.vue +29 -0
  350. package/src/UI/Components/Party/Quests.vue +48 -0
  351. package/src/UI/Components/Sound.vue +42 -0
  352. package/src/UI/Composables/CustomCursor.ts +60 -0
  353. package/src/UI/Composables/LocationMap.ts +315 -0
  354. package/src/UI/Composables/Sound.ts +111 -0
  355. package/src/UI/Composables/TextFeatures.ts +148 -0
  356. package/src/UI/Composables/VisualFeatures.ts +220 -0
  357. package/src/UI/Composables/index.ts +15 -0
  358. package/src/UI/Composables/playStateWatch.ts +31 -0
  359. package/src/UI/StateStore.ts +237 -0
  360. package/src/UI/error.ts +6 -0
  361. package/src/UI/helpers.ts +62 -0
  362. package/src/UI/index.ts +13 -0
  363. package/src/UI/main.ts +62 -0
  364. package/src/UI/startup.ts +58 -0
  365. package/src/UI/styles/bootstrap-storyscript.scss +31 -0
  366. package/src/UI/styles/empty.css +3 -0
  367. package/src/UI/styles/lookinglass.png +0 -0
  368. package/src/UI/styles/storyscript.css +735 -0
  369. package/typeExtensions.d.ts +25 -0
  370. package/vite-env.d.ts +1 -0
@@ -0,0 +1,271 @@
1
+ <templateSet group="StoryScript">
2
+ <template name="ssdestination" value="{&#10; name: '$name$',&#10; target: null$target$&#10;}$END$" description="StoryScript - Add a location destination" toReformat="false" toShortenFQNames="true">
3
+ <variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
4
+ <variable name="target" expression="" defaultValue="" alwaysStopAt="true" />
5
+ <context>
6
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
7
+ <option name="TS_CLASS_MEMBER_STATEMENT" value="false" />
8
+ <option name="TS_EXPRESSION" value="true" />
9
+ <option name="TS_STATEMENT" value="true" />
10
+ </context>
11
+ </template>
12
+ <template name="ssbarriers" value="barriers: [&#10; [ '$id$', {&#10; name: '$name$',&#10; actions: [&#10; $actions$&#10; ]&#10; }]&#10;]$END$" description="StoryScript - Add destination barriers" toReformat="false" toShortenFQNames="true">
13
+ <variable name="id" expression="" defaultValue="" alwaysStopAt="true" />
14
+ <variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
15
+ <variable name="actions" expression="" defaultValue="" alwaysStopAt="true" />
16
+ <context>
17
+ <option name="TSX_HTML" value="false" />
18
+ <option name="TS_CLASS" value="false" />
19
+ <option name="TS_DOT_PROPERTY_ACCESS" value="false" />
20
+ <option name="TS_EXPRESSION" value="false" />
21
+ <option name="TS_STATEMENT" value="false" />
22
+ <option name="TS_TOP_LEVEL_STATEMENT" value="false" />
23
+ <option name="TypeScript" value="true" />
24
+ </context>
25
+ </template>
26
+ <template name="ssbarrier" value="[ '$id$', {&#10; name: '$name$',&#10; actions: [&#10; $actions$&#10; ]&#10;}]$END$" description="StoryScript - Add a destination barrier" toReformat="false" toShortenFQNames="true">
27
+ <variable name="id" expression="" defaultValue="" alwaysStopAt="true" />
28
+ <variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
29
+ <variable name="actions" expression="" defaultValue="" alwaysStopAt="true" />
30
+ <context>
31
+ <option name="TSX_HTML" value="false" />
32
+ <option name="TS_CLASS" value="false" />
33
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
34
+ <option name="TS_CLASS_MEMBER_STATEMENT" value="false" />
35
+ <option name="TS_DOT_PROPERTY_ACCESS" value="false" />
36
+ <option name="TS_TOP_LEVEL_STATEMENT" value="false" />
37
+ <option name="TypeScript" value="true" />
38
+ </context>
39
+ </template>
40
+ <template name="ssinlinefeature" value="{&#10; name: '$name$',&#10; combinations: {&#10; combine: [&#10; $combine$&#10; ]&#10; }&#10;}$END$" description="StoryScript - Add an inline feature" toReformat="false" toShortenFQNames="true">
41
+ <variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
42
+ <variable name="combine" expression="" defaultValue="" alwaysStopAt="true" />
43
+ <context>
44
+ <option name="TSX_HTML" value="false" />
45
+ <option name="TS_CLASS" value="false" />
46
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
47
+ <option name="TS_CLASS_MEMBER_STATEMENT" value="false" />
48
+ <option name="TS_DOT_PROPERTY_ACCESS" value="false" />
49
+ <option name="TS_TOP_LEVEL_STATEMENT" value="false" />
50
+ <option name="TypeScript" value="true" />
51
+ </context>
52
+ </template>
53
+ <template name="ssmaplocation" value="{&#10; location: $location$,&#10; coords: '$coordinates$'&#10; }$END$" description="StoryScript - Add a map location" toReformat="false" toShortenFQNames="true">
54
+ <variable name="location" expression="" defaultValue="" alwaysStopAt="true" />
55
+ <variable name="coordinates" expression="" defaultValue="" alwaysStopAt="true" />
56
+ <context>
57
+ <option name="TSX_HTML" value="false" />
58
+ <option name="TS_CLASS" value="false" />
59
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
60
+ <option name="TS_CLASS_MEMBER_STATEMENT" value="false" />
61
+ <option name="TS_DOT_PROPERTY_ACCESS" value="false" />
62
+ <option name="TS_TOP_LEVEL_STATEMENT" value="false" />
63
+ <option name="TypeScript" value="true" />
64
+ </context>
65
+ </template>
66
+ <template name="ssaction" value="[ '$id$', {&#10; text: '$text$',&#10; execute: (game: IGame) =&gt; {&#10; $executeFunc$&#10; }&#10;}]$END$" description="StoryScript - Add an action" toReformat="false" toShortenFQNames="true">
67
+ <variable name="id" expression="" defaultValue="" alwaysStopAt="true" />
68
+ <variable name="text" expression="" defaultValue="" alwaysStopAt="true" />
69
+ <variable name="executeFunc" expression="" defaultValue="" alwaysStopAt="true" />
70
+ <context>
71
+ <option name="TSX_HTML" value="false" />
72
+ <option name="TS_CLASS" value="false" />
73
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
74
+ <option name="TS_CLASS_MEMBER_STATEMENT" value="false" />
75
+ <option name="TS_DOT_PROPERTY_ACCESS" value="false" />
76
+ <option name="TS_TOP_LEVEL_STATEMENT" value="false" />
77
+ <option name="TypeScript" value="true" />
78
+ </context>
79
+ </template>
80
+ <template name="sscombinationaction" value="{&#10; text: '$text$',&#10; preposition: '$preposition$',&#10; requiresTool: false$requiresTool$,&#10; failText: (game: IGame, target: ICombinable, tool: ICombinable): string =&gt; &#10; '$failText$'&#10;}$END$" description="StoryScript - Add a combination action" toReformat="false" toShortenFQNames="true">
81
+ <variable name="text" expression="" defaultValue="" alwaysStopAt="true" />
82
+ <variable name="preposition" expression="" defaultValue="" alwaysStopAt="true" />
83
+ <variable name="requiresTool" expression="" defaultValue="" alwaysStopAt="true" />
84
+ <variable name="failText" expression="" defaultValue="" alwaysStopAt="true" />
85
+ <context>
86
+ <option name="TSX_HTML" value="false" />
87
+ <option name="TS_CLASS" value="false" />
88
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
89
+ <option name="TS_CLASS_MEMBER_STATEMENT" value="false" />
90
+ <option name="TS_DOT_PROPERTY_ACCESS" value="false" />
91
+ <option name="TS_TOP_LEVEL_STATEMENT" value="false" />
92
+ <option name="TypeScript" value="true" />
93
+ </context>
94
+ </template>
95
+ <template name="sscombinations" value="combinations: {&#10; combine: [&#10; $acombination$,&#10; ]&#10;}$END$" description="StoryScript - Add combinations" toReformat="false" toShortenFQNames="true">
96
+ <variable name="acombination" expression="" defaultValue="" alwaysStopAt="true" />
97
+ <context>
98
+ <option name="TSX_HTML" value="false" />
99
+ <option name="TS_CLASS" value="false" />
100
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
101
+ <option name="TS_CLASS_MEMBER_STATEMENT" value="false" />
102
+ <option name="TS_DOT_PROPERTY_ACCESS" value="false" />
103
+ <option name="TS_TOP_LEVEL_STATEMENT" value="false" />
104
+ <option name="TypeScript" value="true" />
105
+ </context>
106
+ </template>
107
+ <template name="sscombine" value="{&#10; combinationType: '$type$',&#10; match: (game: IGame, target: ICombinable, tool: ICombinable): string | { text: string, removeTarget: boolean } =&gt; {&#10; return '$matchResult$';&#10; }&#10;}$END$" description="StoryScript - Add a combination" toReformat="false" toShortenFQNames="true">
108
+ <variable name="type" expression="" defaultValue="" alwaysStopAt="true" />
109
+ <variable name="matchResult" expression="" defaultValue="" alwaysStopAt="true" />
110
+ <context>
111
+ <option name="TSX_HTML" value="false" />
112
+ <option name="TS_CLASS" value="false" />
113
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
114
+ <option name="TS_CLASS_MEMBER_STATEMENT" value="false" />
115
+ <option name="TS_DOT_PROPERTY_ACCESS" value="false" />
116
+ <option name="TS_TOP_LEVEL_STATEMENT" value="false" />
117
+ <option name="TypeScript" value="true" />
118
+ </context>
119
+ </template>
120
+ <template name="ssconversationaction" value="['$id$', (game: IGame, person: IPerson) =&gt; {&#10; $actionBody$&#10;}]$END$" description="StoryScript - Add a conversation action" toReformat="false" toShortenFQNames="true">
121
+ <variable name="id" expression="" defaultValue="" alwaysStopAt="true" />
122
+ <variable name="actionBody" expression="" defaultValue="" alwaysStopAt="true" />
123
+ <context>
124
+ <option name="TSX_HTML" value="false" />
125
+ <option name="TS_CLASS" value="false" />
126
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
127
+ <option name="TS_CLASS_MEMBER_STATEMENT" value="false" />
128
+ <option name="TS_DOT_PROPERTY_ACCESS" value="false" />
129
+ <option name="TS_TOP_LEVEL_STATEMENT" value="false" />
130
+ <option name="TypeScript" value="true" />
131
+ </context>
132
+ </template>
133
+ <template name="sstrade" value="trade : {&#10; name: '$name$',&#10; text: '$text$',&#10; ownItemsOnly: true$ownItemsOnly$,&#10; buy: {&#10; text: '$buyText$',&#10; emptyText: '$emptyBuyText$',&#10; itemSelector: (game: IGame, item: IItem): boolean =&gt; {&#10; return true$buyItemSelector$;&#10; }&#10; },&#10; sell: {&#10; text: '$sellText$',&#10; emptyText: '$emptySellText$',&#10; itemSelector: (game: IGame, item: IItem): boolean =&gt; {&#10; return true$sellItemSelector$;&#10; }&#10; }&#10;}$END$" description="StoryScript - Add a trade object" toReformat="false" toShortenFQNames="true">
134
+ <variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
135
+ <variable name="text" expression="" defaultValue="" alwaysStopAt="true" />
136
+ <variable name="ownItemsOnly" expression="" defaultValue="" alwaysStopAt="true" />
137
+ <variable name="buyText" expression="" defaultValue="" alwaysStopAt="true" />
138
+ <variable name="emptyBuyText" expression="" defaultValue="" alwaysStopAt="true" />
139
+ <variable name="buyItemSelector" expression="" defaultValue="" alwaysStopAt="true" />
140
+ <variable name="sellText" expression="" defaultValue="" alwaysStopAt="true" />
141
+ <variable name="emptySellText" expression="" defaultValue="" alwaysStopAt="true" />
142
+ <variable name="sellItemSelector" expression="" defaultValue="" alwaysStopAt="true" />
143
+ <context>
144
+ <option name="TSX_HTML" value="false" />
145
+ <option name="TS_CLASS" value="false" />
146
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
147
+ <option name="TS_CLASS_MEMBER_STATEMENT" value="false" />
148
+ <option name="TS_DOT_PROPERTY_ACCESS" value="false" />
149
+ <option name="TS_TOP_LEVEL_STATEMENT" value="false" />
150
+ <option name="TypeScript" value="true" />
151
+ </context>
152
+ </template>
153
+ <template name="ssattributes" value="{&#10; attributes: [&#10; $attributes$&#10; ]&#10;}$END$" description="StoryScript - Add character creation attributes" toReformat="false" toShortenFQNames="true">
154
+ <variable name="attributes" expression="" defaultValue="" alwaysStopAt="true" />
155
+ <context>
156
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
157
+ <option name="TS_EXPRESSION" value="true" />
158
+ </context>
159
+ </template>
160
+ <template name="ssattribute" value="{&#10; question: '$question$',&#10; entries: [&#10; $entries$&#10; ]&#10;}$END$" description="StoryScript - Add a character creation attribute" toReformat="false" toShortenFQNames="true">
161
+ <variable name="question" expression="" defaultValue="" alwaysStopAt="true" />
162
+ <variable name="entries" expression="" defaultValue="" alwaysStopAt="true" />
163
+ <context>
164
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
165
+ <option name="TS_EXPRESSION" value="true" />
166
+ </context>
167
+ </template>
168
+ <template name="ssattributeentry" value="{&#10; attribute: '$attribute$',&#10; min: $min$,&#10; max: $max$,&#10; value: '$value$'&#10;}$END$" description="StoryScript - Add a character creation attribute entry" toReformat="false" toShortenFQNames="true">
169
+ <variable name="attribute" expression="" defaultValue="" alwaysStopAt="true" />
170
+ <variable name="min" expression="" defaultValue="" alwaysStopAt="true" />
171
+ <variable name="max" expression="" defaultValue="" alwaysStopAt="true" />
172
+ <variable name="value" expression="" defaultValue="" alwaysStopAt="true" />
173
+ <context>
174
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
175
+ <option name="TS_EXPRESSION" value="true" />
176
+ </context>
177
+ </template>
178
+ <template name="ssquestions" value="{&#10; questions: [&#10; $questions$&#10; ]&#10;}$END$" description="StoryScript - Add character creation questions" toReformat="false" toShortenFQNames="true">
179
+ <variable name="questions" expression="" defaultValue="" alwaysStopAt="true" />
180
+ <context>
181
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
182
+ <option name="TS_EXPRESSION" value="true" />
183
+ </context>
184
+ </template>
185
+ <template name="ssquestion" value="{&#10; question: '$question$',&#10; entries: [&#10; $entries$&#10; ]&#10;}$END$" description="StoryScript - Add a character creation question" toReformat="false" toShortenFQNames="true">
186
+ <variable name="question" expression="" defaultValue="" alwaysStopAt="true" />
187
+ <variable name="entries" expression="" defaultValue="" alwaysStopAt="true" />
188
+ <context>
189
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
190
+ <option name="TS_EXPRESSION" value="true" />
191
+ </context>
192
+ </template>
193
+ <template name="ssquestionentry" value="{&#10; text: '$text$',&#10; value: '$value$',&#10; bonus: $bonus$&#10;}$END$" description="StoryScript - Add a character creation question entry" toReformat="false" toShortenFQNames="true">
194
+ <variable name="text" expression="" defaultValue="" alwaysStopAt="true" />
195
+ <variable name="value" expression="" defaultValue="" alwaysStopAt="true" />
196
+ <variable name="bonus" expression="" defaultValue="" alwaysStopAt="true" />
197
+ <context>
198
+ <option name="TS_CLASS_MEMBER_EXPRESSION" value="false" />
199
+ <option name="TS_EXPRESSION" value="true" />
200
+ </context>
201
+ </template>
202
+ <template name="ssdescription" value="&lt;description name=&quot;$name$&quot;&gt;&#10; $content$&#10;&lt;/description&gt;&#10;$END$" description="StoryScript - Add a description node" toReformat="false" toShortenFQNames="true">
203
+ <variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
204
+ <variable name="content" expression="" defaultValue="" alwaysStopAt="true" />
205
+ <context>
206
+ <option name="HTML_TEXT" value="true" />
207
+ </context>
208
+ </template>
209
+ <template name="ssaudio" value="&lt;audio controls=&quot;controls&quot; autoplay=&quot;autoplay&quot;&gt;&#10; &lt;source :src=&quot;'resources/$filename$.mp3'&quot; type=&quot;audio/mp3&quot; /&gt;&#10; Your browser does not support audio.&#10;&lt;/audio&gt;&#10;$END$" description="StoryScript - Add an audio node" toReformat="false" toShortenFQNames="true">
210
+ <variable name="filename" expression="" defaultValue="" alwaysStopAt="true" />
211
+ <context>
212
+ <option name="HTML_TEXT" value="true" />
213
+ </context>
214
+ </template>
215
+ <template name="ssvisualfeatures" value="&lt;visual-features img=&quot;$filename$&quot;&gt;&#10; &lt;area name=&quot;$name$&quot; shape=&quot;$shape$&quot; coords=&quot;$coords$&quot; /&gt;&#10;&lt;/visual-features&gt;$END$" description="StoryScript - Add visual features" toReformat="false" toShortenFQNames="true">
216
+ <variable name="filename" expression="" defaultValue="" alwaysStopAt="true" />
217
+ <variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
218
+ <variable name="shape" expression="" defaultValue="" alwaysStopAt="true" />
219
+ <variable name="coords" expression="" defaultValue="" alwaysStopAt="true" />
220
+ <context>
221
+ <option name="HTML_TEXT" value="true" />
222
+ </context>
223
+ </template>
224
+ <template name="ssfeature" value="&lt;feature name=&quot;$name$&quot;&gt;$text$&lt;/feature&gt;&#10;$END$" description="StoryScript - Add a feature" toReformat="false" toShortenFQNames="true">
225
+ <variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
226
+ <variable name="text" expression="" defaultValue="" alwaysStopAt="true" />
227
+ <context>
228
+ <option name="HTML_TEXT" value="true" />
229
+ </context>
230
+ </template>
231
+ <template name="ssvisualFeature" value="&lt;area name=&quot;$name$&quot; shape=&quot;$shape$&quot; coords=&quot;$coords$&quot; /&gt;&#10;$END$" description="StoryScript - Add a visual feature" toReformat="false" toShortenFQNames="true">
232
+ <variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
233
+ <variable name="shape" expression="" defaultValue="" alwaysStopAt="true" />
234
+ <variable name="coords" expression="" defaultValue="" alwaysStopAt="true" />
235
+ <context>
236
+ <option name="HTML_TEXT" value="true" />
237
+ </context>
238
+ </template>
239
+ <template name="ssconversation" value="&lt;conversation&gt;&#10; &lt;default-reply&gt;&#10; &lt;/default-reply&gt;&#10; &lt;node name=&quot;$name$&quot; trigger=&quot;$trigger$&quot;&gt;&#10; &lt;p&gt;&#10; $text$&#10; &lt;/p&gt;&#10; &lt;replies default-reply=&quot;&quot;&gt;&#10; $replies$&#10; &lt;/replies&gt;&#10; &lt;/node&gt;&#10;&lt;/conversation&gt;&#10;$END$" description="StoryScript - Add a conversation" toReformat="false" toShortenFQNames="true">
240
+ <variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
241
+ <variable name="trigger" expression="" defaultValue="" alwaysStopAt="true" />
242
+ <variable name="text" expression="" defaultValue="" alwaysStopAt="true" />
243
+ <variable name="replies" expression="" defaultValue="" alwaysStopAt="true" />
244
+ <context>
245
+ <option name="HTML_TEXT" value="true" />
246
+ </context>
247
+ </template>
248
+ <template name="ssconversationnode" value="&lt;node name=&quot;$name$&quot; trigger=&quot;$trigger$&quot;&gt;&#10; &lt;p&gt;&#10; $text$&#10; &lt;/p&gt;&#10; &lt;replies default-reply=&quot;&quot;&gt;&#10; $replies$&#10; &lt;/replies&gt;&#10;&lt;/node&gt;&#10;$END$" description="StoryScript - Add a conversation node" toReformat="false" toShortenFQNames="true">
249
+ <variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
250
+ <variable name="trigger" expression="" defaultValue="" alwaysStopAt="true" />
251
+ <variable name="text" expression="" defaultValue="" alwaysStopAt="true" />
252
+ <variable name="replies" expression="" defaultValue="" alwaysStopAt="true" />
253
+ <context>
254
+ <option name="HTML_TEXT" value="true" />
255
+ </context>
256
+ </template>
257
+ <template name="ssconversationreply" value="&lt;reply node=&quot;$name$&quot; set-start=&quot;&quot; requires=&quot;&quot; trigger=&quot;&quot; quest-complete=&quot;&quot;&gt;&#10; $text$&#10;&lt;/reply&gt;&#10;$END$" description="StoryScript - Add a conversation reply" toReformat="false" toShortenFQNames="true">
258
+ <variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
259
+ <variable name="text" expression="" defaultValue="" alwaysStopAt="true" />
260
+ <context>
261
+ <option name="HTML_TEXT" value="true" />
262
+ </context>
263
+ </template>
264
+ <template name="sstrigger" value="&lt;span data-trigger=&quot;$trigger$&quot;&gt;$text$&lt;/span&gt;&#10;$END$" description="StoryScript - add a trigger" toReformat="false" toShortenFQNames="true">
265
+ <variable name="trigger" expression="" defaultValue="" alwaysStopAt="true" />
266
+ <variable name="text" expression="" defaultValue="" alwaysStopAt="true" />
267
+ <context>
268
+ <option name="HTML_TEXT" value="true" />
269
+ </context>
270
+ </template>
271
+ </templateSet>
package/README.md CHANGED
@@ -1,3 +1,10 @@
1
- # Temporary Holding Version
1
+ # StoryScript
2
+ StoryScript is an engine to create games for the web. Games that run anywhere, online or offline,
3
+ on any device, and work well with both mouse and touch control. You play your games while you
4
+ build them! Your changes are shown immediately, allowing you to shape your world as you move
5
+ through it.
2
6
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
7
+ StoryScript uses TypeScript, Vue and Vite and works especially well with Visual Studio Code
8
+ and Rider, for which it has Code Snippets / Live Templates.
9
+
10
+ To get started, find examples or read the tutorials, please visit the [StoryScript Website](https://www.storyscript.nl).
@@ -0,0 +1,112 @@
1
+ import fs from 'fs';
2
+ import {normalizePath} from 'vite';
3
+ import checker from 'vite-plugin-checker';
4
+ import {viteStaticCopy} from 'vite-plugin-static-copy';
5
+ import path from 'path';
6
+ import vue from '@vitejs/plugin-vue';
7
+ import jsonfile from "jsonfile";
8
+ import {VitePWA} from 'vite-plugin-pwa'
9
+ import {fileURLToPath} from "url";
10
+
11
+ const {readFileSync} = jsonfile;
12
+
13
+ const __filename = fileURLToPath(import.meta.url);
14
+ let __dirname = path.dirname(__filename);
15
+ const rootFolder = __dirname.includes('/node_modules/') ? `${__dirname.split('/node_modules/')[0]}` : __dirname;
16
+
17
+ const srcPath = `${rootFolder}/src`;
18
+
19
+ export const getBaseViteConfig = (gamePath) => {
20
+ const gameInfoPath = `${gamePath}/webroot/gameinfo.json`;
21
+
22
+ let gameInfo;
23
+
24
+ if (fs.existsSync(gameInfoPath)) {
25
+ gameInfo = readFileSync(gameInfoPath);
26
+ }
27
+
28
+ return {
29
+ base: ``,
30
+ publicDir: path.resolve(gamePath, 'webroot'),
31
+ define: {
32
+ 'process.env': {}
33
+ },
34
+ resolve: {
35
+ alias: {
36
+ src: srcPath,
37
+ game: gamePath,
38
+ $resources: path.resolve(gamePath, 'resources')
39
+ }
40
+ },
41
+ plugins: [
42
+ {
43
+ name: 'set-game-name-and-description',
44
+ transformIndexHtml(html) {
45
+ return gameInfo ? html
46
+ .replace(/%STORYSCRIPT_GAME_NAME%/g, gameInfo.name)
47
+ .replace(/%STORYSCRIPT_GAME_DESCRIPTION%/g, gameInfo.description) : html;
48
+ }
49
+ },
50
+ vue(),
51
+ checker({
52
+ typescript: true,
53
+ vueTsc: true
54
+ }),
55
+ viteStaticCopy({
56
+ watch: {
57
+ reloadPageOnChange: true
58
+ },
59
+ silent: true,
60
+ targets: [
61
+ {
62
+ src: normalizePath(path.resolve(gamePath, 'resources/**/*.*')),
63
+ dest: 'resources',
64
+ // This is relative to the project root. So ./src/Games/{GameName}/resources will be trimmed. We
65
+ // cannot use 'stripBase: true' because we want to support placing resources in subdirectories.
66
+ rename: {stripBase: 4}
67
+ }
68
+ ]
69
+ }),
70
+ {
71
+ name: 'run-postbuild',
72
+ apply: 'build',
73
+ async writeBundle() {
74
+ const {postBuild} = await import('./scripts/postbuild.js');
75
+ await postBuild();
76
+ }
77
+ },
78
+ VitePWA({
79
+ registerType: 'autoUpdate',
80
+ devOptions: {
81
+ enabled: false
82
+ },
83
+ workbox: {
84
+ globDirectory: 'dist',
85
+ globPatterns: [
86
+ 'assets/**/*',
87
+ 'resources/**/*',
88
+ 'index.html',
89
+ 'manifest.webmanifest',
90
+ ],
91
+ }
92
+ })
93
+ ],
94
+ server: {
95
+ port: 3000,
96
+ open: true
97
+ },
98
+ preview: {
99
+ port: 8080,
100
+ },
101
+ build: {
102
+ target: 'esnext',
103
+ outDir: "./dist",
104
+ sourcemap: false,
105
+ rolldownOptions: {
106
+ output: {
107
+ keepNames: true
108
+ }
109
+ }
110
+ }
111
+ };
112
+ };
@@ -0,0 +1 @@
1
+ export const currentGameName = '';
@@ -0,0 +1,12 @@
1
+ # Visual Studio Code and Rider Settings
2
+ /.vscode
3
+ /.idea
4
+
5
+ # dependencies
6
+ /node_modules
7
+
8
+ # Copied and generated files for StoryScript, resource files that should not be checked in
9
+ /dist/*
10
+ /src/Tests/**/coverage/*
11
+
12
+ stats.html
@@ -0,0 +1,34 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ES2022",
5
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
6
+
7
+ "paths": {
8
+ "storyScript": ["./node_modules/storyscript"],
9
+ "src/*": ["./src/*"]
10
+ },
11
+ "typeRoots": ["./node_modules/@types"],
12
+ "types": ["node", "vite/client"],
13
+
14
+ "sourceMap": true,
15
+ "noEmitOnError": true,
16
+ "removeComments": false,
17
+ "useDefineForClassFields": true,
18
+ "skipLibCheck": true,
19
+
20
+ /* Linting */
21
+ "strict": true,
22
+ "noImplicitAny": false,
23
+ "strictNullChecks": false,
24
+
25
+ /* Bundler mode */
26
+ "moduleResolution": "bundler",
27
+ "allowSyntheticDefaultImports": true,
28
+ "resolveJsonModule": true,
29
+ "isolatedModules": true,
30
+ "noEmit": true,
31
+ "allowJs": true,
32
+ },
33
+ "exclude": ["currentGameName.js"]
34
+ }
@@ -0,0 +1,14 @@
1
+ import {getBaseViteConfig} from "storyscript/vite-config";
2
+ import {defineConfig} from "vite";
3
+ import {fileURLToPath} from "url";
4
+ import path from "path";
5
+ import {currentGameName} from "./currentGameName.js";
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ let __dirname = path.dirname(__filename);
9
+ const gamePath = `${__dirname}/src/Games/${currentGameName}`;
10
+
11
+ const config = getBaseViteConfig(gamePath);
12
+ config.resolve.alias['storyScript'] = `${__dirname}/node_modules/storyscript`;
13
+
14
+ export default defineConfig(config);
@@ -0,0 +1,29 @@
1
+ import {defineConfig, mergeConfig} from 'vitest/config'
2
+ // @ts-ignore
3
+ import viteConfig from './vite.config.ts'
4
+ import {currentGameName} from "./currentGameName.js";
5
+
6
+ export default mergeConfig(viteConfig, defineConfig({
7
+ test: {
8
+ environment: 'jsdom',
9
+ coverage: {
10
+ enabled: true,
11
+ provider: 'v8',
12
+ reporter: ['json', 'html'],
13
+ reportsDirectory: './src/Tests/coverage',
14
+ reportOnFailure: true,
15
+ include: [
16
+ `src/Games/${currentGameName}/**`
17
+ ],
18
+ exclude: [
19
+ '**/*.html',
20
+ '**/*.d.ts',
21
+ "**/*.json",
22
+ '**/[iI]nterfaces/**',
23
+ "**/resources/**",
24
+ "**/ui/styles/**",
25
+ "**/webroot/**"
26
+ ]
27
+ }
28
+ }
29
+ }));
@@ -0,0 +1,2 @@
1
+ export { Open } from './open';
2
+ export { OpenWithKey } from './openWithKey';
@@ -0,0 +1,6 @@
1
+ import { IBarrier, IDestination, IGame } from '../..';
2
+ /**
3
+ * A basic function to remove a barrier and then execute a callback function.
4
+ * @param callback
5
+ */
6
+ export declare function Open(callback?: (game: IGame, barrier: [string, IBarrier], destination: IDestination) => void): (game: IGame, barrier: [string, IBarrier], destination: IDestination) => void;
@@ -0,0 +1,7 @@
1
+ import { IBarrier, IDestination, IGame } from '../..';
2
+ /**
3
+ * A basic function to remove a barrier using a key and then execute a callback function. When it is not specified that the player
4
+ * should keep the key after using it, it is removed from his item list.
5
+ * @param callback The callback function to invoke after the barrier is removed.
6
+ */
7
+ export declare function OpenWithKey(callback?: (game: IGame, barrier: [string, IBarrier], destination: IDestination) => void): (game: IGame, barrier: [string, IBarrier], destination: IDestination) => void;
@@ -0,0 +1,18 @@
1
+ import { ICompiledLocation, IDefinitions, IDestination, IEnemy, IFeature, IItem, IKey, ILocation, IMap, IPerson, IQuest } from '..';
2
+ export declare function Location(entity: ILocation): ILocation;
3
+ export declare function LocationMap(entity: IMap): IMap;
4
+ export declare function Enemy<T extends IEnemy>(entity: T): T;
5
+ export declare function Person<T extends IPerson>(entity: T): T;
6
+ export declare function Item<T extends IItem>(entity: T): T;
7
+ export declare function Key<T extends IKey>(entity: T): T;
8
+ export declare function Feature<T extends IFeature>(entity: T): IFeature;
9
+ export declare function Quest<T extends IQuest>(entity: T): T;
10
+ export declare function DynamicEntity<T>(entityFunction: () => T, id?: string): T;
11
+ export declare function customEntity<T, C extends {
12
+ name: string;
13
+ }>(definition: () => T, customData: C): T;
14
+ export declare function buildEntities(definitions: IDefinitions): Record<string, Record<string, any>>;
15
+ export declare function InitEntityCollection(entity: any, property: string): void;
16
+ export declare function setDestination(destination: IDestination): void;
17
+ export declare function getBasicFeatureData(location: ICompiledLocation, node: HTMLElement): IFeature;
18
+ export declare function getParsedDocument(tag: string, value?: string, wrapIfNotFound?: boolean): HTMLCollectionOf<Element>;
@@ -0,0 +1,37 @@
1
+ import { IGame } from './game';
2
+ import { ActionType } from './enumerations/actionType';
3
+ import { ActionStatus } from './enumerations/actionStatus';
4
+ /**
5
+ * Actions available to the player when exploring the location.
6
+ */
7
+ export interface IAction {
8
+ /**
9
+ * The text shown for this action (e.g. 'Search').
10
+ */
11
+ text?: string;
12
+ /**
13
+ * How to visually identify this action to the player.
14
+ */
15
+ actionType?: ActionType;
16
+ /**
17
+ * The action status or a function that returns an action status to set the status dynamically.
18
+ */
19
+ status?: ActionStatus | ((game: IGame) => ActionStatus);
20
+ /**
21
+ * The function to execute or game event to raise when the player selects the action. Return
22
+ * true if the action should be allowed to execute more than once. When an event is raised
23
+ * the action is considered to be allowed to execute more than once.
24
+ */
25
+ execute: string | ((game: IGame) => boolean | void);
26
+ /**
27
+ * If the player should confirm executing the action, specify a text to ask for confirmation here.
28
+ * The player will then be asked to confirm before the action is executed, and he'll have the
29
+ * option to cancel.
30
+ */
31
+ confirmationText?: string;
32
+ /**
33
+ * When this flag is set to true, the action is not shown to the player. Useful to only conditionally
34
+ * make actions present on a location.
35
+ */
36
+ inactive?: boolean;
37
+ }
@@ -0,0 +1,11 @@
1
+ import { IGame } from '../..';
2
+ export interface IAutoplayStep {
3
+ /**
4
+ * The action to execute for this step.
5
+ */
6
+ action: (game: IGame) => void;
7
+ /**
8
+ * The number of milliseconds to wait before executing this step.
9
+ */
10
+ delay: number;
11
+ }
@@ -0,0 +1,16 @@
1
+ import { IKey } from './key';
2
+ import { IBarrierAction } from './barrierAction';
3
+ import { ICombinable } from './combinations/combinable';
4
+ /**
5
+ * The base properties for barriers that block a player from moving between one world location to the next.
6
+ */
7
+ export interface IBarrier extends ICombinable {
8
+ /**
9
+ * The actions the player can perform on the barrier (e.g. inspect or open).
10
+ */
11
+ actions?: [string, IBarrierAction][];
12
+ /**
13
+ * The key to use to remove this barrier.
14
+ */
15
+ key?: (() => IKey) | string;
16
+ }
@@ -0,0 +1,19 @@
1
+ import { IGame } from './game';
2
+ import { IBarrier } from './barrier';
3
+ import { IDestination } from './destination';
4
+ /**
5
+ * Actions that can be performed on barriers, like opening doors or rowing across rivers.
6
+ */
7
+ export interface IBarrierAction {
8
+ /**
9
+ * The name of the barrier action as show to the player.
10
+ */
11
+ text: string;
12
+ /**
13
+ * The function to execute when the player selects this action.
14
+ * @param game The game object
15
+ * @param barrier The barrier
16
+ * @param destination The destination the barrier is for
17
+ */
18
+ execute(game: IGame, barrier: [string, IBarrier], destination: IDestination): void;
19
+ }