@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,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All game texts that can be customized.
|
|
3
|
+
*/
|
|
4
|
+
export interface IInterfaceTexts {
|
|
5
|
+
equipmentHeader?: string;
|
|
6
|
+
head?: string;
|
|
7
|
+
amulet?: string;
|
|
8
|
+
body?: string;
|
|
9
|
+
hands?: string;
|
|
10
|
+
rightHand?: string;
|
|
11
|
+
leftHand?: string;
|
|
12
|
+
rightRing?: string;
|
|
13
|
+
leftRing?: string;
|
|
14
|
+
legs?: string;
|
|
15
|
+
feet?: string;
|
|
16
|
+
backpack?: string;
|
|
17
|
+
equip?: string;
|
|
18
|
+
use?: string;
|
|
19
|
+
drop?: string;
|
|
20
|
+
enemies?: string;
|
|
21
|
+
fight?: string;
|
|
22
|
+
attack?: string;
|
|
23
|
+
attackWith?: string;
|
|
24
|
+
aid?: string;
|
|
25
|
+
aidWith?: string;
|
|
26
|
+
noWeapon?: string;
|
|
27
|
+
useCombatItem?: string;
|
|
28
|
+
combatRound?: string;
|
|
29
|
+
enemyHitpoints?: string;
|
|
30
|
+
enemyCombatName?: string;
|
|
31
|
+
characterHitpoints?: string;
|
|
32
|
+
newGame?: string;
|
|
33
|
+
firstCharacter?: string;
|
|
34
|
+
secondCharacter?: string;
|
|
35
|
+
thirdCharacter?: string;
|
|
36
|
+
nthCharacter?: string;
|
|
37
|
+
nextCharacter?: string;
|
|
38
|
+
yourName?: string;
|
|
39
|
+
startAdventure?: string;
|
|
40
|
+
nextQuestion?: string;
|
|
41
|
+
actions?: string;
|
|
42
|
+
destinations?: string;
|
|
43
|
+
back?: string;
|
|
44
|
+
onTheGround?: string;
|
|
45
|
+
youLost?: string;
|
|
46
|
+
questFailed?: string;
|
|
47
|
+
finalScore?: string;
|
|
48
|
+
tryAgain?: string;
|
|
49
|
+
highScores?: string;
|
|
50
|
+
youWon?: string;
|
|
51
|
+
congratulations?: string;
|
|
52
|
+
playAgain?: string;
|
|
53
|
+
startOver?: string;
|
|
54
|
+
resetWorld?: string;
|
|
55
|
+
gameName?: string;
|
|
56
|
+
saveGame?: string;
|
|
57
|
+
save?: string;
|
|
58
|
+
loadGame?: string;
|
|
59
|
+
load?: string;
|
|
60
|
+
loading?: string;
|
|
61
|
+
youAreHere?: string;
|
|
62
|
+
messages?: string;
|
|
63
|
+
hitpoints?: string;
|
|
64
|
+
currency?: string;
|
|
65
|
+
partyCurrency?: string;
|
|
66
|
+
trade?: string;
|
|
67
|
+
talk?: string;
|
|
68
|
+
examine?: string;
|
|
69
|
+
encounters?: string;
|
|
70
|
+
closeModal?: string;
|
|
71
|
+
combatTitle?: string;
|
|
72
|
+
value?: string;
|
|
73
|
+
traderCurrency?: string;
|
|
74
|
+
startCombat?: string;
|
|
75
|
+
combatWin?: string;
|
|
76
|
+
enemiesToFight?: string;
|
|
77
|
+
useInCombat?: string;
|
|
78
|
+
noCombatAction?: string;
|
|
79
|
+
view?: string;
|
|
80
|
+
quests?: string;
|
|
81
|
+
currentQuests?: string;
|
|
82
|
+
completedQuests?: string;
|
|
83
|
+
combinations?: string;
|
|
84
|
+
tryCombination?: string;
|
|
85
|
+
noCombination?: string;
|
|
86
|
+
noCombinationNoTool?: string;
|
|
87
|
+
levelUp?: string;
|
|
88
|
+
levelUpDescription?: string;
|
|
89
|
+
completeLevelUp?: string;
|
|
90
|
+
newSaveGame?: string;
|
|
91
|
+
existingSaveGames?: string;
|
|
92
|
+
overwriteSaveGame?: string;
|
|
93
|
+
loadSaveGame?: string;
|
|
94
|
+
characterSheet?: string;
|
|
95
|
+
skipIntro?: string;
|
|
96
|
+
mainMenu?: string;
|
|
97
|
+
mainMenuShort?: string;
|
|
98
|
+
confirmRestart?: string;
|
|
99
|
+
restartCancelled?: string;
|
|
100
|
+
restartConfirmed?: string;
|
|
101
|
+
cancel?: string;
|
|
102
|
+
groupItem?: string;
|
|
103
|
+
splitItemGroup?: string;
|
|
104
|
+
worldProperties?: any;
|
|
105
|
+
confirmAction?: string;
|
|
106
|
+
cancelAction?: string;
|
|
107
|
+
stockItemDisplayText?: string;
|
|
108
|
+
buyConfirmationText?: string;
|
|
109
|
+
confirmBuy?: string;
|
|
110
|
+
cancelBuy?: string;
|
|
111
|
+
sellConfirmationText?: string;
|
|
112
|
+
confirmSell?: string;
|
|
113
|
+
cancelSell?: string;
|
|
114
|
+
currencyWon?: string;
|
|
115
|
+
itemsTaken?: string;
|
|
116
|
+
enemiesDefeated?: string;
|
|
117
|
+
backToGame?: string;
|
|
118
|
+
conversationEnded?: string;
|
|
119
|
+
openFullScreenMap?: string;
|
|
120
|
+
closeFullScreenMap?: string;
|
|
121
|
+
pressToShowMarkers?: string;
|
|
122
|
+
touchToShowMarkers?: string;
|
|
123
|
+
startGame?: string;
|
|
124
|
+
continueGame?: string;
|
|
125
|
+
autoplayText?: string;
|
|
126
|
+
noPlayWarning?: string;
|
|
127
|
+
/**
|
|
128
|
+
* A function to build text replacing tokens in a template, e.g. 'it is {0}, {1}' with parameters 'day' and '12:00' becomes 'it is day, 12:00'.
|
|
129
|
+
* If no function is specified, a default implementation is used.
|
|
130
|
+
* @param template The text template to replace the tokens in
|
|
131
|
+
* @param tokens The tokens to add to the template
|
|
132
|
+
*/
|
|
133
|
+
format?(template: string, tokens: string[]): string;
|
|
134
|
+
/**
|
|
135
|
+
* A function to format a text using title case, e.g. 'world map' becomes 'World Map'.
|
|
136
|
+
* If no function is specified, a default implementation is used.
|
|
137
|
+
* @param text The text to format
|
|
138
|
+
*/
|
|
139
|
+
titleCase?(text: string): string;
|
|
140
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { IFeature } from './feature';
|
|
2
|
+
import { IEnemy } from './enemy';
|
|
3
|
+
import { IGame } from './game';
|
|
4
|
+
import { EquipmentType } from './enumerations/equipmentType';
|
|
5
|
+
import { IEquipment } from './equipment';
|
|
6
|
+
import { ICharacter } from './character';
|
|
7
|
+
import { TargetType } from './enumerations/targetType';
|
|
8
|
+
/**
|
|
9
|
+
* An item that can be found in the game and used by the character.
|
|
10
|
+
*/
|
|
11
|
+
export interface IItem extends IFeature {
|
|
12
|
+
/**
|
|
13
|
+
* One or more parts of the character body this item is for (or no part, in case of a miscellaneous item).
|
|
14
|
+
* Use string values only for custom equipment types.
|
|
15
|
+
*/
|
|
16
|
+
equipmentType: EquipmentType | EquipmentType[] | string | string[];
|
|
17
|
+
/**
|
|
18
|
+
* True if the item uses all the slots specified by the equipment type array, false if it occupies only one.
|
|
19
|
+
*/
|
|
20
|
+
usesMultipleSlots?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Set the target type for the item if the item needs to be used on a target. For example, a weapon targets
|
|
23
|
+
* an enemy, while a healing spell will target an ally. If the target type is not specified, the item cannot
|
|
24
|
+
* be used on enemies or allies.
|
|
25
|
+
*/
|
|
26
|
+
targetType?: TargetType;
|
|
27
|
+
/**
|
|
28
|
+
* The details about this item as displayed to the player. If you use an HTML-page to describe the item, the contents of that HTM-page
|
|
29
|
+
* will be used to set this property at run-time.
|
|
30
|
+
*/
|
|
31
|
+
description?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The number of times the item can be used before disappearing. If not specified, the item can be used indefinitely.
|
|
34
|
+
*/
|
|
35
|
+
charges?: number;
|
|
36
|
+
/**
|
|
37
|
+
* When this flag is set to true or the function returns true and the item has a use function specified, the use action will also be
|
|
38
|
+
* available during combat.
|
|
39
|
+
*/
|
|
40
|
+
useInCombat?: boolean | ((item: IItem, equipment: IEquipment) => boolean);
|
|
41
|
+
/**
|
|
42
|
+
* When this flag is set to false, the item is not selectable. This is used to allow items to be unselectable during combat,
|
|
43
|
+
* for example when you want items to be available only during certain rounds.
|
|
44
|
+
*/
|
|
45
|
+
selectable?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The value of the item in whatever credits are used in the game.
|
|
48
|
+
*/
|
|
49
|
+
value?: number;
|
|
50
|
+
/**
|
|
51
|
+
* When this flag is set to true, the item is not shown to the player. Useful to only conditionally make items available on a location.
|
|
52
|
+
*/
|
|
53
|
+
inactive?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* When this is a flag set to true or has a function that returns true, the item cannot be dropped by the player. This is useful to
|
|
56
|
+
* have items that should not be dropped, such as an adventure map.
|
|
57
|
+
*/
|
|
58
|
+
canDrop?: boolean | ((game: IGame, item: IItem) => boolean);
|
|
59
|
+
/**
|
|
60
|
+
* When specified, this function will be executed when the item is equipped by the player.
|
|
61
|
+
* @param character The character equipping the item
|
|
62
|
+
* @param item The item to be equipped
|
|
63
|
+
* @param game The game object
|
|
64
|
+
*/
|
|
65
|
+
equip?(character: ICharacter, item: IItem, game: IGame): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* When specified, this function will be executed when the item is unequipped by the player.
|
|
68
|
+
* @param character The character unequipping the item
|
|
69
|
+
* @param item The item to be unequipped
|
|
70
|
+
* @param game The game object
|
|
71
|
+
*/
|
|
72
|
+
unequip?(character: ICharacter, item: IItem, game: IGame): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* When specified, this item can be used and a use action becomes available on the item. The function will be executed when the player
|
|
75
|
+
* executes this action. Return a promise if the result should be awaited.
|
|
76
|
+
* @param game The game object
|
|
77
|
+
* @param character The character that uses the item
|
|
78
|
+
* @param item The item to use
|
|
79
|
+
* @param target The target to use the item on, if any
|
|
80
|
+
*/
|
|
81
|
+
use?(game: IGame, character: ICharacter, item: IItem, target?: IEnemy): Promise<void> | void;
|
|
82
|
+
/**
|
|
83
|
+
* When specified, this action determines whether the use action for an item will be shown.
|
|
84
|
+
* @param game The game object
|
|
85
|
+
* @param character The character that wants to use the item
|
|
86
|
+
* @param item The item to show the use action for
|
|
87
|
+
*/
|
|
88
|
+
canUse?(game: IGame, character: ICharacter, item: IItem): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* When specified, this action determines whether the item can be used on the requested target.
|
|
91
|
+
* @param game The game object
|
|
92
|
+
* @param item The item to check the target for
|
|
93
|
+
* @param target The target on which the item would be used
|
|
94
|
+
*/
|
|
95
|
+
canTarget?(game: IGame, item: IItem, target: IEnemy | ICharacter): boolean;
|
|
96
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IItem } from './item';
|
|
2
|
+
import { IBarrierAction } from './barrierAction';
|
|
3
|
+
/**
|
|
4
|
+
* A special kind of item, that can remove a barrier.
|
|
5
|
+
*/
|
|
6
|
+
export interface IKey extends IItem {
|
|
7
|
+
/**
|
|
8
|
+
* Set this flag to true if the player keeps the key after using it. Otherwise, it will be removed from his
|
|
9
|
+
* inventory when used.
|
|
10
|
+
*/
|
|
11
|
+
keepAfterUse?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The action triggered when using the key to remove the barrier.
|
|
14
|
+
*/
|
|
15
|
+
open: IBarrierAction;
|
|
16
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { IGame } from './game';
|
|
2
|
+
import { IAction } from './action';
|
|
3
|
+
import { IFeatureCollection } from './featureCollection';
|
|
4
|
+
import { IEnemy } from './enemy';
|
|
5
|
+
import { IPerson } from './person';
|
|
6
|
+
import { IItem } from './item';
|
|
7
|
+
import { IDestination } from './destination';
|
|
8
|
+
import { ITrade } from './trade';
|
|
9
|
+
/**
|
|
10
|
+
* The base properties for a part of the game world. A StoryScript game world is made up of a collection of locations.
|
|
11
|
+
*/
|
|
12
|
+
export interface ILocation {
|
|
13
|
+
/**
|
|
14
|
+
* The name of the location as shown to the player.
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* The location description HTML file.
|
|
19
|
+
*/
|
|
20
|
+
description: string;
|
|
21
|
+
/**
|
|
22
|
+
* When specified, the functions in this array will be called when the player enters the location.
|
|
23
|
+
* If nothing or false is returned, the function will be removed once it completed. Return true
|
|
24
|
+
* to keep the function and call it every time the player enters the location.
|
|
25
|
+
*/
|
|
26
|
+
enterEvents?: [string, (game: IGame) => void | boolean][];
|
|
27
|
+
/**
|
|
28
|
+
* When specified, the functions in this array will be called when the player leaves the location.
|
|
29
|
+
* If nothing or false is returned, the function will be removed once it completed. Return true
|
|
30
|
+
* to keep the function and call it every time the player leaves the location.
|
|
31
|
+
*/
|
|
32
|
+
leaveEvents?: [string, (game: IGame) => void | boolean][];
|
|
33
|
+
/**
|
|
34
|
+
* Actions that the player can perform at this location.
|
|
35
|
+
*/
|
|
36
|
+
actions?: [string, IAction][];
|
|
37
|
+
/**
|
|
38
|
+
* Actions that the player can perform at this location when in combat.
|
|
39
|
+
*/
|
|
40
|
+
combatActions?: [string, IAction][];
|
|
41
|
+
/**
|
|
42
|
+
* When specified, the functions in this array will be called from text features or user code when
|
|
43
|
+
* the trigger that should activate them is activated.
|
|
44
|
+
*/
|
|
45
|
+
triggeredActions?: [string, (game: IGame, activate: boolean, data: Record<string, string>) => void][];
|
|
46
|
+
/**
|
|
47
|
+
* When specified, this function is called to determine the selector for the description of this location. Useful for dynamically
|
|
48
|
+
* setting a location's description. If you want to have a description selector function for all locations, use the descriptionSelector
|
|
49
|
+
* function of the game rules. Return the selector string.
|
|
50
|
+
* @param game The game object
|
|
51
|
+
*/
|
|
52
|
+
descriptionSelector?: ((game: IGame) => string) | string;
|
|
53
|
+
/**
|
|
54
|
+
* The features of this location that the player can interact with.
|
|
55
|
+
*/
|
|
56
|
+
features?: IFeatureCollection;
|
|
57
|
+
/**
|
|
58
|
+
* The enemies that occupy this location.
|
|
59
|
+
*/
|
|
60
|
+
enemies?: IEnemy[];
|
|
61
|
+
/**
|
|
62
|
+
* The characters at this location that the player can interact with.
|
|
63
|
+
*/
|
|
64
|
+
persons?: IPerson[];
|
|
65
|
+
/**
|
|
66
|
+
* The items that can be found at this location.
|
|
67
|
+
*/
|
|
68
|
+
items?: IItem[];
|
|
69
|
+
/**
|
|
70
|
+
* The other locations in the game world that can be reached from this one.
|
|
71
|
+
*/
|
|
72
|
+
destinations?: IDestination[];
|
|
73
|
+
/**
|
|
74
|
+
* Trade objects present at this location. If you don't want to use persons to trade with, you can use this array.
|
|
75
|
+
* Useful for e.g. adding containers like chests to the game.
|
|
76
|
+
*/
|
|
77
|
+
trade?: ITrade[];
|
|
78
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IMapLocation } from '../../..';
|
|
2
|
+
export interface IMap {
|
|
3
|
+
/**
|
|
4
|
+
* The name of this map.
|
|
5
|
+
*/
|
|
6
|
+
name: string;
|
|
7
|
+
/**
|
|
8
|
+
* The image to use for this map.
|
|
9
|
+
*/
|
|
10
|
+
mapImage: string;
|
|
11
|
+
/**
|
|
12
|
+
* The locations that are part of this map.
|
|
13
|
+
*/
|
|
14
|
+
locations: IMapLocation[];
|
|
15
|
+
/**
|
|
16
|
+
* The image to use for the player location on the map, if any.
|
|
17
|
+
*/
|
|
18
|
+
avatarImage?: string;
|
|
19
|
+
/**
|
|
20
|
+
* True if text markers with the location names should be shown on the map, false otherwise.
|
|
21
|
+
*/
|
|
22
|
+
locationNamesAsTextMarkers: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The default image to use as a marker for locations on the map.
|
|
25
|
+
*/
|
|
26
|
+
locationMarkerImage?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The time it takes for transitions on the map to complete. This is used to display elements like the avatar
|
|
29
|
+
* only after all transitions are finished. Defaults to 1000 ms.
|
|
30
|
+
*/
|
|
31
|
+
transitionTime?: number;
|
|
32
|
+
/**
|
|
33
|
+
* True if location markers on the map can be clicked to navigate to that location, falsy otherwise.
|
|
34
|
+
*/
|
|
35
|
+
clickable?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The JavaScript KeyboardEvent.key value to listen for before showing the location markers. If not set, the markers
|
|
38
|
+
* will be shown all the time. If set, they will show only when the specified key is pressed.
|
|
39
|
+
*/
|
|
40
|
+
showMarkersOnKeyPress?: string;
|
|
41
|
+
/**
|
|
42
|
+
* True if you want to show a toggle behind the map name to show the map full screen in a dialog, falsy otherwise.
|
|
43
|
+
*/
|
|
44
|
+
toggleFullScreen?: boolean;
|
|
45
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ILocation } from '../../..';
|
|
2
|
+
export interface IMapLocation {
|
|
3
|
+
/**
|
|
4
|
+
* The pointer to the location. This will be replaced with the location id during runtime.
|
|
5
|
+
*/
|
|
6
|
+
location: (() => ILocation) | string;
|
|
7
|
+
/**
|
|
8
|
+
* The coordinates of this location on the map. use the format '{left},{top}'.
|
|
9
|
+
*/
|
|
10
|
+
coords?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The specific image to show for this location, if any.
|
|
13
|
+
*/
|
|
14
|
+
markerImage?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The specific text to show on this location label, if any.
|
|
17
|
+
*/
|
|
18
|
+
textLabel?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Set during runtime to contain the HTML element of the text label or marker image.
|
|
21
|
+
*/
|
|
22
|
+
markerElement?: HTMLElement;
|
|
23
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ICharacter } from './character';
|
|
2
|
+
import { IQuest } from './quest';
|
|
3
|
+
export interface IParty {
|
|
4
|
+
/**
|
|
5
|
+
* The name of the party.
|
|
6
|
+
*/
|
|
7
|
+
name?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The members of the party.
|
|
10
|
+
*/
|
|
11
|
+
characters: ICharacter[];
|
|
12
|
+
/**
|
|
13
|
+
* The amount of credits the party has, in whatever form.
|
|
14
|
+
*/
|
|
15
|
+
currency?: number;
|
|
16
|
+
/**
|
|
17
|
+
* All the quests the party has accepted, both active and complete.
|
|
18
|
+
*/
|
|
19
|
+
quests?: IQuest[];
|
|
20
|
+
/**
|
|
21
|
+
* The number of points scored by the party so far. This property should be managed in your game rules. The score will
|
|
22
|
+
* be used to determine the party's ranking in the high-score list on game end.
|
|
23
|
+
*/
|
|
24
|
+
score?: number;
|
|
25
|
+
/**
|
|
26
|
+
* The id of the location in the game world the party is currently at.
|
|
27
|
+
*/
|
|
28
|
+
currentLocationId?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The id of the location in the game world the party visited before the current one.
|
|
31
|
+
*/
|
|
32
|
+
previousLocationId?: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IEnemy } from './enemy';
|
|
2
|
+
import { ITrade } from './trade';
|
|
3
|
+
import { IQuest } from './quest';
|
|
4
|
+
import { IConversation } from './conversations/conversation';
|
|
5
|
+
/**
|
|
6
|
+
* The base properties of a character in the game the player can talk or trade with.
|
|
7
|
+
*/
|
|
8
|
+
export interface IPerson extends IEnemy {
|
|
9
|
+
/**
|
|
10
|
+
* True if the player can attack the character, false otherwise.
|
|
11
|
+
*/
|
|
12
|
+
canAttack?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The trade settings for the person.
|
|
15
|
+
*/
|
|
16
|
+
trade?: ITrade;
|
|
17
|
+
/**
|
|
18
|
+
* The conversation options for the person.
|
|
19
|
+
*/
|
|
20
|
+
conversation?: IConversation;
|
|
21
|
+
/**
|
|
22
|
+
* The quests this person has available.
|
|
23
|
+
*/
|
|
24
|
+
quests?: IQuest[];
|
|
25
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { IPerson } from './person';
|
|
2
|
+
import { IGame } from './game';
|
|
3
|
+
/**
|
|
4
|
+
* A quest a player can complete.
|
|
5
|
+
*/
|
|
6
|
+
export interface IQuest {
|
|
7
|
+
/**
|
|
8
|
+
* The name of the quest as shown to the player.
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* The id of the person the player is pursuing this quest for.
|
|
13
|
+
*/
|
|
14
|
+
issuedBy?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The quest status, either as a string or a function that can produce a quest status dynamically.
|
|
17
|
+
*/
|
|
18
|
+
status: string | ((game: IGame, quest: IQuest, done: boolean) => string);
|
|
19
|
+
/**
|
|
20
|
+
* A function to execute when the player starts this quest.
|
|
21
|
+
* @param game The game object
|
|
22
|
+
* @param quest The quest to start
|
|
23
|
+
* @param person The person this quest is for
|
|
24
|
+
*/
|
|
25
|
+
start?(game: IGame, quest: IQuest, person: IPerson): void;
|
|
26
|
+
/**
|
|
27
|
+
* A function that is called by the engine to determine whether a quest is completed.
|
|
28
|
+
* @param game The game object
|
|
29
|
+
* @param quest The quest to check the status for
|
|
30
|
+
*/
|
|
31
|
+
checkDone(game: IGame, quest: IQuest): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* A function to execute when the player completes this quest.
|
|
34
|
+
* @param game The game object
|
|
35
|
+
* @param quest The quest to complete
|
|
36
|
+
* @param person The person this quest is for
|
|
37
|
+
*/
|
|
38
|
+
complete?(game: IGame, quest: IQuest, person: IPerson): void;
|
|
39
|
+
/**
|
|
40
|
+
* True if the player started the quest, false otherwise.
|
|
41
|
+
*/
|
|
42
|
+
started?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* True if the player completed the quest, false otherwise.
|
|
45
|
+
*/
|
|
46
|
+
completed?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* A custom object to track quest progress.
|
|
49
|
+
*/
|
|
50
|
+
progress?: any;
|
|
51
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ICharacter, ICreateCharacter, IGame, IItem } from '../../..';
|
|
2
|
+
export interface ICharacterRules {
|
|
3
|
+
/**
|
|
4
|
+
* Use this function to determine what character attributes should be shown on the character sheet. Return the names
|
|
5
|
+
* of the attributes (e.g. 'strength').
|
|
6
|
+
*/
|
|
7
|
+
getSheetAttributes?(): string[];
|
|
8
|
+
/**
|
|
9
|
+
* Use this function to use custom logic whether or not to show an equipment slot. Returns true if the slot
|
|
10
|
+
* should be shown, false otherwise.
|
|
11
|
+
* @param character The character to show the slot for
|
|
12
|
+
* @param slot The slot to show.
|
|
13
|
+
*/
|
|
14
|
+
isSlotUsed?(character: ICharacter, slot: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Use this function to specify the steps in your character creation process. Return the character creation sheet.
|
|
17
|
+
*/
|
|
18
|
+
getCreateCharacterSheet?(): ICreateCharacter;
|
|
19
|
+
/**
|
|
20
|
+
* Use this function to specify the steps in your character level up process. Return the level-up sheet.
|
|
21
|
+
*/
|
|
22
|
+
getLevelUpSheet?(): ICreateCharacter;
|
|
23
|
+
/**
|
|
24
|
+
* This function is called when the character sheet has been filled in and the game is about to start.
|
|
25
|
+
* You can add custom logic here to prepare your character before game start. Return the player character.
|
|
26
|
+
* @param game The game about to start
|
|
27
|
+
* @param characterData The character sheet filled in
|
|
28
|
+
*/
|
|
29
|
+
createCharacter?(game: IGame, characterData: ICreateCharacter): ICharacter;
|
|
30
|
+
/**
|
|
31
|
+
* This function is called when the level-up sheet has been filled in and the game is about to continue.
|
|
32
|
+
* You can add custom logic here to process the level-up sheet before the game continues. Return true if
|
|
33
|
+
* you also want the default level-up sheet processing to run.
|
|
34
|
+
* @param character The character
|
|
35
|
+
* @param characterData The level-up sheet filled in
|
|
36
|
+
*/
|
|
37
|
+
levelUp?(character: ICharacter, characterData: ICreateCharacter): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Specify this function if you want to apply custom rules to check whether a character can equip an item.
|
|
40
|
+
* If the player is not allowed to equip the item, return false.
|
|
41
|
+
* @param item The item about to be equipped
|
|
42
|
+
* @param character The player character
|
|
43
|
+
*/
|
|
44
|
+
canEquip?(item: IItem, character: ICharacter): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Specify this function if you want to apply custom rules before allowing a player to equip an item. If the player
|
|
47
|
+
* is not allowed to equip the item, return false.
|
|
48
|
+
* @param game The active game
|
|
49
|
+
* @param character The player character
|
|
50
|
+
* @param item The item about to be equipped
|
|
51
|
+
*/
|
|
52
|
+
beforeEquip?(game: IGame, character: ICharacter, item: IItem): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Specify this function if you want to apply custom rules before allowing a player to unequip an item. If the player
|
|
55
|
+
* is not allowed to unequip the item, return false.
|
|
56
|
+
* @param game The active game
|
|
57
|
+
* @param character The player character
|
|
58
|
+
* @param item The item about to be unequipped
|
|
59
|
+
*/
|
|
60
|
+
beforeUnequip?(game: IGame, character: ICharacter, item: IItem): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Specify this function if you want to apply custom rules before a player picks up an item. Return false if the player
|
|
63
|
+
* should not pick up the item.
|
|
64
|
+
* @param game The active game
|
|
65
|
+
* @param character The player character
|
|
66
|
+
* @param item The item about to be picked up
|
|
67
|
+
*/
|
|
68
|
+
beforePickup?(game: IGame, character: ICharacter, item: IItem): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Specify this function if you want to apply custom rules before a player drops an item. Return false if the player
|
|
71
|
+
* should not drop the item.
|
|
72
|
+
* @param game The active game
|
|
73
|
+
* @param character The player character
|
|
74
|
+
* @param item The item about to be dropped
|
|
75
|
+
*/
|
|
76
|
+
beforeDrop?(game: IGame, character: ICharacter, item: IItem): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Specify this function if you want to do something special when a character's health changes.
|
|
79
|
+
* @param game The active game
|
|
80
|
+
* @param character The character for whom the health changes
|
|
81
|
+
* @param change The change in health points. If the player is wounded, the number will be negative.
|
|
82
|
+
*/
|
|
83
|
+
hitpointsChange?(game: IGame, character: ICharacter, change: number): void;
|
|
84
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ICharacter, ICombatSetup, ICombatTurn, ICompiledLocation, IEnemy, IGame, IItem } from '../../..';
|
|
2
|
+
export interface ICombatRules {
|
|
3
|
+
/**
|
|
4
|
+
* This function allows you to add custom logic to execute before combat starts.
|
|
5
|
+
* @param game The active game
|
|
6
|
+
* @param location The current location
|
|
7
|
+
*/
|
|
8
|
+
initCombat?(game: IGame, location: ICompiledLocation): void;
|
|
9
|
+
/**
|
|
10
|
+
* This function is called before each combat round starts, and allows you to override round settings.
|
|
11
|
+
* @param game The active game
|
|
12
|
+
* @param combat The setup for the next combat round
|
|
13
|
+
*/
|
|
14
|
+
initCombatRound?(game: IGame, combat: ICombatSetup<ICombatTurn>): void;
|
|
15
|
+
/**
|
|
16
|
+
* This function determines the combat rules for your game. Return a promise
|
|
17
|
+
* when you want the engine to wait for your function to complete asynchronously.
|
|
18
|
+
* @param game The active game
|
|
19
|
+
* @param combatRound The setup for this combat round
|
|
20
|
+
* @param retaliate True if the enemies present can fight back, false or undefined otherwise
|
|
21
|
+
*/
|
|
22
|
+
fight?(game: IGame, combatRound: ICombatSetup<ICombatTurn>, retaliate?: boolean): Promise<void> | void;
|
|
23
|
+
/**
|
|
24
|
+
* Use this function to run custom code to determine whether an item should be selectable for combat
|
|
25
|
+
* or not.
|
|
26
|
+
* @param game The active game
|
|
27
|
+
* @param item The item for which to determine whether it should be selectable
|
|
28
|
+
*/
|
|
29
|
+
itemIsSelectable?(game: IGame, item: IItem): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* This function will be called when an enemy is defeated.
|
|
32
|
+
* @param game The active game
|
|
33
|
+
* @param character The character defeating the enemy
|
|
34
|
+
* @param enemy The enemy just defeated
|
|
35
|
+
*/
|
|
36
|
+
enemyDefeated?(game: IGame, character: ICharacter, enemy: IEnemy): void;
|
|
37
|
+
/**
|
|
38
|
+
* Specify this function if you want to apply custom rules before an enemy drops an item when defeated.
|
|
39
|
+
* Return false if the enemy should not drop the item.
|
|
40
|
+
* @param game The active game
|
|
41
|
+
* @param character The character defeating the enemy
|
|
42
|
+
* @param enemy The enemy defeated
|
|
43
|
+
* @param item The item about to be dropped
|
|
44
|
+
*/
|
|
45
|
+
beforeDrop?(game: IGame, character: ICharacter, enemy: IEnemy, item: IItem): boolean;
|
|
46
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IActiveCombination, ICombinable, ICombinationAction, IGame } from '../../..';
|
|
2
|
+
export interface ICombinationRules {
|
|
3
|
+
/**
|
|
4
|
+
* If you want to use combinations in your game, you must use this property to specify the
|
|
5
|
+
* combination actions that your game uses (e.g. 'Look at', 'Use', etc.).
|
|
6
|
+
*/
|
|
7
|
+
combinationActions?: ICombinationAction[];
|
|
8
|
+
/**
|
|
9
|
+
* Use this function to run code after each successful combination.
|
|
10
|
+
* @param game The game object
|
|
11
|
+
* @param combination The combination used
|
|
12
|
+
* @param target The target of the combination
|
|
13
|
+
*/
|
|
14
|
+
success?: (game: IGame, combination: IActiveCombination, target: ICombinable) => void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IAutoplayStep, IParty } from '../../..';
|
|
2
|
+
export interface IDemoMode {
|
|
3
|
+
/**
|
|
4
|
+
* The number of milliseconds to wait before starting the game demo.
|
|
5
|
+
*/
|
|
6
|
+
startDelay: number;
|
|
7
|
+
/**
|
|
8
|
+
* The party to use when playing the demo.
|
|
9
|
+
*/
|
|
10
|
+
party: IParty;
|
|
11
|
+
/**
|
|
12
|
+
* The steps to play during the demo.
|
|
13
|
+
*/
|
|
14
|
+
steps: IAutoplayStep[];
|
|
15
|
+
}
|