@strixit/storyscript 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +1 -0
- package/CodeSnippets/StoryScriptSnippets.code-snippets +573 -0
- package/LICENSE.txt +21 -0
- package/LiveTemplates/StoryScript.xml +271 -0
- package/README.md +9 -2
- package/baseViteConfig.js +112 -0
- package/clientFiles/currentGameName.js +1 -0
- package/clientFiles/gitignore +12 -0
- package/clientFiles/tsconfig.json +34 -0
- package/clientFiles/vite.config.ts +14 -0
- package/clientFiles/vitest.config.ts +29 -0
- package/dist/src/Engine/Actions/index.d.ts +2 -0
- package/dist/src/Engine/Actions/open.d.ts +6 -0
- package/dist/src/Engine/Actions/openWithKey.d.ts +7 -0
- package/dist/src/Engine/EntityCreatorFunctions.d.ts +18 -0
- package/dist/src/Engine/Interfaces/action.d.ts +37 -0
- package/dist/src/Engine/Interfaces/autoplayStep.d.ts +11 -0
- package/dist/src/Engine/Interfaces/barrier.d.ts +16 -0
- package/dist/src/Engine/Interfaces/barrierAction.d.ts +19 -0
- package/dist/src/Engine/Interfaces/character.d.ts +48 -0
- package/dist/src/Engine/Interfaces/combatSetup.d.ts +9 -0
- package/dist/src/Engine/Interfaces/combatTurn.d.ts +37 -0
- package/dist/src/Engine/Interfaces/combatWinnings.d.ts +6 -0
- package/dist/src/Engine/Interfaces/combinations/activeCombination.d.ts +14 -0
- package/dist/src/Engine/Interfaces/combinations/combinable.d.ts +18 -0
- package/dist/src/Engine/Interfaces/combinations/combinationAction.d.ts +41 -0
- package/dist/src/Engine/Interfaces/combinations/combinationMatchResult.d.ts +14 -0
- package/dist/src/Engine/Interfaces/combinations/combinations.d.ts +17 -0
- package/dist/src/Engine/Interfaces/combinations/combine.d.ts +22 -0
- package/dist/src/Engine/Interfaces/combinations/combineResult.d.ts +18 -0
- package/dist/src/Engine/Interfaces/combinations/gameCombinations.d.ts +40 -0
- package/dist/src/Engine/Interfaces/compiledLocation.d.ts +33 -0
- package/dist/src/Engine/Interfaces/conversations/conversation.d.ts +44 -0
- package/dist/src/Engine/Interfaces/conversations/conversationLogEntry.d.ts +13 -0
- package/dist/src/Engine/Interfaces/conversations/conversationNode.d.ts +22 -0
- package/dist/src/Engine/Interfaces/conversations/conversationReply.d.ts +49 -0
- package/dist/src/Engine/Interfaces/createCharacter/createCharacter.d.ts +20 -0
- package/dist/src/Engine/Interfaces/createCharacter/createCharacterAttribute.d.ts +18 -0
- package/dist/src/Engine/Interfaces/createCharacter/createCharacterAttributeEntry.d.ts +18 -0
- package/dist/src/Engine/Interfaces/createCharacter/createCharacterQuestion.d.ts +18 -0
- package/dist/src/Engine/Interfaces/createCharacter/createCharacterQuestionEntry.d.ts +22 -0
- package/dist/src/Engine/Interfaces/createCharacter/createCharacterStep.d.ts +40 -0
- package/dist/src/Engine/Interfaces/customCursor.d.ts +8 -0
- package/dist/src/Engine/Interfaces/defaultEquipment.d.ts +19 -0
- package/dist/src/Engine/Interfaces/definitions.d.ts +40 -0
- package/dist/src/Engine/Interfaces/destination.d.ts +31 -0
- package/dist/src/Engine/Interfaces/dynamicStyle.d.ts +10 -0
- package/dist/src/Engine/Interfaces/enemy.d.ts +46 -0
- package/dist/src/Engine/Interfaces/enumerations/actionStatus.d.ts +18 -0
- package/dist/src/Engine/Interfaces/enumerations/actionType.d.ts +9 -0
- package/dist/src/Engine/Interfaces/enumerations/equipmentType.d.ts +51 -0
- package/dist/src/Engine/Interfaces/enumerations/gameState.d.ts +11 -0
- package/dist/src/Engine/Interfaces/enumerations/playState.d.ts +10 -0
- package/dist/src/Engine/Interfaces/enumerations/targetType.d.ts +9 -0
- package/dist/src/Engine/Interfaces/equipment.d.ts +43 -0
- package/dist/src/Engine/Interfaces/feature.d.ts +37 -0
- package/dist/src/Engine/Interfaces/featureCollection.d.ts +7 -0
- package/dist/src/Engine/Interfaces/game.d.ts +148 -0
- package/dist/src/Engine/Interfaces/gameEvents.d.ts +7 -0
- package/dist/src/Engine/Interfaces/groupableItem.d.ts +32 -0
- package/dist/src/Engine/Interfaces/helpers.d.ts +50 -0
- package/dist/src/Engine/Interfaces/index.d.ts +78 -0
- package/dist/src/Engine/Interfaces/interfaceTexts.d.ts +140 -0
- package/dist/src/Engine/Interfaces/item.d.ts +96 -0
- package/dist/src/Engine/Interfaces/key.d.ts +16 -0
- package/dist/src/Engine/Interfaces/location.d.ts +78 -0
- package/dist/src/Engine/Interfaces/maps/map.d.ts +45 -0
- package/dist/src/Engine/Interfaces/maps/mapLocation.d.ts +23 -0
- package/dist/src/Engine/Interfaces/party.d.ts +33 -0
- package/dist/src/Engine/Interfaces/person.d.ts +25 -0
- package/dist/src/Engine/Interfaces/quest.d.ts +51 -0
- package/dist/src/Engine/Interfaces/rules/characterRules.d.ts +84 -0
- package/dist/src/Engine/Interfaces/rules/combatRules.d.ts +46 -0
- package/dist/src/Engine/Interfaces/rules/combinationRules.d.ts +15 -0
- package/dist/src/Engine/Interfaces/rules/demoMode.d.ts +15 -0
- package/dist/src/Engine/Interfaces/rules/encounterRules.d.ts +4 -0
- package/dist/src/Engine/Interfaces/rules/explorationRules.d.ts +42 -0
- package/dist/src/Engine/Interfaces/rules/generalRules.d.ts +62 -0
- package/dist/src/Engine/Interfaces/rules/rules.d.ts +31 -0
- package/dist/src/Engine/Interfaces/rules/setupRules.d.ts +56 -0
- package/dist/src/Engine/Interfaces/rules/titleScreen.d.ts +16 -0
- package/dist/src/Engine/Interfaces/saveGame.d.ts +33 -0
- package/dist/src/Engine/Interfaces/scoreEntry.d.ts +13 -0
- package/dist/src/Engine/Interfaces/services/autoplayService.d.ts +19 -0
- package/dist/src/Engine/Interfaces/services/characterService.d.ts +17 -0
- package/dist/src/Engine/Interfaces/services/combatService.d.ts +26 -0
- package/dist/src/Engine/Interfaces/services/combinationService.d.ts +9 -0
- package/dist/src/Engine/Interfaces/services/commandService.d.ts +64 -0
- package/dist/src/Engine/Interfaces/services/conversationService.d.ts +5 -0
- package/dist/src/Engine/Interfaces/services/dataSerializer.d.ts +4 -0
- package/dist/src/Engine/Interfaces/services/dataService.d.ts +33 -0
- package/dist/src/Engine/Interfaces/services/dataSynchronizer.d.ts +3 -0
- package/dist/src/Engine/Interfaces/services/gameService.d.ts +10 -0
- package/dist/src/Engine/Interfaces/services/index.d.ts +16 -0
- package/dist/src/Engine/Interfaces/services/itemService.d.ts +14 -0
- package/dist/src/Engine/Interfaces/services/localStorageService.d.ts +6 -0
- package/dist/src/Engine/Interfaces/services/locationService.d.ts +8 -0
- package/dist/src/Engine/Interfaces/services/soundService.d.ts +5 -0
- package/dist/src/Engine/Interfaces/services/tradeService.d.ts +9 -0
- package/dist/src/Engine/Interfaces/soundPlayer.d.ts +30 -0
- package/dist/src/Engine/Interfaces/sprite.d.ts +23 -0
- package/dist/src/Engine/Interfaces/stateList.d.ts +9 -0
- package/dist/src/Engine/Interfaces/statistics.d.ts +13 -0
- package/dist/src/Engine/Interfaces/stock.d.ts +39 -0
- package/dist/src/Engine/Interfaces/trade.d.ts +62 -0
- package/dist/src/Engine/ServiceFactory.d.ts +52 -0
- package/dist/src/Engine/Services/AutoplayService.d.ts +11 -0
- package/dist/src/Engine/Services/CharacterService.d.ts +21 -0
- package/dist/src/Engine/Services/CombatService.d.ts +16 -0
- package/dist/src/Engine/Services/CombinationService.d.ts +15 -0
- package/dist/src/Engine/Services/CommandService.d.ts +24 -0
- package/dist/src/Engine/Services/ConversationService.d.ts +26 -0
- package/dist/src/Engine/Services/DataSerializer.d.ts +17 -0
- package/dist/src/Engine/Services/DataService.d.ts +16 -0
- package/dist/src/Engine/Services/DataSynchronizer.d.ts +12 -0
- package/dist/src/Engine/Services/GameService.d.ts +28 -0
- package/dist/src/Engine/Services/HelperService.d.ts +18 -0
- package/dist/src/Engine/Services/ItemService.d.ts +21 -0
- package/dist/src/Engine/Services/LocalStorageService.d.ts +7 -0
- package/dist/src/Engine/Services/LocationService.d.ts +25 -0
- package/dist/src/Engine/Services/SoundService.d.ts +13 -0
- package/dist/src/Engine/Services/TradeService.d.ts +17 -0
- package/dist/src/Engine/Services/index.d.ts +17 -0
- package/dist/src/Engine/Services/serializationData.d.ts +8 -0
- package/dist/src/Engine/Services/sharedFunctions.d.ts +21 -0
- package/dist/src/Engine/arrayAndFunctionExtensions.d.ts +3 -0
- package/dist/src/Engine/defaultTexts.d.ts +7 -0
- package/dist/src/Engine/gameEvents.d.ts +10 -0
- package/dist/src/Engine/index.d.ts +8 -0
- package/dist/src/Engine/stateProperties.d.ts +6 -0
- package/dist/src/Engine/utilityFunctions.d.ts +25 -0
- package/dist/src/UI/Composables/CustomCursor.d.ts +2 -0
- package/dist/src/UI/Composables/LocationMap.d.ts +26 -0
- package/dist/src/UI/Composables/Sound.d.ts +7 -0
- package/dist/src/UI/Composables/TextFeatures.d.ts +8 -0
- package/dist/src/UI/Composables/VisualFeatures.d.ts +7 -0
- package/dist/src/UI/Composables/index.d.ts +7 -0
- package/dist/src/UI/Composables/playStateWatch.d.ts +2 -0
- package/dist/src/UI/StateStore.d.ts +14256 -0
- package/dist/src/UI/error.d.ts +6 -0
- package/dist/src/UI/helpers.d.ts +3 -0
- package/dist/src/UI/index.d.ts +6 -0
- package/dist/src/UI/main.d.ts +1 -0
- package/dist/src/UI/startup.d.ts +2 -0
- package/dist/src/constants.d.ts +17 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/storyscript.css +9566 -0
- package/dist/storyscript.js +9659 -0
- package/dist/storyscript.js.map +1 -0
- package/dist/storyscript.mjs +9569 -0
- package/dist/storyscript.mjs.map +1 -0
- package/electron.cjs +44 -0
- package/index.html +14 -0
- package/package.json +118 -4
- package/scripts/cli.js +268 -0
- package/scripts/createAsset.js +117 -0
- package/scripts/createGame.js +40 -0
- package/scripts/helpers.js +21 -0
- package/scripts/postbuild.js +179 -0
- package/scripts/setupTesting.js +17 -0
- package/shims-vue.d.ts +1 -0
- package/src/Engine/Actions/index.ts +2 -0
- package/src/Engine/Actions/open.ts +12 -0
- package/src/Engine/Actions/openWithKey.ts +23 -0
- package/src/Engine/EntityCreatorFunctions.ts +602 -0
- package/src/Engine/Interfaces/action.ts +43 -0
- package/src/Engine/Interfaces/autoplayStep.ts +13 -0
- package/src/Engine/Interfaces/barrier.ts +18 -0
- package/src/Engine/Interfaces/barrierAction.ts +21 -0
- package/src/Engine/Interfaces/character.ts +58 -0
- package/src/Engine/Interfaces/combatSetup.ts +10 -0
- package/src/Engine/Interfaces/combatTurn.ts +45 -0
- package/src/Engine/Interfaces/combatWinnings.ts +7 -0
- package/src/Engine/Interfaces/combinations/activeCombination.ts +16 -0
- package/src/Engine/Interfaces/combinations/combinable.ts +21 -0
- package/src/Engine/Interfaces/combinations/combinationAction.ts +45 -0
- package/src/Engine/Interfaces/combinations/combinationMatchResult.ts +16 -0
- package/src/Engine/Interfaces/combinations/combinations.ts +19 -0
- package/src/Engine/Interfaces/combinations/combine.ts +25 -0
- package/src/Engine/Interfaces/combinations/combineResult.ts +21 -0
- package/src/Engine/Interfaces/combinations/gameCombinations.ts +48 -0
- package/src/Engine/Interfaces/compiledLocation.ts +37 -0
- package/src/Engine/Interfaces/conversations/conversation.ts +47 -0
- package/src/Engine/Interfaces/conversations/conversationLogEntry.ts +14 -0
- package/src/Engine/Interfaces/conversations/conversationNode.ts +26 -0
- package/src/Engine/Interfaces/conversations/conversationReply.ts +59 -0
- package/src/Engine/Interfaces/createCharacter/createCharacter.ts +23 -0
- package/src/Engine/Interfaces/createCharacter/createCharacterAttribute.ts +21 -0
- package/src/Engine/Interfaces/createCharacter/createCharacterAttributeEntry.ts +21 -0
- package/src/Engine/Interfaces/createCharacter/createCharacterQuestion.ts +21 -0
- package/src/Engine/Interfaces/createCharacter/createCharacterQuestionEntry.ts +25 -0
- package/src/Engine/Interfaces/createCharacter/createCharacterStep.ts +47 -0
- package/src/Engine/Interfaces/customCursor.ts +5 -0
- package/src/Engine/Interfaces/defaultEquipment.ts +32 -0
- package/src/Engine/Interfaces/definitions.ts +48 -0
- package/src/Engine/Interfaces/destination.ts +37 -0
- package/src/Engine/Interfaces/dynamicStyle.ts +11 -0
- package/src/Engine/Interfaces/enemy.ts +54 -0
- package/src/Engine/Interfaces/enumerations/actionStatus.ts +20 -0
- package/src/Engine/Interfaces/enumerations/actionType.ts +9 -0
- package/src/Engine/Interfaces/enumerations/equipmentType.ts +61 -0
- package/src/Engine/Interfaces/enumerations/gameState.ts +11 -0
- package/src/Engine/Interfaces/enumerations/playState.ts +10 -0
- package/src/Engine/Interfaces/enumerations/targetType.ts +9 -0
- package/src/Engine/Interfaces/equipment.ts +44 -0
- package/src/Engine/Interfaces/feature.ts +43 -0
- package/src/Engine/Interfaces/featureCollection.ts +8 -0
- package/src/Engine/Interfaces/game.ts +201 -0
- package/src/Engine/Interfaces/gameEvents.ts +11 -0
- package/src/Engine/Interfaces/groupableItem.ts +37 -0
- package/src/Engine/Interfaces/helpers.ts +55 -0
- package/src/Engine/Interfaces/index.ts +158 -0
- package/src/Engine/Interfaces/interfaceTexts.ts +142 -0
- package/src/Engine/Interfaces/item.ts +111 -0
- package/src/Engine/Interfaces/key.ts +18 -0
- package/src/Engine/Interfaces/location.ts +92 -0
- package/src/Engine/Interfaces/maps/map.ts +55 -0
- package/src/Engine/Interfaces/maps/mapLocation.ts +28 -0
- package/src/Engine/Interfaces/party.ts +40 -0
- package/src/Engine/Interfaces/person.ts +29 -0
- package/src/Engine/Interfaces/quest.ts +60 -0
- package/src/Engine/Interfaces/rules/characterRules.ts +96 -0
- package/src/Engine/Interfaces/rules/combatRules.ts +52 -0
- package/src/Engine/Interfaces/rules/combinationRules.ts +17 -0
- package/src/Engine/Interfaces/rules/demoMode.ts +18 -0
- package/src/Engine/Interfaces/rules/encounterRules.ts +5 -0
- package/src/Engine/Interfaces/rules/explorationRules.ts +47 -0
- package/src/Engine/Interfaces/rules/generalRules.ts +80 -0
- package/src/Engine/Interfaces/rules/rules.ts +46 -0
- package/src/Engine/Interfaces/rules/setupRules.ts +65 -0
- package/src/Engine/Interfaces/rules/titleScreen.ts +19 -0
- package/src/Engine/Interfaces/saveGame.ts +39 -0
- package/src/Engine/Interfaces/scoreEntry.ts +14 -0
- package/src/Engine/Interfaces/services/autoplayService.ts +23 -0
- package/src/Engine/Interfaces/services/characterService.ts +35 -0
- package/src/Engine/Interfaces/services/combatService.ts +30 -0
- package/src/Engine/Interfaces/services/combinationService.ts +10 -0
- package/src/Engine/Interfaces/services/commandService.ts +75 -0
- package/src/Engine/Interfaces/services/conversationService.ts +7 -0
- package/src/Engine/Interfaces/services/dataSerializer.ts +4 -0
- package/src/Engine/Interfaces/services/dataService.ts +39 -0
- package/src/Engine/Interfaces/services/dataSynchronizer.ts +9 -0
- package/src/Engine/Interfaces/services/gameService.ts +17 -0
- package/src/Engine/Interfaces/services/index.ts +33 -0
- package/src/Engine/Interfaces/services/itemService.ts +25 -0
- package/src/Engine/Interfaces/services/localStorageService.ts +6 -0
- package/src/Engine/Interfaces/services/locationService.ts +13 -0
- package/src/Engine/Interfaces/services/soundService.ts +7 -0
- package/src/Engine/Interfaces/services/tradeService.ts +15 -0
- package/src/Engine/Interfaces/soundPlayer.ts +30 -0
- package/src/Engine/Interfaces/sprite.ts +27 -0
- package/src/Engine/Interfaces/stateList.ts +13 -0
- package/src/Engine/Interfaces/statistics.ts +14 -0
- package/src/Engine/Interfaces/stock.ts +46 -0
- package/src/Engine/Interfaces/trade.ts +72 -0
- package/src/Engine/ServiceFactory.ts +167 -0
- package/src/Engine/Services/AutoplayService.ts +59 -0
- package/src/Engine/Services/CharacterService.ts +291 -0
- package/src/Engine/Services/CombatService.ts +266 -0
- package/src/Engine/Services/CombinationService.ts +197 -0
- package/src/Engine/Services/CommandService.ts +197 -0
- package/src/Engine/Services/ConversationService.ts +406 -0
- package/src/Engine/Services/DataSerializer.ts +326 -0
- package/src/Engine/Services/DataService.ts +93 -0
- package/src/Engine/Services/DataSynchronizer.ts +216 -0
- package/src/Engine/Services/GameService.ts +554 -0
- package/src/Engine/Services/HelperService.ts +94 -0
- package/src/Engine/Services/ItemService.ts +294 -0
- package/src/Engine/Services/LocalStorageService.ts +24 -0
- package/src/Engine/Services/LocationService.ts +380 -0
- package/src/Engine/Services/SoundService.ts +54 -0
- package/src/Engine/Services/TradeService.ts +176 -0
- package/src/Engine/Services/index.ts +17 -0
- package/src/Engine/Services/serializationData.ts +8 -0
- package/src/Engine/Services/sharedFunctions.ts +296 -0
- package/src/Engine/arrayAndFunctionExtensions.ts +269 -0
- package/src/Engine/defaultTexts.ts +162 -0
- package/src/Engine/gameEvents.ts +51 -0
- package/src/Engine/index.ts +9 -0
- package/src/Engine/stateProperties.ts +9 -0
- package/src/Engine/utilityFunctions.ts +238 -0
- package/src/Games/_GameTemplate/character.ts +31 -0
- package/src/Games/_GameTemplate/customTexts.ts +8 -0
- package/src/Games/_GameTemplate/interfaces/action.ts +5 -0
- package/src/Games/_GameTemplate/interfaces/combatSetup.ts +7 -0
- package/src/Games/_GameTemplate/interfaces/combatTurn.ts +8 -0
- package/src/Games/_GameTemplate/interfaces/destination.ts +5 -0
- package/src/Games/_GameTemplate/interfaces/enemy.ts +11 -0
- package/src/Games/_GameTemplate/interfaces/equipment.ts +5 -0
- package/src/Games/_GameTemplate/interfaces/feature.ts +9 -0
- package/src/Games/_GameTemplate/interfaces/game.ts +22 -0
- package/src/Games/_GameTemplate/interfaces/interfaceTexts.ts +5 -0
- package/src/Games/_GameTemplate/interfaces/item.ts +18 -0
- package/src/Games/_GameTemplate/interfaces/key.ts +10 -0
- package/src/Games/_GameTemplate/interfaces/location.ts +22 -0
- package/src/Games/_GameTemplate/interfaces/map.ts +16 -0
- package/src/Games/_GameTemplate/interfaces/party.ts +8 -0
- package/src/Games/_GameTemplate/interfaces/person.ts +11 -0
- package/src/Games/_GameTemplate/interfaces/quest.ts +9 -0
- package/src/Games/_GameTemplate/locations/Start.html +5 -0
- package/src/Games/_GameTemplate/locations/start.ts +12 -0
- package/src/Games/_GameTemplate/rules.ts +60 -0
- package/src/Games/_GameTemplate/types.ts +55 -0
- package/src/Games/_GameTemplate/ui/styles/game.css +3 -0
- package/src/Games/_GameTemplate/webroot/favicon.ico +0 -0
- package/src/Games/_GameTemplate/webroot/gameinfo.json +10 -0
- package/src/Games/_GameTemplate/webroot/logo192.png +0 -0
- package/src/Games/_GameTemplate/webroot/logo512.png +0 -0
- package/src/Tests/Games/_GameTemplate/specs/rules.test.ts +9 -0
- package/src/UI/Components/AppShell.vue +43 -0
- package/src/UI/Components/Autoplay.vue +32 -0
- package/src/UI/Components/Combinations.vue +37 -0
- package/src/UI/Components/Common/Collapsible.vue +50 -0
- package/src/UI/Components/Common/ModalDialog.vue +54 -0
- package/src/UI/Components/Common/Sprite.vue +53 -0
- package/src/UI/Components/Description.vue +23 -0
- package/src/UI/Components/Encounter/Combat/Combat.vue +89 -0
- package/src/UI/Components/Encounter/Combat/CombatActions.vue +26 -0
- package/src/UI/Components/Encounter/Combat/CombatParticipant.vue +22 -0
- package/src/UI/Components/Encounter/Combat/CombatTargetSelect.vue +55 -0
- package/src/UI/Components/Encounter/Combat/CombatWin.vue +33 -0
- package/src/UI/Components/Encounter/Conversation.vue +66 -0
- package/src/UI/Components/Encounter/Encounter.vue +39 -0
- package/src/UI/Components/Encounter/Enemy.vue +30 -0
- package/src/UI/Components/Encounter/Trade/Stock.vue +58 -0
- package/src/UI/Components/Encounter/Trade/Trade.vue +24 -0
- package/src/UI/Components/Exploration/ActionLog.vue +17 -0
- package/src/UI/Components/Exploration/Destination.vue +66 -0
- package/src/UI/Components/Exploration/Exploration.vue +67 -0
- package/src/UI/Components/Exploration/Ground.vue +22 -0
- package/src/UI/Components/Exploration/LocationMap.vue +42 -0
- package/src/UI/Components/Exploration/LocationText.vue +39 -0
- package/src/UI/Components/Exploration/LocationVisual.vue +38 -0
- package/src/UI/Components/GameContainer.vue +49 -0
- package/src/UI/Components/GameMenu.vue +111 -0
- package/src/UI/Components/GameState/GameOver.vue +20 -0
- package/src/UI/Components/GameState/HighScores.vue +22 -0
- package/src/UI/Components/GameState/Intro.vue +17 -0
- package/src/UI/Components/GameState/TitleScreen.vue +42 -0
- package/src/UI/Components/GameState/Victory.vue +28 -0
- package/src/UI/Components/Navigation.vue +94 -0
- package/src/UI/Components/Party/Backpack.vue +68 -0
- package/src/UI/Components/Party/BuildCharacter.vue +64 -0
- package/src/UI/Components/Party/CharacterSheet.vue +57 -0
- package/src/UI/Components/Party/CreateCharacter.vue +46 -0
- package/src/UI/Components/Party/Equipment.vue +48 -0
- package/src/UI/Components/Party/EquipmentSlot.vue +31 -0
- package/src/UI/Components/Party/LevelUp.vue +27 -0
- package/src/UI/Components/Party/Party.vue +29 -0
- package/src/UI/Components/Party/Quests.vue +48 -0
- package/src/UI/Components/Sound.vue +42 -0
- package/src/UI/Composables/CustomCursor.ts +60 -0
- package/src/UI/Composables/LocationMap.ts +315 -0
- package/src/UI/Composables/Sound.ts +111 -0
- package/src/UI/Composables/TextFeatures.ts +148 -0
- package/src/UI/Composables/VisualFeatures.ts +220 -0
- package/src/UI/Composables/index.ts +15 -0
- package/src/UI/Composables/playStateWatch.ts +31 -0
- package/src/UI/StateStore.ts +237 -0
- package/src/UI/error.ts +6 -0
- package/src/UI/helpers.ts +62 -0
- package/src/UI/index.ts +13 -0
- package/src/UI/main.ts +62 -0
- package/src/UI/startup.ts +58 -0
- package/src/UI/styles/bootstrap-storyscript.scss +31 -0
- package/src/UI/styles/empty.css +3 -0
- package/src/UI/styles/lookinglass.png +0 -0
- package/src/UI/styles/storyscript.css +735 -0
- package/typeExtensions.d.ts +25 -0
- package/vite-env.d.ts +1 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ILocation }from 'storyScript';
|
|
2
|
+
|
|
3
|
+
export interface IMapLocation {
|
|
4
|
+
/**
|
|
5
|
+
* The pointer to the location. This will be replaced with the location id during runtime.
|
|
6
|
+
*/
|
|
7
|
+
location: (() => ILocation) | string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The coordinates of this location on the map. use the format '{left},{top}'.
|
|
11
|
+
*/
|
|
12
|
+
coords?: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The specific image to show for this location, if any.
|
|
16
|
+
*/
|
|
17
|
+
markerImage?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The specific text to show on this location label, if any.
|
|
21
|
+
*/
|
|
22
|
+
textLabel?: string
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Set during runtime to contain the HTML element of the text label or marker image.
|
|
26
|
+
*/
|
|
27
|
+
markerElement?: HTMLElement;
|
|
28
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ICharacter } from "./character";
|
|
2
|
+
import { IQuest } from "./quest";
|
|
3
|
+
|
|
4
|
+
export interface IParty {
|
|
5
|
+
/**
|
|
6
|
+
* The name of the party.
|
|
7
|
+
*/
|
|
8
|
+
name?: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The members of the party.
|
|
12
|
+
*/
|
|
13
|
+
characters: ICharacter[];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The amount of credits the party has, in whatever form.
|
|
17
|
+
*/
|
|
18
|
+
currency?: number;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* All the quests the party has accepted, both active and complete.
|
|
22
|
+
*/
|
|
23
|
+
quests?: IQuest[];
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The number of points scored by the party so far. This property should be managed in your game rules. The score will
|
|
27
|
+
* be used to determine the party's ranking in the high-score list on game end.
|
|
28
|
+
*/
|
|
29
|
+
score?: number;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The id of the location in the game world the party is currently at.
|
|
33
|
+
*/
|
|
34
|
+
currentLocationId?: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The id of the location in the game world the party visited before the current one.
|
|
38
|
+
*/
|
|
39
|
+
previousLocationId?: string;
|
|
40
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IEnemy } from './enemy';
|
|
2
|
+
import { ITrade } from './trade';
|
|
3
|
+
import { IQuest } from './quest';
|
|
4
|
+
import { IConversation } from './conversations/conversation';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The base properties of a character in the game the player can talk or trade with.
|
|
8
|
+
*/
|
|
9
|
+
export interface IPerson extends IEnemy {
|
|
10
|
+
/**
|
|
11
|
+
* True if the player can attack the character, false otherwise.
|
|
12
|
+
*/
|
|
13
|
+
canAttack?: boolean;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The trade settings for the person.
|
|
17
|
+
*/
|
|
18
|
+
trade?: ITrade;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The conversation options for the person.
|
|
22
|
+
*/
|
|
23
|
+
conversation?: IConversation;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The quests this person has available.
|
|
27
|
+
*/
|
|
28
|
+
quests?: IQuest[];
|
|
29
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { IPerson } from './person';
|
|
2
|
+
import { IGame } from './game';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A quest a player can complete.
|
|
6
|
+
*/
|
|
7
|
+
export interface IQuest {
|
|
8
|
+
/**
|
|
9
|
+
* The name of the quest as shown to the player.
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The id of the person the player is pursuing this quest for.
|
|
15
|
+
*/
|
|
16
|
+
issuedBy?: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The quest status, either as a string or a function that can produce a quest status dynamically.
|
|
20
|
+
*/
|
|
21
|
+
status: string | ((game: IGame, quest: IQuest, done: boolean) => string),
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A function to execute when the player starts this quest.
|
|
25
|
+
* @param game The game object
|
|
26
|
+
* @param quest The quest to start
|
|
27
|
+
* @param person The person this quest is for
|
|
28
|
+
*/
|
|
29
|
+
start?(game: IGame, quest: IQuest, person: IPerson): void;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* A function that is called by the engine to determine whether a quest is completed.
|
|
33
|
+
* @param game The game object
|
|
34
|
+
* @param quest The quest to check the status for
|
|
35
|
+
*/
|
|
36
|
+
checkDone(game: IGame, quest: IQuest): boolean;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A function to execute when the player completes this quest.
|
|
40
|
+
* @param game The game object
|
|
41
|
+
* @param quest The quest to complete
|
|
42
|
+
* @param person The person this quest is for
|
|
43
|
+
*/
|
|
44
|
+
complete?(game: IGame, quest: IQuest, person: IPerson): void;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* True if the player started the quest, false otherwise.
|
|
48
|
+
*/
|
|
49
|
+
started?: boolean;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* True if the player completed the quest, false otherwise.
|
|
53
|
+
*/
|
|
54
|
+
completed?: boolean;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* A custom object to track quest progress.
|
|
58
|
+
*/
|
|
59
|
+
progress?: any
|
|
60
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import {ICharacter, ICreateCharacter, IGame, IItem} from 'storyScript';
|
|
2
|
+
|
|
3
|
+
export interface ICharacterRules {
|
|
4
|
+
/**
|
|
5
|
+
* Use this function to determine what character attributes should be shown on the character sheet. Return the names
|
|
6
|
+
* of the attributes (e.g. 'strength').
|
|
7
|
+
*/
|
|
8
|
+
getSheetAttributes?(): string[];
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Use this function to use custom logic whether or not to show an equipment slot. Returns true if the slot
|
|
12
|
+
* should be shown, false otherwise.
|
|
13
|
+
* @param character The character to show the slot for
|
|
14
|
+
* @param slot The slot to show.
|
|
15
|
+
*/
|
|
16
|
+
isSlotUsed?(character: ICharacter, slot: string): boolean;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Use this function to specify the steps in your character creation process. Return the character creation sheet.
|
|
20
|
+
*/
|
|
21
|
+
getCreateCharacterSheet?(): ICreateCharacter;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Use this function to specify the steps in your character level up process. Return the level-up sheet.
|
|
25
|
+
*/
|
|
26
|
+
getLevelUpSheet?(): ICreateCharacter;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* This function is called when the character sheet has been filled in and the game is about to start.
|
|
30
|
+
* You can add custom logic here to prepare your character before game start. Return the player character.
|
|
31
|
+
* @param game The game about to start
|
|
32
|
+
* @param characterData The character sheet filled in
|
|
33
|
+
*/
|
|
34
|
+
createCharacter?(game: IGame, characterData: ICreateCharacter): ICharacter;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* This function is called when the level-up sheet has been filled in and the game is about to continue.
|
|
38
|
+
* You can add custom logic here to process the level-up sheet before the game continues. Return true if
|
|
39
|
+
* you also want the default level-up sheet processing to run.
|
|
40
|
+
* @param character The character
|
|
41
|
+
* @param characterData The level-up sheet filled in
|
|
42
|
+
*/
|
|
43
|
+
levelUp?(character: ICharacter, characterData: ICreateCharacter): boolean;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Specify this function if you want to apply custom rules to check whether a character can equip an item.
|
|
47
|
+
* If the player is not allowed to equip the item, return false.
|
|
48
|
+
* @param item The item about to be equipped
|
|
49
|
+
* @param character The player character
|
|
50
|
+
*/
|
|
51
|
+
canEquip?(item: IItem, character: ICharacter): boolean;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Specify this function if you want to apply custom rules before allowing a player to equip an item. If the player
|
|
55
|
+
* is not allowed to equip the item, return false.
|
|
56
|
+
* @param game The active game
|
|
57
|
+
* @param character The player character
|
|
58
|
+
* @param item The item about to be equipped
|
|
59
|
+
*/
|
|
60
|
+
beforeEquip?(game: IGame, character: ICharacter, item: IItem): boolean;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Specify this function if you want to apply custom rules before allowing a player to unequip an item. If the player
|
|
64
|
+
* is not allowed to unequip the item, return false.
|
|
65
|
+
* @param game The active game
|
|
66
|
+
* @param character The player character
|
|
67
|
+
* @param item The item about to be unequipped
|
|
68
|
+
*/
|
|
69
|
+
beforeUnequip?(game: IGame, character: ICharacter, item: IItem): boolean;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Specify this function if you want to apply custom rules before a player picks up an item. Return false if the player
|
|
73
|
+
* should not pick up the item.
|
|
74
|
+
* @param game The active game
|
|
75
|
+
* @param character The player character
|
|
76
|
+
* @param item The item about to be picked up
|
|
77
|
+
*/
|
|
78
|
+
beforePickup?(game: IGame, character: ICharacter, item: IItem): boolean;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Specify this function if you want to apply custom rules before a player drops an item. Return false if the player
|
|
82
|
+
* should not drop the item.
|
|
83
|
+
* @param game The active game
|
|
84
|
+
* @param character The player character
|
|
85
|
+
* @param item The item about to be dropped
|
|
86
|
+
*/
|
|
87
|
+
beforeDrop?(game: IGame, character: ICharacter, item: IItem): boolean;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Specify this function if you want to do something special when a character's health changes.
|
|
91
|
+
* @param game The active game
|
|
92
|
+
* @param character The character for whom the health changes
|
|
93
|
+
* @param change The change in health points. If the player is wounded, the number will be negative.
|
|
94
|
+
*/
|
|
95
|
+
hitpointsChange?(game: IGame, character: ICharacter, change: number): void;
|
|
96
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {ICharacter, ICombatSetup, ICombatTurn, ICompiledLocation, IEnemy, IGame, IItem} from 'storyScript';
|
|
2
|
+
|
|
3
|
+
export interface ICombatRules {
|
|
4
|
+
/**
|
|
5
|
+
* This function allows you to add custom logic to execute before combat starts.
|
|
6
|
+
* @param game The active game
|
|
7
|
+
* @param location The current location
|
|
8
|
+
*/
|
|
9
|
+
initCombat?(game: IGame, location: ICompiledLocation): void;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* This function is called before each combat round starts, and allows you to override round settings.
|
|
13
|
+
* @param game The active game
|
|
14
|
+
* @param combat The setup for the next combat round
|
|
15
|
+
*/
|
|
16
|
+
initCombatRound?(game: IGame, combat: ICombatSetup<ICombatTurn>): void;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This function determines the combat rules for your game. Return a promise
|
|
20
|
+
* when you want the engine to wait for your function to complete asynchronously.
|
|
21
|
+
* @param game The active game
|
|
22
|
+
* @param combatRound The setup for this combat round
|
|
23
|
+
* @param retaliate True if the enemies present can fight back, false or undefined otherwise
|
|
24
|
+
*/
|
|
25
|
+
fight?(game: IGame, combatRound: ICombatSetup<ICombatTurn>, retaliate?: boolean): Promise<void> | void;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Use this function to run custom code to determine whether an item should be selectable for combat
|
|
29
|
+
* or not.
|
|
30
|
+
* @param game The active game
|
|
31
|
+
* @param item The item for which to determine whether it should be selectable
|
|
32
|
+
*/
|
|
33
|
+
itemIsSelectable?(game: IGame, item: IItem): boolean;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* This function will be called when an enemy is defeated.
|
|
37
|
+
* @param game The active game
|
|
38
|
+
* @param character The character defeating the enemy
|
|
39
|
+
* @param enemy The enemy just defeated
|
|
40
|
+
*/
|
|
41
|
+
enemyDefeated?(game: IGame, character: ICharacter, enemy: IEnemy): void;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Specify this function if you want to apply custom rules before an enemy drops an item when defeated.
|
|
45
|
+
* Return false if the enemy should not drop the item.
|
|
46
|
+
* @param game The active game
|
|
47
|
+
* @param character The character defeating the enemy
|
|
48
|
+
* @param enemy The enemy defeated
|
|
49
|
+
* @param item The item about to be dropped
|
|
50
|
+
*/
|
|
51
|
+
beforeDrop?(game: IGame, character: ICharacter, enemy: IEnemy, item: IItem): boolean;
|
|
52
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {IActiveCombination, ICombinable, ICombinationAction, IGame} from 'storyScript';
|
|
2
|
+
|
|
3
|
+
export interface ICombinationRules {
|
|
4
|
+
/**
|
|
5
|
+
* If you want to use combinations in your game, you must use this property to specify the
|
|
6
|
+
* combination actions that your game uses (e.g. 'Look at', 'Use', etc.).
|
|
7
|
+
*/
|
|
8
|
+
combinationActions?: ICombinationAction[];
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Use this function to run code after each successful combination.
|
|
12
|
+
* @param game The game object
|
|
13
|
+
* @param combination The combination used
|
|
14
|
+
* @param target The target of the combination
|
|
15
|
+
*/
|
|
16
|
+
success?: (game: IGame, combination: IActiveCombination, target: ICombinable) => void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {IAutoplayStep, IParty} from 'storyScript';
|
|
2
|
+
|
|
3
|
+
export interface IDemoMode {
|
|
4
|
+
/**
|
|
5
|
+
* The number of milliseconds to wait before starting the game demo.
|
|
6
|
+
*/
|
|
7
|
+
startDelay: number;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The party to use when playing the demo.
|
|
11
|
+
*/
|
|
12
|
+
party: IParty;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The steps to play during the demo.
|
|
16
|
+
*/
|
|
17
|
+
steps: IAutoplayStep[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {ICharacter, ICompiledLocation, IGame, IItem} from 'storyScript';
|
|
2
|
+
|
|
3
|
+
export interface IExplorationRules {
|
|
4
|
+
/**
|
|
5
|
+
* When specified, this function will be called whenever the player enters a location.
|
|
6
|
+
* @param game The active game
|
|
7
|
+
* @param location The location the player enters
|
|
8
|
+
* @param previousLocationId The id of the location the player left traveling to the new location
|
|
9
|
+
* @param travel True if the player arrived by traveling, falsy otherwise. A player can get
|
|
10
|
+
* to a location without traveling when a game is loaded, for example.
|
|
11
|
+
*/
|
|
12
|
+
enterLocation?(game: IGame, location: ICompiledLocation, previousLocationId?: string, travel?: boolean): void;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* When specified, this function will be called whenever the player enters leaves a location.
|
|
16
|
+
* @param game The active game
|
|
17
|
+
* @param location The location the player leaves
|
|
18
|
+
* @param newLocationId The id of the location the player travels to
|
|
19
|
+
* @param travel True if the player leaves by traveling, falsy otherwise.
|
|
20
|
+
*/
|
|
21
|
+
leaveLocation?(game: IGame, location: ICompiledLocation, newLocationId?: string, travel?: boolean): void;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* When specified, this function will be called to determine whether a destination should
|
|
25
|
+
* be marked as visited.
|
|
26
|
+
* @param game The active game
|
|
27
|
+
* @param location The location the destination leads to
|
|
28
|
+
*/
|
|
29
|
+
hasVisitedLocation?(game: IGame, location: ICompiledLocation): boolean;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Specify this function if you want to run custom logic to set the description selector when selecting the description when
|
|
33
|
+
* entering a location. Return the selector string. This is useful if you for example want to show different descriptions at
|
|
34
|
+
* night.
|
|
35
|
+
* @param game The active game
|
|
36
|
+
*/
|
|
37
|
+
descriptionSelector?(game: IGame): string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Use this hook to run code just before the player tries to use an item. Return true if the
|
|
41
|
+
* item's use function should be run after your code has run, false otherwise.
|
|
42
|
+
* @param game The active game
|
|
43
|
+
* @param character The character using the item
|
|
44
|
+
* @param item The item about to be used
|
|
45
|
+
*/
|
|
46
|
+
onUseItem?(game: IGame, character: ICharacter, item: IItem): boolean;
|
|
47
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GameState,
|
|
3
|
+
ICharacter,
|
|
4
|
+
IGame,
|
|
5
|
+
IGroupableItem,
|
|
6
|
+
IInterfaceTexts,
|
|
7
|
+
IItem,
|
|
8
|
+
ITrade,
|
|
9
|
+
PlayState
|
|
10
|
+
} from 'storyScript';
|
|
11
|
+
|
|
12
|
+
export interface IGeneralRules {
|
|
13
|
+
/**
|
|
14
|
+
* This function is called when the party's score changes. Return true if you want to toggle the level-up
|
|
15
|
+
* status afterward.
|
|
16
|
+
* @param game The active game
|
|
17
|
+
* @param change The change in score.
|
|
18
|
+
*/
|
|
19
|
+
scoreChange?(game: IGame, change: number): boolean;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* This function is called when the game state changes.
|
|
23
|
+
* @param game The active game
|
|
24
|
+
* @param newGameState The new game state
|
|
25
|
+
* @param oldGameState The current game state
|
|
26
|
+
* */
|
|
27
|
+
gameStateChange?(game: IGame, newGameState: GameState, oldGameState: GameState): void;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* This function is called when the play state changes.
|
|
31
|
+
* @param game The active game
|
|
32
|
+
* @param newPlayState The new play state
|
|
33
|
+
* @param oldPlayState The current play state
|
|
34
|
+
* */
|
|
35
|
+
playStateChange?(game: IGame, newPlayState: PlayState, oldPlayState: PlayState): void;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Use this function if you want to run additonal logic when determining the player's final score on game end.
|
|
39
|
+
* @param game The game about to be ended
|
|
40
|
+
*/
|
|
41
|
+
determineFinalScore?(game: IGame): void;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Use this function to run logic before the game is saved. You can use this to change what is saved as part
|
|
45
|
+
* of a game.
|
|
46
|
+
* @param game The game about to be saved.
|
|
47
|
+
*/
|
|
48
|
+
beforeSave?(game: IGame): void;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Use this function to run logic after the game is saved. You can use this to revert changes you made in
|
|
52
|
+
* beforeSave.
|
|
53
|
+
* @param game The game about to be saved.
|
|
54
|
+
*/
|
|
55
|
+
afterSave?(game: IGame): void;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Use this function to override the standard way of naming items. This is useful if you want to use a
|
|
59
|
+
* different naming for items that are grouped.
|
|
60
|
+
* @param item The item to get the name for.
|
|
61
|
+
* @param texts The interface texts.
|
|
62
|
+
*/
|
|
63
|
+
getItemName?(item: IItem, texts: IInterfaceTexts): string;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Use this function if you want to use special rules for grouping items.
|
|
67
|
+
* @param character The character grouping the items.
|
|
68
|
+
* @param group The item that is the parent for the group.
|
|
69
|
+
* @param item The item to add as a member to the parent.
|
|
70
|
+
*/
|
|
71
|
+
canGroupItem?(character: ICharacter, group: IGroupableItem<IItem>, item: IGroupableItem<IItem>): boolean;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Use this function if you want to run code to determine whether an item can be sold to a buyer.
|
|
75
|
+
* @param game The game object
|
|
76
|
+
* @param item The item to sell
|
|
77
|
+
* @param buyer The potential buyer
|
|
78
|
+
*/
|
|
79
|
+
canBuyItem?(game: IGame, item: IItem, buyer: ITrade | ICharacter): boolean;
|
|
80
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ICharacterRules,
|
|
3
|
+
ICombatRules,
|
|
4
|
+
ICombinationRules,
|
|
5
|
+
IEncounterRules,
|
|
6
|
+
IExplorationRules,
|
|
7
|
+
IGeneralRules,
|
|
8
|
+
ISetupRules
|
|
9
|
+
} from 'storyScript';
|
|
10
|
+
|
|
11
|
+
export interface IRules {
|
|
12
|
+
/**
|
|
13
|
+
* Rules for setting up the game.
|
|
14
|
+
*/
|
|
15
|
+
setup: ISetupRules,
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* General game rules.
|
|
19
|
+
*/
|
|
20
|
+
general?: IGeneralRules,
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Rules for the game character.
|
|
24
|
+
*/
|
|
25
|
+
character: ICharacterRules,
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Rules for exploring.
|
|
29
|
+
*/
|
|
30
|
+
exploration?: IExplorationRules,
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Rules for encounters.
|
|
34
|
+
*/
|
|
35
|
+
encounters?: IEncounterRules,
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Rules for combat.
|
|
39
|
+
*/
|
|
40
|
+
combat?: ICombatRules,
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Rule for combat.
|
|
44
|
+
*/
|
|
45
|
+
combinations?: ICombinationRules
|
|
46
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {IGame, ITitleScreen, StateList} from 'storyScript';
|
|
2
|
+
|
|
3
|
+
export interface ISetupRules {
|
|
4
|
+
/**
|
|
5
|
+
* Specify a name of an image file in your resources folder to use that image as a custom mouse cursor.
|
|
6
|
+
* Don't use a large image, as the browser may not display it. Dimensions of 50x50 or 32x32 pixels work well.
|
|
7
|
+
*/
|
|
8
|
+
customCursorImage?: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Set this to a positive value greater than 1 to allow the player to create a party of more than
|
|
12
|
+
* one character.
|
|
13
|
+
*/
|
|
14
|
+
numberOfCharacters?: number;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Set this if you want to use a title screen.
|
|
18
|
+
*/
|
|
19
|
+
titleScreen?: ITitleScreen;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Set this to true if you want to show an intro screen when the game starts.
|
|
23
|
+
*/
|
|
24
|
+
intro?: boolean;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* When you want to play a music file when the game is in a certain state, use this list. Use it like this:
|
|
28
|
+
playList: {
|
|
29
|
+
[Using GameState:] 'play.mp4': [GameState.Play].
|
|
30
|
+
[For multiple game states:] 'play.mp4': [GameState.Intro, GameState.Play].
|
|
31
|
+
[Using PlayState:] 'combat.mp4': [PlayState.Combat].
|
|
32
|
+
[Using Locations:] 'start.mp4': [Start].
|
|
33
|
+
[Using a custom function:] '': [game => string] (the string value returned from the function should be the music file).
|
|
34
|
+
}
|
|
35
|
+
*/
|
|
36
|
+
playList?: StateList;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* When you want to fade out music before starting a new piece, set this interval. The interval is in miliseconds, so specify
|
|
40
|
+
* a sufficiently large value (e.g. 250). The volume will be reduced by 10% each interval, and the new music starts when the
|
|
41
|
+
* volume of the current music reaches 0.
|
|
42
|
+
*/
|
|
43
|
+
fadeMusicInterval?: number;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Run custom code to prepare the game before it begins. NOTE: this also runs when
|
|
47
|
+
* the browser reloads. If you want to run code only on the start of a new game, use
|
|
48
|
+
* gameStart instead.
|
|
49
|
+
* @param game The game about to be started
|
|
50
|
+
*/
|
|
51
|
+
initGame?(game: IGame): void;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Run custom code to prepare the game before entering the start location, e.g. adding game-specific
|
|
55
|
+
* world properties to it.
|
|
56
|
+
* @param game The game about to be started
|
|
57
|
+
*/
|
|
58
|
+
gameStart?(game: IGame): void;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Run custom code to prepare the game before resuming a game when loading a game.
|
|
62
|
+
* @param game The game about to be loaded
|
|
63
|
+
*/
|
|
64
|
+
continueGame?(game: IGame): void;
|
|
65
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {IDemoMode}from 'storyScript';
|
|
2
|
+
|
|
3
|
+
export interface ITitleScreen {
|
|
4
|
+
/**
|
|
5
|
+
* Set this flag to true if you want to show a title screen, false otherwise.
|
|
6
|
+
*/
|
|
7
|
+
showTitleScreen: boolean;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Set this function to get the demo configuration if you want to autoplay a demo game.
|
|
11
|
+
*/
|
|
12
|
+
getDemoMode?: () => IDemoMode;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The transition time to use to fade to the game demo from the title screen, and back out when the demo has run.
|
|
16
|
+
* Use the CSS format, e.g. '.1' or '1'.
|
|
17
|
+
*/
|
|
18
|
+
transitionDelay?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {ICompiledLocation} from './compiledLocation';
|
|
2
|
+
import {IStatistics} from './statistics';
|
|
3
|
+
import {IParty} from './party';
|
|
4
|
+
import { IMap } from './maps/map';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* An object to save the game state.
|
|
8
|
+
*/
|
|
9
|
+
export interface ISaveGame {
|
|
10
|
+
/**
|
|
11
|
+
* The party to save
|
|
12
|
+
*/
|
|
13
|
+
party: IParty;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The statistics to save.
|
|
17
|
+
*/
|
|
18
|
+
statistics: IStatistics;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The properties of the world to save.
|
|
22
|
+
*/
|
|
23
|
+
worldProperties: {};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The world locations to save.
|
|
27
|
+
*/
|
|
28
|
+
world: Record<string, ICompiledLocation>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The world maps to save.
|
|
32
|
+
*/
|
|
33
|
+
maps: Record<string, IMap>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The autoplaying audio that was started already.
|
|
37
|
+
*/
|
|
38
|
+
playedAudio: []
|
|
39
|
+
}
|