@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,47 @@
1
+ import {ICreateCharacter, ICreateCharacterAttribute, ICreateCharacterQuestion, IParty} from 'storyScript';
2
+
3
+ /**
4
+ * The definition of a step in the character creation process.
5
+ */
6
+ export interface ICreateCharacterStep {
7
+ /**
8
+ * The text describing this step in the creation process to the player.
9
+ */
10
+ description?: string;
11
+
12
+ /**
13
+ * The questions to show as part of this step.
14
+ */
15
+ questions?: ICreateCharacterQuestion[];
16
+
17
+ /**
18
+ * The attributes to show as part of this step.
19
+ */
20
+ attributes?: ICreateCharacterAttribute[];
21
+
22
+ /**
23
+ * The total numner of points to distribute over multiple attributes.
24
+ */
25
+ numberOfAttributePoints?: number;
26
+
27
+ /**
28
+ * The selector that determines what step will be activated after the current one.
29
+ * Either pass the number of the step or a function returning that number.
30
+ */
31
+ nextStepSelector?: number | ((party: IParty, character: ICreateCharacter, currentStep: ICreateCharacterStep) => number);
32
+
33
+ /**
34
+ * Set this flag to true to mark this step as one of the final steps in character creation.
35
+ * This allows building a branched character creation process.
36
+ */
37
+ finish?: boolean;
38
+
39
+ /**
40
+ * A function that executes when the step is to be displayed to the player.
41
+ * @param party The party created so far
42
+ * @param character The character sheet filled in so far
43
+ * @param currentStep The step about to be shown to the player
44
+ * @param previousStep The step just completed by the player, or undefined if the step to be displayed is the first step in the sheet.
45
+ */
46
+ initStep?(party: IParty, character: ICreateCharacter, currentStep: ICreateCharacterStep, previousStep?: number): void;
47
+ }
@@ -0,0 +1,5 @@
1
+ export interface ICustomCursor {
2
+ image: string;
3
+ dimensions: { width: number, height: number };
4
+ style: string;
5
+ }
@@ -0,0 +1,32 @@
1
+ import { IEquipment } from './equipment';
2
+ import { IItem } from './item';
3
+
4
+ /**
5
+ * This class is for internal StoryScript use only, to determine which equipment slots belong
6
+ * to the default ones and which are custom for a game.
7
+ */
8
+ export class DefaultEquipment implements IEquipment {
9
+ constructor() {
10
+ this.head = null;
11
+ this.amulet = null;
12
+ this.body = null;
13
+ this.hands = null;
14
+ this.leftHand = null;
15
+ this.leftRing = null;
16
+ this.rightHand = null;
17
+ this.rightRing = null;
18
+ this.legs = null;
19
+ this.feet = null;
20
+ }
21
+
22
+ head: IItem;
23
+ amulet: IItem;
24
+ body: IItem;
25
+ hands: IItem;
26
+ leftHand: IItem;
27
+ leftRing: IItem;
28
+ rightHand: IItem;
29
+ rightRing: IItem;
30
+ legs: IItem;
31
+ feet: IItem;
32
+ }
@@ -0,0 +1,48 @@
1
+ import { ILocation } from './location';
2
+ import { IAction } from './action';
3
+ import { IPerson } from './person';
4
+ import { IItem } from './item';
5
+ import { IQuest } from './quest';
6
+ import { IFeature } from './feature';
7
+ import { IEnemy } from './enemy';
8
+ import { IMap } from './maps/map';
9
+
10
+ /**
11
+ * All definitions created for a StoryScript the game.
12
+ */
13
+ export interface IDefinitions {
14
+ /**
15
+ * The locations available in the game world.
16
+ */
17
+ locations: (() => ILocation)[];
18
+
19
+ /**
20
+ * The available maps of the world.
21
+ */
22
+ maps: (() => IMap)[];
23
+
24
+ /**
25
+ * The features present in the game world.
26
+ */
27
+ features: (() => IFeature)[];
28
+
29
+ /**
30
+ * The enemies present in the game world.
31
+ */
32
+ enemies: (() => IEnemy)[];
33
+
34
+ /**
35
+ * The persons roaming the game world.
36
+ */
37
+ persons: (() => IPerson)[];
38
+
39
+ /**
40
+ * The items that can be found in the game world.
41
+ */
42
+ items: (() => IItem)[];
43
+
44
+ /**
45
+ * The quests the player can pursue in the game world.
46
+ */
47
+ quests: (() => IQuest)[];
48
+ }
@@ -0,0 +1,37 @@
1
+ import { IBarrier } from './barrier';
2
+ import { ILocation } from './location';
3
+
4
+ /**
5
+ * The base properties for a destination reachable from a location.
6
+ */
7
+ export interface IDestination {
8
+ /**
9
+ * The name of the destination to show to the player.
10
+ */
11
+ name: string;
12
+
13
+ /**
14
+ * The css class to add to the destination so it can be styled.
15
+ */
16
+ style?: string;
17
+
18
+ /**
19
+ * True if the destination is inactive and not visible, false otherwise.
20
+ */
21
+ inactive?: boolean;
22
+
23
+ /**
24
+ * The barriers that are blocking travel to the new location.
25
+ */
26
+ barriers?: [string, IBarrier][];
27
+
28
+ /**
29
+ * The location that this destination leads to.
30
+ */
31
+ target: (() => ILocation) | string;
32
+
33
+ /**
34
+ * True if the location this destination leads to was visited before by the player, false otherwise.
35
+ */
36
+ visited?: boolean;
37
+ }
@@ -0,0 +1,11 @@
1
+ export interface IDynamicStyle {
2
+ /**
3
+ * The selector for the element to style dynamically.
4
+ */
5
+ elementSelector: string;
6
+
7
+ /**
8
+ * The styles to apply as name/value pairs. E.g. ['margin-top', '50px'];
9
+ */
10
+ styles: string[][];
11
+ }
@@ -0,0 +1,54 @@
1
+ import { IFeature } from './feature';
2
+ import { IItem } from './item';
3
+ import { IGame } from './game';
4
+
5
+ /**
6
+ * Defines the base properties for an enemy in the game.
7
+ */
8
+ export interface IEnemy extends IFeature {
9
+ /**
10
+ * The details about this enemy as displayed to the player. If you use an HTML-page to describe the enemy, the contents of that HTML-page
11
+ * will be used to set this property at run-time.
12
+ */
13
+ description?: string;
14
+
15
+ /**
16
+ * The health of the enemy.
17
+ */
18
+ hitpoints: number;
19
+
20
+ /**
21
+ * The current health of the enemy, tracked by StoryScript at runtime.
22
+ */
23
+ currentHitpoints?: number;
24
+
25
+ /**
26
+ * The amount of credits the enemy has, in whatever form.
27
+ */
28
+ currency?: number;
29
+
30
+ /**
31
+ * The items the enemy is carrying.
32
+ */
33
+ items?: IItem[];
34
+
35
+ /**
36
+ * When this flag is set to true, the enemy is not shown to the player, cannot be attacked and will not block the player from travelling.
37
+ * Useful to only conditionally make enemies present on a location.
38
+ */
39
+ inactive?: boolean;
40
+
41
+ /**
42
+ * When specified, this function will be called when the enemy is attacked by the player.
43
+ * @param game The game object
44
+ * @param enemy The attacked enemy
45
+ */
46
+ onAttack?(game: IGame, enemy: IEnemy): void;
47
+
48
+ /**
49
+ * When specified, this function will be called when the enemy's health is reduced to 0 or less.
50
+ * @param game The game object
51
+ * @param enemy The defeated enemy
52
+ */
53
+ onDefeat?(game: IGame, enemy: IEnemy): void;
54
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Used to set the availability of actions to the player.
3
+ */
4
+ export enum ActionStatus {
5
+ /**
6
+ * The action shows up for the player and is selectable.
7
+ */
8
+ Available = 'Available',
9
+
10
+ /**
11
+ * The action shows up for the player but is not selectable. Useful to show actions that could be performed if additional criteria
12
+ * had been met (e.g. the character needs to be stronger to break down a door).
13
+ */
14
+ Disabled = 'Disabled',
15
+
16
+ /**
17
+ * The action is not shown to the player. Useful for actions that are only conditionally available.
18
+ */
19
+ Unavailable = 'Unavailable'
20
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Used to differentiate between actions visually (e.g. color).
3
+ */
4
+ export enum ActionType {
5
+ Regular = 'Regular',
6
+ Check = 'Check',
7
+ Combat = 'Combat',
8
+ Trade = 'Trade'
9
+ }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Used to specify what part of the player body the item is meant for, if any. You can specify the equipment slots used in your game as an object
3
+ * on the character class of your game. Note that items may belong to more than one type, e.g. two-handed weapons that require both the left and
4
+ * right hand to use.
5
+ */
6
+ export enum EquipmentType {
7
+ /**
8
+ * Items worn on the head, ranging from diadem to helmets covering the entire head.
9
+ */
10
+ Head = 'Head',
11
+
12
+ /**
13
+ * Items worn around the neck, like amulets.
14
+ */
15
+ Amulet = 'Amulet',
16
+
17
+ /**
18
+ * Items worn on the torso and upper arms.
19
+ */
20
+ Body = 'Body',
21
+
22
+ /**
23
+ * Items worn on the hands, like gloves.
24
+ */
25
+ Hands = 'Hands',
26
+
27
+ /**
28
+ * Items that can be used in the non-dominant hand.
29
+ */
30
+ LeftHand = 'LeftHand',
31
+
32
+ /**
33
+ * Small items worn around the finger on the non-dominant hand.
34
+ */
35
+ LeftRing = 'LeftRing',
36
+
37
+ /**
38
+ * Items that can be used in the dominant hand.
39
+ */
40
+ RightHand = 'RightHand',
41
+
42
+ /**
43
+ * Small items worn around the finger on the dominant hand.
44
+ */
45
+ RightRing = 'RightRing',
46
+
47
+ /**
48
+ * Items worn on the legs.
49
+ */
50
+ Legs = 'Legs',
51
+
52
+ /**
53
+ * Items like boots that are used for walking but may also offer additional protection.
54
+ */
55
+ Feet = 'Feet',
56
+
57
+ /**
58
+ * All other type of items. Miscellaneous items cannot be equipped.
59
+ */
60
+ Miscellaneous = 'Miscellaneous'
61
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Used to determine the UI to show to the player, e.g. the intro or exploration screen.
3
+ */
4
+ export enum GameState {
5
+ Intro = 'Intro',
6
+ CreateCharacter = 'CreateCharacter',
7
+ Play = 'Play',
8
+ LevelUp = 'LevelUp',
9
+ GameOver = 'GameOver',
10
+ Victory = 'Victory'
11
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Used to determine the situational UI to show to the player, e.g. the menu or trade screen.
3
+ */
4
+ export enum PlayState {
5
+ Menu = 'Menu',
6
+ Combat = 'Combat',
7
+ Trade = 'Trade',
8
+ Conversation = 'Conversation',
9
+ Description = 'Description'
10
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Used to determine whether an item usable in combat can be used on enemies or party characters.
3
+ */
4
+ export enum TargetType {
5
+ Ally = 'Ally',
6
+ AllyOrSelf = 'AllyOrSelf',
7
+ Enemy = 'Enemy',
8
+ Self = 'Self'
9
+ }
@@ -0,0 +1,44 @@
1
+ import { IItem } from "./item";
2
+
3
+ export interface IEquipment {
4
+ /**
5
+ * Items worn on the head, ranging from diadem to helmets covering the entire head.
6
+ */
7
+ head?: IItem,
8
+ /**
9
+ * Items worn around the neck, like amulets.
10
+ */
11
+ amulet?: IItem,
12
+ /**
13
+ * Items worn on the torso and upper arms.
14
+ */
15
+ body?: IItem,
16
+ /**
17
+ * Items worn on the hands, like gloves.
18
+ */
19
+ hands?: IItem,
20
+ /**
21
+ * Items that can be used in the non-dominant hand.
22
+ */
23
+ leftHand?: IItem,
24
+ /**
25
+ * Small items worn around the finger on the non-dominant hand.
26
+ */
27
+ leftRing?: IItem,
28
+ /**
29
+ * Items that can be used in the dominant hand.
30
+ */
31
+ rightHand?: IItem,
32
+ /**
33
+ * Small items worn around the finger on the dominant hand.
34
+ */
35
+ rightRing?: IItem,
36
+ /**
37
+ * Items worn on the legs.
38
+ */
39
+ legs?: IItem,
40
+ /**
41
+ * Items like boots that are used for walking but may also offer additional protection.
42
+ */
43
+ feet?: IItem
44
+ }
@@ -0,0 +1,43 @@
1
+ import {ICombinable} from './combinations/combinable';
2
+ import {Sprite} from "./sprite";
3
+
4
+ /**
5
+ * A feature of a location, which can be anything the player can interact with using combinations.
6
+ */
7
+ export interface IFeature extends ICombinable {
8
+ /**
9
+ * The description of the feature. Used when features are added to locations
10
+ * at run-time.
11
+ */
12
+ description?: string;
13
+
14
+ /**
15
+ * The coordinates of this feature when using image maps for visual features.
16
+ */
17
+ coords?: string;
18
+
19
+ /**
20
+ * The shape of this feature when using image maps for visual features.
21
+ */
22
+ shape?: string;
23
+
24
+ /**
25
+ * The file path for the picture to show. When using image maps for visual features, the picture will
26
+ * be shown on top of the image map for this feature. The path should be relative to the resources folder.
27
+ * Use either a picture OR an animation.
28
+ */
29
+ picture?: string;
30
+
31
+ /**
32
+ * The animation settings for this feature. When using image maps for visual features, the animation will
33
+ * be shown on top of the image map for this feature. Use either a picture OR an animation.
34
+ */
35
+ animation?: Sprite;
36
+
37
+ /**
38
+ * This flag controls whether the feature can be interacted with. When not set, it defaults to true. Only when
39
+ * explicitly set to false can the feature not be interacted with. Non-interactive features can be used to for
40
+ * example enrich the game in visual adventure games.
41
+ */
42
+ interactive?: boolean;
43
+ }
@@ -0,0 +1,8 @@
1
+ import { IFeature } from './feature';
2
+
3
+ /**
4
+ * A collection of features of a location.
5
+ */
6
+ export interface IFeatureCollection extends Array<IFeature> {
7
+ collectionPicture?: string;
8
+ }
@@ -0,0 +1,201 @@
1
+ import {
2
+ GameState,
3
+ IAutoplayService,
4
+ ICharacter,
5
+ ICombatSetup,
6
+ ICombatTurn,
7
+ ICommandService,
8
+ ICompiledLocation,
9
+ ICreateCharacter,
10
+ IFeature,
11
+ IGameCombinations,
12
+ IHelpers,
13
+ ILocation,
14
+ IMap,
15
+ IParty,
16
+ IPerson,
17
+ ISoundPlayer,
18
+ IStatistics,
19
+ ITrade,
20
+ PlayState,
21
+ ScoreEntry
22
+ } from 'storyScript';
23
+
24
+ /**
25
+ * The StoryScript main game object.
26
+ */
27
+ export interface IGame {
28
+ /**
29
+ * The sheet to create a character for the game.
30
+ */
31
+ createCharacterSheet?: ICreateCharacter;
32
+
33
+ /**
34
+ * The player's adventuring party.
35
+ */
36
+ party: IParty;
37
+
38
+ /**
39
+ * The active party character.
40
+ */
41
+ activeCharacter: ICharacter;
42
+
43
+ /**
44
+ * All the locations in the game world.
45
+ */
46
+ locations: Record<string, ICompiledLocation> & {
47
+ get?(id?: string | (() => ILocation) | ICompiledLocation): ICompiledLocation;
48
+ };
49
+
50
+ /**
51
+ * All the maps of the game world.
52
+ */
53
+ maps: Record<string, IMap> & {
54
+ get?(id?: string | (() => IMap)): IMap;
55
+ };
56
+
57
+ /**
58
+ * The location in the game world the player is currently at.
59
+ */
60
+ currentLocation: ICompiledLocation;
61
+
62
+ /**
63
+ * The location in the game world the player visited before the current one.
64
+ */
65
+ previousLocation: ICompiledLocation;
66
+
67
+ /**
68
+ * The map of the part of the world the player is currently at, if any.
69
+ */
70
+ currentMap?: IMap;
71
+
72
+ /**
73
+ * The high score log for the game.
74
+ */
75
+ highScores: ScoreEntry[];
76
+
77
+ /**
78
+ * A log containing descriptions of player actions during the game.
79
+ */
80
+ actionLog: string[];
81
+
82
+ /**
83
+ * A log containing descriptions of player actions during combat in the game.
84
+ */
85
+ combatLog: string[];
86
+
87
+ /**
88
+ * The current state of the game.
89
+ */
90
+ state: GameState;
91
+
92
+ /**
93
+ * The current state of play of the game.
94
+ */
95
+ playState: PlayState;
96
+
97
+ /**
98
+ * True if the game has started, meaning the user has passed the title screen. False otherwise.
99
+ */
100
+ started: boolean;
101
+
102
+ /**
103
+ * The person the player is currently interacting with.
104
+ */
105
+ person: IPerson;
106
+
107
+ /**
108
+ * The trade object or person the player is currently trading with.
109
+ */
110
+ trade: ITrade;
111
+
112
+ /**
113
+ * The description currently shown to the player.
114
+ */
115
+ currentDescription: {
116
+ /**
117
+ * The description title.
118
+ */
119
+ title: string;
120
+
121
+ /**
122
+ * The type of the entity for which the description is shown.
123
+ */
124
+ type: string;
125
+
126
+ /**
127
+ * The feature of which to show the description.
128
+ */
129
+ item: IFeature;
130
+ };
131
+
132
+ /**
133
+ * True if a game is being loaded, false otherwise.
134
+ */
135
+ loading: boolean;
136
+
137
+ combinations: IGameCombinations,
138
+
139
+ /**
140
+ * The custom properties for the game world.
141
+ */
142
+ worldProperties: any;
143
+
144
+ /**
145
+ * The root UI element. You can use this to interact with the UI if you need to.
146
+ */
147
+ UIRootElement: HTMLElement;
148
+
149
+ /**
150
+ * The statistics for this game.
151
+ */
152
+ statistics: IStatistics;
153
+
154
+ /**
155
+ * Helper functions to make programming the game easier.
156
+ */
157
+ helpers: IHelpers;
158
+
159
+ /**
160
+ * The sound player for the game.
161
+ */
162
+ sounds: ISoundPlayer,
163
+
164
+ /**
165
+ * The autoplay service to autoplay (parts of) your game and run your game in demo mode.
166
+ */
167
+ autoplay: IAutoplayService;
168
+
169
+ /**
170
+ * True if autoplay is in progress, false otherwise.
171
+ */
172
+ autoplaying: boolean;
173
+
174
+ /**
175
+ * The command service for programmatic access to your game's interactions.
176
+ */
177
+ commands: ICommandService;
178
+ /**
179
+ * The setup for the next combat round. This object is used to track
180
+ * which character attacks which enemy using what item or weapon.
181
+ */
182
+ combat: ICombatSetup<ICombatTurn>;
183
+
184
+ /**
185
+ * Logs a message to the location log.
186
+ * @param message The message to log
187
+ */
188
+ logToLocationLog(message: string): void;
189
+
190
+ /**
191
+ * Logs a message to the action log.
192
+ * @param message The message to log
193
+ */
194
+ logToActionLog(message: string): void;
195
+
196
+ /**
197
+ * Logs a message to the combat log.
198
+ * @param message The message to log
199
+ */
200
+ logToCombatLog(message: string): void;
201
+ }
@@ -0,0 +1,11 @@
1
+ import {IGame} from 'storyScript';
2
+
3
+ export interface IGameEvents {
4
+ register(eventName: string, throwWhenAlreadyRegistered: boolean): void;
5
+
6
+ subscribe(eventName: string | string[], handler: (game: IGame, eventArguments: {}) => void, throwIfUnknown?: boolean): void;
7
+
8
+ publish(eventName: string, eventArguments: any): void;
9
+
10
+ setGame(game: IGame): void
11
+ }