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,368 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FeatureQuery
|
|
3
|
+
*
|
|
4
|
+
* Central query interface for class features and racial traits.
|
|
5
|
+
* Provides default and custom features with prerequisite validation.
|
|
6
|
+
*
|
|
7
|
+
* **Design:** FeatureQuery provides query methods that read from ExtensionManager.
|
|
8
|
+
* All feature registration is done via ExtensionManager.register().
|
|
9
|
+
*
|
|
10
|
+
* This class provides:
|
|
11
|
+
* - Query methods with caching for performance
|
|
12
|
+
* - Feature-related helper methods
|
|
13
|
+
* - Prerequisite validation
|
|
14
|
+
*
|
|
15
|
+
* No duplicate storage - all data lives in ExtensionManager.
|
|
16
|
+
*
|
|
17
|
+
* **Note:** Both class features and racial traits read from ExtensionManager.
|
|
18
|
+
* To register new features, use ExtensionManager.register() directly.
|
|
19
|
+
*/
|
|
20
|
+
import type { ClassFeature, RacialTrait, ValidationResult } from './FeatureTypes.js';
|
|
21
|
+
import type { Class, Race } from '../types/Character.js';
|
|
22
|
+
import type { CharacterSheet } from '../types/Character.js';
|
|
23
|
+
/**
|
|
24
|
+
* FeatureQuery - Singleton class for querying features and traits
|
|
25
|
+
*
|
|
26
|
+
* This is a query interface that reads from ExtensionManager.
|
|
27
|
+
* All class features and racial traits are stored in ExtensionManager; FeatureQuery provides:
|
|
28
|
+
* - Query methods with caching for performance
|
|
29
|
+
* - Feature-related helper methods
|
|
30
|
+
* - Prerequisite validation
|
|
31
|
+
*
|
|
32
|
+
* Design principle: No duplicate storage. All feature data lives in ExtensionManager.
|
|
33
|
+
* To register new features, use ExtensionManager.register() directly.
|
|
34
|
+
*/
|
|
35
|
+
export declare class FeatureQuery {
|
|
36
|
+
private static instance;
|
|
37
|
+
private manager;
|
|
38
|
+
private allClassFeaturesCache;
|
|
39
|
+
private classFeaturesIndex;
|
|
40
|
+
private allRacialTraitsCache;
|
|
41
|
+
private racialTraitsIndex;
|
|
42
|
+
private constructor();
|
|
43
|
+
/**
|
|
44
|
+
* Get the singleton instance
|
|
45
|
+
*/
|
|
46
|
+
static getInstance(): FeatureQuery;
|
|
47
|
+
/**
|
|
48
|
+
* Invalidate all caches
|
|
49
|
+
*
|
|
50
|
+
* This method is primarily for internal use and advanced scenarios.
|
|
51
|
+
*
|
|
52
|
+
* Call this method after directly manipulating ExtensionManager's data
|
|
53
|
+
* (e.g., after calling ExtensionManager.resetAll()).
|
|
54
|
+
*
|
|
55
|
+
* This ensures that FeatureQuery's cached data is refreshed to reflect
|
|
56
|
+
* the current state of ExtensionManager.
|
|
57
|
+
*/
|
|
58
|
+
invalidateCache(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Get all class features as an array
|
|
61
|
+
*
|
|
62
|
+
* Reads from ExtensionManager with caching.
|
|
63
|
+
*
|
|
64
|
+
* @returns Array of all class features
|
|
65
|
+
*/
|
|
66
|
+
private getAllClassFeaturesArray;
|
|
67
|
+
/**
|
|
68
|
+
* Get all racial traits as an array
|
|
69
|
+
*
|
|
70
|
+
* Reads from ExtensionManager with caching.
|
|
71
|
+
* Aggregates traits from both the general 'racialTraits' category and
|
|
72
|
+
* all race-specific categories (e.g., 'racialTraits.Elf', 'racialTraits.Dragonkin').
|
|
73
|
+
*
|
|
74
|
+
* @returns Array of all racial traits
|
|
75
|
+
*/
|
|
76
|
+
private getAllRacialTraitsArray;
|
|
77
|
+
/**
|
|
78
|
+
* Get all features for a class at a specific level
|
|
79
|
+
*
|
|
80
|
+
* Returns all features the character would have at the given level,
|
|
81
|
+
* including features from lower levels.
|
|
82
|
+
*
|
|
83
|
+
* Reads from ExtensionManager with caching.
|
|
84
|
+
*
|
|
85
|
+
* @param className - Class to get features for
|
|
86
|
+
* @param level - Character level (1-20)
|
|
87
|
+
* @returns Array of class features
|
|
88
|
+
*/
|
|
89
|
+
getClassFeatures(className: Class, level: number): ClassFeature[];
|
|
90
|
+
/**
|
|
91
|
+
* Get features gained at a specific level for a class
|
|
92
|
+
*
|
|
93
|
+
* Returns only the features gained at exactly this level.
|
|
94
|
+
*
|
|
95
|
+
* Reads from ExtensionManager with caching.
|
|
96
|
+
*
|
|
97
|
+
* @param className - Class to get features for
|
|
98
|
+
* @param level - Level to check
|
|
99
|
+
* @returns Array of class features
|
|
100
|
+
*/
|
|
101
|
+
getFeaturesForLevel(className: Class, level: number): ClassFeature[];
|
|
102
|
+
/**
|
|
103
|
+
* Alias for getFeaturesForLevel for API compatibility
|
|
104
|
+
*
|
|
105
|
+
* @param className - Class to get features for
|
|
106
|
+
* @param level - Level to check
|
|
107
|
+
* @returns Array of class features
|
|
108
|
+
*/
|
|
109
|
+
getClassFeaturesForLevel(className: Class, level: number): ClassFeature[];
|
|
110
|
+
/**
|
|
111
|
+
* Get a single class feature by ID
|
|
112
|
+
*
|
|
113
|
+
* Reads from ExtensionManager.
|
|
114
|
+
*
|
|
115
|
+
* @param featureId - Feature ID to look up
|
|
116
|
+
* @returns Class feature or undefined if not found
|
|
117
|
+
*/
|
|
118
|
+
getClassFeatureById(featureId: string): ClassFeature | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* Get all class features organized by class
|
|
121
|
+
*
|
|
122
|
+
* Returns a Map where keys are class names and values are arrays
|
|
123
|
+
* of all features for that class.
|
|
124
|
+
*
|
|
125
|
+
* Reads from ExtensionManager with caching.
|
|
126
|
+
*
|
|
127
|
+
* @returns Map of class names to their features
|
|
128
|
+
*/
|
|
129
|
+
getAllClassFeatures(): Map<string, ClassFeature[]>;
|
|
130
|
+
/**
|
|
131
|
+
* Get all racial traits for a race
|
|
132
|
+
*
|
|
133
|
+
* Reads from ExtensionManager with caching.
|
|
134
|
+
*
|
|
135
|
+
* @param race - Race to get traits for
|
|
136
|
+
* @returns Array of racial traits
|
|
137
|
+
*/
|
|
138
|
+
getRacialTraits(race: Race): RacialTrait[];
|
|
139
|
+
/**
|
|
140
|
+
* Get only base racial traits (excluding subrace-specific traits)
|
|
141
|
+
*
|
|
142
|
+
* Returns traits that apply to all members of a race, regardless of subrace.
|
|
143
|
+
*
|
|
144
|
+
* Reads from ExtensionManager with caching.
|
|
145
|
+
*
|
|
146
|
+
* @param race - Race to get base traits for
|
|
147
|
+
* @returns Array of base racial traits
|
|
148
|
+
*/
|
|
149
|
+
getBaseRacialTraits(race: Race): RacialTrait[];
|
|
150
|
+
/**
|
|
151
|
+
* Get racial traits for a specific subrace
|
|
152
|
+
*
|
|
153
|
+
* Returns base traits for the race plus subrace-specific traits.
|
|
154
|
+
*
|
|
155
|
+
* Reads from ExtensionManager with caching.
|
|
156
|
+
*
|
|
157
|
+
* @param race - Base race
|
|
158
|
+
* @param subrace - Subrace name
|
|
159
|
+
* @returns Array of racial traits for the subrace
|
|
160
|
+
*/
|
|
161
|
+
getRacialTraitsForSubrace(race: Race, subrace: string): RacialTrait[];
|
|
162
|
+
/**
|
|
163
|
+
* Get only subrace-specific traits
|
|
164
|
+
*
|
|
165
|
+
* Returns only traits that specifically apply to the given subrace.
|
|
166
|
+
*
|
|
167
|
+
* Reads from ExtensionManager with caching.
|
|
168
|
+
*
|
|
169
|
+
* @param race - Base race
|
|
170
|
+
* @param subrace - Subrace name
|
|
171
|
+
* @returns Array of subrace-specific traits
|
|
172
|
+
*/
|
|
173
|
+
getSubraceTraits(race: Race, subrace: string): RacialTrait[];
|
|
174
|
+
/**
|
|
175
|
+
* Get all available subraces for a race
|
|
176
|
+
*
|
|
177
|
+
* Returns a unique list of subrace names for the given race.
|
|
178
|
+
* First checks RACE_DATA for a defined subraces list, then falls back
|
|
179
|
+
* to deriving subraces from registered racial traits (for custom content).
|
|
180
|
+
*
|
|
181
|
+
* Reads from ExtensionManager with caching.
|
|
182
|
+
*
|
|
183
|
+
* @param race - Race to get subraces for
|
|
184
|
+
* @returns Array of unique subrace names
|
|
185
|
+
*/
|
|
186
|
+
getAvailableSubraces(race: Race): string[];
|
|
187
|
+
/**
|
|
188
|
+
* Find the race associated with a given subrace
|
|
189
|
+
*
|
|
190
|
+
* Searches through all registered racial traits to find which race
|
|
191
|
+
* has traits with the specified subrace. Returns undefined if the
|
|
192
|
+
* subrace is not found in any race's traits.
|
|
193
|
+
*
|
|
194
|
+
* Reads from ExtensionManager.
|
|
195
|
+
*
|
|
196
|
+
* @param subrace - Subrace name to look up
|
|
197
|
+
* @returns Race that has this subrace, or undefined if not found
|
|
198
|
+
*/
|
|
199
|
+
getRaceForSubrace(subrace: string): Race | undefined;
|
|
200
|
+
/**
|
|
201
|
+
* Get a single racial trait by ID
|
|
202
|
+
*
|
|
203
|
+
* Reads from ExtensionManager.
|
|
204
|
+
*
|
|
205
|
+
* @param traitId - Trait ID to look up
|
|
206
|
+
* @returns Racial trait or undefined if not found
|
|
207
|
+
*/
|
|
208
|
+
getRacialTraitById(traitId: string): RacialTrait | undefined;
|
|
209
|
+
/**
|
|
210
|
+
* Get all racial traits organized by race
|
|
211
|
+
*
|
|
212
|
+
* Returns a Map where keys are race names and values are arrays
|
|
213
|
+
* of all traits for that race.
|
|
214
|
+
*
|
|
215
|
+
* Reads from ExtensionManager with caching.
|
|
216
|
+
*
|
|
217
|
+
* @returns Map of race names to their traits
|
|
218
|
+
*/
|
|
219
|
+
getAllRacialTraits(): Map<string, RacialTrait[]>;
|
|
220
|
+
/**
|
|
221
|
+
* Validate feature prerequisites against a character
|
|
222
|
+
*
|
|
223
|
+
* Checks if the character meets all requirements for a feature or trait.
|
|
224
|
+
*
|
|
225
|
+
* @param feature - Feature or trait to validate
|
|
226
|
+
* @param character - Character sheet to validate against
|
|
227
|
+
* @returns Validation result with unmet prerequisites if any
|
|
228
|
+
*/
|
|
229
|
+
validatePrerequisites(feature: ClassFeature | RacialTrait, character: CharacterSheet): ValidationResult;
|
|
230
|
+
/**
|
|
231
|
+
* Validate class feature prerequisites against a character
|
|
232
|
+
*
|
|
233
|
+
* Alias for validatePrerequisites with type safety for ClassFeature.
|
|
234
|
+
*
|
|
235
|
+
* @param feature - Class feature to validate
|
|
236
|
+
* @param character - Character sheet to validate against
|
|
237
|
+
* @returns Validation result with unmet prerequisites if any
|
|
238
|
+
*/
|
|
239
|
+
validateFeaturePrerequisites(feature: ClassFeature, character: CharacterSheet): ValidationResult;
|
|
240
|
+
/**
|
|
241
|
+
* Validate racial trait prerequisites against a character
|
|
242
|
+
*
|
|
243
|
+
* Alias for validatePrerequisites with type safety for RacialTrait.
|
|
244
|
+
*
|
|
245
|
+
* @param trait - Racial trait to validate
|
|
246
|
+
* @param character - Character sheet to validate against
|
|
247
|
+
* @returns Validation result with unmet prerequisites if any
|
|
248
|
+
*/
|
|
249
|
+
validateTraitPrerequisites(trait: RacialTrait, character: CharacterSheet): ValidationResult;
|
|
250
|
+
/**
|
|
251
|
+
* Get all feature IDs a character currently has
|
|
252
|
+
*
|
|
253
|
+
* Helper method for prerequisite validation.
|
|
254
|
+
*
|
|
255
|
+
* @param character - Character sheet
|
|
256
|
+
* @returns Array of feature IDs
|
|
257
|
+
*/
|
|
258
|
+
private getCharacterFeatureIds;
|
|
259
|
+
/**
|
|
260
|
+
* Check if a character can gain a feature
|
|
261
|
+
*
|
|
262
|
+
* Convenience method that validates prerequisites and returns boolean.
|
|
263
|
+
*
|
|
264
|
+
* @param feature - Feature or trait to check
|
|
265
|
+
* @param character - Character sheet
|
|
266
|
+
* @returns True if character meets all prerequisites
|
|
267
|
+
*/
|
|
268
|
+
canGainFeature(feature: ClassFeature | RacialTrait, character: CharacterSheet): boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Check if a character meets the prerequisites for a feature
|
|
271
|
+
*
|
|
272
|
+
* Alias for canGainFeature() for API compatibility with documentation.
|
|
273
|
+
*
|
|
274
|
+
* @param feature - Feature or trait to check
|
|
275
|
+
* @param character - Character sheet
|
|
276
|
+
* @returns True if character meets all prerequisites
|
|
277
|
+
*/
|
|
278
|
+
meetsPrerequisites(feature: ClassFeature | RacialTrait, character: CharacterSheet): boolean;
|
|
279
|
+
/**
|
|
280
|
+
* Get all classes that have features registered
|
|
281
|
+
*
|
|
282
|
+
* Reads from ExtensionManager.
|
|
283
|
+
*
|
|
284
|
+
* @returns Array of class names
|
|
285
|
+
*/
|
|
286
|
+
getRegisteredClasses(): Class[];
|
|
287
|
+
/**
|
|
288
|
+
* Get all races that have traits registered
|
|
289
|
+
*
|
|
290
|
+
* Reads from ExtensionManager.
|
|
291
|
+
*
|
|
292
|
+
* @returns Array of race names
|
|
293
|
+
*/
|
|
294
|
+
getRegisteredRaces(): Race[];
|
|
295
|
+
/**
|
|
296
|
+
* Get total count of registered features
|
|
297
|
+
*
|
|
298
|
+
* Reads from ExtensionManager for both class features and racial traits.
|
|
299
|
+
*
|
|
300
|
+
* @returns Object with counts
|
|
301
|
+
*/
|
|
302
|
+
getQueryStats(): {
|
|
303
|
+
totalClassFeatures: number;
|
|
304
|
+
totalRacialTraits: number;
|
|
305
|
+
classesWithFeatures: number;
|
|
306
|
+
racesWithTraits: number;
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* Clear the query cache and reset ExtensionManager data
|
|
310
|
+
*
|
|
311
|
+
* Clears all registered features and traits from ExtensionManager.
|
|
312
|
+
* Useful for testing or reinitialization.
|
|
313
|
+
*/
|
|
314
|
+
clearQueryCache(): void;
|
|
315
|
+
/**
|
|
316
|
+
* Check if the registry has been initialized
|
|
317
|
+
*
|
|
318
|
+
* Checks ExtensionManager for racial traits data.
|
|
319
|
+
*
|
|
320
|
+
* @returns True if initialized with defaults
|
|
321
|
+
*/
|
|
322
|
+
isInitialized(): boolean;
|
|
323
|
+
/**
|
|
324
|
+
* Get features granted by equipment
|
|
325
|
+
*
|
|
326
|
+
* Equipment features are features that can be granted by equipping items.
|
|
327
|
+
* Features with spawnWeight: 0 are still valid for equipment use.
|
|
328
|
+
*
|
|
329
|
+
* Note: This method returns all features that can be granted by equipment.
|
|
330
|
+
* To get features for a specific equipment item, use ExtensionManager
|
|
331
|
+
* to retrieve the equipment definition and check its grantsFeatures property.
|
|
332
|
+
*
|
|
333
|
+
* @param equipmentName - Name of the equipment piece (reserved for future use)
|
|
334
|
+
* @returns Array of features that can be granted by equipment
|
|
335
|
+
*/
|
|
336
|
+
static getEquipmentFeatures(equipmentName: string): ClassFeature[];
|
|
337
|
+
/**
|
|
338
|
+
* Check if a feature can be granted by equipment
|
|
339
|
+
*
|
|
340
|
+
* Features with spawnWeight: 0 are still valid for equipment.
|
|
341
|
+
* This method checks if a feature ID exists in the registry and can be
|
|
342
|
+
* referenced by equipment definitions.
|
|
343
|
+
*
|
|
344
|
+
* @param featureId - Feature ID to check
|
|
345
|
+
* @returns True if the feature exists and can be granted by equipment
|
|
346
|
+
*/
|
|
347
|
+
static isValidEquipmentFeature(featureId: string): boolean;
|
|
348
|
+
/**
|
|
349
|
+
* Get all racial traits as a plain object (for debugging/serialization)
|
|
350
|
+
*
|
|
351
|
+
* Note: For both class features and racial traits, use ExtensionManager.get() directly.
|
|
352
|
+
* This method is kept for API compatibility.
|
|
353
|
+
*
|
|
354
|
+
* Reads from ExtensionManager.
|
|
355
|
+
*
|
|
356
|
+
* @returns Object mapping race names to their traits
|
|
357
|
+
*/
|
|
358
|
+
exportRacialTraits(): Record<string, RacialTrait[]>;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Get the global FeatureQuery instance
|
|
362
|
+
*
|
|
363
|
+
* Convenience function for accessing the singleton.
|
|
364
|
+
*
|
|
365
|
+
* @returns FeatureQuery instance
|
|
366
|
+
*/
|
|
367
|
+
export declare function getFeatureQuery(): FeatureQuery;
|
|
368
|
+
//# sourceMappingURL=FeatureQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureQuery.d.ts","sourceRoot":"","sources":["../../../src/core/features/FeatureQuery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EACR,YAAY,EACZ,WAAW,EACX,gBAAgB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI5D;;;;;;;;;;;GAWG;AACH,qBAAa,YAAY;IACrB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAe;IACtC,OAAO,CAAC,OAAO,CAAmB;IAGlC,OAAO,CAAC,qBAAqB,CAA+B;IAC5D,OAAO,CAAC,kBAAkB,CAA4C;IAGtE,OAAO,CAAC,oBAAoB,CAA8B;IAC1D,OAAO,CAAC,iBAAiB,CAA2C;IAEpE,OAAO;IAIP;;OAEG;IACH,MAAM,CAAC,WAAW,IAAI,YAAY;IAOlC;;;;;;;;;;OAUG;IACH,eAAe,IAAI,IAAI;IAOvB;;;;;;OAMG;IACH,OAAO,CAAC,wBAAwB;IAQhC;;;;;;;;OAQG;IACH,OAAO,CAAC,uBAAuB;IAS/B;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,EAAE;IAKjE;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,EAAE;IAKpE;;;;;;OAMG;IACH,wBAAwB,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,EAAE;IAIzE;;;;;;;OAOG;I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E,YAAY,GAAG,WAAW,EAAE,SAAS,EAAE,cAAc,GAAG,OAAO;IAKvF;;;;;;;;OAQG;IACH,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW,EAAE,SAAS,EAAE,cAAc,GAAG,OAAO;IAI3F;;;;;;OAMG;IACH,oBAAoB,IAAI,KAAK,EAAE;IAS/B;;;;;;OAMG;IACH,kBAAkB,IAAI,IAAI,EAAE;IAS5B;;;;;;OAMG;IACH,aAAa,IAAI;QACb,kBAAkB,EAAE,MAAM,CAAC;QAC3B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,mBAAmB,EAAE,MAAM,CAAC;QAC5B,eAAe,EAAE,MAAM,CAAC;KAC3B;IAqBD;;;;;OAKG;IACH,eAAe,IAAI,IAAI;IAWvB;;;;;;OAMG;IACH,aAAa,IAAI,OAAO;IAKxB;;;;;;;;;;;;OAYG;IAEH,MAAM,CAAC,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,YAAY,EAAE;IAqBlE;;;;;;;;;OASG;IACH,MAAM,CAAC,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAc1D;;;;;;;;;OASG;IACH,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC;CAQtD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAE9C"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Defines the interfaces for custom class features and racial traits.
|
|
5
|
+
*
|
|
6
|
+
* These interfaces allow for:
|
|
7
|
+
* - Extensible feature definitions with prerequisites
|
|
8
|
+
* - Feature effects (stat bonuses, skill proficiencies, ability unlocks)
|
|
9
|
+
* - Integration with FeatureQuery for runtime customization
|
|
10
|
+
*/
|
|
11
|
+
import type { Class, Race, Ability } from '../types/Character.js';
|
|
12
|
+
/**
|
|
13
|
+
* Feature effect types that modify character capabilities
|
|
14
|
+
*
|
|
15
|
+
* - stat_bonus: Add to an ability score (e.g., +1 STR)
|
|
16
|
+
* - skill_proficiency: Grant proficiency or expertise in a skill
|
|
17
|
+
* - ability_unlock: Unlock a new ability (e.g., flight, darkvision)
|
|
18
|
+
* - passive_modifier: Add a constant modifier to rolls (e.g., +1 damage)
|
|
19
|
+
* - resource_grant: Grant a resource pool (e.g., rage counts, ki points)
|
|
20
|
+
* - spell_slot_bonus: Grant additional spell slots
|
|
21
|
+
*/
|
|
22
|
+
export type FeatureEffectType = 'stat_bonus' | 'skill_proficiency' | 'ability_unlock' | 'passive_modifier' | 'resource_grant' | 'spell_slot_bonus';
|
|
23
|
+
/**
|
|
24
|
+
* Feature effect that applies a mechanical benefit
|
|
25
|
+
*
|
|
26
|
+
* Effects are applied when a character gains a feature or trait.
|
|
27
|
+
* Multiple effects can be combined for complex features.
|
|
28
|
+
*/
|
|
29
|
+
export interface FeatureEffect {
|
|
30
|
+
/** Type of effect to apply */
|
|
31
|
+
type: FeatureEffectType;
|
|
32
|
+
/** Target stat, skill, or ability this affects */
|
|
33
|
+
target: string;
|
|
34
|
+
/** Value to apply (number for bonuses, string for unlocks, boolean for flags) */
|
|
35
|
+
value: number | string | boolean;
|
|
36
|
+
/** Optional condition for when this effect applies (e.g., "while raging") */
|
|
37
|
+
condition?: string;
|
|
38
|
+
/** Optional description of this specific effect */
|
|
39
|
+
description?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Prerequisites for gaining a feature or trait
|
|
43
|
+
*
|
|
44
|
+
* Features can require:
|
|
45
|
+
* - A minimum character level
|
|
46
|
+
* - Other features to be learned first (chains)
|
|
47
|
+
* - Minimum ability scores
|
|
48
|
+
* - Specific class or race
|
|
49
|
+
* - Skills that must be proficient first
|
|
50
|
+
* - Spells that must be known first
|
|
51
|
+
* - Custom conditions
|
|
52
|
+
*/
|
|
53
|
+
export interface FeaturePrerequisite {
|
|
54
|
+
/** Minimum level required (default: 1) */
|
|
55
|
+
level?: number;
|
|
56
|
+
/** Features that must be learned first (by ID) */
|
|
57
|
+
features?: string[];
|
|
58
|
+
/** Minimum ability scores required */
|
|
59
|
+
abilities?: Partial<Record<Ability, number>>;
|
|
60
|
+
/** Specific class required (for multi-class features) */
|
|
61
|
+
class?: Class;
|
|
62
|
+
/** Specific race required */
|
|
63
|
+
race?: Race;
|
|
64
|
+
/** Specific subrace required (e.g., 'High Elf', 'Hill Dwarf') */
|
|
65
|
+
subrace?: string;
|
|
66
|
+
/** Skills that must be proficient first (by skill ID) */
|
|
67
|
+
skills?: string[];
|
|
68
|
+
/** Spells that must be known first (by spell name) */
|
|
69
|
+
spells?: string[];
|
|
70
|
+
/** Custom condition description (for manual validation) */
|
|
71
|
+
custom?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Feature type classification
|
|
75
|
+
*
|
|
76
|
+
* - passive: Always active, no action required (e.g., damage resistance)
|
|
77
|
+
* - active: Requires an action or bonus action to use (e.g., Second Wind)
|
|
78
|
+
* - resource: Grants a resource pool to spend (e.g., Ki Points, Rage)
|
|
79
|
+
* - trigger: Automatic but conditional (e.g., Sneak Attack when conditions met)
|
|
80
|
+
*/
|
|
81
|
+
export type FeatureType = 'passive' | 'active' | 'resource' | 'trigger';
|
|
82
|
+
/**
|
|
83
|
+
* Source of the feature definition
|
|
84
|
+
*
|
|
85
|
+
* - default: Built-in D&D 5e feature from the base game
|
|
86
|
+
* - custom: User-created or expansion pack content
|
|
87
|
+
*/
|
|
88
|
+
export type FeatureSource = 'default' | 'custom';
|
|
89
|
+
/**
|
|
90
|
+
* Complete definition of a class feature
|
|
91
|
+
*
|
|
92
|
+
* Features are abilities gained as a character levels up in their class.
|
|
93
|
+
* Examples: Rage, Extra Attack, Metamagic, Unleash Incarnation
|
|
94
|
+
*/
|
|
95
|
+
export interface ClassFeature {
|
|
96
|
+
/** Unique identifier for this feature (e.g., 'barbarian_rage', 'fighter_action_surge') */
|
|
97
|
+
id: string;
|
|
98
|
+
/** Display name shown to players */
|
|
99
|
+
name: string;
|
|
100
|
+
/** Detailed description of what the feature does */
|
|
101
|
+
description: string;
|
|
102
|
+
/** Type of feature (determines how it's used) */
|
|
103
|
+
type: FeatureType;
|
|
104
|
+
/** Character class this feature belongs to */
|
|
105
|
+
class: Class;
|
|
106
|
+
/** Level at which this feature is gained */
|
|
107
|
+
level: number;
|
|
108
|
+
/** Prerequisites that must be met to gain this feature */
|
|
109
|
+
prerequisites?: FeaturePrerequisite;
|
|
110
|
+
/** Effects applied when this feature is gained */
|
|
111
|
+
effects?: FeatureEffect[];
|
|
112
|
+
/** Whether this feature is built-in or custom */
|
|
113
|
+
source: FeatureSource;
|
|
114
|
+
/** Optional tags for filtering/categorizing (e.g., ['melee', 'damage']) */
|
|
115
|
+
tags?: string[];
|
|
116
|
+
/** Optional flavor text or lore */
|
|
117
|
+
lore?: string;
|
|
118
|
+
/** Optional icon URL for small UI display */
|
|
119
|
+
icon?: string;
|
|
120
|
+
/** Optional image URL for larger display */
|
|
121
|
+
image?: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Complete definition of a racial trait
|
|
125
|
+
*
|
|
126
|
+
* Traits are innate abilities granted by a character's race.
|
|
127
|
+
* Examples: Darkvision, Fey Ancestry, Bravery, Stonecunning
|
|
128
|
+
*/
|
|
129
|
+
export interface RacialTrait {
|
|
130
|
+
/** Unique identifier for this trait (e.g., 'elf_darkvision', 'dwarf_dwarven_resilience') */
|
|
131
|
+
id: string;
|
|
132
|
+
/** Display name shown to players */
|
|
133
|
+
name: string;
|
|
134
|
+
/** Detailed description of what the trait does */
|
|
135
|
+
description: string;
|
|
136
|
+
/** Race this trait belongs to */
|
|
137
|
+
race: Race;
|
|
138
|
+
/** Optional subrace requirement (e.g., 'High Elf', 'Hill Dwarf') */
|
|
139
|
+
subrace?: string;
|
|
140
|
+
/** Prerequisites that must be met */
|
|
141
|
+
prerequisites?: FeaturePrerequisite;
|
|
142
|
+
/** Effects applied when this trait is gained (usually at character creation) */
|
|
143
|
+
effects?: FeatureEffect[];
|
|
144
|
+
/** Whether this trait is built-in or custom */
|
|
145
|
+
source: FeatureSource;
|
|
146
|
+
/** Optional tags for filtering/categorizing */
|
|
147
|
+
tags?: string[];
|
|
148
|
+
/** Optional flavor text or lore */
|
|
149
|
+
lore?: string;
|
|
150
|
+
/** Optional icon URL for small UI display */
|
|
151
|
+
icon?: string;
|
|
152
|
+
/** Optional image URL for larger display */
|
|
153
|
+
image?: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Feature entry for character storage
|
|
157
|
+
*
|
|
158
|
+
* When stored on a CharacterSheet, features are tracked by ID
|
|
159
|
+
* along with any dynamic state (uses remaining, choices made, etc.)
|
|
160
|
+
*/
|
|
161
|
+
export interface CharacterFeature {
|
|
162
|
+
/** ID of the feature from the registry */
|
|
163
|
+
featureId: string;
|
|
164
|
+
/** Display name (cached for quick access) */
|
|
165
|
+
name: string;
|
|
166
|
+
/** Level at which this feature was gained */
|
|
167
|
+
gainedAtLevel: number;
|
|
168
|
+
/** Source of the feature */
|
|
169
|
+
source: FeatureSource;
|
|
170
|
+
/** Dynamic state for resource features (e.g., { uses: 3, maxUses: 3 }) */
|
|
171
|
+
state?: Record<string, number | boolean | string>;
|
|
172
|
+
/** Choices made for features with options (e.g., chosen Fighting Style) */
|
|
173
|
+
choices?: Record<string, string | number | boolean>;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Trait entry for character storage
|
|
177
|
+
*
|
|
178
|
+
* Similar to CharacterFeature but for racial traits
|
|
179
|
+
*/
|
|
180
|
+
export interface CharacterTrait {
|
|
181
|
+
/** ID of the trait from the registry */
|
|
182
|
+
traitId: string;
|
|
183
|
+
/** Display name (cached for quick access) */
|
|
184
|
+
name: string;
|
|
185
|
+
/** Whether this is a default trait or custom */
|
|
186
|
+
source: FeatureSource;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Validation result for feature prerequisites
|
|
190
|
+
*/
|
|
191
|
+
export interface ValidationResult {
|
|
192
|
+
/** Whether all prerequisites are met */
|
|
193
|
+
valid: boolean;
|
|
194
|
+
/** Array of prerequisite descriptions that are not met */
|
|
195
|
+
unmet?: string[];
|
|
196
|
+
/** Detailed error messages */
|
|
197
|
+
errors?: string[];
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=FeatureTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureTypes.d.ts","sourceRoot":"","sources":["../../../src/core/features/FeatureTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAElE;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GACvB,YAAY,GACZ,mBAAmB,GACnB,gBAAgB,GAChB,kBAAkB,GAClB,gBAAgB,GAChB,kBAAkB,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC1B,8BAA8B;IAC9B,IAAI,EAAE,iBAAiB,CAAC;IAExB,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IAEf,iFAAiF;IACjF,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAEjC,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,mBAAmB;IAChC,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAE7C,yDAAyD;IACzD,KAAK,CAAC,EAAE,KAAK,CAAC;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