@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,48 @@
|
|
|
1
|
+
import { IItem } from './item';
|
|
2
|
+
import { IEquipment } from './equipment';
|
|
3
|
+
/**
|
|
4
|
+
* The player character in the StoryScript game.
|
|
5
|
+
*/
|
|
6
|
+
export interface ICharacter {
|
|
7
|
+
/**
|
|
8
|
+
* The name of the player character.
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* The file name of the image to display for the character. The file name should be relative to the index.html file.
|
|
13
|
+
*/
|
|
14
|
+
portraitFileName?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The total health of the player when in top condition.
|
|
17
|
+
*/
|
|
18
|
+
hitpoints: number;
|
|
19
|
+
/**
|
|
20
|
+
* The current health of the player.
|
|
21
|
+
*/
|
|
22
|
+
currentHitpoints: number;
|
|
23
|
+
/**
|
|
24
|
+
* All items the player is carrying in his backpack. Note that equipped items are not in this list.
|
|
25
|
+
*/
|
|
26
|
+
items: IItem[];
|
|
27
|
+
/**
|
|
28
|
+
* All items the character has that can be used during combat.
|
|
29
|
+
*/
|
|
30
|
+
combatItems?: IItem[];
|
|
31
|
+
/**
|
|
32
|
+
* The items the character has equipped.
|
|
33
|
+
*/
|
|
34
|
+
equipment: IEquipment;
|
|
35
|
+
/**
|
|
36
|
+
* The player's experience. This is an optional element, you should track experience in your game rules.
|
|
37
|
+
*/
|
|
38
|
+
experience?: number;
|
|
39
|
+
/**
|
|
40
|
+
* The player character level. This is an optional element, you should track level and take care of level
|
|
41
|
+
* up in your game rules.
|
|
42
|
+
*/
|
|
43
|
+
level?: number;
|
|
44
|
+
/**
|
|
45
|
+
* True when this is the active party character, false otherwise. This is a runtime property managed by StoryScript.
|
|
46
|
+
*/
|
|
47
|
+
isActiveCharacter?: boolean;
|
|
48
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICharacter, ICombatTurn, ICombatWinnings, IEnemy } from '../..';
|
|
2
|
+
export interface ICombatSetup<T extends ICombatTurn> extends Array<T> {
|
|
3
|
+
roundHeader: string;
|
|
4
|
+
noActionText: string;
|
|
5
|
+
round: number;
|
|
6
|
+
characters: ICharacter[];
|
|
7
|
+
enemies: IEnemy[];
|
|
8
|
+
winnings: ICombatWinnings;
|
|
9
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ICharacter } from './character';
|
|
2
|
+
import { IEnemy } from './enemy';
|
|
3
|
+
import { IItem } from './item';
|
|
4
|
+
export interface ICombatTurn {
|
|
5
|
+
/**
|
|
6
|
+
* The character for whom this turn is set up.
|
|
7
|
+
*/
|
|
8
|
+
character: ICharacter;
|
|
9
|
+
/**
|
|
10
|
+
* The enemies and allies available for targeting to the character this turn.
|
|
11
|
+
*/
|
|
12
|
+
targetsAvailable: (IEnemy | ICharacter)[];
|
|
13
|
+
/**
|
|
14
|
+
* The target selected by the character during the previous turn.
|
|
15
|
+
*/
|
|
16
|
+
previousTarget: IEnemy | ICharacter;
|
|
17
|
+
/**
|
|
18
|
+
* The target selected by the character this turn.
|
|
19
|
+
*/
|
|
20
|
+
target: IEnemy | ICharacter;
|
|
21
|
+
/**
|
|
22
|
+
* True when the target was defeated this turn, false otherwise.
|
|
23
|
+
*/
|
|
24
|
+
targetDefeated: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The items available to the character this turn.
|
|
27
|
+
*/
|
|
28
|
+
itemsAvailable: IItem[];
|
|
29
|
+
/**
|
|
30
|
+
* The item selected by the character during the previous turn.
|
|
31
|
+
*/
|
|
32
|
+
previousItem?: IItem;
|
|
33
|
+
/**
|
|
34
|
+
* The item selected by the character this turn.
|
|
35
|
+
*/
|
|
36
|
+
item?: IItem;
|
|
37
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ICombinationAction, ICombinable } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* The currently active combination when playing the game.
|
|
4
|
+
*/
|
|
5
|
+
export interface IActiveCombination {
|
|
6
|
+
/**
|
|
7
|
+
* The action type of the currently active combination.
|
|
8
|
+
*/
|
|
9
|
+
selectedCombinationAction: ICombinationAction;
|
|
10
|
+
/**
|
|
11
|
+
* The currently selected tool of the combination.
|
|
12
|
+
*/
|
|
13
|
+
selectedTool: ICombinable;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ICombinations } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* Defines an object that can participate in combinations.
|
|
4
|
+
*/
|
|
5
|
+
export interface ICombinable {
|
|
6
|
+
/**
|
|
7
|
+
* The id of the object, set at runtime.
|
|
8
|
+
*/
|
|
9
|
+
id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The name of the object.
|
|
12
|
+
*/
|
|
13
|
+
name: string;
|
|
14
|
+
/**
|
|
15
|
+
* The combinations this object type can participate in.
|
|
16
|
+
*/
|
|
17
|
+
combinations?: ICombinations<ICombinable>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ICombinable, ICombinationMatchResult, IGame } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* Combination actions that can be tried in the game, e.g. throwing an object at another object.
|
|
4
|
+
*/
|
|
5
|
+
export interface ICombinationAction {
|
|
6
|
+
/**
|
|
7
|
+
* The text to display for the action in the interface (e.g. 'Look' for 'Look at')
|
|
8
|
+
*/
|
|
9
|
+
text: string;
|
|
10
|
+
/**
|
|
11
|
+
* The preposition to use for the action, e.g. 'at' for 'Look at'. Some actions do not need a preposition, like pull.
|
|
12
|
+
*/
|
|
13
|
+
preposition?: string;
|
|
14
|
+
/**
|
|
15
|
+
* True if the action requires a tool, false otherwise. E.g. 'Look at' does not require a tool
|
|
16
|
+
* (you can just look at something) while 'Throw at' obviously does require something being thrown.
|
|
17
|
+
*/
|
|
18
|
+
requiresTool?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The text to show to the player, or a function returning this text, when a combination attempt for this action fails.
|
|
21
|
+
* @param game The game object
|
|
22
|
+
* @param tool The tool for the combination
|
|
23
|
+
* @param target The target of the combination
|
|
24
|
+
*/
|
|
25
|
+
failText?: string | ((game: IGame, tool: ICombinable, target: ICombinable) => string);
|
|
26
|
+
/**
|
|
27
|
+
* Set this to true to make this action the default. A player doesn't need to select it first to use it. If no combination
|
|
28
|
+
* is active when the player selects a feature, this action will be used.
|
|
29
|
+
*/
|
|
30
|
+
isDefault?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Set this to use a picture for your combinations in addition to a text. For visual features, this will display the picture
|
|
33
|
+
* as mouse cursor when a cursor is available or on top of the features for touch devices.
|
|
34
|
+
*/
|
|
35
|
+
picture?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Set this to have a default match action available. This is useful if you want to have default behaviour for one particular
|
|
38
|
+
* type of action (e.g. Look at).
|
|
39
|
+
*/
|
|
40
|
+
defaultMatch?(game: IGame, target: ICombinable, tool: ICombinable): string | ICombinationMatchResult;
|
|
41
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ICombinationMatchResult {
|
|
2
|
+
/**
|
|
3
|
+
* The result text of the combination match.
|
|
4
|
+
*/
|
|
5
|
+
text: string;
|
|
6
|
+
/**
|
|
7
|
+
* If true, remove the tool feature after the match is made.
|
|
8
|
+
*/
|
|
9
|
+
removeTool?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* If true, remove the target feature after the match is made.
|
|
12
|
+
*/
|
|
13
|
+
removeTarget?: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ICombinable, ICombine, IGame } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* A list of combinations that can be used on an object.
|
|
4
|
+
*/
|
|
5
|
+
export interface ICombinations<T extends ICombinable> {
|
|
6
|
+
/**
|
|
7
|
+
* The combinations available.
|
|
8
|
+
*/
|
|
9
|
+
combine: ICombine<T>[];
|
|
10
|
+
/**
|
|
11
|
+
* The text to show to the player, or a function returning this text, when a combination attempt on this object fails.
|
|
12
|
+
* @param game The game object
|
|
13
|
+
* @param target The target of the combination.
|
|
14
|
+
* @param tool The tool for the combination.
|
|
15
|
+
*/
|
|
16
|
+
failText?: string | ((game: IGame, target: ICombinable, tool: ICombinable) => string);
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ICombinable, ICombinationMatchResult, IGame } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* A combination definition.
|
|
4
|
+
*/
|
|
5
|
+
export interface ICombine<T extends ICombinable> {
|
|
6
|
+
/**
|
|
7
|
+
* The tool for this combination.
|
|
8
|
+
*/
|
|
9
|
+
tool?: T;
|
|
10
|
+
/**
|
|
11
|
+
* The type of the combination, which should match an ICombination text.
|
|
12
|
+
*/
|
|
13
|
+
combinationType: string;
|
|
14
|
+
/**
|
|
15
|
+
* The function to execute when a combination is successful. Return the success text. When omitted,
|
|
16
|
+
* the default match for the combination type will be invoked (when specified).
|
|
17
|
+
* @param game The game object
|
|
18
|
+
* @param target The target of the combination
|
|
19
|
+
* @param tool The tool for the combination
|
|
20
|
+
*/
|
|
21
|
+
match?(game: IGame, target: ICombinable, tool: ICombinable): string | ICombinationMatchResult;
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ICombineResult {
|
|
2
|
+
/**
|
|
3
|
+
* The result text of the combination attempt.
|
|
4
|
+
*/
|
|
5
|
+
text: string;
|
|
6
|
+
/**
|
|
7
|
+
* True if a successful match was made, false otherwise.
|
|
8
|
+
*/
|
|
9
|
+
success: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* If true, remove the tool feature after the match is made.
|
|
12
|
+
*/
|
|
13
|
+
removeTool?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* If true, remove the target feature after the match is made.
|
|
16
|
+
*/
|
|
17
|
+
removeTarget?: boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IActiveCombination, ICombinable, ICombineResult } from '../../..';
|
|
2
|
+
export interface IGameCombinations {
|
|
3
|
+
/**
|
|
4
|
+
* Holds the currently selected combination action during rum-time. This will be undefined or null when the player
|
|
5
|
+
* is not trying a combination.
|
|
6
|
+
*/
|
|
7
|
+
activeCombination: IActiveCombination;
|
|
8
|
+
/**
|
|
9
|
+
* The result from the last attempted combination.
|
|
10
|
+
*/
|
|
11
|
+
combinationResult: {
|
|
12
|
+
/**
|
|
13
|
+
* Indicates whether the combination is done.
|
|
14
|
+
*/
|
|
15
|
+
done: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The combination result text.
|
|
18
|
+
*/
|
|
19
|
+
text: string;
|
|
20
|
+
/**
|
|
21
|
+
* The features to remove.
|
|
22
|
+
*/
|
|
23
|
+
featuresToRemove: string[];
|
|
24
|
+
/**
|
|
25
|
+
* Resets the combination result.
|
|
26
|
+
*/
|
|
27
|
+
reset(): void;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Get the class name to use for the current combine state.
|
|
31
|
+
* @param tool The tool of the combination. Pass this in to get the class name for the tool element. Pass nothing to
|
|
32
|
+
* get the class name for the tool button bar.
|
|
33
|
+
*/
|
|
34
|
+
getCombineClass(tool: ICombinable): string;
|
|
35
|
+
/**
|
|
36
|
+
* Try the combination the player has created.
|
|
37
|
+
* @param target The target of the combination
|
|
38
|
+
*/
|
|
39
|
+
tryCombine(target: ICombinable): ICombineResult;
|
|
40
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ILocation } from './location';
|
|
2
|
+
/**
|
|
3
|
+
* A location compiled for runtime.
|
|
4
|
+
*/
|
|
5
|
+
export interface ICompiledLocation extends ILocation {
|
|
6
|
+
/**
|
|
7
|
+
* The id of the location.
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* The current description shown to the player for this location.
|
|
12
|
+
*/
|
|
13
|
+
description: string;
|
|
14
|
+
/**
|
|
15
|
+
* True if the player has visited this location, false otherwise.
|
|
16
|
+
*/
|
|
17
|
+
hasVisited?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* All the descriptions available for this location, per description key.
|
|
20
|
+
*/
|
|
21
|
+
descriptions?: {
|
|
22
|
+
[key: string]: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The file path for the picture to show for this location. It is read from the location's HTML file's
|
|
26
|
+
* picture tag if present.
|
|
27
|
+
*/
|
|
28
|
+
picture?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Messages logged to this location.
|
|
31
|
+
*/
|
|
32
|
+
log?: string[];
|
|
33
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IConversationLogEntry, IConversationNode, IGame, IPerson } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* A conversation between the player and a person. The nodes are loaded at run-time from the HTML file of the person.
|
|
4
|
+
*/
|
|
5
|
+
export interface IConversation {
|
|
6
|
+
/**
|
|
7
|
+
* The title of the conversation as shown to the player.
|
|
8
|
+
*/
|
|
9
|
+
title?: string;
|
|
10
|
+
/**
|
|
11
|
+
* True if reply options that the player cannot choose are to be displayed but unselectable, false to just hide them.
|
|
12
|
+
*/
|
|
13
|
+
showUnavailableReplies?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The actions that can be triggered from the conversation.
|
|
16
|
+
*/
|
|
17
|
+
actions?: [string, (game: IGame, person: IPerson) => void][];
|
|
18
|
+
/**
|
|
19
|
+
* The nodes that make up this conversation. Loaded from the person HTML at runtime.
|
|
20
|
+
*/
|
|
21
|
+
nodes?: IConversationNode[];
|
|
22
|
+
/**
|
|
23
|
+
* The name of the node to start the conversation with. Set at runtime.
|
|
24
|
+
*/
|
|
25
|
+
startNode?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The node currently active in the conversation.
|
|
28
|
+
*/
|
|
29
|
+
activeNode?: IConversationNode;
|
|
30
|
+
/**
|
|
31
|
+
* A log of the conversation so far.
|
|
32
|
+
*/
|
|
33
|
+
conversationLog?: IConversationLogEntry[];
|
|
34
|
+
/**
|
|
35
|
+
* A semicolon separated list set at runtime of replies that can be selected only once and have been selected by the player.
|
|
36
|
+
*/
|
|
37
|
+
singleRepliesChosen?: string;
|
|
38
|
+
/**
|
|
39
|
+
* When specified, this function will be used to determine what conversation node to set as the active node.
|
|
40
|
+
* @param game The game object
|
|
41
|
+
* @param person The person the player is having the conversation with
|
|
42
|
+
*/
|
|
43
|
+
selectActiveNode?(game: IGame, person: IPerson): IConversationNode;
|
|
44
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IConversationReply } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* A node of a conversation.
|
|
4
|
+
*/
|
|
5
|
+
export interface IConversationNode {
|
|
6
|
+
/**
|
|
7
|
+
* The internal name of the node, used to reference it from code.
|
|
8
|
+
*/
|
|
9
|
+
node: string;
|
|
10
|
+
/**
|
|
11
|
+
* The node text as shown to the player.
|
|
12
|
+
*/
|
|
13
|
+
lines: string;
|
|
14
|
+
/**
|
|
15
|
+
* The possible replies of the player for this node.
|
|
16
|
+
*/
|
|
17
|
+
replies: IConversationReply[];
|
|
18
|
+
/**
|
|
19
|
+
* The action triggered when this node is activated. The trigger string must equal an action in the conversation options.
|
|
20
|
+
*/
|
|
21
|
+
trigger?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for a reply to a node.
|
|
3
|
+
*/
|
|
4
|
+
export interface IConversationReply {
|
|
5
|
+
/**
|
|
6
|
+
* True if this reply is the default reply, available to all nodes. False otherwise.
|
|
7
|
+
*/
|
|
8
|
+
defaultReply?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* specifies an item or a character attribute with a minimum number required for this reply to be available.
|
|
11
|
+
*/
|
|
12
|
+
requires?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The text of this reply as shown to the player.
|
|
15
|
+
*/
|
|
16
|
+
lines?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The node that will continue the conversation if this reply is chosen.
|
|
19
|
+
*/
|
|
20
|
+
linkToNode?: string;
|
|
21
|
+
/**
|
|
22
|
+
* True if the player can select the reply, false otherwise.
|
|
23
|
+
*/
|
|
24
|
+
available?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* True if the player can see the reply even though it is not available to him, false otherwise.
|
|
27
|
+
*/
|
|
28
|
+
showWhenUnavailable?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The action triggered by choosing this response. The trigger string must equal an action in the conversation options.
|
|
31
|
+
*/
|
|
32
|
+
trigger?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The name of the quest to start when this reply is chosen.
|
|
35
|
+
*/
|
|
36
|
+
questStart?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The name of the quest to complete when this reply is chosen.
|
|
39
|
+
*/
|
|
40
|
+
questComplete?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The name of the node to set as the start node when this reply is chosen.
|
|
43
|
+
*/
|
|
44
|
+
setStart?: string;
|
|
45
|
+
/**
|
|
46
|
+
* True if this reply can be chosen only once.
|
|
47
|
+
*/
|
|
48
|
+
once?: boolean;
|
|
49
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ICreateCharacterStep } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* The definition of the sheet to create a character for the game.
|
|
4
|
+
*/
|
|
5
|
+
export interface ICreateCharacter {
|
|
6
|
+
/**
|
|
7
|
+
* The steps in the character creation process.
|
|
8
|
+
*/
|
|
9
|
+
steps: ICreateCharacterStep[];
|
|
10
|
+
/**
|
|
11
|
+
* The currently active step.
|
|
12
|
+
*/
|
|
13
|
+
currentStep?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The function that will select the next step in the character creation process. This function is added by the engine at run-time.
|
|
16
|
+
* @param character The character sheet filled in so far
|
|
17
|
+
* @param next True if the next step is to be triggered, false otherwise. Defaults to true.
|
|
18
|
+
*/
|
|
19
|
+
nextStep?(character: ICreateCharacter, next?: boolean): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ICreateCharacterAttributeEntry } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* An attribute entry for a create character question.
|
|
4
|
+
*/
|
|
5
|
+
export interface ICreateCharacterAttribute {
|
|
6
|
+
/**
|
|
7
|
+
* The text for the attribute selection as displayed to the player.
|
|
8
|
+
*/
|
|
9
|
+
question: string;
|
|
10
|
+
/**
|
|
11
|
+
* The total number to be distributed among the entries.
|
|
12
|
+
*/
|
|
13
|
+
numberOfPointsToDistribute?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The attributes to distribute the points for.
|
|
16
|
+
*/
|
|
17
|
+
entries: ICreateCharacterAttributeEntry[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ICreateCharacterAttributeEntry {
|
|
2
|
+
/**
|
|
3
|
+
* The attribute text as displayed to the player.
|
|
4
|
+
*/
|
|
5
|
+
attribute: string;
|
|
6
|
+
/**
|
|
7
|
+
* The value of the attribute.
|
|
8
|
+
*/
|
|
9
|
+
value?: number | string;
|
|
10
|
+
/**
|
|
11
|
+
* The minimum number the attribute should have.
|
|
12
|
+
*/
|
|
13
|
+
min?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The maximum number the attribute is allowed to have.
|
|
16
|
+
*/
|
|
17
|
+
max?: number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ICreateCharacterQuestionEntry } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* A question for the player to answer when creating a character.
|
|
4
|
+
*/
|
|
5
|
+
export interface ICreateCharacterQuestion {
|
|
6
|
+
/**
|
|
7
|
+
* The question text as displayed to the player.
|
|
8
|
+
*/
|
|
9
|
+
question: string;
|
|
10
|
+
/**
|
|
11
|
+
* The available replies to the question.
|
|
12
|
+
*/
|
|
13
|
+
entries: ICreateCharacterQuestionEntry[];
|
|
14
|
+
/**
|
|
15
|
+
* The currently selected entry. Used during run-time.
|
|
16
|
+
*/
|
|
17
|
+
selectedEntry?: ICreateCharacterQuestionEntry;
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An answer to a character creation question.
|
|
3
|
+
*/
|
|
4
|
+
export interface ICreateCharacterQuestionEntry {
|
|
5
|
+
/**
|
|
6
|
+
* The answer text as displayed to the player.
|
|
7
|
+
*/
|
|
8
|
+
text: string;
|
|
9
|
+
/**
|
|
10
|
+
* The value of the entry, which should be a character attribute that the bonus will be applied to.
|
|
11
|
+
*/
|
|
12
|
+
value: string;
|
|
13
|
+
/**
|
|
14
|
+
* The bonus to apply to the character attribute when this answer is chosen.
|
|
15
|
+
*/
|
|
16
|
+
bonus?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Set this flag to true to make this choice finish character creation.
|
|
19
|
+
* This allows building a branched character creation process.
|
|
20
|
+
*/
|
|
21
|
+
finish?: boolean;
|
|
22
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ICreateCharacter, ICreateCharacterAttribute, ICreateCharacterQuestion, IParty } from '../../..';
|
|
2
|
+
/**
|
|
3
|
+
* The definition of a step in the character creation process.
|
|
4
|
+
*/
|
|
5
|
+
export interface ICreateCharacterStep {
|
|
6
|
+
/**
|
|
7
|
+
* The text describing this step in the creation process to the player.
|
|
8
|
+
*/
|
|
9
|
+
description?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The questions to show as part of this step.
|
|
12
|
+
*/
|
|
13
|
+
questions?: ICreateCharacterQuestion[];
|
|
14
|
+
/**
|
|
15
|
+
* The attributes to show as part of this step.
|
|
16
|
+
*/
|
|
17
|
+
attributes?: ICreateCharacterAttribute[];
|
|
18
|
+
/**
|
|
19
|
+
* The total numner of points to distribute over multiple attributes.
|
|
20
|
+
*/
|
|
21
|
+
numberOfAttributePoints?: number;
|
|
22
|
+
/**
|
|
23
|
+
* The selector that determines what step will be activated after the current one.
|
|
24
|
+
* Either pass the number of the step or a function returning that number.
|
|
25
|
+
*/
|
|
26
|
+
nextStepSelector?: number | ((party: IParty, character: ICreateCharacter, currentStep: ICreateCharacterStep) => number);
|
|
27
|
+
/**
|
|
28
|
+
* Set this flag to true to mark this step as one of the final steps in character creation.
|
|
29
|
+
* This allows building a branched character creation process.
|
|
30
|
+
*/
|
|
31
|
+
finish?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* A function that executes when the step is to be displayed to the player.
|
|
34
|
+
* @param party The party created so far
|
|
35
|
+
* @param character The character sheet filled in so far
|
|
36
|
+
* @param currentStep The step about to be shown to the player
|
|
37
|
+
* @param previousStep The step just completed by the player, or undefined if the step to be displayed is the first step in the sheet.
|
|
38
|
+
*/
|
|
39
|
+
initStep?(party: IParty, character: ICreateCharacter, currentStep: ICreateCharacterStep, previousStep?: number): void;
|
|
40
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IEquipment } from './equipment';
|
|
2
|
+
import { IItem } from './item';
|
|
3
|
+
/**
|
|
4
|
+
* This class is for internal StoryScript use only, to determine which equipment slots belong
|
|
5
|
+
* to the default ones and which are custom for a game.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DefaultEquipment implements IEquipment {
|
|
8
|
+
constructor();
|
|
9
|
+
head: IItem;
|
|
10
|
+
amulet: IItem;
|
|
11
|
+
body: IItem;
|
|
12
|
+
hands: IItem;
|
|
13
|
+
leftHand: IItem;
|
|
14
|
+
leftRing: IItem;
|
|
15
|
+
rightHand: IItem;
|
|
16
|
+
rightRing: IItem;
|
|
17
|
+
legs: IItem;
|
|
18
|
+
feet: IItem;
|
|
19
|
+
}
|