@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.
- package/.env +1 -0
- package/CodeSnippets/StoryScriptSnippets.code-snippets +573 -0
- package/LICENSE.txt +21 -0
- package/LiveTemplates/StoryScript.xml +271 -0
- package/README.md +9 -2
- package/baseViteConfig.js +112 -0
- package/clientFiles/currentGameName.js +1 -0
- package/clientFiles/gitignore +12 -0
- package/clientFiles/tsconfig.json +34 -0
- package/clientFiles/vite.config.ts +14 -0
- package/clientFiles/vitest.config.ts +29 -0
- package/dist/src/Engine/Actions/index.d.ts +2 -0
- package/dist/src/Engine/Actions/open.d.ts +6 -0
- package/dist/src/Engine/Actions/openWithKey.d.ts +7 -0
- package/dist/src/Engine/EntityCreatorFunctions.d.ts +18 -0
- package/dist/src/Engine/Interfaces/action.d.ts +37 -0
- package/dist/src/Engine/Interfaces/autoplayStep.d.ts +11 -0
- package/dist/src/Engine/Interfaces/barrier.d.ts +16 -0
- package/dist/src/Engine/Interfaces/barrierAction.d.ts +19 -0
- package/dist/src/Engine/Interfaces/character.d.ts +48 -0
- package/dist/src/Engine/Interfaces/combatSetup.d.ts +9 -0
- package/dist/src/Engine/Interfaces/combatTurn.d.ts +37 -0
- package/dist/src/Engine/Interfaces/combatWinnings.d.ts +6 -0
- package/dist/src/Engine/Interfaces/combinations/activeCombination.d.ts +14 -0
- package/dist/src/Engine/Interfaces/combinations/combinable.d.ts +18 -0
- package/dist/src/Engine/Interfaces/combinations/combinationAction.d.ts +41 -0
- package/dist/src/Engine/Interfaces/combinations/combinationMatchResult.d.ts +14 -0
- package/dist/src/Engine/Interfaces/combinations/combinations.d.ts +17 -0
- package/dist/src/Engine/Interfaces/combinations/combine.d.ts +22 -0
- package/dist/src/Engine/Interfaces/combinations/combineResult.d.ts +18 -0
- package/dist/src/Engine/Interfaces/combinations/gameCombinations.d.ts +40 -0
- package/dist/src/Engine/Interfaces/compiledLocation.d.ts +33 -0
- package/dist/src/Engine/Interfaces/conversations/conversation.d.ts +44 -0
- package/dist/src/Engine/Interfaces/conversations/conversationLogEntry.d.ts +13 -0
- package/dist/src/Engine/Interfaces/conversations/conversationNode.d.ts +22 -0
- package/dist/src/Engine/Interfaces/conversations/conversationReply.d.ts +49 -0
- package/dist/src/Engine/Interfaces/createCharacter/createCharacter.d.ts +20 -0
- package/dist/src/Engine/Interfaces/createCharacter/createCharacterAttribute.d.ts +18 -0
- package/dist/src/Engine/Interfaces/createCharacter/createCharacterAttributeEntry.d.ts +18 -0
- package/dist/src/Engine/Interfaces/createCharacter/createCharacterQuestion.d.ts +18 -0
- package/dist/src/Engine/Interfaces/createCharacter/createCharacterQuestionEntry.d.ts +22 -0
- package/dist/src/Engine/Interfaces/createCharacter/createCharacterStep.d.ts +40 -0
- package/dist/src/Engine/Interfaces/customCursor.d.ts +8 -0
- package/dist/src/Engine/Interfaces/defaultEquipment.d.ts +19 -0
- package/dist/src/Engine/Interfaces/definitions.d.ts +40 -0
- package/dist/src/Engine/Interfaces/destination.d.ts +31 -0
- package/dist/src/Engine/Interfaces/dynamicStyle.d.ts +10 -0
- package/dist/src/Engine/Interfaces/enemy.d.ts +46 -0
- package/dist/src/Engine/Interfaces/enumerations/actionStatus.d.ts +18 -0
- package/dist/src/Engine/Interfaces/enumerations/actionType.d.ts +9 -0
- package/dist/src/Engine/Interfaces/enumerations/equipmentType.d.ts +51 -0
- package/dist/src/Engine/Interfaces/enumerations/gameState.d.ts +11 -0
- package/dist/src/Engine/Interfaces/enumerations/playState.d.ts +10 -0
- package/dist/src/Engine/Interfaces/enumerations/targetType.d.ts +9 -0
- package/dist/src/Engine/Interfaces/equipment.d.ts +43 -0
- package/dist/src/Engine/Interfaces/feature.d.ts +37 -0
- package/dist/src/Engine/Interfaces/featureCollection.d.ts +7 -0
- package/dist/src/Engine/Interfaces/game.d.ts +148 -0
- package/dist/src/Engine/Interfaces/gameEvents.d.ts +7 -0
- package/dist/src/Engine/Interfaces/groupableItem.d.ts +32 -0
- package/dist/src/Engine/Interfaces/helpers.d.ts +50 -0
- package/dist/src/Engine/Interfaces/index.d.ts +78 -0
- package/dist/src/Engine/Interfaces/interfaceTexts.d.ts +140 -0
- package/dist/src/Engine/Interfaces/item.d.ts +96 -0
- package/dist/src/Engine/Interfaces/key.d.ts +16 -0
- package/dist/src/Engine/Interfaces/location.d.ts +78 -0
- package/dist/src/Engine/Interfaces/maps/map.d.ts +45 -0
- package/dist/src/Engine/Interfaces/maps/mapLocation.d.ts +23 -0
- package/dist/src/Engine/Interfaces/party.d.ts +33 -0
- package/dist/src/Engine/Interfaces/person.d.ts +25 -0
- package/dist/src/Engine/Interfaces/quest.d.ts +51 -0
- package/dist/src/Engine/Interfaces/rules/characterRules.d.ts +84 -0
- package/dist/src/Engine/Interfaces/rules/combatRules.d.ts +46 -0
- package/dist/src/Engine/Interfaces/rules/combinationRules.d.ts +15 -0
- package/dist/src/Engine/Interfaces/rules/demoMode.d.ts +15 -0
- package/dist/src/Engine/Interfaces/rules/encounterRules.d.ts +4 -0
- package/dist/src/Engine/Interfaces/rules/explorationRules.d.ts +42 -0
- package/dist/src/Engine/Interfaces/rules/generalRules.d.ts +62 -0
- package/dist/src/Engine/Interfaces/rules/rules.d.ts +31 -0
- package/dist/src/Engine/Interfaces/rules/setupRules.d.ts +56 -0
- package/dist/src/Engine/Interfaces/rules/titleScreen.d.ts +16 -0
- package/dist/src/Engine/Interfaces/saveGame.d.ts +33 -0
- package/dist/src/Engine/Interfaces/scoreEntry.d.ts +13 -0
- package/dist/src/Engine/Interfaces/services/autoplayService.d.ts +19 -0
- package/dist/src/Engine/Interfaces/services/characterService.d.ts +17 -0
- package/dist/src/Engine/Interfaces/services/combatService.d.ts +26 -0
- package/dist/src/Engine/Interfaces/services/combinationService.d.ts +9 -0
- package/dist/src/Engine/Interfaces/services/commandService.d.ts +64 -0
- package/dist/src/Engine/Interfaces/services/conversationService.d.ts +5 -0
- package/dist/src/Engine/Interfaces/services/dataSerializer.d.ts +4 -0
- package/dist/src/Engine/Interfaces/services/dataService.d.ts +33 -0
- package/dist/src/Engine/Interfaces/services/dataSynchronizer.d.ts +3 -0
- package/dist/src/Engine/Interfaces/services/gameService.d.ts +10 -0
- package/dist/src/Engine/Interfaces/services/index.d.ts +16 -0
- package/dist/src/Engine/Interfaces/services/itemService.d.ts +14 -0
- package/dist/src/Engine/Interfaces/services/localStorageService.d.ts +6 -0
- package/dist/src/Engine/Interfaces/services/locationService.d.ts +8 -0
- package/dist/src/Engine/Interfaces/services/soundService.d.ts +5 -0
- package/dist/src/Engine/Interfaces/services/tradeService.d.ts +9 -0
- package/dist/src/Engine/Interfaces/soundPlayer.d.ts +30 -0
- package/dist/src/Engine/Interfaces/sprite.d.ts +23 -0
- package/dist/src/Engine/Interfaces/stateList.d.ts +9 -0
- package/dist/src/Engine/Interfaces/statistics.d.ts +13 -0
- package/dist/src/Engine/Interfaces/stock.d.ts +39 -0
- package/dist/src/Engine/Interfaces/trade.d.ts +62 -0
- package/dist/src/Engine/ServiceFactory.d.ts +52 -0
- package/dist/src/Engine/Services/AutoplayService.d.ts +11 -0
- package/dist/src/Engine/Services/CharacterService.d.ts +21 -0
- package/dist/src/Engine/Services/CombatService.d.ts +16 -0
- package/dist/src/Engine/Services/CombinationService.d.ts +15 -0
- package/dist/src/Engine/Services/CommandService.d.ts +24 -0
- package/dist/src/Engine/Services/ConversationService.d.ts +26 -0
- package/dist/src/Engine/Services/DataSerializer.d.ts +17 -0
- package/dist/src/Engine/Services/DataService.d.ts +16 -0
- package/dist/src/Engine/Services/DataSynchronizer.d.ts +12 -0
- package/dist/src/Engine/Services/GameService.d.ts +28 -0
- package/dist/src/Engine/Services/HelperService.d.ts +18 -0
- package/dist/src/Engine/Services/ItemService.d.ts +21 -0
- package/dist/src/Engine/Services/LocalStorageService.d.ts +7 -0
- package/dist/src/Engine/Services/LocationService.d.ts +25 -0
- package/dist/src/Engine/Services/SoundService.d.ts +13 -0
- package/dist/src/Engine/Services/TradeService.d.ts +17 -0
- package/dist/src/Engine/Services/index.d.ts +17 -0
- package/dist/src/Engine/Services/serializationData.d.ts +8 -0
- package/dist/src/Engine/Services/sharedFunctions.d.ts +21 -0
- package/dist/src/Engine/arrayAndFunctionExtensions.d.ts +3 -0
- package/dist/src/Engine/defaultTexts.d.ts +7 -0
- package/dist/src/Engine/gameEvents.d.ts +10 -0
- package/dist/src/Engine/index.d.ts +8 -0
- package/dist/src/Engine/stateProperties.d.ts +6 -0
- package/dist/src/Engine/utilityFunctions.d.ts +25 -0
- package/dist/src/UI/Composables/CustomCursor.d.ts +2 -0
- package/dist/src/UI/Composables/LocationMap.d.ts +26 -0
- package/dist/src/UI/Composables/Sound.d.ts +7 -0
- package/dist/src/UI/Composables/TextFeatures.d.ts +8 -0
- package/dist/src/UI/Composables/VisualFeatures.d.ts +7 -0
- package/dist/src/UI/Composables/index.d.ts +7 -0
- package/dist/src/UI/Composables/playStateWatch.d.ts +2 -0
- package/dist/src/UI/StateStore.d.ts +14256 -0
- package/dist/src/UI/error.d.ts +6 -0
- package/dist/src/UI/helpers.d.ts +3 -0
- package/dist/src/UI/index.d.ts +6 -0
- package/dist/src/UI/main.d.ts +1 -0
- package/dist/src/UI/startup.d.ts +2 -0
- package/dist/src/constants.d.ts +17 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/storyscript.css +9566 -0
- package/dist/storyscript.js +9659 -0
- package/dist/storyscript.js.map +1 -0
- package/dist/storyscript.mjs +9569 -0
- package/dist/storyscript.mjs.map +1 -0
- package/electron.cjs +44 -0
- package/index.html +14 -0
- package/package.json +118 -4
- package/scripts/cli.js +268 -0
- package/scripts/createAsset.js +117 -0
- package/scripts/createGame.js +40 -0
- package/scripts/helpers.js +21 -0
- package/scripts/postbuild.js +179 -0
- package/scripts/setupTesting.js +17 -0
- package/shims-vue.d.ts +1 -0
- package/src/Engine/Actions/index.ts +2 -0
- package/src/Engine/Actions/open.ts +12 -0
- package/src/Engine/Actions/openWithKey.ts +23 -0
- package/src/Engine/EntityCreatorFunctions.ts +602 -0
- package/src/Engine/Interfaces/action.ts +43 -0
- package/src/Engine/Interfaces/autoplayStep.ts +13 -0
- package/src/Engine/Interfaces/barrier.ts +18 -0
- package/src/Engine/Interfaces/barrierAction.ts +21 -0
- package/src/Engine/Interfaces/character.ts +58 -0
- package/src/Engine/Interfaces/combatSetup.ts +10 -0
- package/src/Engine/Interfaces/combatTurn.ts +45 -0
- package/src/Engine/Interfaces/combatWinnings.ts +7 -0
- package/src/Engine/Interfaces/combinations/activeCombination.ts +16 -0
- package/src/Engine/Interfaces/combinations/combinable.ts +21 -0
- package/src/Engine/Interfaces/combinations/combinationAction.ts +45 -0
- package/src/Engine/Interfaces/combinations/combinationMatchResult.ts +16 -0
- package/src/Engine/Interfaces/combinations/combinations.ts +19 -0
- package/src/Engine/Interfaces/combinations/combine.ts +25 -0
- package/src/Engine/Interfaces/combinations/combineResult.ts +21 -0
- package/src/Engine/Interfaces/combinations/gameCombinations.ts +48 -0
- package/src/Engine/Interfaces/compiledLocation.ts +37 -0
- package/src/Engine/Interfaces/conversations/conversation.ts +47 -0
- package/src/Engine/Interfaces/conversations/conversationLogEntry.ts +14 -0
- package/src/Engine/Interfaces/conversations/conversationNode.ts +26 -0
- package/src/Engine/Interfaces/conversations/conversationReply.ts +59 -0
- package/src/Engine/Interfaces/createCharacter/createCharacter.ts +23 -0
- package/src/Engine/Interfaces/createCharacter/createCharacterAttribute.ts +21 -0
- package/src/Engine/Interfaces/createCharacter/createCharacterAttributeEntry.ts +21 -0
- package/src/Engine/Interfaces/createCharacter/createCharacterQuestion.ts +21 -0
- package/src/Engine/Interfaces/createCharacter/createCharacterQuestionEntry.ts +25 -0
- package/src/Engine/Interfaces/createCharacter/createCharacterStep.ts +47 -0
- package/src/Engine/Interfaces/customCursor.ts +5 -0
- package/src/Engine/Interfaces/defaultEquipment.ts +32 -0
- package/src/Engine/Interfaces/definitions.ts +48 -0
- package/src/Engine/Interfaces/destination.ts +37 -0
- package/src/Engine/Interfaces/dynamicStyle.ts +11 -0
- package/src/Engine/Interfaces/enemy.ts +54 -0
- package/src/Engine/Interfaces/enumerations/actionStatus.ts +20 -0
- package/src/Engine/Interfaces/enumerations/actionType.ts +9 -0
- package/src/Engine/Interfaces/enumerations/equipmentType.ts +61 -0
- package/src/Engine/Interfaces/enumerations/gameState.ts +11 -0
- package/src/Engine/Interfaces/enumerations/playState.ts +10 -0
- package/src/Engine/Interfaces/enumerations/targetType.ts +9 -0
- package/src/Engine/Interfaces/equipment.ts +44 -0
- package/src/Engine/Interfaces/feature.ts +43 -0
- package/src/Engine/Interfaces/featureCollection.ts +8 -0
- package/src/Engine/Interfaces/game.ts +201 -0
- package/src/Engine/Interfaces/gameEvents.ts +11 -0
- package/src/Engine/Interfaces/groupableItem.ts +37 -0
- package/src/Engine/Interfaces/helpers.ts +55 -0
- package/src/Engine/Interfaces/index.ts +158 -0
- package/src/Engine/Interfaces/interfaceTexts.ts +142 -0
- package/src/Engine/Interfaces/item.ts +111 -0
- package/src/Engine/Interfaces/key.ts +18 -0
- package/src/Engine/Interfaces/location.ts +92 -0
- package/src/Engine/Interfaces/maps/map.ts +55 -0
- package/src/Engine/Interfaces/maps/mapLocation.ts +28 -0
- package/src/Engine/Interfaces/party.ts +40 -0
- package/src/Engine/Interfaces/person.ts +29 -0
- package/src/Engine/Interfaces/quest.ts +60 -0
- package/src/Engine/Interfaces/rules/characterRules.ts +96 -0
- package/src/Engine/Interfaces/rules/combatRules.ts +52 -0
- package/src/Engine/Interfaces/rules/combinationRules.ts +17 -0
- package/src/Engine/Interfaces/rules/demoMode.ts +18 -0
- package/src/Engine/Interfaces/rules/encounterRules.ts +5 -0
- package/src/Engine/Interfaces/rules/explorationRules.ts +47 -0
- package/src/Engine/Interfaces/rules/generalRules.ts +80 -0
- package/src/Engine/Interfaces/rules/rules.ts +46 -0
- package/src/Engine/Interfaces/rules/setupRules.ts +65 -0
- package/src/Engine/Interfaces/rules/titleScreen.ts +19 -0
- package/src/Engine/Interfaces/saveGame.ts +39 -0
- package/src/Engine/Interfaces/scoreEntry.ts +14 -0
- package/src/Engine/Interfaces/services/autoplayService.ts +23 -0
- package/src/Engine/Interfaces/services/characterService.ts +35 -0
- package/src/Engine/Interfaces/services/combatService.ts +30 -0
- package/src/Engine/Interfaces/services/combinationService.ts +10 -0
- package/src/Engine/Interfaces/services/commandService.ts +75 -0
- package/src/Engine/Interfaces/services/conversationService.ts +7 -0
- package/src/Engine/Interfaces/services/dataSerializer.ts +4 -0
- package/src/Engine/Interfaces/services/dataService.ts +39 -0
- package/src/Engine/Interfaces/services/dataSynchronizer.ts +9 -0
- package/src/Engine/Interfaces/services/gameService.ts +17 -0
- package/src/Engine/Interfaces/services/index.ts +33 -0
- package/src/Engine/Interfaces/services/itemService.ts +25 -0
- package/src/Engine/Interfaces/services/localStorageService.ts +6 -0
- package/src/Engine/Interfaces/services/locationService.ts +13 -0
- package/src/Engine/Interfaces/services/soundService.ts +7 -0
- package/src/Engine/Interfaces/services/tradeService.ts +15 -0
- package/src/Engine/Interfaces/soundPlayer.ts +30 -0
- package/src/Engine/Interfaces/sprite.ts +27 -0
- package/src/Engine/Interfaces/stateList.ts +13 -0
- package/src/Engine/Interfaces/statistics.ts +14 -0
- package/src/Engine/Interfaces/stock.ts +46 -0
- package/src/Engine/Interfaces/trade.ts +72 -0
- package/src/Engine/ServiceFactory.ts +167 -0
- package/src/Engine/Services/AutoplayService.ts +59 -0
- package/src/Engine/Services/CharacterService.ts +291 -0
- package/src/Engine/Services/CombatService.ts +266 -0
- package/src/Engine/Services/CombinationService.ts +197 -0
- package/src/Engine/Services/CommandService.ts +197 -0
- package/src/Engine/Services/ConversationService.ts +406 -0
- package/src/Engine/Services/DataSerializer.ts +326 -0
- package/src/Engine/Services/DataService.ts +93 -0
- package/src/Engine/Services/DataSynchronizer.ts +216 -0
- package/src/Engine/Services/GameService.ts +554 -0
- package/src/Engine/Services/HelperService.ts +94 -0
- package/src/Engine/Services/ItemService.ts +294 -0
- package/src/Engine/Services/LocalStorageService.ts +24 -0
- package/src/Engine/Services/LocationService.ts +380 -0
- package/src/Engine/Services/SoundService.ts +54 -0
- package/src/Engine/Services/TradeService.ts +176 -0
- package/src/Engine/Services/index.ts +17 -0
- package/src/Engine/Services/serializationData.ts +8 -0
- package/src/Engine/Services/sharedFunctions.ts +296 -0
- package/src/Engine/arrayAndFunctionExtensions.ts +269 -0
- package/src/Engine/defaultTexts.ts +162 -0
- package/src/Engine/gameEvents.ts +51 -0
- package/src/Engine/index.ts +9 -0
- package/src/Engine/stateProperties.ts +9 -0
- package/src/Engine/utilityFunctions.ts +238 -0
- package/src/Games/_GameTemplate/character.ts +31 -0
- package/src/Games/_GameTemplate/customTexts.ts +8 -0
- package/src/Games/_GameTemplate/interfaces/action.ts +5 -0
- package/src/Games/_GameTemplate/interfaces/combatSetup.ts +7 -0
- package/src/Games/_GameTemplate/interfaces/combatTurn.ts +8 -0
- package/src/Games/_GameTemplate/interfaces/destination.ts +5 -0
- package/src/Games/_GameTemplate/interfaces/enemy.ts +11 -0
- package/src/Games/_GameTemplate/interfaces/equipment.ts +5 -0
- package/src/Games/_GameTemplate/interfaces/feature.ts +9 -0
- package/src/Games/_GameTemplate/interfaces/game.ts +22 -0
- package/src/Games/_GameTemplate/interfaces/interfaceTexts.ts +5 -0
- package/src/Games/_GameTemplate/interfaces/item.ts +18 -0
- package/src/Games/_GameTemplate/interfaces/key.ts +10 -0
- package/src/Games/_GameTemplate/interfaces/location.ts +22 -0
- package/src/Games/_GameTemplate/interfaces/map.ts +16 -0
- package/src/Games/_GameTemplate/interfaces/party.ts +8 -0
- package/src/Games/_GameTemplate/interfaces/person.ts +11 -0
- package/src/Games/_GameTemplate/interfaces/quest.ts +9 -0
- package/src/Games/_GameTemplate/locations/Start.html +5 -0
- package/src/Games/_GameTemplate/locations/start.ts +12 -0
- package/src/Games/_GameTemplate/rules.ts +60 -0
- package/src/Games/_GameTemplate/types.ts +55 -0
- package/src/Games/_GameTemplate/ui/styles/game.css +3 -0
- package/src/Games/_GameTemplate/webroot/favicon.ico +0 -0
- package/src/Games/_GameTemplate/webroot/gameinfo.json +10 -0
- package/src/Games/_GameTemplate/webroot/logo192.png +0 -0
- package/src/Games/_GameTemplate/webroot/logo512.png +0 -0
- package/src/Tests/Games/_GameTemplate/specs/rules.test.ts +9 -0
- package/src/UI/Components/AppShell.vue +43 -0
- package/src/UI/Components/Autoplay.vue +32 -0
- package/src/UI/Components/Combinations.vue +37 -0
- package/src/UI/Components/Common/Collapsible.vue +50 -0
- package/src/UI/Components/Common/ModalDialog.vue +54 -0
- package/src/UI/Components/Common/Sprite.vue +53 -0
- package/src/UI/Components/Description.vue +23 -0
- package/src/UI/Components/Encounter/Combat/Combat.vue +89 -0
- package/src/UI/Components/Encounter/Combat/CombatActions.vue +26 -0
- package/src/UI/Components/Encounter/Combat/CombatParticipant.vue +22 -0
- package/src/UI/Components/Encounter/Combat/CombatTargetSelect.vue +55 -0
- package/src/UI/Components/Encounter/Combat/CombatWin.vue +33 -0
- package/src/UI/Components/Encounter/Conversation.vue +66 -0
- package/src/UI/Components/Encounter/Encounter.vue +39 -0
- package/src/UI/Components/Encounter/Enemy.vue +30 -0
- package/src/UI/Components/Encounter/Trade/Stock.vue +58 -0
- package/src/UI/Components/Encounter/Trade/Trade.vue +24 -0
- package/src/UI/Components/Exploration/ActionLog.vue +17 -0
- package/src/UI/Components/Exploration/Destination.vue +66 -0
- package/src/UI/Components/Exploration/Exploration.vue +67 -0
- package/src/UI/Components/Exploration/Ground.vue +22 -0
- package/src/UI/Components/Exploration/LocationMap.vue +42 -0
- package/src/UI/Components/Exploration/LocationText.vue +39 -0
- package/src/UI/Components/Exploration/LocationVisual.vue +38 -0
- package/src/UI/Components/GameContainer.vue +49 -0
- package/src/UI/Components/GameMenu.vue +111 -0
- package/src/UI/Components/GameState/GameOver.vue +20 -0
- package/src/UI/Components/GameState/HighScores.vue +22 -0
- package/src/UI/Components/GameState/Intro.vue +17 -0
- package/src/UI/Components/GameState/TitleScreen.vue +42 -0
- package/src/UI/Components/GameState/Victory.vue +28 -0
- package/src/UI/Components/Navigation.vue +94 -0
- package/src/UI/Components/Party/Backpack.vue +68 -0
- package/src/UI/Components/Party/BuildCharacter.vue +64 -0
- package/src/UI/Components/Party/CharacterSheet.vue +57 -0
- package/src/UI/Components/Party/CreateCharacter.vue +46 -0
- package/src/UI/Components/Party/Equipment.vue +48 -0
- package/src/UI/Components/Party/EquipmentSlot.vue +31 -0
- package/src/UI/Components/Party/LevelUp.vue +27 -0
- package/src/UI/Components/Party/Party.vue +29 -0
- package/src/UI/Components/Party/Quests.vue +48 -0
- package/src/UI/Components/Sound.vue +42 -0
- package/src/UI/Composables/CustomCursor.ts +60 -0
- package/src/UI/Composables/LocationMap.ts +315 -0
- package/src/UI/Composables/Sound.ts +111 -0
- package/src/UI/Composables/TextFeatures.ts +148 -0
- package/src/UI/Composables/VisualFeatures.ts +220 -0
- package/src/UI/Composables/index.ts +15 -0
- package/src/UI/Composables/playStateWatch.ts +31 -0
- package/src/UI/StateStore.ts +237 -0
- package/src/UI/error.ts +6 -0
- package/src/UI/helpers.ts +62 -0
- package/src/UI/index.ts +13 -0
- package/src/UI/main.ts +62 -0
- package/src/UI/startup.ts +58 -0
- package/src/UI/styles/bootstrap-storyscript.scss +31 -0
- package/src/UI/styles/empty.css +3 -0
- package/src/UI/styles/lookinglass.png +0 -0
- package/src/UI/styles/storyscript.css +735 -0
- package/typeExtensions.d.ts +25 -0
- package/vite-env.d.ts +1 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ICharacter, ICompiledLocation, IGame, IItem } from '../../..';
|
|
2
|
+
export interface IExplorationRules {
|
|
3
|
+
/**
|
|
4
|
+
* When specified, this function will be called whenever the player enters a location.
|
|
5
|
+
* @param game The active game
|
|
6
|
+
* @param location The location the player enters
|
|
7
|
+
* @param previousLocationId The id of the location the player left traveling to the new location
|
|
8
|
+
* @param travel True if the player arrived by traveling, falsy otherwise. A player can get
|
|
9
|
+
* to a location without traveling when a game is loaded, for example.
|
|
10
|
+
*/
|
|
11
|
+
enterLocation?(game: IGame, location: ICompiledLocation, previousLocationId?: string, travel?: boolean): void;
|
|
12
|
+
/**
|
|
13
|
+
* When specified, this function will be called whenever the player enters leaves a location.
|
|
14
|
+
* @param game The active game
|
|
15
|
+
* @param location The location the player leaves
|
|
16
|
+
* @param newLocationId The id of the location the player travels to
|
|
17
|
+
* @param travel True if the player leaves by traveling, falsy otherwise.
|
|
18
|
+
*/
|
|
19
|
+
leaveLocation?(game: IGame, location: ICompiledLocation, newLocationId?: string, travel?: boolean): void;
|
|
20
|
+
/**
|
|
21
|
+
* When specified, this function will be called to determine whether a destination should
|
|
22
|
+
* be marked as visited.
|
|
23
|
+
* @param game The active game
|
|
24
|
+
* @param location The location the destination leads to
|
|
25
|
+
*/
|
|
26
|
+
hasVisitedLocation?(game: IGame, location: ICompiledLocation): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Specify this function if you want to run custom logic to set the description selector when selecting the description when
|
|
29
|
+
* entering a location. Return the selector string. This is useful if you for example want to show different descriptions at
|
|
30
|
+
* night.
|
|
31
|
+
* @param game The active game
|
|
32
|
+
*/
|
|
33
|
+
descriptionSelector?(game: IGame): string;
|
|
34
|
+
/**
|
|
35
|
+
* Use this hook to run code just before the player tries to use an item. Return true if the
|
|
36
|
+
* item's use function should be run after your code has run, false otherwise.
|
|
37
|
+
* @param game The active game
|
|
38
|
+
* @param character The character using the item
|
|
39
|
+
* @param item The item about to be used
|
|
40
|
+
*/
|
|
41
|
+
onUseItem?(game: IGame, character: ICharacter, item: IItem): boolean;
|
|
42
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { GameState, ICharacter, IGame, IGroupableItem, IInterfaceTexts, IItem, ITrade, PlayState } from '../../..';
|
|
2
|
+
export interface IGeneralRules {
|
|
3
|
+
/**
|
|
4
|
+
* This function is called when the party's score changes. Return true if you want to toggle the level-up
|
|
5
|
+
* status afterward.
|
|
6
|
+
* @param game The active game
|
|
7
|
+
* @param change The change in score.
|
|
8
|
+
*/
|
|
9
|
+
scoreChange?(game: IGame, change: number): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* This function is called when the game state changes.
|
|
12
|
+
* @param game The active game
|
|
13
|
+
* @param newGameState The new game state
|
|
14
|
+
* @param oldGameState The current game state
|
|
15
|
+
* */
|
|
16
|
+
gameStateChange?(game: IGame, newGameState: GameState, oldGameState: GameState): void;
|
|
17
|
+
/**
|
|
18
|
+
* This function is called when the play state changes.
|
|
19
|
+
* @param game The active game
|
|
20
|
+
* @param newPlayState The new play state
|
|
21
|
+
* @param oldPlayState The current play state
|
|
22
|
+
* */
|
|
23
|
+
playStateChange?(game: IGame, newPlayState: PlayState, oldPlayState: PlayState): void;
|
|
24
|
+
/**
|
|
25
|
+
* Use this function if you want to run additonal logic when determining the player's final score on game end.
|
|
26
|
+
* @param game The game about to be ended
|
|
27
|
+
*/
|
|
28
|
+
determineFinalScore?(game: IGame): void;
|
|
29
|
+
/**
|
|
30
|
+
* Use this function to run logic before the game is saved. You can use this to change what is saved as part
|
|
31
|
+
* of a game.
|
|
32
|
+
* @param game The game about to be saved.
|
|
33
|
+
*/
|
|
34
|
+
beforeSave?(game: IGame): void;
|
|
35
|
+
/**
|
|
36
|
+
* Use this function to run logic after the game is saved. You can use this to revert changes you made in
|
|
37
|
+
* beforeSave.
|
|
38
|
+
* @param game The game about to be saved.
|
|
39
|
+
*/
|
|
40
|
+
afterSave?(game: IGame): void;
|
|
41
|
+
/**
|
|
42
|
+
* Use this function to override the standard way of naming items. This is useful if you want to use a
|
|
43
|
+
* different naming for items that are grouped.
|
|
44
|
+
* @param item The item to get the name for.
|
|
45
|
+
* @param texts The interface texts.
|
|
46
|
+
*/
|
|
47
|
+
getItemName?(item: IItem, texts: IInterfaceTexts): string;
|
|
48
|
+
/**
|
|
49
|
+
* Use this function if you want to use special rules for grouping items.
|
|
50
|
+
* @param character The character grouping the items.
|
|
51
|
+
* @param group The item that is the parent for the group.
|
|
52
|
+
* @param item The item to add as a member to the parent.
|
|
53
|
+
*/
|
|
54
|
+
canGroupItem?(character: ICharacter, group: IGroupableItem<IItem>, item: IGroupableItem<IItem>): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Use this function if you want to run code to determine whether an item can be sold to a buyer.
|
|
57
|
+
* @param game The game object
|
|
58
|
+
* @param item The item to sell
|
|
59
|
+
* @param buyer The potential buyer
|
|
60
|
+
*/
|
|
61
|
+
canBuyItem?(game: IGame, item: IItem, buyer: ITrade | ICharacter): boolean;
|
|
62
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ICharacterRules, ICombatRules, ICombinationRules, IEncounterRules, IExplorationRules, IGeneralRules, ISetupRules } from '../../..';
|
|
2
|
+
export interface IRules {
|
|
3
|
+
/**
|
|
4
|
+
* Rules for setting up the game.
|
|
5
|
+
*/
|
|
6
|
+
setup: ISetupRules;
|
|
7
|
+
/**
|
|
8
|
+
* General game rules.
|
|
9
|
+
*/
|
|
10
|
+
general?: IGeneralRules;
|
|
11
|
+
/**
|
|
12
|
+
* Rules for the game character.
|
|
13
|
+
*/
|
|
14
|
+
character: ICharacterRules;
|
|
15
|
+
/**
|
|
16
|
+
* Rules for exploring.
|
|
17
|
+
*/
|
|
18
|
+
exploration?: IExplorationRules;
|
|
19
|
+
/**
|
|
20
|
+
* Rules for encounters.
|
|
21
|
+
*/
|
|
22
|
+
encounters?: IEncounterRules;
|
|
23
|
+
/**
|
|
24
|
+
* Rules for combat.
|
|
25
|
+
*/
|
|
26
|
+
combat?: ICombatRules;
|
|
27
|
+
/**
|
|
28
|
+
* Rule for combat.
|
|
29
|
+
*/
|
|
30
|
+
combinations?: ICombinationRules;
|
|
31
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { IGame, ITitleScreen, StateList } from '../../..';
|
|
2
|
+
export interface ISetupRules {
|
|
3
|
+
/**
|
|
4
|
+
* Specify a name of an image file in your resources folder to use that image as a custom mouse cursor.
|
|
5
|
+
* Don't use a large image, as the browser may not display it. Dimensions of 50x50 or 32x32 pixels work well.
|
|
6
|
+
*/
|
|
7
|
+
customCursorImage?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Set this to a positive value greater than 1 to allow the player to create a party of more than
|
|
10
|
+
* one character.
|
|
11
|
+
*/
|
|
12
|
+
numberOfCharacters?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Set this if you want to use a title screen.
|
|
15
|
+
*/
|
|
16
|
+
titleScreen?: ITitleScreen;
|
|
17
|
+
/**
|
|
18
|
+
* Set this to true if you want to show an intro screen when the game starts.
|
|
19
|
+
*/
|
|
20
|
+
intro?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* When you want to play a music file when the game is in a certain state, use this list. Use it like this:
|
|
23
|
+
playList: {
|
|
24
|
+
[Using GameState:] 'play.mp4': [GameState.Play].
|
|
25
|
+
[For multiple game states:] 'play.mp4': [GameState.Intro, GameState.Play].
|
|
26
|
+
[Using PlayState:] 'combat.mp4': [PlayState.Combat].
|
|
27
|
+
[Using Locations:] 'start.mp4': [Start].
|
|
28
|
+
[Using a custom function:] '': [game => string] (the string value returned from the function should be the music file).
|
|
29
|
+
}
|
|
30
|
+
*/
|
|
31
|
+
playList?: StateList;
|
|
32
|
+
/**
|
|
33
|
+
* When you want to fade out music before starting a new piece, set this interval. The interval is in miliseconds, so specify
|
|
34
|
+
* a sufficiently large value (e.g. 250). The volume will be reduced by 10% each interval, and the new music starts when the
|
|
35
|
+
* volume of the current music reaches 0.
|
|
36
|
+
*/
|
|
37
|
+
fadeMusicInterval?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Run custom code to prepare the game before it begins. NOTE: this also runs when
|
|
40
|
+
* the browser reloads. If you want to run code only on the start of a new game, use
|
|
41
|
+
* gameStart instead.
|
|
42
|
+
* @param game The game about to be started
|
|
43
|
+
*/
|
|
44
|
+
initGame?(game: IGame): void;
|
|
45
|
+
/**
|
|
46
|
+
* Run custom code to prepare the game before entering the start location, e.g. adding game-specific
|
|
47
|
+
* world properties to it.
|
|
48
|
+
* @param game The game about to be started
|
|
49
|
+
*/
|
|
50
|
+
gameStart?(game: IGame): void;
|
|
51
|
+
/**
|
|
52
|
+
* Run custom code to prepare the game before resuming a game when loading a game.
|
|
53
|
+
* @param game The game about to be loaded
|
|
54
|
+
*/
|
|
55
|
+
continueGame?(game: IGame): void;
|
|
56
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IDemoMode } from '../../..';
|
|
2
|
+
export interface ITitleScreen {
|
|
3
|
+
/**
|
|
4
|
+
* Set this flag to true if you want to show a title screen, false otherwise.
|
|
5
|
+
*/
|
|
6
|
+
showTitleScreen: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Set this function to get the demo configuration if you want to autoplay a demo game.
|
|
9
|
+
*/
|
|
10
|
+
getDemoMode?: () => IDemoMode;
|
|
11
|
+
/**
|
|
12
|
+
* The transition time to use to fade to the game demo from the title screen, and back out when the demo has run.
|
|
13
|
+
* Use the CSS format, e.g. '.1' or '1'.
|
|
14
|
+
*/
|
|
15
|
+
transitionDelay?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ICompiledLocation } from './compiledLocation';
|
|
2
|
+
import { IStatistics } from './statistics';
|
|
3
|
+
import { IParty } from './party';
|
|
4
|
+
import { IMap } from './maps/map';
|
|
5
|
+
/**
|
|
6
|
+
* An object to save the game state.
|
|
7
|
+
*/
|
|
8
|
+
export interface ISaveGame {
|
|
9
|
+
/**
|
|
10
|
+
* The party to save
|
|
11
|
+
*/
|
|
12
|
+
party: IParty;
|
|
13
|
+
/**
|
|
14
|
+
* The statistics to save.
|
|
15
|
+
*/
|
|
16
|
+
statistics: IStatistics;
|
|
17
|
+
/**
|
|
18
|
+
* The properties of the world to save.
|
|
19
|
+
*/
|
|
20
|
+
worldProperties: {};
|
|
21
|
+
/**
|
|
22
|
+
* The world locations to save.
|
|
23
|
+
*/
|
|
24
|
+
world: Record<string, ICompiledLocation>;
|
|
25
|
+
/**
|
|
26
|
+
* The world maps to save.
|
|
27
|
+
*/
|
|
28
|
+
maps: Record<string, IMap>;
|
|
29
|
+
/**
|
|
30
|
+
* The autoplaying audio that was started already.
|
|
31
|
+
*/
|
|
32
|
+
playedAudio: [];
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IAutoplayStep, IDemoMode } from '../../..';
|
|
2
|
+
export interface IAutoplayService {
|
|
3
|
+
/**
|
|
4
|
+
* Start autoplay using the steps specified.
|
|
5
|
+
* @param steps The steps to autoplay.
|
|
6
|
+
* @param callback If needed, call a function when autoplay completes.
|
|
7
|
+
*/
|
|
8
|
+
start: (steps: IAutoplayStep[], callback?: () => void) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Stops autoplay in progress.
|
|
11
|
+
*/
|
|
12
|
+
stop: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Start autoplaying the game in demo mode using the configuration specified.
|
|
15
|
+
* @param demoConfig The demo mode configuration.
|
|
16
|
+
* @param restartCallback Call a function to restart the demo when it completes.
|
|
17
|
+
*/
|
|
18
|
+
startDemoMode: (demoConfig: IDemoMode, restartCallback: () => void) => void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ICharacter, ICreateCharacter, ICreateCharacterAttribute, ICreateCharacterAttributeEntry, ICreateCharacterStep, IGame, IQuest } from '../../..';
|
|
2
|
+
export interface ICharacterService {
|
|
3
|
+
getSheetAttributes(): string[];
|
|
4
|
+
setupCharacter(): ICreateCharacter;
|
|
5
|
+
setupLevelUp(): ICreateCharacter;
|
|
6
|
+
createCharacter(game: IGame, characterData: any): ICharacter;
|
|
7
|
+
levelUp(character: ICharacter): ICharacter;
|
|
8
|
+
limitSheetInput(value: number, attribute: ICreateCharacterAttribute, entry: ICreateCharacterAttributeEntry): void;
|
|
9
|
+
distributionDone(sheet: ICreateCharacter, step: ICreateCharacterStep): boolean;
|
|
10
|
+
isSlotUsed(character: ICharacter, slot: string): boolean;
|
|
11
|
+
questStatus(quest: IQuest): string;
|
|
12
|
+
/**
|
|
13
|
+
* Check whether all the equipment on the characters is in valid equipment slots. The equipment type may change
|
|
14
|
+
* during editing, leaving items previously equipped in invalid slots.
|
|
15
|
+
*/
|
|
16
|
+
checkEquipment(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ICharacter, ICombatSetup, ICombatTurn, IEnemy, IItem } from '../../..';
|
|
2
|
+
export interface ICombatService {
|
|
3
|
+
/**
|
|
4
|
+
* The function executed when combat is started.
|
|
5
|
+
*/
|
|
6
|
+
initCombat(): void;
|
|
7
|
+
/**
|
|
8
|
+
* The function executed when the player attacks an enemy.
|
|
9
|
+
* @param combatRound The setup for this combat round
|
|
10
|
+
* @param retaliate True if the enemy can retaliate (default), false otherwise
|
|
11
|
+
*/
|
|
12
|
+
fight(combatRound: ICombatSetup<ICombatTurn>, retaliate?: boolean): Promise<void> | void;
|
|
13
|
+
/**
|
|
14
|
+
* Gets a value indicating whether the item is selectable. True when selectable, false otherwise.
|
|
15
|
+
* @param item The item to check.
|
|
16
|
+
*/
|
|
17
|
+
isSelectable(item: IItem): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Gets a value indicating whether an item can target the proposed target. True when so, false
|
|
20
|
+
* otherwise.
|
|
21
|
+
* @param item The item to check the target for.
|
|
22
|
+
* @param target The proposed target.
|
|
23
|
+
* @param character The character whom the item belongs to.
|
|
24
|
+
*/
|
|
25
|
+
canTarget(item: IItem, target: IEnemy | ICharacter, character: ICharacter): boolean;
|
|
26
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICombinationAction } from '../combinations/combinationAction';
|
|
2
|
+
import { ICombinable } from '../combinations/combinable';
|
|
3
|
+
import { ICombineResult } from '../combinations/combineResult';
|
|
4
|
+
export interface ICombinationService {
|
|
5
|
+
combinationActions: ICombinationAction[];
|
|
6
|
+
getCombineClass(tool: ICombinable): string;
|
|
7
|
+
setActiveCombination(combination: ICombinationAction): void;
|
|
8
|
+
tryCombination(target: ICombinable): ICombineResult;
|
|
9
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { IAction, IBarrier, IBarrierAction, IDestination, IFeature, IItem, ILocation, IPerson } from '../../..';
|
|
2
|
+
export interface ICommandService {
|
|
3
|
+
/**
|
|
4
|
+
* Go to the location specified. If you set the saveProgress flag to false, the game progress will NOT be saved.
|
|
5
|
+
* @param location The location to travel to.
|
|
6
|
+
* @param saveProgress Omit if you want to save the game progress, set to false if you don't want to save.
|
|
7
|
+
*/
|
|
8
|
+
go: (location: (() => ILocation) | string, saveProgress?: boolean) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Talk to the specified person at the current location.
|
|
11
|
+
* @param person The person to talk to
|
|
12
|
+
*/
|
|
13
|
+
talk: (person: () => IPerson) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Answer to the specified node. If no reply is specified, the default reply will be used.
|
|
16
|
+
* @param node
|
|
17
|
+
* @param reply
|
|
18
|
+
*/
|
|
19
|
+
answer: (node: string, reply?: string) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Set the specified combination as the active one.
|
|
22
|
+
* @param combination The combination to set as the active one.
|
|
23
|
+
*/
|
|
24
|
+
selectCombination: (combination: string) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Set the specified feature as the currently active tool.
|
|
27
|
+
* @param feature The feature to make the currently active tool.
|
|
28
|
+
*/
|
|
29
|
+
setTool: (feature: (() => IFeature) | string) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Try the combination specified on the target, optionally using the tool.
|
|
32
|
+
* @param combination The combination to try.
|
|
33
|
+
* @param target The target to try the combination on.
|
|
34
|
+
* @param tool The tool to use in the combination.
|
|
35
|
+
*/
|
|
36
|
+
combine: (combination: string, target: (() => IFeature) | string, tool?: (() => IFeature) | string) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Use the action specified at the current location.
|
|
39
|
+
* @param action The action to use
|
|
40
|
+
*/
|
|
41
|
+
useAction: (action: string | [string, IAction]) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Use the barrier action specified on the barrier and destination at the current location.
|
|
44
|
+
* @param destination The destination the barrier is on
|
|
45
|
+
* @param barrier The barrier to use the action on
|
|
46
|
+
* @param action The barrier action to use
|
|
47
|
+
*/
|
|
48
|
+
useBarrierAction: (destination: string | IDestination, barrier: string | [string, IBarrier], action: string | [string, IBarrierAction]) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Trade with the specified person or object at the current location.
|
|
51
|
+
* @param trade The person or object to trade with.
|
|
52
|
+
*/
|
|
53
|
+
trade: (trade: string | (() => IPerson)) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Buy the specified item from the current trader
|
|
56
|
+
* @param item The item to buy
|
|
57
|
+
*/
|
|
58
|
+
buy: (item: (() => IItem)) => void;
|
|
59
|
+
/**
|
|
60
|
+
* Sell the specified item to the current trader
|
|
61
|
+
* @param item The item to sell
|
|
62
|
+
*/
|
|
63
|
+
sell: (item: (() => IItem)) => void;
|
|
64
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IGame } from '../../..';
|
|
2
|
+
export interface IDataService {
|
|
3
|
+
/**
|
|
4
|
+
* Save the specified object using the save key.
|
|
5
|
+
* @param key The key to use to identity this saved state.
|
|
6
|
+
* @param value The value to save.
|
|
7
|
+
*/
|
|
8
|
+
save<T>(key: string, value: T): void;
|
|
9
|
+
/**
|
|
10
|
+
* Loads an object from the specified save key.
|
|
11
|
+
* @param key The key to use to identity the saved state.
|
|
12
|
+
*/
|
|
13
|
+
load<T>(key: string): T;
|
|
14
|
+
/**
|
|
15
|
+
* Remove an object from storage using the save key.
|
|
16
|
+
* @param key The key to use to identity the saved state.
|
|
17
|
+
*/
|
|
18
|
+
remove(key: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Save the game state, using the default state save key or the one supplied.
|
|
21
|
+
* @param game The game to save
|
|
22
|
+
* @param name The name of the save game to create.
|
|
23
|
+
*/
|
|
24
|
+
saveGame(game: IGame, name?: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Gets all the keys of the saved states for the game.
|
|
27
|
+
*/
|
|
28
|
+
getSaveKeys(): string[];
|
|
29
|
+
/**
|
|
30
|
+
* True if there is a saved game state for the game, false otherwise.
|
|
31
|
+
*/
|
|
32
|
+
hasGameState(): boolean;
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IDemoMode, IGame, PlayState } from '../../..';
|
|
2
|
+
export interface IGameService {
|
|
3
|
+
init(): void;
|
|
4
|
+
initDemo(demoConfig: IDemoMode): void;
|
|
5
|
+
startNewGame(characterData: any): void;
|
|
6
|
+
reset(): void;
|
|
7
|
+
restart(skipIntro?: boolean): void;
|
|
8
|
+
loadGame(name: string): void;
|
|
9
|
+
watchPlayState(callBack: (game: IGame, newPlayState: PlayState, oldPlayState: PlayState) => void): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IAutoplayService } from './autoplayService';
|
|
2
|
+
import { ICharacterService } from './characterService';
|
|
3
|
+
import { ICombatService } from './combatService';
|
|
4
|
+
import { ICombinationService } from './combinationService';
|
|
5
|
+
import { ICommandService } from './commandService';
|
|
6
|
+
import { IConversationService } from './conversationService';
|
|
7
|
+
import { IDataSerializer } from './dataSerializer';
|
|
8
|
+
import { IDataService } from './dataService';
|
|
9
|
+
import { IDataSynchronizer } from './dataSynchronizer';
|
|
10
|
+
import { IGameService } from './gameService';
|
|
11
|
+
import { IItemService } from './itemService';
|
|
12
|
+
import { ILocalStorageService } from './localStorageService';
|
|
13
|
+
import { ILocationService } from './locationService';
|
|
14
|
+
import { ISoundService } from './soundService';
|
|
15
|
+
import { ITradeService } from './tradeService';
|
|
16
|
+
export type { IAutoplayService, ICharacterService, ICombatService, ICombinationService, ICommandService, IConversationService, IDataSerializer, IDataService, IDataSynchronizer, IGameService, IItemService, ILocalStorageService, ILocationService, ISoundService, ITradeService };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ICharacter, IEnemy, IGroupableItem, IItem } from '../../..';
|
|
2
|
+
export interface IItemService {
|
|
3
|
+
getItemName(item: IItem): string;
|
|
4
|
+
pickupItem(character: ICharacter, item: IItem): boolean;
|
|
5
|
+
canGroupItem(character: ICharacter, group: IGroupableItem<IItem>, item: IGroupableItem<IItem>): boolean;
|
|
6
|
+
groupItem(character: ICharacter, group: IGroupableItem<IItem>, item: IGroupableItem<IItem>): boolean;
|
|
7
|
+
splitItemGroup(character: ICharacter, item: IGroupableItem<IItem>): void;
|
|
8
|
+
useItem(character: ICharacter, item: IItem, target?: IEnemy): Promise<void> | void;
|
|
9
|
+
isEquippable(item: IItem, character?: ICharacter): boolean;
|
|
10
|
+
equipItem(character: ICharacter, item: IItem): boolean;
|
|
11
|
+
unequipItem(character: ICharacter, item: IItem): boolean;
|
|
12
|
+
canDrop(item: IItem): boolean;
|
|
13
|
+
dropItem(character: ICharacter, item: IItem): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IAction, IGame, ILocation } from '../../..';
|
|
2
|
+
export interface ILocationService {
|
|
3
|
+
init(): void;
|
|
4
|
+
processDestinations(game: IGame): void;
|
|
5
|
+
loadLocationDescriptions(game: IGame): void;
|
|
6
|
+
changeLocation(location: string | (() => ILocation), travel: boolean, game: IGame): void;
|
|
7
|
+
executeAction(action: [string, IAction]): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICharacter, IItem, IPerson, ITrade } from '../../..';
|
|
2
|
+
export interface ITradeService {
|
|
3
|
+
trade(trade: IPerson | ITrade): void;
|
|
4
|
+
canPay(item: IItem, buyer: ITrade | ICharacter, seller: ITrade | ICharacter): boolean;
|
|
5
|
+
actualPrice(item: IItem, buyer: ITrade | ICharacter, seller: ITrade | ICharacter): number;
|
|
6
|
+
displayPrice(item: IItem, actualPrice: number): string;
|
|
7
|
+
buy(item: IItem, trade: ITrade): boolean;
|
|
8
|
+
sell(item: IItem, trade: ITrade): boolean;
|
|
9
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface ISoundPlayer {
|
|
2
|
+
/**
|
|
3
|
+
* Start playing the currently selected music.
|
|
4
|
+
*/
|
|
5
|
+
startMusic(): void;
|
|
6
|
+
/**
|
|
7
|
+
* Stop playing the current music.
|
|
8
|
+
*/
|
|
9
|
+
stopMusic(): void;
|
|
10
|
+
/**
|
|
11
|
+
* Play a sound and optionally call a function when it completes.
|
|
12
|
+
* @param fileName The sound to play.
|
|
13
|
+
* @param completeCallBack The function to call once the sound has played.
|
|
14
|
+
*/
|
|
15
|
+
playSound(fileName: string, completeCallBack?: () => void): void;
|
|
16
|
+
/**
|
|
17
|
+
* Gets the game's sound queue, containing all the sounds that are being played or are yet
|
|
18
|
+
* to be played.
|
|
19
|
+
*/
|
|
20
|
+
soundQueue: Map<number, {
|
|
21
|
+
value: string;
|
|
22
|
+
playing: boolean;
|
|
23
|
+
completeCallBack?: () => void;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Contains a list of files that have been played before. This is used to play files embedded
|
|
27
|
+
* in audio elements that are set to autoplay only once.
|
|
28
|
+
*/
|
|
29
|
+
playedAudio: string[];
|
|
30
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface Sprite {
|
|
2
|
+
/**
|
|
3
|
+
* The path to the animation's sprite sheet. It should be relative to the resources folder.
|
|
4
|
+
*/
|
|
5
|
+
sheet: string;
|
|
6
|
+
/**
|
|
7
|
+
* The width of each animation frame in pixels.
|
|
8
|
+
*/
|
|
9
|
+
width: number;
|
|
10
|
+
/**
|
|
11
|
+
* The height of each animation frame in pixels.
|
|
12
|
+
*/
|
|
13
|
+
height: number;
|
|
14
|
+
/**
|
|
15
|
+
* The number of frames to display.
|
|
16
|
+
*/
|
|
17
|
+
steps: number;
|
|
18
|
+
/**
|
|
19
|
+
* The speed at which to display one iteration through all the animation steps, in seconds. When
|
|
20
|
+
* omitted, a default of 1 second is used.
|
|
21
|
+
*/
|
|
22
|
+
speed?: number;
|
|
23
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GameState } from './enumerations/gameState';
|
|
2
|
+
import { PlayState } from './enumerations/playState';
|
|
3
|
+
import { IGame } from './game';
|
|
4
|
+
import { ILocation } from './location';
|
|
5
|
+
export declare class StateList implements Record<string, StateListEntry> {
|
|
6
|
+
[key: string]: (GameState | PlayState | (() => ILocation) | ((game: IGame) => string) | string)[];
|
|
7
|
+
}
|
|
8
|
+
export declare class StateListEntry extends Array<(GameState | PlayState | (() => ILocation) | ((game: IGame) => string) | string)> {
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Statistics tracked during the game.
|
|
3
|
+
*/
|
|
4
|
+
export interface IStatistics {
|
|
5
|
+
/**
|
|
6
|
+
* The number of enemies the player defeated.
|
|
7
|
+
*/
|
|
8
|
+
enemiesDefeated?: number;
|
|
9
|
+
/**
|
|
10
|
+
* The number of locations the player visited
|
|
11
|
+
* */
|
|
12
|
+
LocationsVisited?: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { IItem } from './item';
|
|
2
|
+
import { IGame } from './game';
|
|
3
|
+
/**
|
|
4
|
+
* The base properties to configure a collection of items available to buy or sell.
|
|
5
|
+
*/
|
|
6
|
+
export interface IStock {
|
|
7
|
+
/**
|
|
8
|
+
* The text for buying or selling the items as shown to the player.
|
|
9
|
+
*/
|
|
10
|
+
text: string;
|
|
11
|
+
/**
|
|
12
|
+
* The text to show to the player when there are no items available for buying or selling.
|
|
13
|
+
*/
|
|
14
|
+
emptyText: string;
|
|
15
|
+
/**
|
|
16
|
+
* A number or a function to generate a number dynamically that is used to modify the price of items to buy or sell.
|
|
17
|
+
* This can be used to e.g. give players a discount when they completed quests for the trader.
|
|
18
|
+
*/
|
|
19
|
+
priceModifier?: number | ((game: IGame) => number);
|
|
20
|
+
/**
|
|
21
|
+
* This function can be used to limit the items selected from the list of items available for the trader or the items
|
|
22
|
+
* the player has that are available for trading. Return true if the item should be included in the list, false otherwise.
|
|
23
|
+
* @param game The game object
|
|
24
|
+
* @param item The item considered for selection.
|
|
25
|
+
*/
|
|
26
|
+
itemSelector?(game: IGame, item: IItem): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The maximum number of items to select for buying or selling using the item selector.
|
|
29
|
+
*/
|
|
30
|
+
maxItems?: number;
|
|
31
|
+
/**
|
|
32
|
+
* The items available for buying or selling.
|
|
33
|
+
*/
|
|
34
|
+
items?: IItem[];
|
|
35
|
+
/**
|
|
36
|
+
* The text shown to ask the user to confirm the buy or sell.
|
|
37
|
+
*/
|
|
38
|
+
confirmationText?: string;
|
|
39
|
+
}
|