@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,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="game.state === GameState.Victory" id="victory" class="container-fluid">
|
|
3
|
+
<div class="col-12">
|
|
4
|
+
<div>
|
|
5
|
+
<h1>{{ texts.youWon }}</h1>
|
|
6
|
+
<div>
|
|
7
|
+
<p>{{ texts.congratulations }}</p>
|
|
8
|
+
</div>
|
|
9
|
+
<div v-if="game.party.score > 0">
|
|
10
|
+
<span>{{ texts.finalScore }}{{ game.party.score }}</span>
|
|
11
|
+
</div>
|
|
12
|
+
<button class="btn btn-primary" type="button" @click="gameService.restart()">
|
|
13
|
+
{{ texts.playAgain }}
|
|
14
|
+
</button>
|
|
15
|
+
</div>
|
|
16
|
+
<high-scores v-if="game.party.score > 0" :scores="game.highScores"></high-scores>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
<script lang="ts" setup>
|
|
21
|
+
import {storeToRefs} from "pinia";
|
|
22
|
+
import {GameState, useStateStore} from 'storyScript';
|
|
23
|
+
|
|
24
|
+
const store = useStateStore();
|
|
25
|
+
const {game} = storeToRefs(store);
|
|
26
|
+
const {texts, gameService} = store.services;
|
|
27
|
+
|
|
28
|
+
</script>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container-fluid menu-bar">
|
|
3
|
+
<div class="row">
|
|
4
|
+
<div :class="{'col-md-7 col-lg-8': isDevelopment, 'col-9': !isDevelopment }">
|
|
5
|
+
<h1>{{ texts.gameName }}</h1>
|
|
6
|
+
</div>
|
|
7
|
+
<div :class="{'col-md-5 col-lg-4': isDevelopment, 'col-3': !isDevelopment }">
|
|
8
|
+
<div v-if="isDevelopment" id="location-selector">
|
|
9
|
+
<input v-if="availableLocations.length > 1"
|
|
10
|
+
ref="locationSelector"
|
|
11
|
+
aria-autocomplete="list"
|
|
12
|
+
autocapitalize="off"
|
|
13
|
+
autocomplete="off"
|
|
14
|
+
class="form-control"
|
|
15
|
+
name="location-selector"
|
|
16
|
+
placeholder="Jump to location..."
|
|
17
|
+
type="text"
|
|
18
|
+
@focus="setShowSelection(true)"
|
|
19
|
+
@focusout="setShowSelection(false)"
|
|
20
|
+
@keyup="search"
|
|
21
|
+
/>
|
|
22
|
+
<ul v-if="showSelection" id="location-selector-locations" :class="showSelection ? 'show' : ''"
|
|
23
|
+
class="dropdown-menu">
|
|
24
|
+
<li v-for="location of selectedLocations.slice(0, maxLocationsShown)"
|
|
25
|
+
class="dropdown-item"
|
|
26
|
+
@click="game.commands.go(location.id)"
|
|
27
|
+
@mouseenter="setActive">{{ location.name }}
|
|
28
|
+
</li>
|
|
29
|
+
<li v-if="selectedLocations.length > maxLocationsShown" class="dropdown-item refine-search">
|
|
30
|
+
<pre>{{ `More than ${maxLocationsShown} locations found.\r\nSearch to reduce the list.` }}</pre>
|
|
31
|
+
</li>
|
|
32
|
+
</ul>
|
|
33
|
+
</div>
|
|
34
|
+
<div :class="{ 'float-none': isDevelopment}" class="menu-buttons">
|
|
35
|
+
<button class="btn btn-dark btn-sm" type="button" @click="game.playState = PlayState.Menu">
|
|
36
|
+
{{ texts.mainMenuShort }}
|
|
37
|
+
</button>
|
|
38
|
+
<button v-if="isDevelopment" id="resetbutton" class="btn btn-danger btn-sm" type="button"
|
|
39
|
+
@click="gameService.reset()">
|
|
40
|
+
{{ texts.resetWorld }}
|
|
41
|
+
</button>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="float-none"></div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script lang="ts" setup>
|
|
50
|
+
import {storeToRefs} from "pinia";
|
|
51
|
+
import {isDevelopment, PlayState, useStateStore} from 'storyScript';
|
|
52
|
+
import {ref, useTemplateRef} from "vue";
|
|
53
|
+
|
|
54
|
+
const maxLocationsShown = 20;
|
|
55
|
+
const store = useStateStore();
|
|
56
|
+
const {game, availableLocations} = storeToRefs(store);
|
|
57
|
+
const {texts, gameService} = store.services;
|
|
58
|
+
|
|
59
|
+
const locationSelector = useTemplateRef('locationSelector');
|
|
60
|
+
const selectedLocations = ref(availableLocations.value);
|
|
61
|
+
const showSelection = ref(false);
|
|
62
|
+
|
|
63
|
+
const setActive = (event: MouseEvent) => {
|
|
64
|
+
const element = event.currentTarget as HTMLElement;
|
|
65
|
+
const allElements = element.parentElement.children;
|
|
66
|
+
|
|
67
|
+
for (const el of allElements) {
|
|
68
|
+
el.classList.remove("active");
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (element.classList.contains('active')) {
|
|
72
|
+
element.classList.remove('active');
|
|
73
|
+
} else {
|
|
74
|
+
element.classList.add('active');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const setShowSelection = (value: boolean) => {
|
|
79
|
+
if (value === false) {
|
|
80
|
+
// When losing focus, set a timeout to allow the click handler to fire!
|
|
81
|
+
setTimeout(() => {
|
|
82
|
+
showSelection.value = value;
|
|
83
|
+
}, 200)
|
|
84
|
+
} else {
|
|
85
|
+
showSelection.value = value;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const search = () => {
|
|
90
|
+
const searchString = locationSelector.value.value.toLowerCase();
|
|
91
|
+
selectedLocations.value = availableLocations.value.filter(l => l.name.toLocaleLowerCase().includes(searchString));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
</script>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="character-backpack" class="box-container">
|
|
3
|
+
<collapsible :headerClass="'box-title'" :text="texts.backpack">
|
|
4
|
+
<ul id="backpack-panel" class="list-unstyled">
|
|
5
|
+
<li v-for="item of character.items">
|
|
6
|
+
<div :class="game.combinations.getCombineClass(item)" class="feature-cursor"
|
|
7
|
+
@click="game.combinations.tryCombine(item)">
|
|
8
|
+
<span>{{ itemService.getItemName(item) }}</span>
|
|
9
|
+
<div id="backpack-button-row" class="inline">
|
|
10
|
+
<button v-if="itemService.isEquippable(item, character) && store.showEquipment(character)"
|
|
11
|
+
class="btn btn-info btn-sm" type="button"
|
|
12
|
+
@click="itemService.equipItem(character, item)">{{ texts.equip }}
|
|
13
|
+
</button>
|
|
14
|
+
<button v-if="hasDescription(item)" class="btn btn-info btn-sm" type="button"
|
|
15
|
+
@click="store.showDescription('item', item, itemService.getItemName(item))">{{ texts.view }}
|
|
16
|
+
</button>
|
|
17
|
+
<button v-if="canUseItem(character, item)" class="btn btn-info btn-sm" type="button"
|
|
18
|
+
@click="itemService.useItem(character, item)">{{ texts.use }}
|
|
19
|
+
</button>
|
|
20
|
+
<button v-if="itemService.canGroupItem(character, joinItem, item as IGroupableItem<IItem>)"
|
|
21
|
+
:class="{ 'btn-primary': item === joinItem, 'btn-outline-secondary': joinItem && item !== joinItem, 'btn-info': !joinItem }"
|
|
22
|
+
class="btn btn-sm"
|
|
23
|
+
type="button"
|
|
24
|
+
@click="groupItem(item as IGroupableItem<IItem>)">{{ texts.groupItem }}
|
|
25
|
+
</button>
|
|
26
|
+
<button v-if="(item as IGroupableItem<IItem>).members?.length > 0" class="btn btn-info btn-sm"
|
|
27
|
+
type="button" @click="itemService.splitItemGroup(character, item as IGroupableItem<IItem>)">
|
|
28
|
+
{{ texts.splitItemGroup }}
|
|
29
|
+
</button>
|
|
30
|
+
<button v-if="useGround && itemService.canDrop(item)" class="btn btn-info btn-sm" type="button"
|
|
31
|
+
@click="itemService.dropItem(character, item)">{{ texts.drop }}
|
|
32
|
+
</button>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</li>
|
|
36
|
+
</ul>
|
|
37
|
+
</collapsible>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
<script lang="ts" setup>
|
|
41
|
+
import {storeToRefs} from "pinia";
|
|
42
|
+
import {hasDescription, ICharacter, IGroupableItem, IItem, useStateStore} from 'storyScript';
|
|
43
|
+
import {ref} from "vue";
|
|
44
|
+
|
|
45
|
+
const store = useStateStore();
|
|
46
|
+
const {game, useGround, useBackpack} = storeToRefs(store);
|
|
47
|
+
const {texts, itemService} = store.services;
|
|
48
|
+
|
|
49
|
+
const {character} = defineProps<{
|
|
50
|
+
character?: ICharacter
|
|
51
|
+
}>();
|
|
52
|
+
|
|
53
|
+
const joinItem = ref<IGroupableItem<IItem>>(null);
|
|
54
|
+
|
|
55
|
+
useBackpack.value = true;
|
|
56
|
+
|
|
57
|
+
const canUseItem = (character: ICharacter, item: IItem): boolean =>
|
|
58
|
+
item.use && (!item.canUse || item.canUse(game.value, character, item));
|
|
59
|
+
|
|
60
|
+
const groupItem = (item: IGroupableItem<IItem>): void => {
|
|
61
|
+
if (joinItem.value && itemService.groupItem(character, joinItem.value, item)) {
|
|
62
|
+
joinItem.value = null;
|
|
63
|
+
} else {
|
|
64
|
+
joinItem.value = item;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
</script>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="create-character" class="container-fluid">
|
|
3
|
+
<div v-for="(step, stepIndex) of sheet.steps" :hidden="sheet.currentStep !== stepIndex">
|
|
4
|
+
<div v-if="step.description" class="step-description" v-html="step.description"></div>
|
|
5
|
+
<div v-for="(question, questionIndex) of step.questions" class="input-group mb-3">
|
|
6
|
+
<div class="input-group-prepend">
|
|
7
|
+
<label :for="getElementId(stepIndex, questionIndex)" class="input-group-text">{{ question.question }}</label>
|
|
8
|
+
</div>
|
|
9
|
+
<select :id="getElementId(stepIndex, questionIndex)" v-model="question.selectedEntry" class="custom-select"
|
|
10
|
+
@change="sheet.nextStep(sheet, false)">
|
|
11
|
+
<option v-for="entry of question.entries" :value="entry">{{ entry.text }}</option>
|
|
12
|
+
</select>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div v-for="attribute of step.attributes">
|
|
16
|
+
<div v-if="attribute.entries.length > 1">
|
|
17
|
+
<span class="attribute-header">{{ attribute.question }}</span>
|
|
18
|
+
</div>
|
|
19
|
+
<div v-for="(entry, attributeIndex) of attribute.entries" class="input-group mb-3">
|
|
20
|
+
<div class="input-group-prepend">
|
|
21
|
+
<label v-if="attribute.entries.length !== 1" :for="getElementId(stepIndex, attributeIndex)"
|
|
22
|
+
class="input-group-text">{{
|
|
23
|
+
texts.titleCase(entry.attribute)
|
|
24
|
+
}}</label>
|
|
25
|
+
<label v-if="attribute.entries.length === 1" :for="getElementId(stepIndex, attributeIndex)"
|
|
26
|
+
class="input-group-text">{{ attribute.question }}</label>
|
|
27
|
+
</div>
|
|
28
|
+
<input v-if="!entry.min && !entry.max" :id="getElementId(stepIndex, attributeIndex)" v-model="entry.value"
|
|
29
|
+
class="form-control" type="text"/>
|
|
30
|
+
<input v-if="entry.min || entry.max"
|
|
31
|
+
:id="getElementId(stepIndex, attributeIndex)"
|
|
32
|
+
v-model="entry.value"
|
|
33
|
+
class="form-control"
|
|
34
|
+
max="{{ entry.max }}"
|
|
35
|
+
min="{{ entry.min }}"
|
|
36
|
+
type="number"
|
|
37
|
+
@blur="characterService.limitSheetInput(parseInt(($event.target as any).value), attribute, entry)"/>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<button v-if="sheet.currentStep < sheet.steps.length - 1 && !sheet.steps[sheet.currentStep].finish"
|
|
42
|
+
:disabled="!characterService.distributionDone(sheet, step)"
|
|
43
|
+
class="btn btn-primary" type="button"
|
|
44
|
+
@click="sheet.nextStep(sheet)">{{ texts.nextQuestion }}
|
|
45
|
+
</button>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
<script lang="ts" setup>
|
|
50
|
+
|
|
51
|
+
import {ICreateCharacter, useStateStore} from 'storyScript';
|
|
52
|
+
|
|
53
|
+
const store = useStateStore();
|
|
54
|
+
const {texts, characterService} = store.services;
|
|
55
|
+
|
|
56
|
+
const {sheet} = defineProps<{
|
|
57
|
+
sheet?: ICreateCharacter
|
|
58
|
+
}>();
|
|
59
|
+
|
|
60
|
+
const getElementId = (stepIndex: number, elementIndex: number) => {
|
|
61
|
+
return `question-${stepIndex}-${elementIndex}`;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
</script>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="character-attributes" class="box-container">
|
|
3
|
+
<collapsible :headerClass="'box-title'" :text="character.name || texts.characterSheet">
|
|
4
|
+
<div class="character-info">
|
|
5
|
+
<div v-if="character.portraitFileName" class="portraitFrame">
|
|
6
|
+
<img :alt="character.name" :src="character.portraitFileName" class="portrait"/>
|
|
7
|
+
</div>
|
|
8
|
+
<ul id="attributes-panel" class="list-unstyled">
|
|
9
|
+
<li v-for="attribute of characterService.getSheetAttributes()">
|
|
10
|
+
{{ texts.titleCase(attribute) }} {{ character[attribute] }}
|
|
11
|
+
</li>
|
|
12
|
+
<li>{{ texts.hitpoints }}
|
|
13
|
+
<div class="hitpoint-editor">
|
|
14
|
+
<span v-if="!isDevelopment">{{ character.currentHitpoints }}</span>
|
|
15
|
+
<input v-else
|
|
16
|
+
v-model="character.currentHitpoints"
|
|
17
|
+
:max="character.hitpoints"
|
|
18
|
+
:min="1"
|
|
19
|
+
name="hitpoint-editor"
|
|
20
|
+
type="number"
|
|
21
|
+
@blur="limitInput($event, character)">
|
|
22
|
+
</div>
|
|
23
|
+
/ {{ character.hitpoints }}
|
|
24
|
+
</li>
|
|
25
|
+
<li v-if="party.characters.length === 1 && party.currency !== undefined">{{ texts.currency }}
|
|
26
|
+
{{ party.currency }}
|
|
27
|
+
</li>
|
|
28
|
+
</ul>
|
|
29
|
+
<div class="clearfix"></div>
|
|
30
|
+
</div>
|
|
31
|
+
</collapsible>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
<script lang="ts" setup>
|
|
35
|
+
import {storeToRefs} from "pinia";
|
|
36
|
+
import {ICharacter, IParty, isDevelopment, useStateStore} from 'storyScript';
|
|
37
|
+
|
|
38
|
+
const store = useStateStore();
|
|
39
|
+
const {useCharacterSheet} = storeToRefs(store);
|
|
40
|
+
const {texts, characterService} = store.services;
|
|
41
|
+
|
|
42
|
+
const {character} = defineProps<{
|
|
43
|
+
party: IParty,
|
|
44
|
+
character?: ICharacter
|
|
45
|
+
}>();
|
|
46
|
+
|
|
47
|
+
useCharacterSheet.value = true;
|
|
48
|
+
|
|
49
|
+
const limitInput = (_: Event, character: ICharacter): void => {
|
|
50
|
+
if (character.currentHitpoints > character.hitpoints) {
|
|
51
|
+
character.currentHitpoints = character.hitpoints;
|
|
52
|
+
} else if (character.currentHitpoints <= 0) {
|
|
53
|
+
character.currentHitpoints = 1;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
</script>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="game.state === 'CreateCharacter'" id="create-character" class="box-container">
|
|
3
|
+
<div class="box-title">{{ titleText() }}</div>
|
|
4
|
+
<build-character :sheet="game.createCharacterSheet"></build-character>
|
|
5
|
+
<button
|
|
6
|
+
v-if="game.createCharacterSheet.currentStep >= game.createCharacterSheet.steps.length - 1 || game.createCharacterSheet.steps[game.createCharacterSheet.currentStep].finish"
|
|
7
|
+
id="start-adventure" :disabled="!characterService.distributionDone(game.createCharacterSheet, null)"
|
|
8
|
+
class="btn btn-primary" type="button"
|
|
9
|
+
@click="gameService.startNewGame(game.createCharacterSheet)">{{ startText() }}
|
|
10
|
+
</button>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
<script lang="ts" setup>
|
|
14
|
+
import {useStateStore} from 'storyScript';
|
|
15
|
+
import {storeToRefs} from "pinia";
|
|
16
|
+
|
|
17
|
+
const store = useStateStore();
|
|
18
|
+
const {game} = storeToRefs(store);
|
|
19
|
+
const {texts, rules, characterService, gameService} = store.services;
|
|
20
|
+
|
|
21
|
+
const titleText = (): string => {
|
|
22
|
+
if (rules.setup.numberOfCharacters > 1) {
|
|
23
|
+
switch (game.value.party.characters.length || 0) {
|
|
24
|
+
case 0:
|
|
25
|
+
return texts.firstCharacter;
|
|
26
|
+
case 1:
|
|
27
|
+
return texts.secondCharacter;
|
|
28
|
+
case 2:
|
|
29
|
+
return texts.thirdCharacter;
|
|
30
|
+
default:
|
|
31
|
+
return texts.format(texts.nthCharacter, [(game.value.party.characters.length + 1).toString()])
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return texts.newGame;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const startText = (): string => {
|
|
39
|
+
if (rules.setup.numberOfCharacters > 1 && (game.value.party.characters.length < rules.setup.numberOfCharacters - 1)) {
|
|
40
|
+
return texts.nextCharacter;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return texts.startAdventure;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
</script>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="store.showEquipment(character)" class="character-equipment box-container">
|
|
3
|
+
<collapsible :headerClass="'box-title'" :text="texts.equipmentHeader">
|
|
4
|
+
<div class="equipment-panel">
|
|
5
|
+
<equipment-slot slot="head" :character="character"></equipment-slot>
|
|
6
|
+
<equipment-slot slot="amulet" :character="character"></equipment-slot>
|
|
7
|
+
<div class="row">
|
|
8
|
+
<div class="col-sm-12 col-md-4">
|
|
9
|
+
<equipment-slot slot="hands" :character="character"></equipment-slot>
|
|
10
|
+
<equipment-slot slot="rightHand" :character="character"></equipment-slot>
|
|
11
|
+
<equipment-slot slot="rightRing" :character="character"></equipment-slot>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="col-sm-12 col-md-4 body-slot">
|
|
14
|
+
<equipment-slot slot="body" :character="character"></equipment-slot>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="col-sm-12 col-md-4">
|
|
17
|
+
<equipment-slot slot="hands" :character="character"></equipment-slot>
|
|
18
|
+
<equipment-slot slot="leftHand" :character="character"></equipment-slot>
|
|
19
|
+
<equipment-slot slot="leftRing" :character="character"></equipment-slot>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<equipment-slot slot="legs" :character="character"></equipment-slot>
|
|
23
|
+
<equipment-slot slot="feet" :character="character"></equipment-slot>
|
|
24
|
+
<equipment-slot v-for="slot of customSlots()" :slot="slot" :character="character"></equipment-slot>
|
|
25
|
+
</div>
|
|
26
|
+
</collapsible>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
<script lang="ts" setup>
|
|
30
|
+
import {storeToRefs} from "pinia";
|
|
31
|
+
import {DefaultEquipment, ICharacter, useStateStore} from 'storyScript';
|
|
32
|
+
|
|
33
|
+
const store = useStateStore();
|
|
34
|
+
const {useEquipment} = storeToRefs(store);
|
|
35
|
+
const {texts} = store.services;
|
|
36
|
+
|
|
37
|
+
const {character} = defineProps<{
|
|
38
|
+
character?: ICharacter
|
|
39
|
+
}>();
|
|
40
|
+
|
|
41
|
+
useEquipment.value = true;
|
|
42
|
+
|
|
43
|
+
const customSlots = (): string[] => {
|
|
44
|
+
const defaultSlots = Object.keys(new DefaultEquipment());
|
|
45
|
+
return Object.keys(character.equipment).filter(e => defaultSlots.indexOf(e) === -1)
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="isSlotUsed(slot)" class="row">
|
|
3
|
+
<div class="col-12">
|
|
4
|
+
<div v-if="!inline">
|
|
5
|
+
{{ texts[slot] }}
|
|
6
|
+
</div>
|
|
7
|
+
<div :class="!inline || character.equipment[slot] ? '' : 'empty-slot'" class="item-box"
|
|
8
|
+
@click="itemService.unequipItem(character, character.equipment[slot])">
|
|
9
|
+
{{ itemService.getItemName(character.equipment[slot]) ?? (inline ? texts[slot] : null) }}
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
import {ICharacter, useStateStore} from 'storyScript';
|
|
16
|
+
|
|
17
|
+
const store = useStateStore();
|
|
18
|
+
const {texts, itemService, characterService} = store.services;
|
|
19
|
+
|
|
20
|
+
const {character, slot} = defineProps<{
|
|
21
|
+
character: ICharacter;
|
|
22
|
+
slot: string;
|
|
23
|
+
inline?: boolean;
|
|
24
|
+
}>();
|
|
25
|
+
|
|
26
|
+
const isSlotUsed = (slot: string | string[]): boolean => {
|
|
27
|
+
const slots = Array.isArray(slot) ? slot : [slot];
|
|
28
|
+
return slots.find(s => characterService.isSlotUsed(character, s)) !== undefined;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="game.state === GameState.LevelUp" id="level-up" class="container-fluid">
|
|
3
|
+
<!-- TODO: how to make this work? -->
|
|
4
|
+
<div v-for="character of game.party.characters">
|
|
5
|
+
<div class="col-12">
|
|
6
|
+
<h2>{{ texts.levelUp }}</h2>
|
|
7
|
+
<p>{{ texts.format(texts.levelUpDescription, [character.level.toString()]) }}</p>
|
|
8
|
+
<build-character :sheet="game.createCharacterSheet"></build-character>
|
|
9
|
+
<button v-if="game.createCharacterSheet.currentStep >= game.createCharacterSheet.steps.length - 1"
|
|
10
|
+
:disabled="!characterService.distributionDone(game.createCharacterSheet, null)"
|
|
11
|
+
class="btn btn-primary"
|
|
12
|
+
type="button"
|
|
13
|
+
@click="characterService.levelUp(character)">{{ texts.completeLevelUp }}
|
|
14
|
+
</button>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
<script lang="ts" setup>
|
|
20
|
+
import {storeToRefs} from "pinia";
|
|
21
|
+
import {GameState, useStateStore} from 'storyScript';
|
|
22
|
+
|
|
23
|
+
const store = useStateStore();
|
|
24
|
+
const {game} = storeToRefs(store);
|
|
25
|
+
const {texts, characterService} = store.services;
|
|
26
|
+
|
|
27
|
+
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="game.party.characters.length > 1" class="box-container">
|
|
3
|
+
<div class="box-title">{{ game.party.name }}</div>
|
|
4
|
+
<ul class="list-unstyled">
|
|
5
|
+
<li>{{ texts.partyCurrency }} {{ game.party.currency }}</li>
|
|
6
|
+
</ul>
|
|
7
|
+
</div>
|
|
8
|
+
<div v-for="character of game.party.characters"
|
|
9
|
+
:class="{ 'is-active': character === activeCharacter, 'unavailable': character.currentHitpoints <= 0 }"
|
|
10
|
+
class="character-container"
|
|
11
|
+
@click="store.setActiveCharacter(character)">
|
|
12
|
+
<character-sheet :character="character" :party="game.party"></character-sheet>
|
|
13
|
+
<equipment :character="character"></equipment>
|
|
14
|
+
<backpack :character="character"></backpack>
|
|
15
|
+
</div>
|
|
16
|
+
<quests :quests="game.party.quests"></quests>
|
|
17
|
+
</template>
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import {useStateStore} from 'storyScript';
|
|
20
|
+
import {storeToRefs} from "pinia";
|
|
21
|
+
import {computed} from "vue";
|
|
22
|
+
|
|
23
|
+
const store = useStateStore();
|
|
24
|
+
const {game} = storeToRefs(store);
|
|
25
|
+
const {texts} = store.services;
|
|
26
|
+
|
|
27
|
+
const activeCharacter = computed(() => game.value.activeCharacter);
|
|
28
|
+
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="!isEmpty(quests)" id="character-quests" class="box-container">
|
|
3
|
+
<collapsible :headerClass="'box-title'" :text="texts.quests">
|
|
4
|
+
<div id="quest-panel">
|
|
5
|
+
<div v-if="showActiveQuests()">
|
|
6
|
+
<h4>{{ texts.currentQuests }}</h4>
|
|
7
|
+
<ul>
|
|
8
|
+
<li v-for="quest of currentQuests()">
|
|
9
|
+
<span>{{ quest.name }}</span>
|
|
10
|
+
<div v-html="characterService.questStatus(quest)"></div>
|
|
11
|
+
</li>
|
|
12
|
+
</ul>
|
|
13
|
+
</div>
|
|
14
|
+
<div v-if="showCompletedQuests()">
|
|
15
|
+
<h4>{{ texts.completedQuests }}</h4>
|
|
16
|
+
<ul>
|
|
17
|
+
<li v-for="quest of completedQuests()">
|
|
18
|
+
<div v-html="characterService.questStatus(quest)"></div>
|
|
19
|
+
</li>
|
|
20
|
+
</ul>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</collapsible>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
<script lang="ts" setup>
|
|
27
|
+
import {storeToRefs} from "pinia";
|
|
28
|
+
import {IQuest, isEmpty, useStateStore} from 'storyScript';
|
|
29
|
+
|
|
30
|
+
const store = useStateStore();
|
|
31
|
+
const {useQuests} = storeToRefs(store);
|
|
32
|
+
const {texts, characterService} = store.services;
|
|
33
|
+
|
|
34
|
+
const {quests} = defineProps<{
|
|
35
|
+
quests?: IQuest[]
|
|
36
|
+
}>();
|
|
37
|
+
|
|
38
|
+
useQuests.value = true;
|
|
39
|
+
|
|
40
|
+
const showActiveQuests = (): boolean => currentQuests().length > 0;
|
|
41
|
+
|
|
42
|
+
const showCompletedQuests = (): boolean => completedQuests().length > 0;
|
|
43
|
+
|
|
44
|
+
const currentQuests = (): IQuest[] => quests.filter(q => q.completed === false);
|
|
45
|
+
|
|
46
|
+
const completedQuests = (): IQuest[] => quests.filter(q => q.completed === true);
|
|
47
|
+
|
|
48
|
+
</script>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="canPlay !== null && !canPlay" class="no-play-container alert alert-warning">
|
|
3
|
+
<p>
|
|
4
|
+
{{ texts.noPlayWarning }}
|
|
5
|
+
</p>
|
|
6
|
+
</div>
|
|
7
|
+
<audio v-if="getCurrentMusic()"
|
|
8
|
+
ref="music-player"
|
|
9
|
+
:src="`resources/${getCurrentMusic()}`"
|
|
10
|
+
autoplay
|
|
11
|
+
class="storyscript-player"
|
|
12
|
+
loop
|
|
13
|
+
muted>
|
|
14
|
+
</audio>
|
|
15
|
+
<audio v-for="sound of getSoundQueue()" v-if="canPlay" :src="`resources/${sound[1]}`"
|
|
16
|
+
autoplay
|
|
17
|
+
class="storyscript-player"
|
|
18
|
+
@ended="soundCompleted(sound[0])">
|
|
19
|
+
</audio>
|
|
20
|
+
</template>
|
|
21
|
+
<script lang="ts" setup>
|
|
22
|
+
import {useTemplateRef, watch} from "vue";
|
|
23
|
+
import {useSound, useStateStore} from 'storyScript';
|
|
24
|
+
|
|
25
|
+
const store = useStateStore();
|
|
26
|
+
const {texts} = store.services;
|
|
27
|
+
const musicPlayer = useTemplateRef('music-player');
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
canPlay,
|
|
31
|
+
getSoundQueue,
|
|
32
|
+
getCurrentMusic,
|
|
33
|
+
soundCompleted
|
|
34
|
+
} = useSound(musicPlayer);
|
|
35
|
+
|
|
36
|
+
watch(canPlay, (newValue) => {
|
|
37
|
+
if (musicPlayer.value) {
|
|
38
|
+
musicPlayer.value.muted = !newValue;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
</script>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {onMounted, Ref, watch} from "vue";
|
|
2
|
+
import {useStateStore} from "ui/StateStore";
|
|
3
|
+
import {storeToRefs} from "pinia";
|
|
4
|
+
import {isTouchDevice} from 'src/constants';
|
|
5
|
+
import {IActiveCombination, ICustomCursor} from 'storyScript';
|
|
6
|
+
|
|
7
|
+
export function useCustomCursor(uiRoot: Ref<HTMLElement>) {
|
|
8
|
+
const cursorRegex = /resources\/[\w-]*\.[a-zA-Z]{3,4}/;
|
|
9
|
+
const rootElement = uiRoot;
|
|
10
|
+
|
|
11
|
+
const store = useStateStore();
|
|
12
|
+
const {game, customCursor, combinationCursor} = storeToRefs(store);
|
|
13
|
+
|
|
14
|
+
watch(() => customCursor.value, (newVal?: ICustomCursor) => {
|
|
15
|
+
if (newVal?.style) {
|
|
16
|
+
game.value.UIRootElement.style.cursor = customCursor.value.style;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
watch(() => game.value.combinations.activeCombination, (newVal?: IActiveCombination) => {
|
|
21
|
+
if (!newVal) {
|
|
22
|
+
Array.from<HTMLElement>(game.value.UIRootElement.querySelectorAll('.feature-cursor')).forEach(e => {
|
|
23
|
+
e.style.cursor = customCursor.value?.style || null;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
onMounted(() => {
|
|
29
|
+
game.value.UIRootElement = rootElement.value.closest('body');
|
|
30
|
+
|
|
31
|
+
game.value.UIRootElement.addEventListener('mouseover', e => {
|
|
32
|
+
setCursorStyle(e.target as HTMLElement);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const setCursorStyle = (element: HTMLElement) => {
|
|
37
|
+
if (isTouchDevice) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
let isDefaultPointer = getComputedStyle(element)?.cursor === 'pointer';
|
|
42
|
+
let cursorStyle = null;
|
|
43
|
+
|
|
44
|
+
if (element.classList.contains('feature-cursor')) {
|
|
45
|
+
const combinationPicture = game.value.combinations.activeCombination?.selectedCombinationAction?.picture;
|
|
46
|
+
|
|
47
|
+
if (combinationPicture) {
|
|
48
|
+
cursorStyle = combinationCursor.value.style.replace(cursorRegex, `resources/${combinationPicture}`);
|
|
49
|
+
} else {
|
|
50
|
+
cursorStyle = customCursor.value?.style || null;
|
|
51
|
+
}
|
|
52
|
+
} else if (isDefaultPointer && customCursor.value) {
|
|
53
|
+
cursorStyle = customCursor.value.style;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (cursorStyle) {
|
|
57
|
+
element.style.cursor = cursorStyle;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|