@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,238 @@
|
|
|
1
|
+
import {EquipmentType, IItem, ILocation, IParty}from 'storyScript';
|
|
2
|
+
import {StateProperties} from "./stateProperties";
|
|
3
|
+
|
|
4
|
+
const functionRenameRegex = /\$.+/i;
|
|
5
|
+
|
|
6
|
+
export function compareString(left: string, right: string): boolean {
|
|
7
|
+
if ((left === undefined && right === undefined) || (left === null && right === null)) {
|
|
8
|
+
return true;
|
|
9
|
+
} else if ((left === null || left === undefined) || (right === null || right === undefined)) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return left.toLowerCase() === right.toLowerCase();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function getId(id: Function | string) {
|
|
17
|
+
let actualId: string;
|
|
18
|
+
|
|
19
|
+
if (typeof id === 'function') {
|
|
20
|
+
// This is a workaround with function names changing when building for production.
|
|
21
|
+
// With Vite 7, we have e.g. Start becoming Start$2.
|
|
22
|
+
/* v8 ignore next 3 */
|
|
23
|
+
actualId = id.name.replace(functionRenameRegex, '');
|
|
24
|
+
} else {
|
|
25
|
+
actualId = id;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return actualId?.toLowerCase();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function isDataRecord(item: any[]): boolean {
|
|
32
|
+
// Check for either object or function values, as tuples are used to store actions as objects and functions now.
|
|
33
|
+
return item?.length && item.length === 2 && typeof (item[0]) === 'string' && (typeof (item[1]) === 'object' || typeof (item[1]) === 'function');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function getKeyPropertyNames(item: any, includeUniqueIds?: boolean): { first: string, second: string } {
|
|
37
|
+
if (item === undefined) {
|
|
38
|
+
return {first: null, second: null};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (isDataRecord(item)) {
|
|
42
|
+
return {first: '0', second: null};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let firstKeyProperty = includeUniqueIds && item[StateProperties.Id] !== undefined ? <string>StateProperties.Id : null;
|
|
46
|
+
firstKeyProperty ??= item.id !== undefined ? 'id' : null;
|
|
47
|
+
firstKeyProperty ??= item.target !== undefined ? 'target' : null;
|
|
48
|
+
firstKeyProperty ??= item.tool !== undefined ? 'tool' : null;
|
|
49
|
+
let secondKeyProperty = item.type !== undefined ? 'type' : null;
|
|
50
|
+
secondKeyProperty ??= item.combinationType !== undefined ? 'combinationType' : null;
|
|
51
|
+
|
|
52
|
+
return {first: firstKeyProperty, second: secondKeyProperty};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function propertyMatch(first: any, second: any): boolean {
|
|
56
|
+
if (first === undefined || second === undefined) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
let {first: firstProperty, second: secondProperty} = getKeyProperties(first, second);
|
|
61
|
+
|
|
62
|
+
if (firstProperty && secondProperty) {
|
|
63
|
+
return getValue(first[firstProperty]) === getValue(second[firstProperty])
|
|
64
|
+
&& getValue(first[secondProperty]) === getValue(second[secondProperty]);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (firstProperty || secondProperty) {
|
|
68
|
+
return (firstProperty && getValue(first[firstProperty]) === getValue(second[firstProperty])) ||
|
|
69
|
+
(secondProperty && getValue(first[secondProperty]) === getValue(second[secondProperty]));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function getPlural(name: string): string {
|
|
76
|
+
let plural: string;
|
|
77
|
+
|
|
78
|
+
if (name.endsWith('y')) {
|
|
79
|
+
plural = name.substring(0, name.length - 1) + 'ies';
|
|
80
|
+
} else if (name.endsWith('s')) {
|
|
81
|
+
plural = name;
|
|
82
|
+
} else {
|
|
83
|
+
plural = name + 's';
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return plural;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function getSingular(name: string): string {
|
|
90
|
+
let singular: string;
|
|
91
|
+
|
|
92
|
+
if (name.endsWith('ies')) {
|
|
93
|
+
singular = name.substring(0, name.length - 3) + 'y';
|
|
94
|
+
} else if (name.endsWith('e')) {
|
|
95
|
+
singular = name
|
|
96
|
+
} else {
|
|
97
|
+
singular = name.substring(0, name.length - 1);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return singular;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function parseHtmlDocumentFromString(document: string) {
|
|
104
|
+
const parser = new DOMParser();
|
|
105
|
+
return parser.parseFromString(document, 'text/html');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function addHtmlSpaces(text: string): string {
|
|
109
|
+
if (!text) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (text.substring(0, 1).trim() !== '' && !text.startsWith(' ')) {
|
|
114
|
+
text = ' ' + text;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (text.substring(text.length - 1, 1).trim() !== '' && text.substring(text.length - 6, 6) !== ' ') {
|
|
118
|
+
text = text + ' ';
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return text;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function isEmpty(object: any, property?: string) {
|
|
125
|
+
const objectToCheck = property ? object[property] : object;
|
|
126
|
+
|
|
127
|
+
if (objectToCheck) {
|
|
128
|
+
return Array.isArray(objectToCheck) ? objectToCheck.length === 0 : Object.keys(objectToCheck).length === 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export function equals<T extends { id?: string } | ILocation>(entity: T | string, definition: () => T): boolean {
|
|
135
|
+
const id = (entity as { id?: string })?.id ?? getId(entity as Function);
|
|
136
|
+
return id ? compareString(id, definition.name) : false;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function hasItem(party: IParty, item: IItem | string): boolean {
|
|
140
|
+
let hasItem = false;
|
|
141
|
+
|
|
142
|
+
// Check item available. Item list first, equipment second.
|
|
143
|
+
party.characters.forEach(c => {
|
|
144
|
+
if (hasItem) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
hasItem = c.items.get(item) !== undefined;
|
|
149
|
+
|
|
150
|
+
if (hasItem) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
for (const i in c.equipment) {
|
|
155
|
+
const slotItem = <IItem>c.equipment[i];
|
|
156
|
+
hasItem = slotItem && compareString(slotItem.id, (item as IItem)?.id ?? item as string);
|
|
157
|
+
|
|
158
|
+
if (hasItem) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
return hasItem;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function createPromiseForCallback<T>(callBack: Function): { promise: Promise<T>, promiseCallback: () => void } {
|
|
168
|
+
let resolveFunc = null;
|
|
169
|
+
|
|
170
|
+
const promiseCallback = () => {
|
|
171
|
+
const callBackResult = callBack();
|
|
172
|
+
Promise.resolve(callBackResult).then(() => {
|
|
173
|
+
resolveFunc?.();
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const promiseFunc = function (resolve: any) {
|
|
178
|
+
resolveFunc = resolve;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const promise = new Promise<T>(promiseFunc);
|
|
182
|
+
|
|
183
|
+
return {promise, promiseCallback};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export function wait(timeInMs: number, callBack: Function): Promise<void> {
|
|
187
|
+
const {promise, promiseCallback} = createPromiseForCallback<void>(callBack);
|
|
188
|
+
|
|
189
|
+
setTimeout(() => {
|
|
190
|
+
promiseCallback();
|
|
191
|
+
}, timeInMs);
|
|
192
|
+
|
|
193
|
+
return promise;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function interval(intervalTimeInMs: number, repeat: number, intervalCallback: Function, finalCallback?: Function): Promise<void> {
|
|
197
|
+
const {promise, promiseCallback} = createPromiseForCallback<void>(finalCallback ?? (() => {
|
|
198
|
+
}));
|
|
199
|
+
|
|
200
|
+
let count = 0;
|
|
201
|
+
|
|
202
|
+
const interval = setInterval(() => {
|
|
203
|
+
count++;
|
|
204
|
+
intervalCallback();
|
|
205
|
+
|
|
206
|
+
if (count >= repeat) {
|
|
207
|
+
clearInterval(interval);
|
|
208
|
+
|
|
209
|
+
if (finalCallback) {
|
|
210
|
+
setTimeout(() => {
|
|
211
|
+
promiseCallback();
|
|
212
|
+
}, intervalTimeInMs);
|
|
213
|
+
} else {
|
|
214
|
+
promiseCallback();
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}, intervalTimeInMs);
|
|
218
|
+
|
|
219
|
+
return promise;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export function getEquipmentType(slot: EquipmentType | string): string {
|
|
223
|
+
const type = EquipmentType[slot] ?? slot;
|
|
224
|
+
return type.substring(0, 1).toLowerCase() + type.substring(1);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function getKeyProperties(pristine: any, current: any): { first?: string, second?: string } {
|
|
228
|
+
const {first: pristineFirst, second: pristineSecond} = getKeyPropertyNames(pristine, true);
|
|
229
|
+
const {first: currentFirst, second: currentSecond} = getKeyPropertyNames(current, true);
|
|
230
|
+
return {
|
|
231
|
+
first: pristineFirst && currentFirst ? pristineFirst : null,
|
|
232
|
+
second: pristineSecond && currentSecond ? pristineSecond : null
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function getValue(value: any): string {
|
|
237
|
+
return typeof value === 'function' ? value.name.toLowerCase() : value;
|
|
238
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ICharacter } from 'storyScript';
|
|
2
|
+
import { IItem, IEquipment } from './types';
|
|
3
|
+
|
|
4
|
+
export class Character implements ICharacter {
|
|
5
|
+
name: string = '';
|
|
6
|
+
hitpoints: number = 10;
|
|
7
|
+
currentHitpoints: number;
|
|
8
|
+
|
|
9
|
+
// Add character properties here.
|
|
10
|
+
|
|
11
|
+
items: IItem[] = [];
|
|
12
|
+
|
|
13
|
+
equipment: IEquipment = {};
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
this.equipment = {
|
|
17
|
+
// Remove the slots you don't want to use. Remove them from your IEquipment interface too!
|
|
18
|
+
head: null,
|
|
19
|
+
amulet: null,
|
|
20
|
+
body: null,
|
|
21
|
+
hands: null,
|
|
22
|
+
leftHand: null,
|
|
23
|
+
leftRing: null,
|
|
24
|
+
rightHand: null,
|
|
25
|
+
rightRing: null,
|
|
26
|
+
legs: null,
|
|
27
|
+
feet: null
|
|
28
|
+
// Add your custom slots here. Make sure they are also present in your IEquipment interface.
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IEnemy as StoryScriptIEnemy, Enemy as StoryScriptEnemy } from 'storyScript';
|
|
2
|
+
import { IFeature, IItem } from '../types';
|
|
3
|
+
|
|
4
|
+
export function Enemy(entity: IEnemy): IEnemy {
|
|
5
|
+
return StoryScriptEnemy(entity);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface IEnemy extends IFeature, StoryScriptIEnemy {
|
|
9
|
+
items?: IItem[];
|
|
10
|
+
// Add game-specific enemy properties here
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IFeature as StoryScriptIFeature, Feature as StoryScriptFeature } from 'storyScript';
|
|
2
|
+
|
|
3
|
+
export function Feature(entity: IFeature): IFeature {
|
|
4
|
+
return StoryScriptFeature(entity);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface IFeature extends StoryScriptIFeature {
|
|
8
|
+
// Add game-specific item properties here
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IGame as StoryScriptIGame, IHelpers as StoryScriptIHelpers } from 'storyScript';
|
|
2
|
+
import { IPerson, ICompiledLocation, Character, ILocation, IEnemy, IItem, IParty } from '../types';
|
|
3
|
+
|
|
4
|
+
// Your game-specific game interface.
|
|
5
|
+
export interface IGame extends StoryScriptIGame {
|
|
6
|
+
party: IParty,
|
|
7
|
+
activeCharacter: Character;
|
|
8
|
+
person: IPerson;
|
|
9
|
+
locations: Record<string, ICompiledLocation> & {
|
|
10
|
+
get?(id?: string | (() => ILocation) | ICompiledLocation): ICompiledLocation;
|
|
11
|
+
};
|
|
12
|
+
currentLocation: ICompiledLocation;
|
|
13
|
+
previousLocation: ICompiledLocation;
|
|
14
|
+
helpers: IHelpers;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface IHelpers extends StoryScriptIHelpers {
|
|
18
|
+
randomEnemy: (selector?: (enemy: IEnemy) => boolean) => IEnemy;
|
|
19
|
+
randomItem: (selector?: (enemy: IItem) => boolean) => IItem;
|
|
20
|
+
getEnemy: (selector: string) => IEnemy;
|
|
21
|
+
getItem: (selector: string) => IItem;
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IGroupableItem as StoryScriptIGroupableItem,
|
|
3
|
+
IItem as StoryScriptIItem,
|
|
4
|
+
Item as StoryScriptItem
|
|
5
|
+
} from 'storyScript';
|
|
6
|
+
import {IFeature} from '../types';
|
|
7
|
+
|
|
8
|
+
export function Item<T extends IItem>(entity: T): T {
|
|
9
|
+
return StoryScriptItem(entity);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface IItem extends IFeature, StoryScriptIItem {
|
|
13
|
+
// Add game-specific item properties here
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface IGroupableItem extends IItem, StoryScriptIGroupableItem<IItem> {
|
|
17
|
+
// Add game-specific item properties here
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IKey as StoryScriptIKey, Key as StoryScriptKey } from 'storyScript';
|
|
2
|
+
import { IItem } from '../types';
|
|
3
|
+
|
|
4
|
+
export function Key(entity: IKey): IKey {
|
|
5
|
+
return StoryScriptKey(entity);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface IKey extends IItem, StoryScriptIKey {
|
|
9
|
+
// Add game-specific key properties here
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IDestination, IEnemy, IItem, IPerson } from '../types';
|
|
2
|
+
import { ILocation as StoryScriptILocation, Location as StoryScriptLocation, ICompiledLocation as StoryScriptICompiledLocation } from 'storyScript';
|
|
3
|
+
|
|
4
|
+
export function Location(entity: ILocation): ILocation {
|
|
5
|
+
return StoryScriptLocation(entity);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ILocation extends StoryScriptILocation {
|
|
9
|
+
destinations?: IDestination[];
|
|
10
|
+
enemies?: IEnemy[];
|
|
11
|
+
items?: IItem[];
|
|
12
|
+
persons?: IPerson[];
|
|
13
|
+
// Add game-specific location properties here
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ICompiledLocation extends ILocation, StoryScriptICompiledLocation {
|
|
17
|
+
destinations?: IDestination[];
|
|
18
|
+
enemies?: IEnemy[];
|
|
19
|
+
items?: IItem[];
|
|
20
|
+
persons?: IPerson[];
|
|
21
|
+
// Add game-specific location properties here
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IMap as StoryScriptIMap, LocationMap as StoryScriptLocationMap, IMapLocation as StoryScriptIMapLocation } from 'storyScript';
|
|
2
|
+
import {ILocation} from "./location";
|
|
3
|
+
|
|
4
|
+
export function LocationMap(entity: IMap): IMap {
|
|
5
|
+
return StoryScriptLocationMap(entity);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface IMap extends StoryScriptIMap {
|
|
9
|
+
locations: IMapLocation[];
|
|
10
|
+
// Add game-specific location properties here
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface IMapLocation extends StoryScriptIMapLocation {
|
|
14
|
+
location: (() => ILocation) | string;
|
|
15
|
+
// Add game-specific location properties here
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IPerson as StoryScriptIPerson, Person as StoryScriptPerson } from 'storyScript';
|
|
2
|
+
import { IEnemy, IItem, IQuest } from '../types';
|
|
3
|
+
|
|
4
|
+
export function Person(entity: IPerson): IPerson {
|
|
5
|
+
return StoryScriptPerson(entity);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface IPerson extends IEnemy, StoryScriptIPerson {
|
|
9
|
+
items?: IItem[];
|
|
10
|
+
quests?: IQuest[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IQuest as StoryScriptIQuest, Quest as StoryScriptQuest } from 'storyScript';
|
|
2
|
+
|
|
3
|
+
export function Quest(entity: IQuest): IQuest {
|
|
4
|
+
return StoryScriptQuest(entity);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface IQuest extends StoryScriptIQuest {
|
|
8
|
+
// Add game-specific item properties here
|
|
9
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {ICharacter, ICreateCharacter, IRules} from 'storyScript';
|
|
2
|
+
import {Character, ICombatSetup, IEnemy, IGame} from './types';
|
|
3
|
+
|
|
4
|
+
export function Rules(): IRules {
|
|
5
|
+
return {
|
|
6
|
+
setup: {},
|
|
7
|
+
|
|
8
|
+
combinations: {
|
|
9
|
+
combinationActions: [
|
|
10
|
+
// Add combination action names here if you want to use this feature.
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
general: {
|
|
15
|
+
scoreChange: (game: IGame, change: number): boolean => {
|
|
16
|
+
// Implement logic to occur when the score changes. Return true when the character gains a level.
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
character: {
|
|
22
|
+
getSheetAttributes: (): string[] => {
|
|
23
|
+
return [
|
|
24
|
+
// Add the character attributes that you want to show on the character sheet here
|
|
25
|
+
];
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
getCreateCharacterSheet: (): ICreateCharacter => {
|
|
29
|
+
return {
|
|
30
|
+
steps: [
|
|
31
|
+
// Add the character creation steps here, if you want to use character creation.
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
createCharacter: (game: IGame, characterData: ICreateCharacter): ICharacter => {
|
|
37
|
+
var character = new Character();
|
|
38
|
+
return character;
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
exploration: {},
|
|
43
|
+
|
|
44
|
+
combat: {
|
|
45
|
+
fight: (game: IGame, combatSetup: ICombatSetup, retaliate?: boolean) => {
|
|
46
|
+
retaliate = retaliate ?? retaliate;
|
|
47
|
+
|
|
48
|
+
// Implement character attack here.
|
|
49
|
+
|
|
50
|
+
if (retaliate) {
|
|
51
|
+
game.currentLocation.enemies.filter((enemy: IEnemy) => {
|
|
52
|
+
return enemy.currentHitpoints > 0;
|
|
53
|
+
}).forEach(enemy => {
|
|
54
|
+
// Implement monster attack here
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {IParty} from './interfaces/party';
|
|
2
|
+
import {IDestination} from './interfaces/destination';
|
|
3
|
+
import {Feature, IFeature} from './interfaces/feature';
|
|
4
|
+
import {IGroupableItem, IItem, Item} from './interfaces/item';
|
|
5
|
+
import {IKey, Key} from './interfaces/key';
|
|
6
|
+
import {Enemy, IEnemy} from './interfaces/enemy';
|
|
7
|
+
import {IPerson, Person} from './interfaces/person';
|
|
8
|
+
import {IQuest, Quest} from './interfaces/quest';
|
|
9
|
+
import {ICompiledLocation, ILocation, Location} from './interfaces/location';
|
|
10
|
+
import {IEquipment} from './interfaces/equipment';
|
|
11
|
+
import {IGame} from './interfaces/game';
|
|
12
|
+
import {CustomTexts} from './customTexts';
|
|
13
|
+
import {Rules} from './rules';
|
|
14
|
+
import {Character} from './character';
|
|
15
|
+
import {ICombatSetup} from './interfaces/combatSetup';
|
|
16
|
+
import {ICombatTurn} from './interfaces/combatTurn';
|
|
17
|
+
import {IMap, IMapLocation, LocationMap} from './interfaces/map';
|
|
18
|
+
import {IInterfaceTexts} from './interfaces/interfaceTexts';
|
|
19
|
+
import {IAction} from './interfaces/action';
|
|
20
|
+
|
|
21
|
+
export type {
|
|
22
|
+
IAction,
|
|
23
|
+
IParty,
|
|
24
|
+
IDestination,
|
|
25
|
+
IFeature,
|
|
26
|
+
IItem,
|
|
27
|
+
IGroupableItem,
|
|
28
|
+
IKey,
|
|
29
|
+
IEnemy,
|
|
30
|
+
IPerson,
|
|
31
|
+
IQuest,
|
|
32
|
+
ILocation,
|
|
33
|
+
IMap,
|
|
34
|
+
IMapLocation,
|
|
35
|
+
ICompiledLocation,
|
|
36
|
+
IEquipment,
|
|
37
|
+
IGame,
|
|
38
|
+
ICombatSetup,
|
|
39
|
+
ICombatTurn,
|
|
40
|
+
IInterfaceTexts
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
Feature,
|
|
45
|
+
Item,
|
|
46
|
+
Key,
|
|
47
|
+
Enemy,
|
|
48
|
+
Person,
|
|
49
|
+
Quest,
|
|
50
|
+
Location,
|
|
51
|
+
LocationMap,
|
|
52
|
+
CustomTexts,
|
|
53
|
+
Rules,
|
|
54
|
+
Character
|
|
55
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|