playlist-data-engine 1.1.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/LICENSE +21 -0
- package/README.md +352 -0
- package/dist/__vite-browser-external-DYxpcVy9.js +4 -0
- package/dist/constants/DefaultClasses.d.ts +46 -0
- package/dist/constants/DefaultClasses.d.ts.map +1 -0
- package/dist/constants/DefaultEnchantments.d.ts +337 -0
- package/dist/constants/DefaultEnchantments.d.ts.map +1 -0
- package/dist/constants/DefaultEnemies.d.ts +83 -0
- package/dist/constants/DefaultEnemies.d.ts.map +1 -0
- package/dist/constants/DefaultEquipment.d.ts +23 -0
- package/dist/constants/DefaultEquipment.d.ts.map +1 -0
- package/dist/constants/DefaultFeatures.d.ts +22 -0
- package/dist/constants/DefaultFeatures.d.ts.map +1 -0
- package/dist/constants/DefaultRaces.d.ts +102 -0
- package/dist/constants/DefaultRaces.d.ts.map +1 -0
- package/dist/constants/DefaultSkills.d.ts +26 -0
- package/dist/constants/DefaultSkills.d.ts.map +1 -0
- package/dist/constants/DefaultSpells.d.ts +41 -0
- package/dist/constants/DefaultSpells.d.ts.map +1 -0
- package/dist/constants/EncounterBalance.d.ts +208 -0
- package/dist/constants/EncounterBalance.d.ts.map +1 -0
- package/dist/constants/EnemyEquipment.d.ts +71 -0
- package/dist/constants/EnemyEquipment.d.ts.map +1 -0
- package/dist/constants/EnemyRarity.d.ts +79 -0
- package/dist/constants/EnemyRarity.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Construct.d.ts +63 -0
- package/dist/constants/EnemyTemplates/Construct.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Dragon.d.ts +68 -0
- package/dist/constants/EnemyTemplates/Dragon.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Elemental.d.ts +64 -0
- package/dist/constants/EnemyTemplates/Elemental.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Fiend.d.ts +62 -0
- package/dist/constants/EnemyTemplates/Fiend.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Monstrosity.d.ts +63 -0
- package/dist/constants/EnemyTemplates/Monstrosity.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Undead.d.ts +61 -0
- package/dist/constants/EnemyTemplates/Undead.d.ts.map +1 -0
- package/dist/constants/ItemTemplates.d.ts +40 -0
- package/dist/constants/ItemTemplates.d.ts.map +1 -0
- package/dist/constants/MagicItems.d.ts +30 -0
- package/dist/constants/MagicItems.d.ts.map +1 -0
- package/dist/constants/SpellSlots.d.ts +30 -0
- package/dist/constants/SpellSlots.d.ts.map +1 -0
- package/dist/constants/StatScaling.d.ts +113 -0
- package/dist/constants/StatScaling.d.ts.map +1 -0
- package/dist/core/analysis/AudioAnalyzer.d.ts +599 -0
- package/dist/core/analysis/AudioAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/ColorExtractor.d.ts +64 -0
- package/dist/core/analysis/ColorExtractor.d.ts.map +1 -0
- package/dist/core/analysis/EssentiaPitchDetector.d.ts +282 -0
- package/dist/core/analysis/EssentiaPitchDetector.d.ts.map +1 -0
- package/dist/core/analysis/LevelSerializer.d.ts +265 -0
- package/dist/core/analysis/LevelSerializer.d.ts.map +1 -0
- package/dist/core/analysis/MelodyContourAnalyzer.d.ts +283 -0
- package/dist/core/analysis/MelodyContourAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/MultiBandAnalyzer.d.ts +214 -0
- package/dist/core/analysis/MultiBandAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/MusicClassifier.d.ts +524 -0
- package/dist/core/analysis/MusicClassifier.d.ts.map +1 -0
- package/dist/core/analysis/PitchAnalyzer.d.ts +266 -0
- package/dist/core/analysis/PitchAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/PitchDetector.d.ts +251 -0
- package/dist/core/analysis/PitchDetector.d.ts.map +1 -0
- package/dist/core/analysis/SpectrumScanner.d.ts +52 -0
- package/dist/core/analysis/SpectrumScanner.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatInterpolator.d.ts +477 -0
- package/dist/core/analysis/beat/BeatInterpolator.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatMapGenerator.d.ts +170 -0
- package/dist/core/analysis/beat/BeatMapGenerator.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatStream.d.ts +316 -0
- package/dist/core/analysis/beat/BeatStream.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatSubdivider.d.ts +205 -0
- package/dist/core/analysis/beat/BeatSubdivider.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatTracker.d.ts +137 -0
- package/dist/core/analysis/beat/BeatTracker.d.ts.map +1 -0
- package/dist/core/analysis/beat/CompositeStreamGenerator.d.ts +180 -0
- package/dist/core/analysis/beat/CompositeStreamGenerator.d.ts.map +1 -0
- package/dist/core/analysis/beat/DensityAnalyzer.d.ts +246 -0
- package/dist/core/analysis/beat/DensityAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/beat/DifficultyVariantGenerator.d.ts +1082 -0
- package/dist/core/analysis/beat/DifficultyVariantGenerator.d.ts.map +1 -0
- package/dist/core/analysis/beat/GrooveAnalyzer.d.ts +192 -0
- package/dist/core/analysis/beat/GrooveAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/beat/OnsetStrengthEnvelope.d.ts +133 -0
- package/dist/core/analysis/beat/OnsetStrengthEnvelope.d.ts.map +1 -0
- package/dist/core/analysis/beat/PhraseAnalyzer.d.ts +230 -0
- package/dist/core/analysis/beat/PhraseAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/beat/RhythmQuantizer.d.ts +399 -0
- package/dist/core/analysis/beat/RhythmQuantizer.d.ts.map +1 -0
- package/dist/core/analysis/beat/RhythmicBalancer.d.ts +262 -0
- package/dist/core/analysis/beat/RhythmicBalancer.d.ts.map +1 -0
- package/dist/core/analysis/beat/StreamScorer.d.ts +275 -0
- package/dist/core/analysis/beat/StreamScorer.d.ts.map +1 -0
- package/dist/core/analysis/beat/TempoAwareQuantizer.d.ts +256 -0
- package/dist/core/analysis/beat/TempoAwareQuantizer.d.ts.map +1 -0
- package/dist/core/analysis/beat/TempoDetector.d.ts +220 -0
- package/dist/core/analysis/beat/TempoDetector.d.ts.map +1 -0
- package/dist/core/analysis/beat/TransientDetector.d.ts +303 -0
- package/dist/core/analysis/beat/TransientDetector.d.ts.map +1 -0
- package/dist/core/analysis/beat/beatKeyHelpers.d.ts +180 -0
- package/dist/core/analysis/beat/beatKeyHelpers.d.ts.map +1 -0
- package/dist/core/analysis/beat/index.d.ts +41 -0
- package/dist/core/analysis/beat/index.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/audioUtils.d.ts +204 -0
- package/dist/core/analysis/beat/utils/audioUtils.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/beatInterpolationDebug.d.ts +404 -0
- package/dist/core/analysis/beat/utils/beatInterpolationDebug.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/subdivideBeatMap.d.ts +61 -0
- package/dist/core/analysis/beat/utils/subdivideBeatMap.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/unifyBeatMap.d.ts +33 -0
- package/dist/core/analysis/beat/utils/unifyBeatMap.d.ts.map +1 -0
- package/dist/core/analysis/index.d.ts +18 -0
- package/dist/core/analysis/index.d.ts.map +1 -0
- package/dist/core/combat/AI/AICombatRunner.d.ts +108 -0
- package/dist/core/combat/AI/AICombatRunner.d.ts.map +1 -0
- package/dist/core/combat/AI/CombatAI.d.ts +179 -0
- package/dist/core/combat/AI/CombatAI.d.ts.map +1 -0
- package/dist/core/combat/AI/CombatMetricsTracker.d.ts +30 -0
- package/dist/core/combat/AI/CombatMetricsTracker.d.ts.map +1 -0
- package/dist/core/combat/Analysis/BalanceValidator.d.ts +170 -0
- package/dist/core/combat/Analysis/BalanceValidator.d.ts.map +1 -0
- package/dist/core/combat/Analysis/ComparativeAnalyzer.d.ts +231 -0
- package/dist/core/combat/Analysis/ComparativeAnalyzer.d.ts.map +1 -0
- package/dist/core/combat/Analysis/DifficultyCalculator.d.ts +203 -0
- package/dist/core/combat/Analysis/DifficultyCalculator.d.ts.map +1 -0
- package/dist/core/combat/Analysis/ParameterSweep.d.ts +201 -0
- package/dist/core/combat/Analysis/ParameterSweep.d.ts.map +1 -0
- package/dist/core/combat/AttackResolver.d.ts +220 -0
- package/dist/core/combat/AttackResolver.d.ts.map +1 -0
- package/dist/core/combat/CombatEngine.d.ts +388 -0
- package/dist/core/combat/CombatEngine.d.ts.map +1 -0
- package/dist/core/combat/DiceRoller.d.ts +115 -0
- package/dist/core/combat/DiceRoller.d.ts.map +1 -0
- package/dist/core/combat/InitiativeRoller.d.ts +62 -0
- package/dist/core/combat/InitiativeRoller.d.ts.map +1 -0
- package/dist/core/combat/PartyAnalyzer.d.ts +215 -0
- package/dist/core/combat/PartyAnalyzer.d.ts.map +1 -0
- package/dist/core/combat/SeededDiceRoller.d.ts +120 -0
- package/dist/core/combat/SeededDiceRoller.d.ts.map +1 -0
- package/dist/core/combat/Simulation/CombatSimulator.d.ts +366 -0
- package/dist/core/combat/Simulation/CombatSimulator.d.ts.map +1 -0
- package/dist/core/combat/SpellCaster.d.ts +113 -0
- package/dist/core/combat/SpellCaster.d.ts.map +1 -0
- package/dist/core/config/index.d.ts +24 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/progressionConfig.d.ts +73 -0
- package/dist/core/config/progressionConfig.d.ts.map +1 -0
- package/dist/core/config/sensorConfig.d.ts +134 -0
- package/dist/core/config/sensorConfig.d.ts.map +1 -0
- package/dist/core/equipment/BoxOpener.d.ts +175 -0
- package/dist/core/equipment/BoxOpener.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentEffectApplier.d.ts +189 -0
- package/dist/core/equipment/EquipmentEffectApplier.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentModifier.d.ts +327 -0
- package/dist/core/equipment/EquipmentModifier.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentSpawnHelper.d.ts +246 -0
- package/dist/core/equipment/EquipmentSpawnHelper.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentValidator.d.ts +173 -0
- package/dist/core/equipment/EquipmentValidator.d.ts.map +1 -0
- package/dist/core/extensions/ExtensionManager.d.ts +517 -0
- package/dist/core/extensions/ExtensionManager.d.ts.map +1 -0
- package/dist/core/extensions/WeightedSelector.d.ts +156 -0
- package/dist/core/extensions/WeightedSelector.d.ts.map +1 -0
- package/dist/core/extensions/index.d.ts +11 -0
- package/dist/core/extensions/index.d.ts.map +1 -0
- package/dist/core/extensions/initializeDefaults.d.ts +170 -0
- package/dist/core/extensions/initializeDefaults.d.ts.map +1 -0
- package/dist/core/features/FeatureEffectApplier.d.ts +102 -0
- package/dist/core/features/FeatureEffectApplier.d.ts.map +1 -0
- package/dist/core/features/FeatureQuery.d.ts +368 -0
- package/dist/core/features/FeatureQuery.d.ts.map +1 -0
- package/dist/core/features/FeatureTypes.d.ts +199 -0
- package/dist/core/features/FeatureTypes.d.ts.map +1 -0
- package/dist/core/features/FeatureValidator.d.ts +149 -0
- package/dist/core/features/FeatureValidator.d.ts.map +1 -0
- package/dist/core/features/index.d.ts +12 -0
- package/dist/core/features/index.d.ts.map +1 -0
- package/dist/core/generation/AbilityScoreCalculator.d.ts +83 -0
- package/dist/core/generation/AbilityScoreCalculator.d.ts.map +1 -0
- package/dist/core/generation/AppearanceGenerator.d.ts +32 -0
- package/dist/core/generation/AppearanceGenerator.d.ts.map +1 -0
- package/dist/core/generation/BeatConverter.d.ts +127 -0
- package/dist/core/generation/BeatConverter.d.ts.map +1 -0
- package/dist/core/generation/ButtonMapper.d.ts +346 -0
- package/dist/core/generation/ButtonMapper.d.ts.map +1 -0
- package/dist/core/generation/ButtonPatternLibrary.d.ts +92 -0
- package/dist/core/generation/ButtonPatternLibrary.d.ts.map +1 -0
- package/dist/core/generation/CRLevelConverter.d.ts +242 -0
- package/dist/core/generation/CRLevelConverter.d.ts.map +1 -0
- package/dist/core/generation/CharacterGenerator.d.ts +194 -0
- package/dist/core/generation/CharacterGenerator.d.ts.map +1 -0
- package/dist/core/generation/ClassSuggester.d.ts +184 -0
- package/dist/core/generation/ClassSuggester.d.ts.map +1 -0
- package/dist/core/generation/EnemyEquipmentGenerator.d.ts +151 -0
- package/dist/core/generation/EnemyEquipmentGenerator.d.ts.map +1 -0
- package/dist/core/generation/EnemyGenerator.d.ts +595 -0
- package/dist/core/generation/EnemyGenerator.d.ts.map +1 -0
- package/dist/core/generation/EquipmentGenerator.d.ts +204 -0
- package/dist/core/generation/EquipmentGenerator.d.ts.map +1 -0
- package/dist/core/generation/LegendaryGenerator.d.ts +213 -0
- package/dist/core/generation/LegendaryGenerator.d.ts.map +1 -0
- package/dist/core/generation/LevelGenerator.d.ts +390 -0
- package/dist/core/generation/LevelGenerator.d.ts.map +1 -0
- package/dist/core/generation/NamingEngine.d.ts +136 -0
- package/dist/core/generation/NamingEngine.d.ts.map +1 -0
- package/dist/core/generation/PitchBeatLinker.d.ts +150 -0
- package/dist/core/generation/PitchBeatLinker.d.ts.map +1 -0
- package/dist/core/generation/RaceSelector.d.ts +58 -0
- package/dist/core/generation/RaceSelector.d.ts.map +1 -0
- package/dist/core/generation/RhythmGenerator.d.ts +597 -0
- package/dist/core/generation/RhythmGenerator.d.ts.map +1 -0
- package/dist/core/generation/SkillAssigner.d.ts +78 -0
- package/dist/core/generation/SkillAssigner.d.ts.map +1 -0
- package/dist/core/generation/SpellManager.d.ts +132 -0
- package/dist/core/generation/SpellManager.d.ts.map +1 -0
- package/dist/core/generation/SpellcastingGenerator.d.ts +255 -0
- package/dist/core/generation/SpellcastingGenerator.d.ts.map +1 -0
- package/dist/core/generation/index.d.ts +41 -0
- package/dist/core/generation/index.d.ts.map +1 -0
- package/dist/core/parser/MetadataExtractor.d.ts +66 -0
- package/dist/core/parser/MetadataExtractor.d.ts.map +1 -0
- package/dist/core/parser/PlaylistParser.d.ts +45 -0
- package/dist/core/parser/PlaylistParser.d.ts.map +1 -0
- package/dist/core/playback/SubdivisionPlaybackController.d.ts +333 -0
- package/dist/core/playback/SubdivisionPlaybackController.d.ts.map +1 -0
- package/dist/core/playback/index.d.ts +5 -0
- package/dist/core/playback/index.d.ts.map +1 -0
- package/dist/core/progression/CharacterUpdater.d.ts +203 -0
- package/dist/core/progression/CharacterUpdater.d.ts.map +1 -0
- package/dist/core/progression/LevelUpProcessor.d.ts +234 -0
- package/dist/core/progression/LevelUpProcessor.d.ts.map +1 -0
- package/dist/core/progression/PrestigeSystem.d.ts +217 -0
- package/dist/core/progression/PrestigeSystem.d.ts.map +1 -0
- package/dist/core/progression/RhythmXPCalculator.d.ts +182 -0
- package/dist/core/progression/RhythmXPCalculator.d.ts.map +1 -0
- package/dist/core/progression/SessionTracker.d.ts +169 -0
- package/dist/core/progression/SessionTracker.d.ts.map +1 -0
- package/dist/core/progression/XPCalculator.d.ts +128 -0
- package/dist/core/progression/XPCalculator.d.ts.map +1 -0
- package/dist/core/progression/stat/StatIncreaseStrategy.d.ts +97 -0
- package/dist/core/progression/stat/StatIncreaseStrategy.d.ts.map +1 -0
- package/dist/core/progression/stat/StatManager.d.ts +179 -0
- package/dist/core/progression/stat/StatManager.d.ts.map +1 -0
- package/dist/core/sensors/EnvironmentalSensors.d.ts +301 -0
- package/dist/core/sensors/EnvironmentalSensors.d.ts.map +1 -0
- package/dist/core/sensors/GamingPlatformSensors.d.ts +162 -0
- package/dist/core/sensors/GamingPlatformSensors.d.ts.map +1 -0
- package/dist/core/sensors/GeolocationProvider.d.ts +156 -0
- package/dist/core/sensors/GeolocationProvider.d.ts.map +1 -0
- package/dist/core/sensors/MotionDetector.d.ts +58 -0
- package/dist/core/sensors/MotionDetector.d.ts.map +1 -0
- package/dist/core/sensors/SteamAPIClient.d.ts +108 -0
- package/dist/core/sensors/SteamAPIClient.d.ts.map +1 -0
- package/dist/core/sensors/WeatherAPIClient.d.ts +360 -0
- package/dist/core/sensors/WeatherAPIClient.d.ts.map +1 -0
- package/dist/core/sensors/schemas/weather.schema.d.ts +144 -0
- package/dist/core/sensors/schemas/weather.schema.d.ts.map +1 -0
- package/dist/core/skills/SkillQuery.d.ts +159 -0
- package/dist/core/skills/SkillQuery.d.ts.map +1 -0
- package/dist/core/skills/SkillTypes.d.ts +233 -0
- package/dist/core/skills/SkillTypes.d.ts.map +1 -0
- package/dist/core/skills/SkillValidator.d.ts +146 -0
- package/dist/core/skills/SkillValidator.d.ts.map +1 -0
- package/dist/core/skills/index.d.ts +11 -0
- package/dist/core/skills/index.d.ts.map +1 -0
- package/dist/core/spells/SpellQuery.d.ts +194 -0
- package/dist/core/spells/SpellQuery.d.ts.map +1 -0
- package/dist/core/spells/SpellTypes.d.ts +71 -0
- package/dist/core/spells/SpellTypes.d.ts.map +1 -0
- package/dist/core/spells/SpellValidator.d.ts +129 -0
- package/dist/core/spells/SpellValidator.d.ts.map +1 -0
- package/dist/core/spells/index.d.ts +11 -0
- package/dist/core/spells/index.d.ts.map +1 -0
- package/dist/core/types/AudioProfile.d.ts +143 -0
- package/dist/core/types/AudioProfile.d.ts.map +1 -0
- package/dist/core/types/BeatMap.d.ts +1825 -0
- package/dist/core/types/BeatMap.d.ts.map +1 -0
- package/dist/core/types/ButtonMapping.d.ts +345 -0
- package/dist/core/types/ButtonMapping.d.ts.map +1 -0
- package/dist/core/types/Character.d.ts +397 -0
- package/dist/core/types/Character.d.ts.map +1 -0
- package/dist/core/types/ChartedBeatMap.d.ts +169 -0
- package/dist/core/types/ChartedBeatMap.d.ts.map +1 -0
- package/dist/core/types/Combat.d.ts +268 -0
- package/dist/core/types/Combat.d.ts.map +1 -0
- package/dist/core/types/CombatAI.d.ts +143 -0
- package/dist/core/types/CombatAI.d.ts.map +1 -0
- package/dist/core/types/Enemy.d.ts +447 -0
- package/dist/core/types/Enemy.d.ts.map +1 -0
- package/dist/core/types/Environmental.d.ts +213 -0
- package/dist/core/types/Environmental.d.ts.map +1 -0
- package/dist/core/types/Equipment.d.ts +309 -0
- package/dist/core/types/Equipment.d.ts.map +1 -0
- package/dist/core/types/ISessionTracker.d.ts +48 -0
- package/dist/core/types/ISessionTracker.d.ts.map +1 -0
- package/dist/core/types/LevelExport.d.ts +366 -0
- package/dist/core/types/LevelExport.d.ts.map +1 -0
- package/dist/core/types/Playlist.d.ts +70 -0
- package/dist/core/types/Playlist.d.ts.map +1 -0
- package/dist/core/types/Prestige.d.ts +94 -0
- package/dist/core/types/Prestige.d.ts.map +1 -0
- package/dist/core/types/Progression.d.ts +214 -0
- package/dist/core/types/Progression.d.ts.map +1 -0
- package/dist/core/types/RhythmXP.d.ts +398 -0
- package/dist/core/types/RhythmXP.d.ts.map +1 -0
- package/dist/core/utils/AbilityConstants.d.ts +31 -0
- package/dist/core/utils/AbilityConstants.d.ts.map +1 -0
- package/dist/core/utils/EffectApplierUtils.d.ts +56 -0
- package/dist/core/utils/EffectApplierUtils.d.ts.map +1 -0
- package/dist/core/utils/ImageValidator.d.ts +66 -0
- package/dist/core/utils/ImageValidator.d.ts.map +1 -0
- package/dist/core/utils/PrerequisiteValidator.d.ts +88 -0
- package/dist/core/utils/PrerequisiteValidator.d.ts.map +1 -0
- package/dist/essentia-wasm.es-BUEnKUts.js +2990 -0
- package/dist/essentia.js-model.es-CGA0xotH.js +306 -0
- package/dist/index.d.ts +176 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/playlist-data-engine.js +124 -0
- package/dist/playlist-data-engine.mjs +49251 -0
- package/dist/utils/EnchantmentLibrary.d.ts +378 -0
- package/dist/utils/EnchantmentLibrary.d.ts.map +1 -0
- package/dist/utils/arweaveGatewayManager.d.ts +485 -0
- package/dist/utils/arweaveGatewayManager.d.ts.map +1 -0
- package/dist/utils/arweaveUtils.d.ts +118 -0
- package/dist/utils/arweaveUtils.d.ts.map +1 -0
- package/dist/utils/constants.d.ts +439 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/equipmentConstants.d.ts +60 -0
- package/dist/utils/equipmentConstants.d.ts.map +1 -0
- package/dist/utils/hash.d.ts +33 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +192 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/magicItemExamples.d.ts +46 -0
- package/dist/utils/magicItemExamples.d.ts.map +1 -0
- package/dist/utils/playlistUtils.d.ts +149 -0
- package/dist/utils/playlistUtils.d.ts.map +1 -0
- package/dist/utils/random.d.ts +34 -0
- package/dist/utils/random.d.ts.map +1 -0
- package/dist/utils/sensorDashboard.d.ts +60 -0
- package/dist/utils/sensorDashboard.d.ts.map +1 -0
- package/dist/utils/validators.d.ts +189 -0
- package/dist/utils/validators.d.ts.map +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SessionTracker - Manages listening sessions with timestamps and XP calculation
|
|
3
|
+
* Based on specs/001-core-engine/SPEC.md
|
|
4
|
+
*/
|
|
5
|
+
import type { ListeningSession, EnvironmentalContext, GamingContext } from '../types/Progression.js';
|
|
6
|
+
import type { PlaylistTrack } from '../types/Playlist.js';
|
|
7
|
+
import type { ISessionTracker } from '../types/ISessionTracker.js';
|
|
8
|
+
import { XPCalculator } from './XPCalculator.js';
|
|
9
|
+
/**
|
|
10
|
+
* ActiveSession tracks a currently-playing listening session
|
|
11
|
+
*/
|
|
12
|
+
interface ActiveSession {
|
|
13
|
+
track_uuid: string;
|
|
14
|
+
start_time: number;
|
|
15
|
+
track?: PlaylistTrack;
|
|
16
|
+
environmental_context?: EnvironmentalContext;
|
|
17
|
+
gaming_context?: GamingContext;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* SessionTracker class - Records and manages listening sessions
|
|
21
|
+
* Tracks active sessions and calculates XP earned
|
|
22
|
+
* Implements ISessionTracker for dependency injection flexibility
|
|
23
|
+
*/
|
|
24
|
+
export declare class SessionTracker implements ISessionTracker {
|
|
25
|
+
private activeSessions;
|
|
26
|
+
private sessionHistory;
|
|
27
|
+
private xpCalculator;
|
|
28
|
+
private sessionCounter;
|
|
29
|
+
/**
|
|
30
|
+
* Create a new SessionTracker
|
|
31
|
+
* @param xpCalculator - Optional custom XPCalculator instance
|
|
32
|
+
*/
|
|
33
|
+
constructor(xpCalculator?: XPCalculator);
|
|
34
|
+
/**
|
|
35
|
+
* Start a new listening session
|
|
36
|
+
* @param trackUuid - UUID of the track being listened to
|
|
37
|
+
* @param track - Optional PlaylistTrack object for metadata
|
|
38
|
+
* @param context - Optional environmental and gaming context
|
|
39
|
+
* @returns Session ID for tracking
|
|
40
|
+
*/
|
|
41
|
+
startSession(trackUuid: string, track?: PlaylistTrack, context?: {
|
|
42
|
+
environmental_context?: EnvironmentalContext;
|
|
43
|
+
gaming_context?: GamingContext;
|
|
44
|
+
}): string;
|
|
45
|
+
/**
|
|
46
|
+
* End a listening session and record it
|
|
47
|
+
* @param sessionId - The session ID returned from startSession
|
|
48
|
+
* @param durationOverride - Optional override for session duration (in seconds)
|
|
49
|
+
* @param activityType - Optional activity type (stationary, walking, running, driving)
|
|
50
|
+
* @returns The completed ListeningSession or null if session not found
|
|
51
|
+
*/
|
|
52
|
+
endSession(sessionId: string, durationOverride?: number, activityType?: string): ListeningSession | null;
|
|
53
|
+
/**
|
|
54
|
+
* Get an active session without ending it
|
|
55
|
+
* Useful for tracking real-time progress
|
|
56
|
+
* @param sessionId - The session ID
|
|
57
|
+
* @returns The active session or null
|
|
58
|
+
*/
|
|
59
|
+
getActiveSession(sessionId: string): ActiveSession | null;
|
|
60
|
+
/**
|
|
61
|
+
* Get duration of active session in seconds
|
|
62
|
+
* @param sessionId - The session ID
|
|
63
|
+
* @returns Duration in seconds or null if session not found
|
|
64
|
+
*/
|
|
65
|
+
getActiveSessionDuration(sessionId: string): number | null;
|
|
66
|
+
/**
|
|
67
|
+
* Update context for an active session
|
|
68
|
+
* @param sessionId - The session ID
|
|
69
|
+
* @param context - New context data
|
|
70
|
+
* @returns True if updated, false if session not found
|
|
71
|
+
*/
|
|
72
|
+
updateSessionContext(sessionId: string, context: {
|
|
73
|
+
environmental_context?: EnvironmentalContext;
|
|
74
|
+
gaming_context?: GamingContext;
|
|
75
|
+
}): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Get all recorded sessions
|
|
78
|
+
* @returns Array of all completed listening sessions
|
|
79
|
+
*/
|
|
80
|
+
getSessionHistory(): ListeningSession[];
|
|
81
|
+
/**
|
|
82
|
+
* Get sessions for a specific track
|
|
83
|
+
* @param trackUuid - The track UUID to filter by
|
|
84
|
+
* @returns Array of sessions for that track
|
|
85
|
+
*/
|
|
86
|
+
getSessionsForTrack(trackUuid: string): ListeningSession[];
|
|
87
|
+
/**
|
|
88
|
+
* Get total listening time across all sessions
|
|
89
|
+
* @returns Total time in seconds
|
|
90
|
+
*/
|
|
91
|
+
getTotalListeningTime(): number;
|
|
92
|
+
/**
|
|
93
|
+
* Get total XP earned across all sessions
|
|
94
|
+
* @returns Total XP
|
|
95
|
+
*/
|
|
96
|
+
getTotalXPEarned(): number;
|
|
97
|
+
/**
|
|
98
|
+
* Get total listening time for a specific track
|
|
99
|
+
* @param trackUuid - The track UUID
|
|
100
|
+
* @returns Total time in seconds for that track
|
|
101
|
+
*/
|
|
102
|
+
getTrackListeningTime(trackUuid: string): number;
|
|
103
|
+
/**
|
|
104
|
+
* Get listen count for a track (number of sessions)
|
|
105
|
+
* @param trackUuid - The track UUID
|
|
106
|
+
* @returns Number of times the track has been listened to
|
|
107
|
+
*/
|
|
108
|
+
getTrackListenCount(trackUuid: string): number;
|
|
109
|
+
/**
|
|
110
|
+
* Check if a track has been mastered
|
|
111
|
+
* @param trackUuid - The track UUID
|
|
112
|
+
* @param masteryThreshold - Minimum listen count to master (default 10)
|
|
113
|
+
* @returns True if track is mastered
|
|
114
|
+
*/
|
|
115
|
+
isTrackMastered(trackUuid: string, masteryThreshold?: number): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Get sessions within a time range
|
|
118
|
+
* @param startTime - Start timestamp (Unix ms)
|
|
119
|
+
* @param endTime - End timestamp (Unix ms)
|
|
120
|
+
* @returns Array of sessions within the range
|
|
121
|
+
*/
|
|
122
|
+
getSessionsInRange(startTime: number, endTime: number): ListeningSession[];
|
|
123
|
+
/**
|
|
124
|
+
* Get average session length
|
|
125
|
+
* @returns Average duration in seconds
|
|
126
|
+
*/
|
|
127
|
+
getAverageSessionLength(): number;
|
|
128
|
+
/**
|
|
129
|
+
* Get the longest session
|
|
130
|
+
* @returns ListeningSession with longest duration or null
|
|
131
|
+
*/
|
|
132
|
+
getLongestSession(): ListeningSession | null;
|
|
133
|
+
/**
|
|
134
|
+
* Get total XP earned for a specific track.
|
|
135
|
+
* Used by the prestige system to calculate track-level XP.
|
|
136
|
+
* @param trackUuid - The track UUID
|
|
137
|
+
* @returns Total XP earned from sessions for this track
|
|
138
|
+
*/
|
|
139
|
+
getTrackXPTotal(trackUuid: string): number;
|
|
140
|
+
/**
|
|
141
|
+
* Clear all sessions for a specific track.
|
|
142
|
+
* Used by the prestige system to reset track progress after prestiging.
|
|
143
|
+
* @param trackUuid - The track UUID to clear sessions for
|
|
144
|
+
* @returns Number of sessions that were removed
|
|
145
|
+
*/
|
|
146
|
+
clearTrackSessions(trackUuid: string): number;
|
|
147
|
+
/**
|
|
148
|
+
* Clear all session history
|
|
149
|
+
* Useful for testing or resetting
|
|
150
|
+
*/
|
|
151
|
+
clearHistory(): void;
|
|
152
|
+
/**
|
|
153
|
+
* Clear active sessions
|
|
154
|
+
* Use with caution - active sessions will be lost
|
|
155
|
+
*/
|
|
156
|
+
clearActiveSessions(): void;
|
|
157
|
+
/**
|
|
158
|
+
* Get count of active sessions
|
|
159
|
+
* @returns Number of currently active sessions
|
|
160
|
+
*/
|
|
161
|
+
getActiveSessionCount(): number;
|
|
162
|
+
/**
|
|
163
|
+
* Get all active session IDs
|
|
164
|
+
* @returns Array of active session IDs
|
|
165
|
+
*/
|
|
166
|
+
getActiveSessionIds(): string[];
|
|
167
|
+
}
|
|
168
|
+
export {};
|
|
169
|
+
//# sourceMappingURL=SessionTracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionTracker.d.ts","sourceRoot":"","sources":["../../../src/core/progression/SessionTracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACR,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;GAEG;AACH,UAAU,aAAa;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,qBAAqB,CAAC,EAAE,oBAAoB,CAAC;IAC7C,cAAc,CAAC,EAAE,aAAa,CAAC;CAClC;AAED;;;;GAIG;AACH,qBAAa,cAAe,YAAW,eAAe;IAClD,OAAO,CAAC,cAAc,CAAyC;IAC/D,OAAO,CAAC,cAAc,CAA0B;IAChD,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,cAAc,CAAa;IAEnC;;;OAGG;gBACS,YAAY,CAAC,EAAE,YAAY;IAIvC;;;;;;OAMG;IACH,YAAY,CACR,SAAS,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE;QACN,qBAAqB,CAAC,EAAE,oBAAoB,CAAC;QAC7C,cAAc,CAAC,EAAE,aAAa,CAAC;KAClC,GACF,MAAM;IAeT;;;;;;OAMG;IACH,UAAU,CACN,SAAS,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,MAAM,EACzB,YAAY,CAAC,EAAE,MAAM,GACtB,gBAAgB,GAAG,IAAI;IA2C1B;;;;;OAKG;IACH,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAA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1
|
+
/**
|
|
2
|
+
* XPCalculator - Handles all XP calculations for listening sessions
|
|
3
|
+
* Based on specs/001-core-engine/SPEC.md
|
|
4
|
+
*/
|
|
5
|
+
import type { ListeningSession, EnvironmentalContext, GamingContext } from '../types/Progression.js';
|
|
6
|
+
import type { RhythmGameContext } from '../types/RhythmXP.js';
|
|
7
|
+
import type { PlaylistTrack } from '../types/Playlist.js';
|
|
8
|
+
import type { ExperienceSystem } from '../types/Progression.js';
|
|
9
|
+
/**
|
|
10
|
+
* XPCalculator class - Manages experience point calculations
|
|
11
|
+
* with support for activity, environmental, and gaming bonuses
|
|
12
|
+
*/
|
|
13
|
+
export declare class XPCalculator {
|
|
14
|
+
private config;
|
|
15
|
+
/**
|
|
16
|
+
* Create a new XPCalculator
|
|
17
|
+
* @param options - Configuration options for XP calculation
|
|
18
|
+
*/
|
|
19
|
+
constructor(options?: Partial<ExperienceSystem>);
|
|
20
|
+
/**
|
|
21
|
+
* Calculate total XP earned for a listening session
|
|
22
|
+
* Applies all multipliers: base, activity, environmental, gaming, rhythm game
|
|
23
|
+
*
|
|
24
|
+
* @param session - The listening session
|
|
25
|
+
* @param track - The playlist track (for duration validation)
|
|
26
|
+
* @returns Total XP earned after all bonuses
|
|
27
|
+
*/
|
|
28
|
+
calculateSessionXP(session: ListeningSession, track?: PlaylistTrack): number;
|
|
29
|
+
/**
|
|
30
|
+
* Apply environmental bonuses to XP
|
|
31
|
+
* Accounts for time of day, weather, altitude, biome
|
|
32
|
+
*
|
|
33
|
+
* @param baseXP - Base XP value
|
|
34
|
+
* @param context - Environmental context data
|
|
35
|
+
* @returns XP with environmental bonuses applied
|
|
36
|
+
*/
|
|
37
|
+
private applyEnvironmentalBonus;
|
|
38
|
+
/**
|
|
39
|
+
* Apply gaming bonuses to XP
|
|
40
|
+
* Rewards users who listen while gaming
|
|
41
|
+
*
|
|
42
|
+
* @param baseXP - Base XP value
|
|
43
|
+
* @param context - Gaming context data
|
|
44
|
+
* @returns XP with gaming bonuses applied
|
|
45
|
+
*/
|
|
46
|
+
private applyGamingBonus;
|
|
47
|
+
/**
|
|
48
|
+
* Apply rhythm game bonuses to XP
|
|
49
|
+
* Rewards users who play rhythm game while listening (System B)
|
|
50
|
+
*
|
|
51
|
+
* @param baseXP - Base XP value
|
|
52
|
+
* @param context - Rhythm game context data
|
|
53
|
+
* @returns XP with rhythm game bonuses applied
|
|
54
|
+
*/
|
|
55
|
+
private applyRhythmGameBonus;
|
|
56
|
+
/**
|
|
57
|
+
* Calculate total XP modifier (environmental + gaming combined)
|
|
58
|
+
* Capped at 3.0x to prevent excessive stacking
|
|
59
|
+
*
|
|
60
|
+
* @param envContext - Environmental context (optional)
|
|
61
|
+
* @param gamingContext - Gaming context (optional)
|
|
62
|
+
* @param rhythmGameContext - Rhythm game context (optional)
|
|
63
|
+
* @returns Combined multiplier (1.0 to 3.0)
|
|
64
|
+
*/
|
|
65
|
+
calculateTotalModifier(envContext?: EnvironmentalContext, gamingContext?: GamingContext, rhythmGameContext?: RhythmGameContext): number;
|
|
66
|
+
/**
|
|
67
|
+
* Calculate environmental XP modifier
|
|
68
|
+
*
|
|
69
|
+
* @param context - Environmental context
|
|
70
|
+
* @returns Multiplier (1.0 to 3.0)
|
|
71
|
+
*/
|
|
72
|
+
private calculateEnvironmentalModifier;
|
|
73
|
+
/**
|
|
74
|
+
* Calculate gaming XP modifier
|
|
75
|
+
*
|
|
76
|
+
* @param context - Gaming context
|
|
77
|
+
* @returns Multiplier (1.0 to 1.75)
|
|
78
|
+
*/
|
|
79
|
+
private calculateGamingModifier;
|
|
80
|
+
/**
|
|
81
|
+
* Calculate rhythm game XP modifier (System B)
|
|
82
|
+
*
|
|
83
|
+
* @param context - Rhythm game context
|
|
84
|
+
* @returns Multiplier (1.0 to 2.25)
|
|
85
|
+
*/
|
|
86
|
+
private calculateRhythmGameModifier;
|
|
87
|
+
/**
|
|
88
|
+
* Get the XP threshold for a specific level
|
|
89
|
+
*
|
|
90
|
+
* @param level - The level (1-20)
|
|
91
|
+
* @returns Total XP required to reach that level
|
|
92
|
+
*/
|
|
93
|
+
getXPThresholdForLevel(level: number): number;
|
|
94
|
+
/**
|
|
95
|
+
* Get the XP required to advance from current level to next
|
|
96
|
+
*
|
|
97
|
+
* @param currentLevel - Current level (1-19)
|
|
98
|
+
* @returns XP needed to reach next level
|
|
99
|
+
*/
|
|
100
|
+
getXPToNextLevel(currentLevel: number): number;
|
|
101
|
+
/**
|
|
102
|
+
* Determine what level a character should be at with given XP total
|
|
103
|
+
*
|
|
104
|
+
* @param totalXP - Total experience points
|
|
105
|
+
* @returns Character level (1-20)
|
|
106
|
+
*/
|
|
107
|
+
getLevelFromXP(totalXP: number): number;
|
|
108
|
+
/**
|
|
109
|
+
* Check if track is mastered based on listen count
|
|
110
|
+
*
|
|
111
|
+
* @param listenCount - Number of times the track has been listened to
|
|
112
|
+
* @returns True if listen count meets or exceeds mastery threshold
|
|
113
|
+
*/
|
|
114
|
+
isTrackMastered(listenCount: number): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Get the mastery bonus XP
|
|
117
|
+
*
|
|
118
|
+
* @returns XP bonus for mastering a track
|
|
119
|
+
*/
|
|
120
|
+
getMasteryBonusXP(): number;
|
|
121
|
+
/**
|
|
122
|
+
* Get current configuration
|
|
123
|
+
*
|
|
124
|
+
* @returns The ExperienceSystem configuration
|
|
125
|
+
*/
|
|
126
|
+
getConfig(): ExperienceSystem;
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=XPCalculator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XPCalculator.d.ts","sourceRoot":"","sources":["../../../src/core/progression/XPCalculator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAA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ides multiple strategies for determining which stats to increase on level up:
|
|
5
|
+
* - DnD5eStandardStrategy: Manual selection (D&D 5e default)
|
|
6
|
+
* - DnD5eSmartStrategy: Intelligent auto-selection
|
|
7
|
+
* - BalancedStrategy: Always balances lowest stats
|
|
8
|
+
* - PrimaryOnlyStrategy: Always boosts class primary
|
|
9
|
+
* - RandomStrategy: Random selection
|
|
10
|
+
* - ManualStrategy: Requires explicit input
|
|
11
|
+
* - Function support: Accepts simple functions
|
|
12
|
+
*/
|
|
13
|
+
import type { CharacterSheet, Ability } from '../../types/Character.js';
|
|
14
|
+
import type { StatIncreaseStrategy, StatIncreaseOptions, StatIncreaseStrategyType, StatIncreaseFunction } from '../../types/Progression.js';
|
|
15
|
+
/**
|
|
16
|
+
* D&D 5e Standard Strategy
|
|
17
|
+
* Returns empty array requiring manual selection (D&D 5e default behavior)
|
|
18
|
+
*/
|
|
19
|
+
export declare class DnD5eStandardStrategy implements StatIncreaseStrategy {
|
|
20
|
+
readonly name = "D&D 5e Standard";
|
|
21
|
+
selectIncreases(character: CharacterSheet, increaseAmount: number, options?: StatIncreaseOptions): Array<{
|
|
22
|
+
ability: Ability;
|
|
23
|
+
amount: number;
|
|
24
|
+
}>;
|
|
25
|
+
requiresManualInput(options?: StatIncreaseOptions): boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* D&D 5e Smart Strategy
|
|
29
|
+
* Intelligently selects based on class and current stats
|
|
30
|
+
*/
|
|
31
|
+
export declare class DnD5eSmartStrategy implements StatIncreaseStrategy {
|
|
32
|
+
readonly name = "D&D 5e Smart";
|
|
33
|
+
selectIncreases(character: CharacterSheet, increaseAmount: number, options?: StatIncreaseOptions): Array<{
|
|
34
|
+
ability: Ability;
|
|
35
|
+
amount: number;
|
|
36
|
+
}>;
|
|
37
|
+
requiresManualInput(): boolean;
|
|
38
|
+
private shouldSplit;
|
|
39
|
+
private findLowestStat;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Balanced Strategy
|
|
43
|
+
* Always increases the two lowest stats by +1 each (or distributes evenly)
|
|
44
|
+
*/
|
|
45
|
+
export declare class BalancedStrategy implements StatIncreaseStrategy {
|
|
46
|
+
readonly name = "Balanced";
|
|
47
|
+
selectIncreases(character: CharacterSheet, increaseAmount: number, options?: StatIncreaseOptions): Array<{
|
|
48
|
+
ability: Ability;
|
|
49
|
+
amount: number;
|
|
50
|
+
}>;
|
|
51
|
+
requiresManualInput(): boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Primary Only Strategy
|
|
55
|
+
* Always boosts the class's primary ability
|
|
56
|
+
*/
|
|
57
|
+
export declare class PrimaryOnlyStrategy implements StatIncreaseStrategy {
|
|
58
|
+
readonly name = "Primary Only";
|
|
59
|
+
selectIncreases(character: CharacterSheet, increaseAmount: number, options?: StatIncreaseOptions): Array<{
|
|
60
|
+
ability: Ability;
|
|
61
|
+
amount: number;
|
|
62
|
+
}>;
|
|
63
|
+
requiresManualInput(): boolean;
|
|
64
|
+
private findLowestStat;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Random Strategy
|
|
68
|
+
* Randomly selects abilities
|
|
69
|
+
*/
|
|
70
|
+
export declare class RandomStrategy implements StatIncreaseStrategy {
|
|
71
|
+
readonly name = "Random";
|
|
72
|
+
selectIncreases(character: CharacterSheet, increaseAmount: number, options?: StatIncreaseOptions): Array<{
|
|
73
|
+
ability: Ability;
|
|
74
|
+
amount: number;
|
|
75
|
+
}>;
|
|
76
|
+
requiresManualInput(): boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Manual Strategy
|
|
80
|
+
* Always defers to manual stat selection
|
|
81
|
+
* Returns empty array to signal that manual input is required
|
|
82
|
+
* Stats should be applied via CharacterUpdater.applyPendingStatIncrease()
|
|
83
|
+
*/
|
|
84
|
+
export declare class ManualStrategy implements StatIncreaseStrategy {
|
|
85
|
+
readonly name = "Manual";
|
|
86
|
+
selectIncreases(_character: CharacterSheet, _increaseAmount: number, _options?: StatIncreaseOptions): Array<{
|
|
87
|
+
ability: Ability;
|
|
88
|
+
amount: number;
|
|
89
|
+
}>;
|
|
90
|
+
requiresManualInput(): boolean;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Factory function to create strategy instances
|
|
94
|
+
* Accepts either a string type, a full strategy implementation, or a simple function
|
|
95
|
+
*/
|
|
96
|
+
export declare function createStatIncreaseStrategy(strategy: StatIncreaseStrategyType | StatIncreaseStrategy | StatIncreaseFunction): StatIncreaseStrategy;
|
|
97
|
+
//# sourceMappingURL=StatIncreaseStrategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatIncreaseStrategy.d.ts","sourceRoot":"","sources":["../../../../src/core/progression/stat/StatIncreaseStrategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACR,cAAc,EACd,OAAO,EAEV,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACR,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACvB,MAAM,4BAA4B,CAAC;AAGpC;;;GAGG;AACH,qBAAa,qBAAsB,YAAW,oBAAoB;IAC9D,QAAQ,CAAC,IAAI,qBAAqB;IAElC,eAAe,CACX,SAAS,EAAE,cAAc,EACzB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,mBAAmB,GAC9B,KAAK,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAqB9C,mBAAmB,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO;CAI9D;AAED;;;GAGG;AACH,qBAAa,kBAAmB,YAAW,oBAAoB;IAC3D,QAAQ,CAAC,IAAI,kBAAkB;IAE/B,eAAe,CACX,SAAS,EAAE,cAAc,EACzB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,mBAAmB,GAC9B,KA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AAM,EACvB,QAAQ,CAAC,EAAE,mBAAmB,GAC/B,KAAK,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAM9C,mBAAmB,IAAI,OAAO;CAGjC;AA4BD;;;GAGG;AACH,wBAAgB,0BAA0B,CACtC,QAAQ,EAAE,wBAAwB,GAAG,oBAAoB,GAAG,oBAAoB,GACjF,oBAAoB,CA6BtB"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StatManager - Public API for all stat modifications
|
|
3
|
+
*
|
|
4
|
+
* This is the SINGLE SOURCE OF TRUTH for stat changes.
|
|
5
|
+
* All stat modifications MUST go through this class.
|
|
6
|
+
*
|
|
7
|
+
* Provides methods for:
|
|
8
|
+
* - Manual stat increases (potions, items, events)
|
|
9
|
+
* - Manual stat decreases (curses, poison)
|
|
10
|
+
* - Absolute stat setting
|
|
11
|
+
* - Level-up stat increases
|
|
12
|
+
*/
|
|
13
|
+
import type { CharacterSheet, Ability } from '../../types/Character.js';
|
|
14
|
+
import type { StatIncreaseConfig, StatIncreaseResult, StatIncreaseOptions, StatSelectionValidationError } from '../../types/Progression.js';
|
|
15
|
+
/**
|
|
16
|
+
* StatManager - Public API for stat modifications
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // Create with default config (D&D 5e standard)
|
|
21
|
+
* const statManager = new StatManager();
|
|
22
|
+
*
|
|
23
|
+
* // Manual stat increase (potion)
|
|
24
|
+
* const result = statManager.increaseStats(
|
|
25
|
+
* character,
|
|
26
|
+
* [{ ability: 'STR', amount: 4 }],
|
|
27
|
+
* 'item'
|
|
28
|
+
* );
|
|
29
|
+
*
|
|
30
|
+
* // Process level up
|
|
31
|
+
* const levelUpResult = statManager.processLevelUp(character, 4, {
|
|
32
|
+
* forcedAbilities: ['STR']
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare class StatManager {
|
|
37
|
+
private config;
|
|
38
|
+
private strategy;
|
|
39
|
+
constructor(config?: Partial<StatIncreaseConfig>);
|
|
40
|
+
/**
|
|
41
|
+
* Increase stats manually (e.g., from potions, items, events)
|
|
42
|
+
*
|
|
43
|
+
* @param character - The character to modify
|
|
44
|
+
* @param increases - Array of {ability, amount} to increase
|
|
45
|
+
* @param source - Source of the increase (for tracking)
|
|
46
|
+
* @returns Result with updated character and change details
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* // Potion of Strength: +4 STR
|
|
51
|
+
* const result = statManager.increaseStats(character, [
|
|
52
|
+
* { ability: 'STR', amount: 4 }
|
|
53
|
+
* ], 'item');
|
|
54
|
+
*
|
|
55
|
+
* if (result.capped.length > 0) {
|
|
56
|
+
* console.log('Stat was capped at 20!');
|
|
57
|
+
* }
|
|
58
|
+
*
|
|
59
|
+
* const updatedCharacter = result.character;
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
increaseStats(character: CharacterSheet, increases: Array<{
|
|
63
|
+
ability: Ability;
|
|
64
|
+
amount: number;
|
|
65
|
+
}>, source?: StatIncreaseResult['source']): StatIncreaseResult;
|
|
66
|
+
/**
|
|
67
|
+
* Decrease stats (e.g., from curses, damage, poison)
|
|
68
|
+
*
|
|
69
|
+
* @param character - The character to modify
|
|
70
|
+
* @param decreases - Array of {ability, amount} to decrease
|
|
71
|
+
* @param source - Source of the decrease
|
|
72
|
+
* @returns Result with updated character and change details
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* // Curse lowering strength
|
|
77
|
+
* const result = statManager.decreaseStats(character, [
|
|
78
|
+
* { ability: 'STR', amount: 2 }
|
|
79
|
+
* ], 'event');
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
decreaseStats(character: CharacterSheet, decreases: Array<{
|
|
83
|
+
ability: Ability;
|
|
84
|
+
amount: number;
|
|
85
|
+
}>, source?: StatIncreaseResult['source']): StatIncreaseResult;
|
|
86
|
+
/**
|
|
87
|
+
* Set a stat to a specific value (absolute, not relative)
|
|
88
|
+
*
|
|
89
|
+
* @param character - The character to modify
|
|
90
|
+
* @param ability - The ability to set
|
|
91
|
+
* @param value - The new value
|
|
92
|
+
* @param source - Source of the change
|
|
93
|
+
* @returns Result with updated character
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* // Set strength to 18
|
|
98
|
+
* const result = statManager.setStat(character, 'STR', 18, 'manual');
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
setStat(character: CharacterSheet, ability: Ability, value: number, source?: StatIncreaseResult['source']): StatIncreaseResult;
|
|
102
|
+
/**
|
|
103
|
+
* Process stat increases for level up
|
|
104
|
+
* This is called internally by LevelUpProcessor
|
|
105
|
+
*
|
|
106
|
+
* @param character - The character leveling up
|
|
107
|
+
* @param newLevel - The level being reached
|
|
108
|
+
* @param options - Optional overrides for this level up
|
|
109
|
+
* @returns Result with stat increases, or null if no increase at this level
|
|
110
|
+
*/
|
|
111
|
+
processLevelUp(character: CharacterSheet, newLevel: number, options?: StatIncreaseOptions): StatIncreaseResult | null;
|
|
112
|
+
/**
|
|
113
|
+
* Update the configuration
|
|
114
|
+
*
|
|
115
|
+
* @param config - New config (partial)
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* // Change strategy mid-game
|
|
120
|
+
* statManager.updateConfig({
|
|
121
|
+
* strategy: 'dnD5e_smart'
|
|
122
|
+
* });
|
|
123
|
+
*
|
|
124
|
+
* // Override stat cap (e.g., for epic mode)
|
|
125
|
+
* statManager.updateConfig({
|
|
126
|
+
* maxStatCap: 30
|
|
127
|
+
* });
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
updateConfig(config: Partial<StatIncreaseConfig>): void;
|
|
131
|
+
/**
|
|
132
|
+
* Get current configuration
|
|
133
|
+
*/
|
|
134
|
+
getConfig(): Readonly<Required<StatIncreaseConfig>>;
|
|
135
|
+
/**
|
|
136
|
+
* Check if an ability can be increased
|
|
137
|
+
*
|
|
138
|
+
* @param character - The character to check
|
|
139
|
+
* @param ability - The ability to check
|
|
140
|
+
* @param amount - How much to increase by
|
|
141
|
+
* @returns true if increase is possible
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```typescript
|
|
145
|
+
* if (statManager.canIncrease(character, 'STR', 2)) {
|
|
146
|
+
* // Safe to increase
|
|
147
|
+
* }
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
canIncrease(character: CharacterSheet, ability: Ability, amount?: number): boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Get stat cap for an ability
|
|
153
|
+
* @param character - The character to check (for game mode)
|
|
154
|
+
* @param ability - The ability to check
|
|
155
|
+
* @returns Stat cap for this character's game mode
|
|
156
|
+
*/
|
|
157
|
+
getStatCap(character: CharacterSheet, _ability: Ability): number;
|
|
158
|
+
/**
|
|
159
|
+
* Validate stat selection follows D&D 5e rules
|
|
160
|
+
* Rules: +2 to one ability OR +1 to two abilities
|
|
161
|
+
*
|
|
162
|
+
* @param character - Character to validate against
|
|
163
|
+
* @param selections - User's stat selections
|
|
164
|
+
* @param increaseAmount - Total points to distribute (usually 2)
|
|
165
|
+
* @returns Validation result
|
|
166
|
+
*/
|
|
167
|
+
validateDnD5eStatSelection(character: CharacterSheet, selections: Array<{
|
|
168
|
+
ability: Ability;
|
|
169
|
+
amount: number;
|
|
170
|
+
}>, increaseAmount?: number): {
|
|
171
|
+
valid: true;
|
|
172
|
+
} | StatSelectionValidationError;
|
|
173
|
+
/**
|
|
174
|
+
* Merge user config with defaults
|
|
175
|
+
* Note: Stat cap and increase levels are determined at runtime based on character's game mode
|
|
176
|
+
*/
|
|
177
|
+
private mergeWithDefaults;
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=StatManager.d.ts.map
|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