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,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized configuration interface for all sensor modules
|
|
3
|
+
*
|
|
4
|
+
* This module provides type-safe configuration options for:
|
|
5
|
+
* - Environmental sensors (geolocation, weather, motion)
|
|
6
|
+
* - Gaming platform sensors (Steam)
|
|
7
|
+
* - XP modifier calculation
|
|
8
|
+
* - Caching and retry behavior
|
|
9
|
+
*
|
|
10
|
+
* Configuration can be provided via constructor parameters or loaded from environment variables.
|
|
11
|
+
*/
|
|
12
|
+
import type { SensorRetryConfig } from '../types/Environmental.js';
|
|
13
|
+
/**
|
|
14
|
+
* Cache configuration for sensor data
|
|
15
|
+
*/
|
|
16
|
+
export interface CacheConfig {
|
|
17
|
+
/** Time-to-live for cached data in milliseconds (default: varies by sensor) */
|
|
18
|
+
ttlMs: number;
|
|
19
|
+
/** Enable/disable localStorage persistence for browser environments (default: true) */
|
|
20
|
+
useLocalStorage: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Geolocation sensor configuration
|
|
24
|
+
*/
|
|
25
|
+
export interface GeolocationSensorConfig {
|
|
26
|
+
/** Cache TTL in milliseconds (default: 5 minutes) */
|
|
27
|
+
cacheTTL?: number;
|
|
28
|
+
/** Enable localStorage persistence (default: true) */
|
|
29
|
+
useLocalStorage?: boolean;
|
|
30
|
+
/** High accuracy mode for GPS (default: true) */
|
|
31
|
+
enableHighAccuracy?: boolean;
|
|
32
|
+
/** GPS timeout in milliseconds (default: 5000) */
|
|
33
|
+
timeout?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Weather API configuration
|
|
37
|
+
*/
|
|
38
|
+
export interface WeatherSensorConfig {
|
|
39
|
+
/** OpenWeatherMap API key (can be loaded from WEATHER_API_KEY env var) */
|
|
40
|
+
apiKey?: string;
|
|
41
|
+
/** Current weather cache TTL in milliseconds (default: 12 minutes) */
|
|
42
|
+
cacheTTL?: number;
|
|
43
|
+
/** Forecast cache TTL in milliseconds (default: 60 minutes) */
|
|
44
|
+
forecastCacheTTL?: number;
|
|
45
|
+
/** Enable localStorage persistence (default: true) */
|
|
46
|
+
useLocalStorage?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Gaming platform sensor configuration
|
|
50
|
+
*/
|
|
51
|
+
export interface GamingSensorConfig {
|
|
52
|
+
/** Steam configuration */
|
|
53
|
+
steam?: {
|
|
54
|
+
/** Steam API key (can be loaded from STEAM_API_KEY env var) */
|
|
55
|
+
apiKey?: string;
|
|
56
|
+
/** Steam user ID (64-bit ID) */
|
|
57
|
+
steamId?: string;
|
|
58
|
+
/** Polling interval in milliseconds (default: 60000 = 1 minute) */
|
|
59
|
+
pollInterval?: number;
|
|
60
|
+
};
|
|
61
|
+
/** Game metadata cache expiry in milliseconds (default: 24 hours) */
|
|
62
|
+
metadataCacheExpiry?: number;
|
|
63
|
+
/** Maximum backoff delay in milliseconds for polling errors (default: 10 minutes) */
|
|
64
|
+
maxBackoffMs?: number;
|
|
65
|
+
/** XP modifier configuration (overrides for gaming-specific bonuses) */
|
|
66
|
+
xpModifier?: Partial<XPModifierConfig>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* XP modifier calculation configuration
|
|
70
|
+
*/
|
|
71
|
+
export interface XPModifierConfig {
|
|
72
|
+
/** Maximum XP modifier multiplier (default: 3.0) */
|
|
73
|
+
maxModifier: number;
|
|
74
|
+
/** Maximum gaming XP modifier multiplier (default: 1.75) */
|
|
75
|
+
maxGamingModifier: number;
|
|
76
|
+
/** Motion-based bonus: running (default: 0.5 = +50%) */
|
|
77
|
+
runningBonus: number;
|
|
78
|
+
/** Motion-based bonus: walking (default: 0.2 = +20%) */
|
|
79
|
+
walkingBonus: number;
|
|
80
|
+
/** Weather-based bonus: rain/storm (default: 0.4 = +40%) */
|
|
81
|
+
stormBonus: number;
|
|
82
|
+
/** Weather-based bonus: snow (default: 0.3 = +30%) */
|
|
83
|
+
snowBonus: number;
|
|
84
|
+
/** Time-based bonus: night (default: 0.25 = +25%) */
|
|
85
|
+
nightBonus: number;
|
|
86
|
+
/** Altitude-based bonus threshold in meters (default: 1000) */
|
|
87
|
+
altitudeThreshold: number;
|
|
88
|
+
/** Altitude-based bonus amount (default: 0.3 = +30%) */
|
|
89
|
+
altitudeBonus: number;
|
|
90
|
+
/** Gaming base bonus (default: 0.25 = +25%) */
|
|
91
|
+
gamingBaseBonus: number;
|
|
92
|
+
/** Gaming RPG genre bonus (default: 0.2 = +20%) */
|
|
93
|
+
gamingRPGBonus: number;
|
|
94
|
+
/** Gaming multiplayer bonus (default: 0.15 = +15%) */
|
|
95
|
+
gamingMultiplayerBonus: number;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Retry configuration for sensor operations
|
|
99
|
+
*/
|
|
100
|
+
export interface RetryConfig extends SensorRetryConfig {
|
|
101
|
+
/** Enable/disable retry logic entirely (default: true) */
|
|
102
|
+
enabled: boolean;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Complete sensor configuration interface
|
|
106
|
+
*/
|
|
107
|
+
export interface SensorConfig {
|
|
108
|
+
/** Geolocation sensor configuration */
|
|
109
|
+
geolocation: Partial<GeolocationSensorConfig>;
|
|
110
|
+
/** Weather sensor configuration */
|
|
111
|
+
weather: Partial<WeatherSensorConfig>;
|
|
112
|
+
/** Gaming platform configuration */
|
|
113
|
+
gaming: Partial<GamingSensorConfig>;
|
|
114
|
+
/** XP modifier configuration */
|
|
115
|
+
xpModifier: Partial<XPModifierConfig>;
|
|
116
|
+
/** Retry configuration */
|
|
117
|
+
retry: Partial<RetryConfig>;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Default configuration values
|
|
121
|
+
*/
|
|
122
|
+
export declare const DEFAULT_SENSOR_CONFIG: Required<SensorConfig>;
|
|
123
|
+
/**
|
|
124
|
+
* Load configuration from environment variables
|
|
125
|
+
* @returns Partial configuration loaded from environment
|
|
126
|
+
*/
|
|
127
|
+
export declare function loadConfigFromEnv(): Partial<SensorConfig>;
|
|
128
|
+
/**
|
|
129
|
+
* Merge user config with defaults and environment variables
|
|
130
|
+
* @param userConfig User-provided configuration
|
|
131
|
+
* @returns Merged configuration with defaults applied
|
|
132
|
+
*/
|
|
133
|
+
export declare function mergeConfig(userConfig?: Partial<SensorConfig>): Required<SensorConfig>;
|
|
134
|
+
//# sourceMappingURL=sensorConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sensorConfig.d.ts","sourceRoot":"","sources":["../../../src/core/config/sensorConfig.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BoxOpener - Handles opening box items and generating their contents
|
|
3
|
+
*
|
|
4
|
+
* Supports both guaranteed containers (like Explorer's Pack) and
|
|
5
|
+
* probability-based loot boxes.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Weighted random selection from drop pools
|
|
9
|
+
* - Quantity support for bulk items (e.g., 10 torches, 20 arrows)
|
|
10
|
+
* - Gold drops alongside or instead of items
|
|
11
|
+
* - Nested boxes are added unopened (not recursively opened)
|
|
12
|
+
* - Deterministic results via SeededRNG
|
|
13
|
+
*/
|
|
14
|
+
import type { Equipment } from '../../utils/constants.js';
|
|
15
|
+
import type { BoxOpenError, BoxOpenRequirement, BoxOpenResult, EnhancedInventoryItem } from '../types/Equipment.js';
|
|
16
|
+
import { SeededRNG } from '../../utils/random.js';
|
|
17
|
+
/**
|
|
18
|
+
* BoxOpener class for opening box-type equipment items
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* import { BoxOpener, SeededRNG } from 'playlist-data-engine';
|
|
23
|
+
*
|
|
24
|
+
* const rng = new SeededRNG('test-seed');
|
|
25
|
+
* const result = BoxOpener.openBox(explorersPack, rng);
|
|
26
|
+
* console.log(result.items); // Generated items
|
|
27
|
+
* console.log(result.gold); // Gold amount
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare class BoxOpener {
|
|
31
|
+
/**
|
|
32
|
+
* Open a box and generate its contents
|
|
33
|
+
*
|
|
34
|
+
* @param box - The box equipment to open (must have boxContents)
|
|
35
|
+
* @param rng - SeededRNG for deterministic results
|
|
36
|
+
* @param inventory - Optional character inventory for requirement checking.
|
|
37
|
+
* If not provided, requirements are skipped (backward compatible).
|
|
38
|
+
* @returns BoxOpenResult with items, gold, and consumed items if requirements were met
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* const rng = new SeededRNG('deterministic-seed');
|
|
43
|
+
* const result = BoxOpener.openBox(goblinChest, rng);
|
|
44
|
+
* // result.items - array of generated items
|
|
45
|
+
* // result.gold - total gold from drops
|
|
46
|
+
* // result.consumeBox - whether box should be consumed
|
|
47
|
+
*
|
|
48
|
+
* // With inventory (requirement checking enabled)
|
|
49
|
+
* const inventory = [{ name: 'Iron Key', quantity: 1, equipped: false }];
|
|
50
|
+
* const result = BoxOpener.openBox(lockedChest, rng, inventory);
|
|
51
|
+
* if (result.success) {
|
|
52
|
+
* console.log('Consumed:', result.consumedItems);
|
|
53
|
+
* } else {
|
|
54
|
+
* console.log('Cannot open:', result.error?.message);
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
static openBox(box: Equipment, rng: SeededRNG, inventory?: EnhancedInventoryItem[]): BoxOpenResult;
|
|
59
|
+
/**
|
|
60
|
+
* Select one item from a weighted pool using SeededRNG
|
|
61
|
+
*
|
|
62
|
+
* @param pool - Array of pool entries with weights
|
|
63
|
+
* @param rng - SeededRNG for deterministic selection
|
|
64
|
+
* @returns Selected pool entry, or undefined if pool is empty
|
|
65
|
+
*/
|
|
66
|
+
private static selectFromPool;
|
|
67
|
+
/**
|
|
68
|
+
* Get equipment data from the registry (defaults + custom)
|
|
69
|
+
*
|
|
70
|
+
* @param itemName - Name of the equipment to look up
|
|
71
|
+
* @returns Equipment data or undefined if not found
|
|
72
|
+
*/
|
|
73
|
+
private static getEquipmentData;
|
|
74
|
+
/**
|
|
75
|
+
* Check if an equipment item is a box type
|
|
76
|
+
*
|
|
77
|
+
* @param equipment - Equipment to check
|
|
78
|
+
* @returns True if equipment is a box type
|
|
79
|
+
*/
|
|
80
|
+
static isBox(equipment: Equipment): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Check if box requirements are met
|
|
83
|
+
*
|
|
84
|
+
* Validates that the character's inventory contains all required items
|
|
85
|
+
* in sufficient quantities to open the box.
|
|
86
|
+
*
|
|
87
|
+
* @param box - The box to check requirements for
|
|
88
|
+
* @param inventory - Character's items inventory
|
|
89
|
+
* @returns null if all requirements are met, BoxOpenError if not
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* const box = { name: 'Locked Chest', boxContents: { openRequirements: [{ itemName: 'Iron Key' }] } };
|
|
94
|
+
* const inventory = [{ name: 'Iron Key', quantity: 1, equipped: false }];
|
|
95
|
+
*
|
|
96
|
+
* const error = BoxOpener.checkRequirements(box, inventory);
|
|
97
|
+
* if (error) {
|
|
98
|
+
* console.log(`Cannot open: ${error.message}`);
|
|
99
|
+
* }
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
static checkRequirements(box: Equipment, inventory: EnhancedInventoryItem[]): BoxOpenError | null;
|
|
103
|
+
/**
|
|
104
|
+
* Check if a box can be opened with given inventory
|
|
105
|
+
*
|
|
106
|
+
* Simple boolean check useful for UI purposes (showing lock icons, etc).
|
|
107
|
+
*
|
|
108
|
+
* @param box - The box to check
|
|
109
|
+
* @param inventory - Character's items inventory
|
|
110
|
+
* @returns true if box can be opened, false otherwise
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```typescript
|
|
114
|
+
* const box = { name: 'Locked Chest', boxContents: { openRequirements: [{ itemName: 'Iron Key' }] } };
|
|
115
|
+
* const inventory = [{ name: 'Iron Key', quantity: 1, equipped: false }];
|
|
116
|
+
*
|
|
117
|
+
* if (BoxOpener.canOpen(box, inventory)) {
|
|
118
|
+
* console.log('You can open this chest!');
|
|
119
|
+
* }
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
static canOpen(box: Equipment, inventory: EnhancedInventoryItem[]): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Get human-readable description of box requirements
|
|
125
|
+
*
|
|
126
|
+
* Returns a formatted string describing what items are needed to open the box,
|
|
127
|
+
* useful for UI displays or tooltips.
|
|
128
|
+
*
|
|
129
|
+
* @param box - The box equipment to get requirements description for
|
|
130
|
+
* @returns Formatted description string like "Requires: Iron Key" or
|
|
131
|
+
* "Requires: Iron Key, 100 Gold Coins", or null if no requirements
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```typescript
|
|
135
|
+
* const lockedChest = { boxContents: { openRequirements: [{ itemName: 'Iron Key' }] } };
|
|
136
|
+
* console.log(BoxOpener.getRequirementsDescription(lockedChest));
|
|
137
|
+
* // "Requires: Iron Key"
|
|
138
|
+
*
|
|
139
|
+
* const multiReq = { boxContents: { openRequirements: [
|
|
140
|
+
* { itemName: 'Golden Key' },
|
|
141
|
+
* { itemName: 'Gold Coin', quantity: 200 }
|
|
142
|
+
* ]}};
|
|
143
|
+
* console.log(BoxOpener.getRequirementsDescription(multiReq));
|
|
144
|
+
* // "Requires: Golden Key, 200 Gold Coins"
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
static getRequirementsDescription(box: Equipment): string | null;
|
|
148
|
+
/**
|
|
149
|
+
* Preview what a box could contain without actually opening it
|
|
150
|
+
*
|
|
151
|
+
* Returns all possible items that could drop from the box,
|
|
152
|
+
* useful for UI displays or tooltips.
|
|
153
|
+
*
|
|
154
|
+
* @param box - The box equipment to preview
|
|
155
|
+
* @returns Object with possible items, gold range, total drops, and any opening requirements
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* const preview = BoxOpener.previewContents(lockedChest);
|
|
160
|
+
* console.log('Possible items:', preview.possibleItems);
|
|
161
|
+
* console.log('Requires:', preview.openRequirements);
|
|
162
|
+
* // [{ itemName: 'Iron Key' }]
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
static previewContents(box: Equipment): {
|
|
166
|
+
possibleItems: string[];
|
|
167
|
+
possibleGold: {
|
|
168
|
+
min: number;
|
|
169
|
+
max: number;
|
|
170
|
+
};
|
|
171
|
+
totalDrops: number;
|
|
172
|
+
openRequirements?: BoxOpenRequirement[];
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=BoxOpener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BoxOpener.d.ts","sourceRoot":"","sources":["../../../src/core/equipment/BoxOpener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAA4B,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,qBAAqB,EAAqB,MAAM,uBAAuB,CAAC;AACjK,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD;;;;;;;;;;;;GAYG;AACH,qBAAa,SAAS;IAClB;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,MAAM,CAAC,OAAO,CACV,GAAG,EAAE,SAAS,EACd,GAAG,EAAE,SAAS,EACd,SAAS,CAAC,EAAE,qBAAqB,EAAE,GACpC,aAAa;IAgGhB;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAc7B;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAM/B;;;;;OAKG;IACH,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO;IAI3C;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,iBAAiB,CACpB,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,qBAAqB,EAAE,GACnC,YAAY,GAAG,IAAI;IAsCtB;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,OAAO,CACV,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,qBAAqB,EAAE,GACnC,OAAO;IAUV;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,MAAM,CAAC,0BAA0B,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI;IAqBhE;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,GAAG;QACpC,aAAa,EAAE,MAAM,EAAE,CAAC;QACxB,YAAY,EAAE;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC;QAC3C,UAAU,EAAE,MAAM,CAAC;QACnB,gBAAgB,CAAC,EAAE,kBAAkB,EAAE,CAAC;KAC3C;CA2CJ"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Equipment Effect Applier
|
|
3
|
+
*
|
|
4
|
+
* Applies and removes equipment effects to/from characters during equip/unequip.
|
|
5
|
+
* Handles stat bonuses, skill proficiencies, ability unlocks, passive modifiers,
|
|
6
|
+
* equipment-granted features, skills, and spells.
|
|
7
|
+
* Integrates with FeatureEffectApplier.
|
|
8
|
+
*/
|
|
9
|
+
import type { CharacterSheet } from '../types/Character.js';
|
|
10
|
+
import type { EnhancedEquipment, EquipmentProperty, EffectApplicationResult } from '../types/Equipment.js';
|
|
11
|
+
/**
|
|
12
|
+
* EquipmentEffectApplier - Applies and removes equipment effects
|
|
13
|
+
*
|
|
14
|
+
* This class handles:
|
|
15
|
+
* - Applying equipment properties when equipping
|
|
16
|
+
* - Removing equipment properties when unequipping
|
|
17
|
+
* - Managing equipment-granted features, skills, and spells
|
|
18
|
+
* - Tracking equipment effects separately from feature effects for proper removal
|
|
19
|
+
*
|
|
20
|
+
* STACKING: All equipment effects stack by default. Multiple items with the same
|
|
21
|
+
* effect will have their effects combine (e.g., two +1 STR items = +2 STR total).
|
|
22
|
+
*/
|
|
23
|
+
export declare class EquipmentEffectApplier {
|
|
24
|
+
/**
|
|
25
|
+
* Apply all effects from equipping an item
|
|
26
|
+
*
|
|
27
|
+
* @param character - The character to apply effects to
|
|
28
|
+
* @param equipment - The equipment being equipped
|
|
29
|
+
* @param instanceId - Optional instance ID for per-instance tracking
|
|
30
|
+
* @returns Result of the effect application
|
|
31
|
+
*/
|
|
32
|
+
static equipItem(character: CharacterSheet, equipment: EnhancedEquipment, instanceId?: string): EffectApplicationResult;
|
|
33
|
+
/**
|
|
34
|
+
* Remove all effects from unequipping an item
|
|
35
|
+
*
|
|
36
|
+
* @param character - The character to remove effects from
|
|
37
|
+
* @param equipmentName - Name of the equipment being unequipped
|
|
38
|
+
* @param instanceId - Optional instance ID for per-instance tracking
|
|
39
|
+
* @returns Result of the effect removal
|
|
40
|
+
*/
|
|
41
|
+
static unequipItem(character: CharacterSheet, equipmentName: string, instanceId?: string): EffectApplicationResult;
|
|
42
|
+
/**
|
|
43
|
+
* Re-apply all equipment effects (for updates/level-ups)
|
|
44
|
+
*
|
|
45
|
+
* @param character - The character to reapply effects to
|
|
46
|
+
* @returns Result of the effect reapplication
|
|
47
|
+
*/
|
|
48
|
+
static reapplyEquipmentEffects(character: CharacterSheet): EffectApplicationResult;
|
|
49
|
+
/**
|
|
50
|
+
* Get all active equipment effects
|
|
51
|
+
*
|
|
52
|
+
* @param character - The character to get effects from
|
|
53
|
+
* @returns Array of all active equipment properties
|
|
54
|
+
*/
|
|
55
|
+
static getActiveEffects(character: CharacterSheet): EquipmentProperty[];
|
|
56
|
+
/**
|
|
57
|
+
* Apply a single equipment property
|
|
58
|
+
*
|
|
59
|
+
* For property types that match FeatureEffect types (stat_bonus, skill_proficiency,
|
|
60
|
+
* ability_unlock, passive_modifier), we apply them using dedicated methods for consistency.
|
|
61
|
+
*/
|
|
62
|
+
/**
|
|
63
|
+
* Evaluate an armor AC formula string against a character's DEX modifier.
|
|
64
|
+
*
|
|
65
|
+
* Supported patterns:
|
|
66
|
+
* - "16" → flat AC (heavy armor, no DEX)
|
|
67
|
+
* - "11 + DEX" → base + full DEX (light armor)
|
|
68
|
+
* - "14 + min(DEX, 2)"→ base + capped DEX (medium armor)
|
|
69
|
+
*
|
|
70
|
+
* @param formula - The AC formula string from equipment properties
|
|
71
|
+
* @param dexMod - The character's DEX modifier
|
|
72
|
+
* @returns Computed armor class
|
|
73
|
+
*/
|
|
74
|
+
static evaluateACFormula(formula: string, dexMod: number): number;
|
|
75
|
+
private static applyProperty;
|
|
76
|
+
/**
|
|
77
|
+
* Apply an equipment property using dedicated methods.
|
|
78
|
+
*
|
|
79
|
+
* This ensures equipment effects that match feature effect types
|
|
80
|
+
* (stat_bonus, skill_proficiency, ability_unlock, passive_modifier)
|
|
81
|
+
* are applied consistently.
|
|
82
|
+
*/
|
|
83
|
+
private static applyPropertyViaFeatureEffectApplier;
|
|
84
|
+
/**
|
|
85
|
+
* Apply a stat bonus property
|
|
86
|
+
*/
|
|
87
|
+
private static applyStatBonus;
|
|
88
|
+
/**
|
|
89
|
+
* Apply a skill proficiency property
|
|
90
|
+
*
|
|
91
|
+
* Uses shared utility with proficiency hierarchy (none < proficient < expertise)
|
|
92
|
+
*/
|
|
93
|
+
private static applySkillProficiency;
|
|
94
|
+
/**
|
|
95
|
+
* Apply an ability unlock property
|
|
96
|
+
*/
|
|
97
|
+
private static applyAbilityUnlock;
|
|
98
|
+
/**
|
|
99
|
+
* Apply a passive modifier property
|
|
100
|
+
*/
|
|
101
|
+
private static applyPassiveModifier;
|
|
102
|
+
/**
|
|
103
|
+
* Track a special property for game logic reference
|
|
104
|
+
*/
|
|
105
|
+
private static trackSpecialProperty;
|
|
106
|
+
/**
|
|
107
|
+
* Track a damage bonus for game logic reference
|
|
108
|
+
*/
|
|
109
|
+
private static trackDamageBonus;
|
|
110
|
+
/**
|
|
111
|
+
* Remove equipment properties from character
|
|
112
|
+
*/
|
|
113
|
+
private static removeProperties;
|
|
114
|
+
/**
|
|
115
|
+
* Remove a stat bonus
|
|
116
|
+
*/
|
|
117
|
+
private static removeStatBonus;
|
|
118
|
+
/**
|
|
119
|
+
* Remove a skill proficiency
|
|
120
|
+
*/
|
|
121
|
+
private static removeSkillProficiency;
|
|
122
|
+
/**
|
|
123
|
+
* Remove a passive modifier
|
|
124
|
+
*/
|
|
125
|
+
private static removePassiveModifier;
|
|
126
|
+
/**
|
|
127
|
+
* Apply equipment-granted features
|
|
128
|
+
*/
|
|
129
|
+
private static applyEquipmentFeatures;
|
|
130
|
+
/**
|
|
131
|
+
* Apply equipment-granted skills
|
|
132
|
+
*/
|
|
133
|
+
private static applyEquipmentSkills;
|
|
134
|
+
/**
|
|
135
|
+
* Add spells to character
|
|
136
|
+
*/
|
|
137
|
+
private static addSpellsToCharacter;
|
|
138
|
+
/**
|
|
139
|
+
* Remove spells from character
|
|
140
|
+
*/
|
|
141
|
+
private static removeSpellsFromCharacter;
|
|
142
|
+
/**
|
|
143
|
+
* Add a feature to character's class features list
|
|
144
|
+
*/
|
|
145
|
+
private static addFeatureToCharacter;
|
|
146
|
+
/**
|
|
147
|
+
* Add a skill to character
|
|
148
|
+
*
|
|
149
|
+
* Uses shared utility with proficiency hierarchy (none < proficient < expertise)
|
|
150
|
+
*/
|
|
151
|
+
private static addSkillToCharacter;
|
|
152
|
+
/**
|
|
153
|
+
* Remove equipment-granted features
|
|
154
|
+
*/
|
|
155
|
+
private static removeEquipmentFeatures;
|
|
156
|
+
/**
|
|
157
|
+
* Remove equipment-granted skills
|
|
158
|
+
*/
|
|
159
|
+
private static removeEquipmentSkills;
|
|
160
|
+
/**
|
|
161
|
+
* Check if a property condition is met
|
|
162
|
+
*/
|
|
163
|
+
private static checkCondition;
|
|
164
|
+
/**
|
|
165
|
+
* Find an equipment effect entry
|
|
166
|
+
*/
|
|
167
|
+
private static findEquipmentEffect;
|
|
168
|
+
/**
|
|
169
|
+
* Validate stat requirements before equipping an item
|
|
170
|
+
*
|
|
171
|
+
* Checks all stat_requirement properties and returns errors for any
|
|
172
|
+
* requirements that are not met. This is called BEFORE applying effects,
|
|
173
|
+
* so items that don't meet requirements cannot be equipped.
|
|
174
|
+
*
|
|
175
|
+
* @param character - The character equipping the item
|
|
176
|
+
* @param equipment - The equipment being equipped
|
|
177
|
+
* @param properties - The properties to validate
|
|
178
|
+
* @returns Array of error messages (empty if all requirements met)
|
|
179
|
+
*/
|
|
180
|
+
private static validateRequirements;
|
|
181
|
+
/**
|
|
182
|
+
* Track a stat requirement for reference
|
|
183
|
+
*
|
|
184
|
+
* Stat requirements are validated before equipping, but we track them
|
|
185
|
+
* in equipment_effects so game logic can reference them if needed.
|
|
186
|
+
*/
|
|
187
|
+
private static trackStatRequirement;
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=EquipmentEffectApplier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EquipmentEffectApplier.d.ts","sourceRoot":"","sources":["../../../src/core/equipment/EquipmentEffectApplier.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAoB,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAK,EACR,iBAAiB,EACjB,iBAAiB,EAIjB,uBAAuB,EAC1B,MAAM,uBAAuB,CAAC;AAM/B;;;;;;;;;;;GAWG;AACH,qBAAa,sBAAsB;IAC/B;;;;;;;OAOG;IACH,MAAM,CAAC,SAAS,CACZ,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,iBAAiB,EAC5B,UAAU,CAAC,EAAE,MAAM,GACpB,uBAAuB;IA8F1B;;;;;;;OAOG;IACH,MAAM,CAAC,WAAW,CACd,SAAS,EAAE,cAAc,EACzB,aAAa,EAAE,MAAM,EACrB,UAAU,CAAC,EAAE,MAAM,GACpB,uBAAuB;IAwD1B;;;;;OAKG;IACH,MAAM,CAAC,uBAAuB,CAC1B,SAAS,EAAE,cAAc,GAC1B,uBAAuB;IA+E1B;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CACnB,SAAS,EAAE,cAAc,GAC1B,iBAAiB,EAAE;IAYtB;;;;;OAKG;IACH;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IA0BjE,OAAO,CAAC,MAAM,CAAC,aAAa;IAmC5B;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,oCAAoC;IAsBnD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAiB7B;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAUpC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAWjC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAuCnC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAanC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAa/B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAwB/B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAY9B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IASrC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAsBpC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAiDrC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAsBnC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAyBnC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAqBxC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAUpC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IASlC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAoBtC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAWpC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IA4B7B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAWlC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IA4BnC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;CAYtC"}
|