@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,37 @@
1
+ import {IItem} from './item';
2
+
3
+ /**
4
+ * An interface for items that can be combined with others of the same type to create an item group. This is
5
+ * useful if you want to prevent cluttering the player inventory with many items of the same type. A GroupableItem is
6
+ * itself an item, so the first item in the group is used as the parent and additional items are added to the members
7
+ * array.
8
+ */
9
+ export interface IGroupableItem<T extends IItem> extends IItem {
10
+ /**
11
+ * This flag is always set to true for groupable items. It is used to separate groupable items from regular items.
12
+ */
13
+ isGroupable: boolean;
14
+
15
+ /**
16
+ * The name to show for the group of items. Use a placeholder to specify where the number of items in the group
17
+ * should be shown. E.g. '{0} rocks'.
18
+ */
19
+ groupName: string;
20
+
21
+ /**
22
+ * If this number is set, a group of these items can contain no more than this number of items. This is counting
23
+ * the parent and the members.
24
+ */
25
+ maxSize?: number;
26
+
27
+ /**
28
+ * Specify the items that can be grouped together with this one. If omitted, only items of the same type can be
29
+ * grouped.
30
+ */
31
+ groupTypes?: ((() => IGroupableItem<T>) | string)[];
32
+
33
+ /**
34
+ * The items that belong to this group.
35
+ */
36
+ members?: IGroupableItem<T>[];
37
+ }
@@ -0,0 +1,55 @@
1
+ import { IItem } from './item';
2
+ import { IEnemy } from './enemy';
3
+
4
+ export interface IHelpers {
5
+ /**
6
+ * Roll a number of dice to get a number.
7
+ * @param compositeOrSides The number and type of dice (e.g. 3d6) or the number of sides of the dice (e.g.) 6
8
+ * @param dieNumber The number of dice, if not using the composite option
9
+ * @param bonus The bonus to add to the result.
10
+ */
11
+ rollDice(compositeOrSides: string | number, dieNumber?: number, bonus?: number): number;
12
+
13
+ /**
14
+ * Calculate the bonus the character is granted by the items he is carrying.
15
+ * @param person The player character or the person to calculate the bonus for.
16
+ * @param type The player attribute to get the bonus for (e.g. attack)
17
+ */
18
+ calculateBonus(person: { items?: IItem[], equipment?: {} }, type: string): number;
19
+
20
+ /**
21
+ * Get a random enemy to add to the game.
22
+ * @param selector A selector function to limit the list of enemies that can be returned at random (for example a function that excludes ghosts)
23
+ */
24
+ randomEnemy(selector?: (enemy: IEnemy) => boolean): IEnemy;
25
+
26
+ /**
27
+ * Get a random item to add to the game.
28
+ * @param selector A selector function to limit the list of items that can be returned at random (for example a function that excludes magic items)
29
+ */
30
+ randomItem(selector?: (item: IItem) => boolean): IItem;
31
+
32
+ /**
33
+ * Gets a specific item to add to the game.
34
+ * @param selector The id of the item to add
35
+ */
36
+ getItem(selector: string): IItem;
37
+
38
+ /**
39
+ * Gets a specific enemy to add to the game.
40
+ * @param selector The id of the enemy to add
41
+ */
42
+ getEnemy(selector: string): IEnemy;
43
+
44
+ /**
45
+ * Gets an item from the party, checking all character equipment and backpacks.
46
+ * @param item The item to get from the party
47
+ */
48
+ getItemFromParty(item: string | (() => IItem)): IItem;
49
+
50
+ /**
51
+ * Removes an item from the party, checking all character equipment and backpacks.
52
+ * @param item The item to remove from the party
53
+ */
54
+ removeItemFromParty(item: IItem | (() => IItem)): void;
55
+ }
@@ -0,0 +1,158 @@
1
+ import type {IInterfaceTexts} from './interfaceTexts'
2
+ import type {IRules} from './rules/rules'
3
+ import type {IGame} from './game'
4
+ import type {IParty} from './party'
5
+ import type {ICharacter} from './character'
6
+ import type {ICombatTurn} from './combatTurn'
7
+ import type {ICombatSetup} from './combatSetup'
8
+ import type {IEquipment} from './equipment'
9
+ import type {IAction} from './action'
10
+ import type {IFeature} from './feature'
11
+ import type {IFeatureCollection} from './featureCollection'
12
+ import type {IItem} from './item'
13
+ import type {IGroupableItem} from './groupableItem';
14
+ import type {IEnemy} from './enemy'
15
+ import type {IPerson} from './person'
16
+ import type {ITrade} from './trade'
17
+ import type {IKey} from './key'
18
+ import type {IQuest} from './quest'
19
+ import type {ILocation} from './location'
20
+ import type {ICompiledLocation} from './compiledLocation'
21
+ import type {IDestination} from './destination'
22
+ import type {IBarrier} from './barrier'
23
+ import type {IBarrierAction} from './barrierAction'
24
+ import type {IHelpers} from './helpers'
25
+ import {DefaultEquipment} from './defaultEquipment'
26
+ import type {ICombinable} from './combinations/combinable';
27
+ import type {ICombine} from './combinations/combine';
28
+ import type {ICombinations} from './combinations/combinations';
29
+ import type {IActiveCombination} from './combinations/activeCombination';
30
+ import type {ICombinationAction} from './combinations/combinationAction';
31
+ import type {ICombineResult} from './combinations/combineResult';
32
+ import type {ICombinationMatchResult} from './combinations/combinationMatchResult';
33
+ import type {ICreateCharacter} from './createCharacter/createCharacter';
34
+ import type {ICreateCharacterStep} from './createCharacter/createCharacterStep';
35
+ import type {ICreateCharacterQuestion} from './createCharacter/createCharacterQuestion';
36
+ import type {ICreateCharacterQuestionEntry} from './createCharacter/createCharacterQuestionEntry';
37
+ import type {ICreateCharacterAttribute} from './createCharacter/createCharacterAttribute';
38
+ import type {ICreateCharacterAttributeEntry} from './createCharacter/createCharacterAttributeEntry';
39
+ import type {IConversation} from './conversations/conversation';
40
+ import type {IConversationNode} from './conversations/conversationNode';
41
+ import type {IConversationReply} from './conversations/conversationReply';
42
+ import type {IConversationLogEntry} from './conversations/conversationLogEntry';
43
+ import type {ICustomCursor} from './customCursor';
44
+ import type {ICombatWinnings} from './combatWinnings';
45
+ import type {IAutoplayStep} from "./autoplayStep";
46
+ import type {ISetupRules} from './rules/setupRules';
47
+ import type {IGeneralRules} from './rules/generalRules';
48
+ import type {ICharacterRules} from './rules/characterRules';
49
+ import type {IExplorationRules} from './rules/explorationRules';
50
+ import type {ICombatRules} from './rules/combatRules';
51
+ import type {IEncounterRules} from "./rules/encounterRules";
52
+ import type {ICombinationRules} from "./rules/combinationRules";
53
+ import type {ITitleScreen} from "./rules/titleScreen";
54
+ import type {ISoundPlayer} from "./soundPlayer";
55
+ import type {IDemoMode} from "./rules/demoMode";
56
+ import type {IDynamicStyle} from './dynamicStyle';
57
+ import type {IStatistics} from './statistics';
58
+ import type {IDefinitions} from './definitions';
59
+ import type {IGameEvents} from './gameEvents';
60
+ import type {ISaveGame} from "./saveGame";
61
+ import type {IStock} from "./stock";
62
+ import type {IGameCombinations} from "./combinations/gameCombinations";
63
+ import {EquipmentType} from './enumerations/equipmentType';
64
+ import {PlayState} from './enumerations/playState';
65
+ import {GameState} from './enumerations/gameState';
66
+ import {ActionType} from './enumerations/actionType';
67
+ import {ActionStatus} from './enumerations/actionStatus';
68
+ import {TargetType} from './enumerations/targetType';
69
+ import {ScoreEntry} from './scoreEntry';
70
+
71
+ import {IMap} from './maps/map';
72
+ import {IMapLocation} from './maps/mapLocation';
73
+ import {Sprite} from './sprite';
74
+ import {StateList, StateListEntry} from './stateList';
75
+
76
+ export type {
77
+ IInterfaceTexts,
78
+ IRules,
79
+ IGame,
80
+ IParty,
81
+ ICharacter,
82
+ ICombatTurn,
83
+ ICombatSetup,
84
+ IEquipment,
85
+ IAction,
86
+ IItem,
87
+ IGroupableItem,
88
+ IFeature,
89
+ IFeatureCollection,
90
+ IEnemy,
91
+ IKey,
92
+ ILocation,
93
+ ICompiledLocation,
94
+ IDestination,
95
+ IBarrier,
96
+ IBarrierAction,
97
+ IPerson,
98
+ ITrade,
99
+ IQuest,
100
+ IHelpers,
101
+ ICreateCharacter,
102
+ ICreateCharacterStep,
103
+ ICreateCharacterQuestion,
104
+ ICreateCharacterQuestionEntry,
105
+ ICreateCharacterAttribute,
106
+ ICreateCharacterAttributeEntry,
107
+ ICombinable,
108
+ ICombine,
109
+ ICombinations,
110
+ IActiveCombination,
111
+ ICombinationAction,
112
+ IGameCombinations,
113
+ ICombineResult,
114
+ ICombinationMatchResult,
115
+ IConversation,
116
+ IConversationNode,
117
+ IConversationReply,
118
+ IConversationLogEntry,
119
+ IDefinitions,
120
+ IDynamicStyle,
121
+ IStatistics,
122
+ IMap,
123
+ IMapLocation,
124
+ ICustomCursor,
125
+ ICombatWinnings,
126
+ Sprite,
127
+ IAutoplayStep,
128
+ ISetupRules,
129
+ IGeneralRules,
130
+ ICharacterRules,
131
+ IExplorationRules,
132
+ ICombatRules,
133
+ IEncounterRules,
134
+ ICombinationRules,
135
+ ITitleScreen,
136
+ IDemoMode,
137
+ IGameEvents,
138
+ ISaveGame,
139
+ ISoundPlayer,
140
+ IStock
141
+ }
142
+
143
+ export {
144
+ DefaultEquipment,
145
+ EquipmentType,
146
+ PlayState,
147
+ GameState,
148
+ ActionStatus,
149
+ ActionType,
150
+ TargetType,
151
+ ScoreEntry,
152
+ StateList,
153
+ StateListEntry
154
+ }
155
+
156
+ export * from '../Actions/index';
157
+ export * from '../Interfaces/services/index';
158
+ export * from '../EntityCreatorFunctions'
@@ -0,0 +1,142 @@
1
+ /**
2
+ * All game texts that can be customized.
3
+ */
4
+ export interface IInterfaceTexts {
5
+ equipmentHeader?: string;
6
+ head?: string;
7
+ amulet?: string;
8
+ body?: string;
9
+ hands?: string;
10
+ rightHand?: string;
11
+ leftHand?: string;
12
+ rightRing?: string;
13
+ leftRing?: string;
14
+ legs?: string;
15
+ feet?: string;
16
+ backpack?: string;
17
+ equip?: string;
18
+ use?: string;
19
+ drop?: string;
20
+ enemies?: string;
21
+ fight?: string;
22
+ attack?: string;
23
+ attackWith?: string;
24
+ aid?: string;
25
+ aidWith?: string;
26
+ noWeapon?: string,
27
+ useCombatItem?: string,
28
+ combatRound?: string,
29
+ enemyHitpoints?: string,
30
+ enemyCombatName?: string,
31
+ characterHitpoints?: string,
32
+ newGame?: string;
33
+ firstCharacter?: string,
34
+ secondCharacter?: string,
35
+ thirdCharacter?: string,
36
+ nthCharacter?: string,
37
+ nextCharacter?: string,
38
+ yourName?: string;
39
+ startAdventure?: string;
40
+ nextQuestion?: string;
41
+ actions?: string;
42
+ destinations?: string;
43
+ back?: string;
44
+ onTheGround?: string;
45
+ youLost?: string;
46
+ questFailed?: string;
47
+ finalScore?: string;
48
+ tryAgain?: string;
49
+ highScores?: string;
50
+ youWon?: string;
51
+ congratulations?: string;
52
+ playAgain?: string;
53
+ startOver?: string;
54
+ resetWorld?: string;
55
+ gameName?: string;
56
+ saveGame?: string;
57
+ save?: string;
58
+ loadGame?: string;
59
+ load?: string;
60
+ loading?: string;
61
+ youAreHere?: string;
62
+ messages?: string;
63
+ hitpoints?: string;
64
+ currency?: string;
65
+ partyCurrency?: string,
66
+ trade?: string;
67
+ talk?: string;
68
+ examine?: string;
69
+ encounters?: string;
70
+ closeModal?: string;
71
+ combatTitle?: string;
72
+ value?: string;
73
+ traderCurrency?: string;
74
+ startCombat?: string;
75
+ combatWin?: string;
76
+ enemiesToFight?: string;
77
+ useInCombat?: string;
78
+ noCombatAction?: string;
79
+ view?: string;
80
+ quests?: string;
81
+ currentQuests?: string;
82
+ completedQuests?: string;
83
+ combinations?: string;
84
+ tryCombination?: string;
85
+ noCombination?: string;
86
+ noCombinationNoTool?: string;
87
+ levelUp?: string;
88
+ levelUpDescription?: string;
89
+ completeLevelUp?: string;
90
+ newSaveGame?: string;
91
+ existingSaveGames?: string;
92
+ overwriteSaveGame?: string;
93
+ loadSaveGame?: string;
94
+ characterSheet?: string;
95
+ skipIntro?: string;
96
+ mainMenu?: string;
97
+ mainMenuShort?: string;
98
+ confirmRestart?: string;
99
+ restartCancelled?: string;
100
+ restartConfirmed?: string;
101
+ cancel?: string;
102
+ groupItem?: string;
103
+ splitItemGroup?: string;
104
+ worldProperties?: any;
105
+ confirmAction?: string;
106
+ cancelAction?: string;
107
+ stockItemDisplayText?: string,
108
+ buyConfirmationText?: string;
109
+ confirmBuy?: string;
110
+ cancelBuy?: string;
111
+ sellConfirmationText?: string;
112
+ confirmSell?: string;
113
+ cancelSell?: string;
114
+ currencyWon?: string;
115
+ itemsTaken?: string;
116
+ enemiesDefeated?: string;
117
+ backToGame?: string;
118
+ conversationEnded?: string;
119
+ openFullScreenMap?: string;
120
+ closeFullScreenMap?: string;
121
+ pressToShowMarkers?: string;
122
+ touchToShowMarkers?: string;
123
+ startGame?: string;
124
+ continueGame?: string;
125
+ autoplayText?: string;
126
+ noPlayWarning?: string;
127
+
128
+ /**
129
+ * A function to build text replacing tokens in a template, e.g. 'it is {0}, {1}' with parameters 'day' and '12:00' becomes 'it is day, 12:00'.
130
+ * If no function is specified, a default implementation is used.
131
+ * @param template The text template to replace the tokens in
132
+ * @param tokens The tokens to add to the template
133
+ */
134
+ format?(template: string, tokens: string[]): string;
135
+
136
+ /**
137
+ * A function to format a text using title case, e.g. 'world map' becomes 'World Map'.
138
+ * If no function is specified, a default implementation is used.
139
+ * @param text The text to format
140
+ */
141
+ titleCase?(text: string): string;
142
+ }
@@ -0,0 +1,111 @@
1
+ import {IFeature} from './feature';
2
+ import {IEnemy} from './enemy';
3
+ import {IGame} from './game';
4
+ import {EquipmentType} from './enumerations/equipmentType';
5
+ import {IEquipment} from './equipment';
6
+ import {ICharacter} from './character';
7
+ import {TargetType} from './enumerations/targetType';
8
+
9
+ /**
10
+ * An item that can be found in the game and used by the character.
11
+ */
12
+ export interface IItem extends IFeature {
13
+ /**
14
+ * One or more parts of the character body this item is for (or no part, in case of a miscellaneous item).
15
+ * Use string values only for custom equipment types.
16
+ */
17
+ equipmentType: EquipmentType | EquipmentType[] | string | string[];
18
+
19
+ /**
20
+ * True if the item uses all the slots specified by the equipment type array, false if it occupies only one.
21
+ */
22
+ usesMultipleSlots?: boolean;
23
+
24
+ /**
25
+ * Set the target type for the item if the item needs to be used on a target. For example, a weapon targets
26
+ * an enemy, while a healing spell will target an ally. If the target type is not specified, the item cannot
27
+ * be used on enemies or allies.
28
+ */
29
+ targetType?: TargetType;
30
+
31
+ /**
32
+ * The details about this item as displayed to the player. If you use an HTML-page to describe the item, the contents of that HTM-page
33
+ * will be used to set this property at run-time.
34
+ */
35
+ description?: string;
36
+
37
+ /**
38
+ * The number of times the item can be used before disappearing. If not specified, the item can be used indefinitely.
39
+ */
40
+ charges?: number;
41
+
42
+ /**
43
+ * When this flag is set to true or the function returns true and the item has a use function specified, the use action will also be
44
+ * available during combat.
45
+ */
46
+ useInCombat?: boolean | ((item: IItem, equipment: IEquipment) => boolean);
47
+
48
+ /**
49
+ * When this flag is set to false, the item is not selectable. This is used to allow items to be unselectable during combat,
50
+ * for example when you want items to be available only during certain rounds.
51
+ */
52
+ selectable?: boolean;
53
+
54
+ /**
55
+ * The value of the item in whatever credits are used in the game.
56
+ */
57
+ value?: number;
58
+
59
+ /**
60
+ * When this flag is set to true, the item is not shown to the player. Useful to only conditionally make items available on a location.
61
+ */
62
+ inactive?: boolean;
63
+
64
+ /**
65
+ * When this is a flag set to true or has a function that returns true, the item cannot be dropped by the player. This is useful to
66
+ * have items that should not be dropped, such as an adventure map.
67
+ */
68
+ canDrop?: boolean | ((game: IGame, item: IItem) => boolean);
69
+
70
+ /**
71
+ * When specified, this function will be executed when the item is equipped by the player.
72
+ * @param character The character equipping the item
73
+ * @param item The item to be equipped
74
+ * @param game The game object
75
+ */
76
+ equip?(character: ICharacter, item: IItem, game: IGame): boolean;
77
+
78
+ /**
79
+ * When specified, this function will be executed when the item is unequipped by the player.
80
+ * @param character The character unequipping the item
81
+ * @param item The item to be unequipped
82
+ * @param game The game object
83
+ */
84
+ unequip?(character: ICharacter, item: IItem, game: IGame): boolean;
85
+
86
+ /**
87
+ * When specified, this item can be used and a use action becomes available on the item. The function will be executed when the player
88
+ * executes this action. Return a promise if the result should be awaited.
89
+ * @param game The game object
90
+ * @param character The character that uses the item
91
+ * @param item The item to use
92
+ * @param target The target to use the item on, if any
93
+ */
94
+ use?(game: IGame, character: ICharacter, item: IItem, target?: IEnemy): Promise<void> | void;
95
+
96
+ /**
97
+ * When specified, this action determines whether the use action for an item will be shown.
98
+ * @param game The game object
99
+ * @param character The character that wants to use the item
100
+ * @param item The item to show the use action for
101
+ */
102
+ canUse?(game: IGame, character: ICharacter, item: IItem): boolean;
103
+
104
+ /**
105
+ * When specified, this action determines whether the item can be used on the requested target.
106
+ * @param game The game object
107
+ * @param item The item to check the target for
108
+ * @param target The target on which the item would be used
109
+ */
110
+ canTarget?(game: IGame, item: IItem, target: IEnemy | ICharacter): boolean;
111
+ }
@@ -0,0 +1,18 @@
1
+ import { IItem } from './item';
2
+ import { IBarrierAction } from './barrierAction';
3
+
4
+ /**
5
+ * A special kind of item, that can remove a barrier.
6
+ */
7
+ export interface IKey extends IItem {
8
+ /**
9
+ * Set this flag to true if the player keeps the key after using it. Otherwise, it will be removed from his
10
+ * inventory when used.
11
+ */
12
+ keepAfterUse?: boolean;
13
+
14
+ /**
15
+ * The action triggered when using the key to remove the barrier.
16
+ */
17
+ open: IBarrierAction;
18
+ }
@@ -0,0 +1,92 @@
1
+ import {IGame} from './game';
2
+ import {IAction} from './action';
3
+ import {IFeatureCollection} from './featureCollection';
4
+ import {IEnemy} from './enemy';
5
+ import {IPerson} from './person';
6
+ import {IItem} from './item';
7
+ import {IDestination} from './destination';
8
+ import {ITrade} from './trade';
9
+
10
+ /**
11
+ * The base properties for a part of the game world. A StoryScript game world is made up of a collection of locations.
12
+ */
13
+ export interface ILocation {
14
+ /**
15
+ * The name of the location as shown to the player.
16
+ */
17
+ name: string;
18
+
19
+ /**
20
+ * The location description HTML file.
21
+ */
22
+ description: string;
23
+
24
+ /**
25
+ * When specified, the functions in this array will be called when the player enters the location.
26
+ * If nothing or false is returned, the function will be removed once it completed. Return true
27
+ * to keep the function and call it every time the player enters the location.
28
+ */
29
+ enterEvents?: [string, (game: IGame) => void | boolean][];
30
+
31
+ /**
32
+ * When specified, the functions in this array will be called when the player leaves the location.
33
+ * If nothing or false is returned, the function will be removed once it completed. Return true
34
+ * to keep the function and call it every time the player leaves the location.
35
+ */
36
+ leaveEvents?: [string, (game: IGame) => void | boolean][];
37
+
38
+ /**
39
+ * Actions that the player can perform at this location.
40
+ */
41
+ actions?: [string, IAction][];
42
+
43
+ /**
44
+ * Actions that the player can perform at this location when in combat.
45
+ */
46
+ combatActions?: [string, IAction][];
47
+
48
+ /**
49
+ * When specified, the functions in this array will be called from text features or user code when
50
+ * the trigger that should activate them is activated.
51
+ */
52
+ triggeredActions?: [string, (game: IGame, activate: boolean, data: Record<string, string>) => void][];
53
+
54
+ /**
55
+ * When specified, this function is called to determine the selector for the description of this location. Useful for dynamically
56
+ * setting a location's description. If you want to have a description selector function for all locations, use the descriptionSelector
57
+ * function of the game rules. Return the selector string.
58
+ * @param game The game object
59
+ */
60
+ descriptionSelector?: ((game: IGame) => string) | string;
61
+
62
+ /**
63
+ * The features of this location that the player can interact with.
64
+ */
65
+ features?: IFeatureCollection;
66
+
67
+ /**
68
+ * The enemies that occupy this location.
69
+ */
70
+ enemies?: IEnemy[];
71
+
72
+ /**
73
+ * The characters at this location that the player can interact with.
74
+ */
75
+ persons?: IPerson[];
76
+
77
+ /**
78
+ * The items that can be found at this location.
79
+ */
80
+ items?: IItem[];
81
+
82
+ /**
83
+ * The other locations in the game world that can be reached from this one.
84
+ */
85
+ destinations?: IDestination[];
86
+
87
+ /**
88
+ * Trade objects present at this location. If you don't want to use persons to trade with, you can use this array.
89
+ * Useful for e.g. adding containers like chests to the game.
90
+ */
91
+ trade?: ITrade[];
92
+ }
@@ -0,0 +1,55 @@
1
+ import { IMapLocation } from 'storyScript';
2
+
3
+ export interface IMap {
4
+ /**
5
+ * The name of this map.
6
+ */
7
+ name: string;
8
+
9
+ /**
10
+ * The image to use for this map.
11
+ */
12
+ mapImage: string;
13
+
14
+ /**
15
+ * The locations that are part of this map.
16
+ */
17
+ locations: IMapLocation[];
18
+
19
+ /**
20
+ * The image to use for the player location on the map, if any.
21
+ */
22
+ avatarImage?: string;
23
+
24
+ /**
25
+ * True if text markers with the location names should be shown on the map, false otherwise.
26
+ */
27
+ locationNamesAsTextMarkers: boolean;
28
+
29
+ /**
30
+ * The default image to use as a marker for locations on the map.
31
+ */
32
+ locationMarkerImage?: string;
33
+
34
+ /**
35
+ * The time it takes for transitions on the map to complete. This is used to display elements like the avatar
36
+ * only after all transitions are finished. Defaults to 1000 ms.
37
+ */
38
+ transitionTime?: number;
39
+
40
+ /**
41
+ * True if location markers on the map can be clicked to navigate to that location, falsy otherwise.
42
+ */
43
+ clickable?: boolean;
44
+
45
+ /**
46
+ * The JavaScript KeyboardEvent.key value to listen for before showing the location markers. If not set, the markers
47
+ * will be shown all the time. If set, they will show only when the specified key is pressed.
48
+ */
49
+ showMarkersOnKeyPress?: string;
50
+
51
+ /**
52
+ * True if you want to show a toggle behind the map name to show the map full screen in a dialog, falsy otherwise.
53
+ */
54
+ toggleFullScreen?: boolean;
55
+ }