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,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Progression and Environmental System Types
|
|
3
|
+
* Based on specs/001-core-engine/SPEC.md
|
|
4
|
+
*/
|
|
5
|
+
import type { CharacterSheet, Ability } from './Character.js';
|
|
6
|
+
import type { EnvironmentalContext } from './Environmental.js';
|
|
7
|
+
import type { RhythmGameContext } from './RhythmXP.js';
|
|
8
|
+
export type { GeolocationData, MotionData, WeatherData, EnvironmentalContext } from './Environmental.js';
|
|
9
|
+
/**
|
|
10
|
+
* GamingContext - Steam gaming activity data
|
|
11
|
+
* Game detection uses Steam API only.
|
|
12
|
+
*/
|
|
13
|
+
export interface GamingContext {
|
|
14
|
+
isActivelyGaming: boolean;
|
|
15
|
+
platformSource: 'steam' | 'none';
|
|
16
|
+
currentGame?: {
|
|
17
|
+
name: string;
|
|
18
|
+
source: 'steam';
|
|
19
|
+
genre?: string[];
|
|
20
|
+
sessionDuration?: number;
|
|
21
|
+
partySize?: number;
|
|
22
|
+
};
|
|
23
|
+
totalGamingMinutes: number;
|
|
24
|
+
gamesPlayedWhileListening: string[];
|
|
25
|
+
lastUpdated: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* ListeningSession - Record of a single listening session
|
|
29
|
+
*/
|
|
30
|
+
export interface ListeningSession {
|
|
31
|
+
track_uuid: string;
|
|
32
|
+
start_time: number;
|
|
33
|
+
end_time: number;
|
|
34
|
+
duration_seconds: number;
|
|
35
|
+
base_xp_earned: number;
|
|
36
|
+
bonus_xp: number;
|
|
37
|
+
environmental_context?: EnvironmentalContext;
|
|
38
|
+
gaming_context?: GamingContext;
|
|
39
|
+
/** Rhythm game context for XP boost (System B) */
|
|
40
|
+
rhythm_game_context?: RhythmGameContext;
|
|
41
|
+
activity_type?: string;
|
|
42
|
+
total_xp_earned: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* ExperienceSystem - Configuration for XP calculation
|
|
46
|
+
*/
|
|
47
|
+
export interface ExperienceSystem {
|
|
48
|
+
level_thresholds: number[];
|
|
49
|
+
xp_per_second: number;
|
|
50
|
+
xp_per_track_completion: number;
|
|
51
|
+
activity_bonuses: {
|
|
52
|
+
stationary: number;
|
|
53
|
+
walking: number;
|
|
54
|
+
running: number;
|
|
55
|
+
driving: number;
|
|
56
|
+
night_time: number;
|
|
57
|
+
extreme_weather: number;
|
|
58
|
+
high_altitude: number;
|
|
59
|
+
rhythm_game_base: number;
|
|
60
|
+
rhythm_game_combo: number;
|
|
61
|
+
rhythm_game_groove: number;
|
|
62
|
+
};
|
|
63
|
+
track_mastery_threshold: number;
|
|
64
|
+
mastery_bonus_xp: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Strategy selection - either a predefined type or custom implementation
|
|
68
|
+
*/
|
|
69
|
+
export type StatIncreaseStrategyType = 'dnD5e' | 'dnD5e_smart' | 'balanced' | 'primary_only' | 'random' | 'manual';
|
|
70
|
+
/**
|
|
71
|
+
* Simple function type for custom stat increase formulas
|
|
72
|
+
* Game developers can provide a function instead of implementing the full interface
|
|
73
|
+
*/
|
|
74
|
+
export type StatIncreaseFunction = (character: CharacterSheet, increaseAmount: number, options?: StatIncreaseOptions) => Array<{
|
|
75
|
+
ability: Ability;
|
|
76
|
+
amount: number;
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Options passed to strategy selection
|
|
80
|
+
*/
|
|
81
|
+
export interface StatIncreaseOptions {
|
|
82
|
+
/** Force specific abilities (overrides strategy logic) */
|
|
83
|
+
forcedAbilities?: Ability[];
|
|
84
|
+
/** Exclude certain abilities from selection */
|
|
85
|
+
excludedAbilities?: Ability[];
|
|
86
|
+
/** Require increasing multiple abilities (for +2, can be 2x+1 or 1x+2) */
|
|
87
|
+
requireMultiple?: boolean;
|
|
88
|
+
/** Prioritize these abilities (tiebreaker) */
|
|
89
|
+
priorityAbilities?: Ability[];
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Base interface for stat increase strategies
|
|
93
|
+
*/
|
|
94
|
+
export interface StatIncreaseStrategy {
|
|
95
|
+
/** Strategy name for debugging/logging */
|
|
96
|
+
readonly name: string;
|
|
97
|
+
/**
|
|
98
|
+
* Determine which stats to increase
|
|
99
|
+
* @param character - Current character state
|
|
100
|
+
* @param increaseAmount - Total points to distribute (e.g., 2)
|
|
101
|
+
* @param options - Optional constraints
|
|
102
|
+
* @returns Array of {ability, amount} to increase
|
|
103
|
+
*/
|
|
104
|
+
selectIncreases(character: CharacterSheet, increaseAmount: number, options?: StatIncreaseOptions): Array<{
|
|
105
|
+
ability: Ability;
|
|
106
|
+
amount: number;
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* Check if this strategy requires manual user input
|
|
110
|
+
* @param options - Optional constraints
|
|
111
|
+
* @returns true if strategy requires manual selection
|
|
112
|
+
*/
|
|
113
|
+
requiresManualInput(options?: StatIncreaseOptions): boolean;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Stat increase configuration options
|
|
117
|
+
*/
|
|
118
|
+
export interface StatIncreaseConfig {
|
|
119
|
+
/** Maximum stat cap (default: 20 per D&D 5e, hard limit) */
|
|
120
|
+
maxStatCap: number;
|
|
121
|
+
/** Strategy to use for automatic stat increases on level up */
|
|
122
|
+
strategy: StatIncreaseStrategyType | StatIncreaseStrategy | StatIncreaseFunction;
|
|
123
|
+
/** When true, automatically apply stat increases during level up */
|
|
124
|
+
autoApply: boolean;
|
|
125
|
+
/** Custom stat increase levels (default: [4, 8, 12, 16, 19]) */
|
|
126
|
+
statIncreaseLevels: number[];
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Stat increase result from any operation
|
|
130
|
+
*/
|
|
131
|
+
export interface StatIncreaseResult {
|
|
132
|
+
/** The character after modification */
|
|
133
|
+
character: CharacterSheet;
|
|
134
|
+
/** Stats that were increased */
|
|
135
|
+
increases: Array<{
|
|
136
|
+
ability: Ability;
|
|
137
|
+
oldValue: number;
|
|
138
|
+
newValue: number;
|
|
139
|
+
delta: number;
|
|
140
|
+
}>;
|
|
141
|
+
/** Stats that were NOT increased due to cap */
|
|
142
|
+
capped: Array<{
|
|
143
|
+
ability: Ability;
|
|
144
|
+
attemptedValue: number;
|
|
145
|
+
cappedAt: number;
|
|
146
|
+
}>;
|
|
147
|
+
/** Source of the increase */
|
|
148
|
+
source: 'level_up' | 'manual' | 'item' | 'event';
|
|
149
|
+
/** Timestamp of modification */
|
|
150
|
+
timestamp: number;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* LevelUpDetail - Complete breakdown of what happened during a single level-up
|
|
154
|
+
*/
|
|
155
|
+
export interface LevelUpDetail {
|
|
156
|
+
/** Level before this level-up */
|
|
157
|
+
fromLevel: number;
|
|
158
|
+
/** Level after this level-up */
|
|
159
|
+
toLevel: number;
|
|
160
|
+
/** Hit points gained */
|
|
161
|
+
hpIncrease: number;
|
|
162
|
+
/** New max HP after level-up */
|
|
163
|
+
newMaxHP: number;
|
|
164
|
+
/** Proficiency bonus gained (0 if no increase) */
|
|
165
|
+
proficiencyIncrease: number;
|
|
166
|
+
/** New proficiency bonus after level-up */
|
|
167
|
+
newProficiency: number;
|
|
168
|
+
/** Stats that increased (if applicable) */
|
|
169
|
+
statIncreases?: Array<{
|
|
170
|
+
ability: Ability;
|
|
171
|
+
oldValue: number;
|
|
172
|
+
newValue: number;
|
|
173
|
+
delta: number;
|
|
174
|
+
}>;
|
|
175
|
+
/** Class features gained at this level */
|
|
176
|
+
featuresGained?: string[];
|
|
177
|
+
/**
|
|
178
|
+
* New spell slots after level-up (if spellcaster)
|
|
179
|
+
*/
|
|
180
|
+
newSpellSlots?: Record<number, {
|
|
181
|
+
total: number;
|
|
182
|
+
used: number;
|
|
183
|
+
}>;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Result from applying a pending stat increase
|
|
187
|
+
*/
|
|
188
|
+
export interface ApplyPendingStatIncreaseResult {
|
|
189
|
+
/** Updated character with stats applied */
|
|
190
|
+
character: CharacterSheet;
|
|
191
|
+
/** Stats that were increased */
|
|
192
|
+
statIncreases: Array<{
|
|
193
|
+
ability: Ability;
|
|
194
|
+
oldValue: number;
|
|
195
|
+
newValue: number;
|
|
196
|
+
delta: number;
|
|
197
|
+
}>;
|
|
198
|
+
/** Remaining pending stat increases (counter) */
|
|
199
|
+
remainingPending: number;
|
|
200
|
+
/** Timestamp of completion */
|
|
201
|
+
timestamp: number;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Validation error for stat selection
|
|
205
|
+
*/
|
|
206
|
+
export interface StatSelectionValidationError {
|
|
207
|
+
/** Error message */
|
|
208
|
+
error: string;
|
|
209
|
+
/** What was wrong */
|
|
210
|
+
reason: 'invalid_ability' | 'invalid_amount' | 'exceeds_cap' | 'wrong_pattern' | 'duplicate_ability';
|
|
211
|
+
/** Valid patterns allowed */
|
|
212
|
+
allowedPatterns: string[];
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=Progression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Progression.d.ts","sourceRoot":"","sources":["../../../src/core/types/Progression.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAA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
|
|
5
|
+
* with the existing beat detection and progression systems.
|
|
6
|
+
*
|
|
7
|
+
* The system separates "score points" (for in-game display/leaderboards) from
|
|
8
|
+
* "character XP" (for progression/leveling) via the `xpRatio` parameter.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // Default: 10 score points = 1 character XP
|
|
13
|
+
* const config: RhythmXPConfig = {
|
|
14
|
+
* xpRatio: 0.1,
|
|
15
|
+
* baseXP: { perfect: 10, great: 7, good: 5, ok: 2, miss: 0, wrongKey: 0 }
|
|
16
|
+
* };
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
import type { BeatAccuracy } from './BeatMap.js';
|
|
20
|
+
/**
|
|
21
|
+
* Base XP values for each accuracy level
|
|
22
|
+
*
|
|
23
|
+
* These are "score points" - raw values before the xpRatio is applied.
|
|
24
|
+
* Negative values for miss/wrongKey affect displayed score only;
|
|
25
|
+
* character XP is always floored at 0.
|
|
26
|
+
*/
|
|
27
|
+
export interface RhythmBaseXPConfig {
|
|
28
|
+
/** XP for perfect timing (default: 10) */
|
|
29
|
+
perfect: number;
|
|
30
|
+
/** XP for great timing (default: 7) */
|
|
31
|
+
great: number;
|
|
32
|
+
/** XP for good timing (default: 5) */
|
|
33
|
+
good: number;
|
|
34
|
+
/** XP for ok timing (default: 2) */
|
|
35
|
+
ok: number;
|
|
36
|
+
/** XP for missed beats (default: 0, can be negative for score penalty) */
|
|
37
|
+
miss: number;
|
|
38
|
+
/** XP for wrong key press (default: 0, can be negative for score penalty) */
|
|
39
|
+
wrongKey: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Combo end bonus configuration
|
|
43
|
+
*
|
|
44
|
+
* Awarded when a combo breaks, providing a satisfying "completion bonus"
|
|
45
|
+
* for the streak achieved.
|
|
46
|
+
*/
|
|
47
|
+
export interface ComboEndBonusConfig {
|
|
48
|
+
/** Whether combo end bonuses are enabled (default: true) */
|
|
49
|
+
enabled: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Custom formula for calculating bonus score from combo length.
|
|
52
|
+
* Default: (comboLength) => comboLength * 2
|
|
53
|
+
*
|
|
54
|
+
* @param comboLength - The combo length that just ended
|
|
55
|
+
* @returns Bonus score points (before xpRatio)
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* // Exponential bonus
|
|
60
|
+
* formula: (combo) => Math.floor(combo * 1.5)
|
|
61
|
+
*
|
|
62
|
+
* // Step-based (every 10 hits = bigger bonus)
|
|
63
|
+
* formula: (combo) => Math.floor(combo / 10) * 15
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
formula?: (comboLength: number) => number;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Combo multiplier configuration
|
|
70
|
+
*
|
|
71
|
+
* The combo multiplier increases with each successful hit and applies
|
|
72
|
+
* to the current hit only (not retroactively).
|
|
73
|
+
*/
|
|
74
|
+
export interface RhythmComboConfig {
|
|
75
|
+
/** Whether combo multipliers are enabled (default: true) */
|
|
76
|
+
enabled: boolean;
|
|
77
|
+
/** Maximum multiplier cap (default: 5.0, meaning 5x max) */
|
|
78
|
+
cap: number;
|
|
79
|
+
/**
|
|
80
|
+
* Custom formula for calculating multiplier from combo length.
|
|
81
|
+
* Default: (comboLength) => Math.min(1 + (comboLength / 50), cap)
|
|
82
|
+
*
|
|
83
|
+
* At 50 combo = 2x, at 100 combo = 3x, at 200 combo = 5x (cap)
|
|
84
|
+
*
|
|
85
|
+
* @param comboLength - Current combo count
|
|
86
|
+
* @returns Multiplier value (will be capped at `cap`)
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```typescript
|
|
90
|
+
* // Uncapped exponential growth
|
|
91
|
+
* formula: (combo) => 1 + Math.log10(combo + 1)
|
|
92
|
+
*
|
|
93
|
+
* // Step-based (every 10 hits = +0.1x)
|
|
94
|
+
* formula: (combo) => 1 + Math.floor(combo / 10) * 0.1
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
formula?: (comboLength: number) => number;
|
|
98
|
+
/**
|
|
99
|
+
* Whether "ok" accuracy breaks the combo streak (default: true)
|
|
100
|
+
*
|
|
101
|
+
* When true: "ok" accuracy resets combo to 0 (stricter gameplay)
|
|
102
|
+
* When false: "ok" accuracy keeps the combo going (more forgiving)
|
|
103
|
+
*
|
|
104
|
+
* Note: This only affects combo streaks - the groove meter is NOT affected.
|
|
105
|
+
* "ok" accuracy still contributes positively to groove hotness.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* // Default behavior - ok breaks combo
|
|
110
|
+
* okBreaksCombo: true
|
|
111
|
+
*
|
|
112
|
+
* // Forgiving mode - ok keeps combo alive
|
|
113
|
+
* okBreaksCombo: false
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
okBreaksCombo: boolean;
|
|
117
|
+
/** Combo end bonus configuration */
|
|
118
|
+
endBonus: ComboEndBonusConfig;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Groove end bonus configuration
|
|
122
|
+
*
|
|
123
|
+
* Awarded when a groove ends (hotness drops to 0 or session ends).
|
|
124
|
+
* The bonus is calculated using weighted values for different groove statistics.
|
|
125
|
+
*/
|
|
126
|
+
export interface GrooveEndBonusConfig {
|
|
127
|
+
/** Whether groove end bonuses are enabled (default: true) */
|
|
128
|
+
enabled: boolean;
|
|
129
|
+
/** Weight for max streak in bonus calculation (default: 0.4) */
|
|
130
|
+
maxStreakWeight: number;
|
|
131
|
+
/** Weight for average hotness in bonus calculation (default: 0.4) */
|
|
132
|
+
avgHotnessWeight: number;
|
|
133
|
+
/** Weight for groove duration in bonus calculation (default: 0.2) */
|
|
134
|
+
durationWeight: number;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Groove XP configuration
|
|
138
|
+
*
|
|
139
|
+
* Supports two modes:
|
|
140
|
+
* 1. Per-hit groove multiplier: Each hit gets bonus based on current hotness
|
|
141
|
+
* 2. End bonus: Large bonus awarded when groove ends (default)
|
|
142
|
+
*/
|
|
143
|
+
export interface RhythmGrooveConfig {
|
|
144
|
+
/**
|
|
145
|
+
* Whether to apply groove multiplier to each hit (default: false)
|
|
146
|
+
* When true: multiplier += (hotness / 100) * perHitScale
|
|
147
|
+
* At 100% hotness with scale 1.0 = +1.0x to multiplier
|
|
148
|
+
*/
|
|
149
|
+
perHitMultiplier: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Scale factor for per-hit groove bonus (default: 1.0)
|
|
152
|
+
* Only used when perHitMultiplier is true
|
|
153
|
+
*/
|
|
154
|
+
perHitScale: number;
|
|
155
|
+
/** End-of-groove bonus configuration */
|
|
156
|
+
endBonus: GrooveEndBonusConfig;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Complete rhythm XP configuration
|
|
160
|
+
*
|
|
161
|
+
* Controls how XP is calculated for rhythm game button presses.
|
|
162
|
+
* The system separates "score points" (for display) from "character XP" (for progression).
|
|
163
|
+
*/
|
|
164
|
+
export interface RhythmXPConfig {
|
|
165
|
+
/**
|
|
166
|
+
* Base XP values for each accuracy level.
|
|
167
|
+
* These are "score points" - raw values before xpRatio is applied.
|
|
168
|
+
*/
|
|
169
|
+
baseXP: RhythmBaseXPConfig;
|
|
170
|
+
/**
|
|
171
|
+
* Score-to-XP conversion ratio.
|
|
172
|
+
* finalCharacterXP = scorePoints * xpRatio
|
|
173
|
+
*
|
|
174
|
+
* Examples:
|
|
175
|
+
* - xpRatio: 1.0 → 10 score = 10 XP (unchanged)
|
|
176
|
+
* - xpRatio: 0.1 → 10 score = 1 XP (default, tuned for D&D 5e progression)
|
|
177
|
+
* - xpRatio: 0.5 → 10 score = 5 XP (half)
|
|
178
|
+
*
|
|
179
|
+
* This allows tuning the rhythm game independently from character progression.
|
|
180
|
+
*/
|
|
181
|
+
xpRatio: number;
|
|
182
|
+
/** Combo multiplier configuration */
|
|
183
|
+
combo: RhythmComboConfig;
|
|
184
|
+
/** Groove XP configuration */
|
|
185
|
+
groove: RhythmGrooveConfig;
|
|
186
|
+
/**
|
|
187
|
+
* Maximum total multiplier cap (default: 5.0)
|
|
188
|
+
* Applied after combining combo and groove multipliers
|
|
189
|
+
*/
|
|
190
|
+
maxMultiplier: number;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Result of calculating XP for a single button press
|
|
194
|
+
*
|
|
195
|
+
* Contains both score (for display/leaderboards) and XP (for character progression).
|
|
196
|
+
*/
|
|
197
|
+
export interface RhythmXPResult {
|
|
198
|
+
/** Raw score from accuracy (before ratio and multipliers) */
|
|
199
|
+
scorePoints: number;
|
|
200
|
+
/** Score converted to XP base (scorePoints * xpRatio) */
|
|
201
|
+
baseXP: number;
|
|
202
|
+
/** Current combo multiplier applied */
|
|
203
|
+
comboMultiplier: number;
|
|
204
|
+
/** Groove bonus multiplier (0 if not enabled) */
|
|
205
|
+
grooveMultiplier: number;
|
|
206
|
+
/** Combined multiplier (capped at maxMultiplier) */
|
|
207
|
+
totalMultiplier: number;
|
|
208
|
+
/** Final score for display/leaderboards (scorePoints * totalMultiplier) */
|
|
209
|
+
finalScore: number;
|
|
210
|
+
/** Final character XP to add (baseXP * totalMultiplier, floored at 0) */
|
|
211
|
+
finalXP: number;
|
|
212
|
+
/** Breakdown of calculation inputs */
|
|
213
|
+
breakdown: {
|
|
214
|
+
/** Accuracy level of the hit */
|
|
215
|
+
accuracy: BeatAccuracy;
|
|
216
|
+
/** Combo length at time of hit */
|
|
217
|
+
comboLength: number;
|
|
218
|
+
/** Groove hotness at time of hit (0-100), if groove is active */
|
|
219
|
+
grooveHotness?: number;
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Result of calculating combo end bonus
|
|
224
|
+
*
|
|
225
|
+
* Awarded when a combo breaks (miss or wrongKey after a streak).
|
|
226
|
+
*/
|
|
227
|
+
export interface ComboEndBonusResult {
|
|
228
|
+
/** The combo length that just ended */
|
|
229
|
+
comboLength: number;
|
|
230
|
+
/** Raw bonus score (before ratio) */
|
|
231
|
+
bonusScore: number;
|
|
232
|
+
/** Actual XP to add (bonusScore * xpRatio) */
|
|
233
|
+
bonusXP: number;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Statistics for groove end bonus calculation
|
|
237
|
+
*
|
|
238
|
+
* Retrieved from GrooveAnalyzer.getGrooveStats() when a groove ends.
|
|
239
|
+
*/
|
|
240
|
+
export interface GrooveStats {
|
|
241
|
+
/** Peak streak during groove */
|
|
242
|
+
maxStreak: number;
|
|
243
|
+
/** Peak hotness reached during groove */
|
|
244
|
+
maxHotness: number;
|
|
245
|
+
/** Average hotness over groove lifetime */
|
|
246
|
+
avgHotness: number;
|
|
247
|
+
/** How long groove lasted in seconds */
|
|
248
|
+
duration: number;
|
|
249
|
+
/** Total hits in groove */
|
|
250
|
+
totalHits: number;
|
|
251
|
+
/** When groove started (audio time) */
|
|
252
|
+
startTime: number;
|
|
253
|
+
/** When groove ended (audio time) */
|
|
254
|
+
endTime: number;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Statistics for groove end bonus calculation (simplified input)
|
|
258
|
+
*
|
|
259
|
+
* Used when calling calculateGrooveEndBonus() directly.
|
|
260
|
+
*/
|
|
261
|
+
export interface GrooveEndStats {
|
|
262
|
+
/** Peak streak during groove */
|
|
263
|
+
maxStreak: number;
|
|
264
|
+
/** Average hotness over groove lifetime */
|
|
265
|
+
avgHotness: number;
|
|
266
|
+
/** How long groove lasted in seconds */
|
|
267
|
+
duration: number;
|
|
268
|
+
/** Total hits in groove */
|
|
269
|
+
totalHits: number;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Result of calculating groove end bonus
|
|
273
|
+
*
|
|
274
|
+
* Awarded when a groove ends (hotness drops to 0 or session ends).
|
|
275
|
+
*/
|
|
276
|
+
export interface GrooveEndBonusResult {
|
|
277
|
+
/** Raw bonus score (before ratio) */
|
|
278
|
+
bonusScore: number;
|
|
279
|
+
/** Actual XP to add (bonusScore * xpRatio) */
|
|
280
|
+
bonusXP: number;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Cumulative session statistics for UI display
|
|
284
|
+
*
|
|
285
|
+
* Tracks totals over a rhythm game session for displaying
|
|
286
|
+
* session summaries without requiring frontend tracking.
|
|
287
|
+
*/
|
|
288
|
+
export interface RhythmSessionTotals {
|
|
289
|
+
/** Total raw score accumulated */
|
|
290
|
+
totalScore: number;
|
|
291
|
+
/** Total character XP earned */
|
|
292
|
+
totalXP: number;
|
|
293
|
+
/** Peak combo achieved */
|
|
294
|
+
maxCombo: number;
|
|
295
|
+
/** Count of each accuracy type */
|
|
296
|
+
accuracyDistribution: {
|
|
297
|
+
perfect: number;
|
|
298
|
+
great: number;
|
|
299
|
+
good: number;
|
|
300
|
+
ok: number;
|
|
301
|
+
miss: number;
|
|
302
|
+
wrongKey: number;
|
|
303
|
+
};
|
|
304
|
+
/** Overall accuracy percentage (perfect+great+good+ok / total hits) */
|
|
305
|
+
accuracyPercentage: number;
|
|
306
|
+
/** Session duration in seconds */
|
|
307
|
+
duration: number;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Rhythm game context for listening session XP boost
|
|
311
|
+
*
|
|
312
|
+
* When active, boosts the background listening XP while playing rhythm game.
|
|
313
|
+
* This is separate from the per-button-press XP (RhythmXPCalculator).
|
|
314
|
+
*/
|
|
315
|
+
export interface RhythmGameContext {
|
|
316
|
+
/** Is rhythm game mode currently active? */
|
|
317
|
+
isActive: boolean;
|
|
318
|
+
/** Current combo length */
|
|
319
|
+
currentCombo: number;
|
|
320
|
+
/** Max combo for scaling (default: 100) */
|
|
321
|
+
maxComboCap: number;
|
|
322
|
+
/** Current groove hotness (0-100) */
|
|
323
|
+
grooveHotness: number;
|
|
324
|
+
/** Average hotness over session (optional) */
|
|
325
|
+
avgGrooveHotness?: number;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Default rhythm XP configuration
|
|
329
|
+
*
|
|
330
|
+
* Tuned for D&D 5e progression with xpRatio: 0.1 (10 score points = 1 character XP).
|
|
331
|
+
*
|
|
332
|
+
* Note: The default combo multiplier formula (1 + comboLength/50, capped at 5.0) is
|
|
333
|
+
* implemented in RhythmXPCalculator. The config.combo.formula is only for custom formulas.
|
|
334
|
+
*/
|
|
335
|
+
export declare const DEFAULT_RHYTHM_XP_CONFIG: RhythmXPConfig;
|
|
336
|
+
/**
|
|
337
|
+
* Merge user config with defaults
|
|
338
|
+
*
|
|
339
|
+
* Creates a complete RhythmXPConfig by merging user-provided partial
|
|
340
|
+
* configuration with sensible defaults.
|
|
341
|
+
*
|
|
342
|
+
* @param userConfig - Partial configuration to override defaults
|
|
343
|
+
* @returns Complete configuration
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* ```typescript
|
|
347
|
+
* // Use all defaults
|
|
348
|
+
* const config = mergeRhythmXPConfig();
|
|
349
|
+
*
|
|
350
|
+
* // Customize XP ratio only
|
|
351
|
+
* const config = mergeRhythmXPConfig({ xpRatio: 0.2 });
|
|
352
|
+
*
|
|
353
|
+
* // Customize combo settings
|
|
354
|
+
* const config = mergeRhythmXPConfig({
|
|
355
|
+
* combo: {
|
|
356
|
+
* cap: 10.0,
|
|
357
|
+
* formula: (combo) => 1 + Math.log10(combo + 1)
|
|
358
|
+
* }
|
|
359
|
+
* });
|
|
360
|
+
* ```
|
|
361
|
+
*/
|
|
362
|
+
export declare function mergeRhythmXPConfig(userConfig?: Partial<RhythmXPConfig>): RhythmXPConfig;
|
|
363
|
+
/**
|
|
364
|
+
* Determine if an accuracy level should break the combo streak.
|
|
365
|
+
*
|
|
366
|
+
* This helper function centralizes the combo-breaking logic so frontends
|
|
367
|
+
* don't have to duplicate it. It considers both the accuracy level and
|
|
368
|
+
* the `okBreaksCombo` configuration option.
|
|
369
|
+
*
|
|
370
|
+
* @param accuracy - The accuracy level of the hit
|
|
371
|
+
* @param okBreaksCombo - Whether "ok" accuracy breaks combo (default: true from config)
|
|
372
|
+
* @returns true if the accuracy should break the combo, false otherwise
|
|
373
|
+
*
|
|
374
|
+
* @example
|
|
375
|
+
* ```typescript
|
|
376
|
+
* import { shouldAccuracyBreakCombo, RhythmXPCalculator } from 'playlist-data-engine';
|
|
377
|
+
*
|
|
378
|
+
* const rhythmXP = new RhythmXPCalculator();
|
|
379
|
+
* const config = rhythmXP.getConfig();
|
|
380
|
+
*
|
|
381
|
+
* // Check if accuracy breaks combo
|
|
382
|
+
* if (shouldAccuracyBreakCombo(buttonResult.accuracy, config.combo.okBreaksCombo)) {
|
|
383
|
+
* // Combo breaks - award end bonus before resetting
|
|
384
|
+
* const bonus = rhythmXP.calculateComboEndBonus(currentCombo);
|
|
385
|
+
* updater.addXP(character, bonus.bonusXP, 'combo_bonus');
|
|
386
|
+
* currentCombo = 0;
|
|
387
|
+
* } else {
|
|
388
|
+
* currentCombo++;
|
|
389
|
+
* }
|
|
390
|
+
*
|
|
391
|
+
* // Using with custom okBreaksCombo setting
|
|
392
|
+
* const customConfig = { combo: { okBreaksCombo: false } };
|
|
393
|
+
* const rhythmXP = new RhythmXPCalculator(customConfig);
|
|
394
|
+
* // Now "ok" accuracy will NOT break combo
|
|
395
|
+
* ```
|
|
396
|
+
*/
|
|
397
|
+
export declare function shouldAccuracyBreakCombo(accuracy: BeatAccuracy, okBreaksCombo?: boolean): boolean;
|
|
398
|
+
//# sourceMappingURL=RhythmXP.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RhythmXP.d.ts","sourceRoot":"","sources":["../../../src/core/types/RhythmXP.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMjD;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IAC/B,0CAA0C;IAC1C,OAAO,EAAE,MA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8CAA8C;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAgBD;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,EAAE,cA8BtC,CAAC;AAgDF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,mBAAmB,CAC/B,UAAU,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GACrC,cAAc,CAahB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,YAAY,EACtB,aAAa,GAAE,OAAsD,GACtE,OAAO,CAaT"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Ability Constants
|
|
3
|
+
*
|
|
4
|
+
* Central location for ability-related constants and utility functions.
|
|
5
|
+
* Eliminates duplicate code across SkillValidator, SpellValidator, and FeatureValidator.
|
|
6
|
+
*/
|
|
7
|
+
import type { Ability } from '../types/Character.js';
|
|
8
|
+
/**
|
|
9
|
+
* Valid D&D 5e abilities
|
|
10
|
+
*
|
|
11
|
+
* This constant is shared across:
|
|
12
|
+
* - SkillValidator (src/core/skills/SkillValidator.ts)
|
|
13
|
+
* - SpellValidator (src/core/spells/SpellValidator.ts)
|
|
14
|
+
* - FeatureValidator (src/core/features/FeatureValidator.ts)
|
|
15
|
+
*/
|
|
16
|
+
export declare const VALID_ABILITIES: ReadonlyArray<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Check if a string is a valid ability score
|
|
19
|
+
*
|
|
20
|
+
* This utility function is shared across validators to provide
|
|
21
|
+
* consistent ability validation throughout the codebase.
|
|
22
|
+
*
|
|
23
|
+
* @param ability - The ability string to check
|
|
24
|
+
* @returns True if it's a valid ability score
|
|
25
|
+
*/
|
|
26
|
+
export declare function isValidAbility(ability: string): ability is Ability;
|
|
27
|
+
/**
|
|
28
|
+
* Alias for isValidAbility - both names are equivalent and supported
|
|
29
|
+
*/
|
|
30
|
+
export { isValidAbility as isAbility };
|
|
31
|
+
//# sourceMappingURL=AbilityConstants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbilityConstants.d.ts","sourceRoot":"","sources":["../../../src/core/utils/AbilityConstants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC,MAAM,CAAuD,CAAC;AAE1G;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,OAAO,CAElE;AAED;;GAEG;AACH,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,CAAC"}
|