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,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Equipment Modifier
|
|
3
|
+
*
|
|
4
|
+
* Handles equipment modification operations including enchanting, cursing,
|
|
5
|
+
* upgrading, and template application. Supports per-instance modifications
|
|
6
|
+
* that can be applied to individual equipment items.
|
|
7
|
+
*/
|
|
8
|
+
import type { CharacterSheet } from '../types/Character.js';
|
|
9
|
+
import type { CharacterEquipment, EquipmentProperty, EquipmentModification, EquipmentMiniFeature } from '../types/Equipment.js';
|
|
10
|
+
/**
|
|
11
|
+
* Modification result containing the updated equipment state
|
|
12
|
+
*/
|
|
13
|
+
export interface ModificationResult {
|
|
14
|
+
/** Updated equipment state */
|
|
15
|
+
equipment: CharacterEquipment;
|
|
16
|
+
/** Whether the modification was applied */
|
|
17
|
+
success: boolean;
|
|
18
|
+
/** Errors encountered (if any) */
|
|
19
|
+
errors?: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* EquipmentModifier - Equipment modification operations
|
|
23
|
+
*
|
|
24
|
+
* This class provides static methods for:
|
|
25
|
+
* - Enchanting equipment with new properties (per-instance)
|
|
26
|
+
* - Applying template modifications (creates new item based on template)
|
|
27
|
+
* - Cursing equipment with negative effects
|
|
28
|
+
* - Upgrading equipment (improve existing properties)
|
|
29
|
+
* - Removing modifications
|
|
30
|
+
* - Querying modification history
|
|
31
|
+
* - Checking for templates
|
|
32
|
+
* - Getting combined effects from base + modifications
|
|
33
|
+
*
|
|
34
|
+
* TEMPLATE VS INSTANCE:
|
|
35
|
+
* - Template modifications create new equipment based on a template definition
|
|
36
|
+
* - Per-instance modifications are stored in the modifications array
|
|
37
|
+
* - Both can coexist on the same item
|
|
38
|
+
*/
|
|
39
|
+
export declare class EquipmentModifier {
|
|
40
|
+
/**
|
|
41
|
+
* Enchant equipment with new properties (creates per-instance modification)
|
|
42
|
+
*
|
|
43
|
+
* Enchanting adds positive magical properties to an item. Each enchantment
|
|
44
|
+
* is stored as a per-instance modification that can be removed later.
|
|
45
|
+
*
|
|
46
|
+
* @param equipment - Current equipment state
|
|
47
|
+
* @param itemName - Name of the item to enchant
|
|
48
|
+
* @param enchantment - The enchantment to apply
|
|
49
|
+
* @param character - Optional character to reapply effects to
|
|
50
|
+
* @returns Updated equipment with enchantment applied
|
|
51
|
+
*/
|
|
52
|
+
static enchant(equipment: CharacterEquipment, itemName: string, enchantment: EquipmentModification, character?: CharacterSheet): CharacterEquipment;
|
|
53
|
+
/**
|
|
54
|
+
* Apply a template modification to equipment
|
|
55
|
+
*
|
|
56
|
+
* Template-based modifications create new items based on template definitions
|
|
57
|
+
* stored in ExtensionManager under 'equipment.templates' category.
|
|
58
|
+
*
|
|
59
|
+
* @param equipment - Current equipment state
|
|
60
|
+
* @param itemName - Name of the item to modify
|
|
61
|
+
* @param templateId - ID of the template to apply
|
|
62
|
+
* @param character - Optional character to reapply effects to
|
|
63
|
+
* @returns Updated equipment with template applied
|
|
64
|
+
*/
|
|
65
|
+
static applyTemplate(equipment: CharacterEquipment, itemName: string, templateId: string, character?: CharacterSheet): CharacterEquipment;
|
|
66
|
+
/**
|
|
67
|
+
* Curse equipment with negative effects
|
|
68
|
+
*
|
|
69
|
+
* Cursing adds negative properties to an item. Like enchantments,
|
|
70
|
+
* curses are stored as per-instance modifications that can be removed.
|
|
71
|
+
*
|
|
72
|
+
* @param equipment - Current equipment state
|
|
73
|
+
* @param itemName - Name of the item to curse
|
|
74
|
+
* @param curse - The curse to apply
|
|
75
|
+
* @param character - Optional character to reapply effects to
|
|
76
|
+
* @returns Updated equipment with curse applied
|
|
77
|
+
*/
|
|
78
|
+
static curse(equipment: CharacterEquipment, itemName: string, curse: EquipmentModification, character?: CharacterSheet): CharacterEquipment;
|
|
79
|
+
/**
|
|
80
|
+
* Upgrade equipment (improve existing properties)
|
|
81
|
+
*
|
|
82
|
+
* Upgrading enhances existing properties on an item or adds new positive
|
|
83
|
+
* properties. This is a convenience wrapper around enchant().
|
|
84
|
+
*
|
|
85
|
+
* @param equipment - Current equipment state
|
|
86
|
+
* @param itemName - Name of the item to upgrade
|
|
87
|
+
* @param upgrade - The upgrade to apply
|
|
88
|
+
* @param character - Optional character to reapply effects to
|
|
89
|
+
* @returns Updated equipment with upgrade applied
|
|
90
|
+
*/
|
|
91
|
+
static upgrade(equipment: CharacterEquipment, itemName: string, upgrade: EquipmentModification, character?: CharacterSheet): CharacterEquipment;
|
|
92
|
+
/**
|
|
93
|
+
* Remove a modification from equipment
|
|
94
|
+
*
|
|
95
|
+
* Removes a specific modification by ID from an item. If the item
|
|
96
|
+
* is equipped, effects are recalculated.
|
|
97
|
+
*
|
|
98
|
+
* @param equipment - Current equipment state
|
|
99
|
+
* @param itemName - Name of the item
|
|
100
|
+
* @param modificationId - ID of the modification to remove
|
|
101
|
+
* @param character - Optional character to reapply effects to
|
|
102
|
+
* @returns Updated equipment with modification removed
|
|
103
|
+
*/
|
|
104
|
+
static removeModification(equipment: CharacterEquipment, itemName: string, modificationId: string, character?: CharacterSheet): CharacterEquipment;
|
|
105
|
+
/**
|
|
106
|
+
* Get modification history for an item
|
|
107
|
+
*
|
|
108
|
+
* Returns all modifications that have been applied to an item,
|
|
109
|
+
* in the order they were applied.
|
|
110
|
+
*
|
|
111
|
+
* @param equipment - Current equipment state
|
|
112
|
+
* @param itemName - Name of the item
|
|
113
|
+
* @returns Array of modifications (oldest first)
|
|
114
|
+
*/
|
|
115
|
+
static getModificationHistory(equipment: CharacterEquipment, itemName: string): EquipmentModification[];
|
|
116
|
+
/**
|
|
117
|
+
* Get all active effects from an item (base + modifications)
|
|
118
|
+
*
|
|
119
|
+
* Combines the base equipment properties with all modification
|
|
120
|
+
* properties to give the complete set of active effects.
|
|
121
|
+
*
|
|
122
|
+
* @param equipment - Current equipment state
|
|
123
|
+
* @param itemName - Name of the item
|
|
124
|
+
* @param instanceId - Optional instance ID for multi-item tracking
|
|
125
|
+
* @returns Array of all active equipment properties
|
|
126
|
+
*/
|
|
127
|
+
static getCombinedEffects(equipment: CharacterEquipment, itemName: string, instanceId?: string): EquipmentProperty[];
|
|
128
|
+
/**
|
|
129
|
+
* Check if item has a specific template
|
|
130
|
+
*
|
|
131
|
+
* @param equipment - Current equipment state
|
|
132
|
+
* @param itemName - Name of the item
|
|
133
|
+
* @param templateId - Template ID to check for
|
|
134
|
+
* @returns True if the item has the template
|
|
135
|
+
*/
|
|
136
|
+
static hasTemplate(equipment: CharacterEquipment, itemName: string, templateId: string): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Get all templates applied to an item
|
|
139
|
+
*
|
|
140
|
+
* @param equipment - Current equipment state
|
|
141
|
+
* @param itemName - Name of the item
|
|
142
|
+
* @returns Array of template IDs
|
|
143
|
+
*/
|
|
144
|
+
static getAppliedTemplates(equipment: CharacterEquipment, itemName: string): string[];
|
|
145
|
+
/**
|
|
146
|
+
* Remove all modifications from an item
|
|
147
|
+
*
|
|
148
|
+
* Removes all modifications, effectively restoring the item to
|
|
149
|
+
* its base state.
|
|
150
|
+
*
|
|
151
|
+
* @param equipment - Current equipment state
|
|
152
|
+
* @param itemName - Name of the item
|
|
153
|
+
* @param character - Optional character to reapply effects to
|
|
154
|
+
* @returns Updated equipment with all modifications removed
|
|
155
|
+
*/
|
|
156
|
+
static removeAllModifications(equipment: CharacterEquipment, itemName: string, character?: CharacterSheet): CharacterEquipment;
|
|
157
|
+
/**
|
|
158
|
+
* Disenchant an item (remove all enchantments, keep curses)
|
|
159
|
+
*
|
|
160
|
+
* Removes only positive modifications (enchantments/upgrades), leaving
|
|
161
|
+
* curses intact. Useful for "remove curse" mechanics.
|
|
162
|
+
*
|
|
163
|
+
* @param equipment - Current equipment state
|
|
164
|
+
* @param itemName - Name of the item
|
|
165
|
+
* @param character - Optional character to reapply effects to
|
|
166
|
+
* @returns Updated equipment with enchantments removed
|
|
167
|
+
*/
|
|
168
|
+
static disenchant(equipment: CharacterEquipment, itemName: string, character?: CharacterSheet): CharacterEquipment;
|
|
169
|
+
/**
|
|
170
|
+
* Lift curse from an item (remove all curses, keep enchantments)
|
|
171
|
+
*
|
|
172
|
+
* Removes only negative modifications (curses), leaving enchantments
|
|
173
|
+
* intact.
|
|
174
|
+
*
|
|
175
|
+
* @param equipment - Current equipment state
|
|
176
|
+
* @param itemName - Name of the item
|
|
177
|
+
* @param character - Optional character to reapply effects to
|
|
178
|
+
* @returns Updated equipment with curses removed
|
|
179
|
+
*/
|
|
180
|
+
static liftCurse(equipment: CharacterEquipment, itemName: string, character?: CharacterSheet): CharacterEquipment;
|
|
181
|
+
/**
|
|
182
|
+
* Add a modification to equipment (internal implementation)
|
|
183
|
+
*/
|
|
184
|
+
private static addModificationToEquipment;
|
|
185
|
+
/**
|
|
186
|
+
* Find an item in equipment by name
|
|
187
|
+
*/
|
|
188
|
+
private static findItem;
|
|
189
|
+
/**
|
|
190
|
+
* Get equipment data from ExtensionManager
|
|
191
|
+
*/
|
|
192
|
+
private static getEquipmentData;
|
|
193
|
+
/**
|
|
194
|
+
* Apply modification effects to character
|
|
195
|
+
*/
|
|
196
|
+
private static applyModificationEffects;
|
|
197
|
+
/**
|
|
198
|
+
* Create a modification from properties
|
|
199
|
+
*
|
|
200
|
+
* Convenience factory for creating modification objects.
|
|
201
|
+
*
|
|
202
|
+
* @param id - Unique ID for the modification
|
|
203
|
+
* @param name - Display name of the modification
|
|
204
|
+
* @param properties - Properties to add
|
|
205
|
+
* @param source - Source type (enchantment, curse, upgrade, etc.)
|
|
206
|
+
* @returns EquipmentModification object
|
|
207
|
+
*/
|
|
208
|
+
static createModification(id: string, name: string, properties: EquipmentProperty[], source: string): EquipmentModification;
|
|
209
|
+
/**
|
|
210
|
+
* Create a modification with feature grants
|
|
211
|
+
*
|
|
212
|
+
* Convenience factory for creating feature-granting modifications.
|
|
213
|
+
*
|
|
214
|
+
* @param id - Unique ID for the modification
|
|
215
|
+
* @param name - Display name of the modification
|
|
216
|
+
* @param properties - Properties to add
|
|
217
|
+
* @param addsFeatures - Features to grant
|
|
218
|
+
* @param source - Source type
|
|
219
|
+
* @returns EquipmentModification object
|
|
220
|
+
*/
|
|
221
|
+
static createFeatureModification(id: string, name: string, properties: EquipmentProperty[], addsFeatures: Array<string | EquipmentMiniFeature>, source: string): EquipmentModification;
|
|
222
|
+
/**
|
|
223
|
+
* Create a modification with skill grants
|
|
224
|
+
*
|
|
225
|
+
* Convenience factory for creating skill-granting modifications.
|
|
226
|
+
*
|
|
227
|
+
* @param id - Unique ID for the modification
|
|
228
|
+
* @param name - Display name of the modification
|
|
229
|
+
* @param properties - Properties to add
|
|
230
|
+
* @param addsSkills - Skills to grant
|
|
231
|
+
* @param source - Source type
|
|
232
|
+
* @returns EquipmentModification object
|
|
233
|
+
*/
|
|
234
|
+
static createSkillModification(id: string, name: string, properties: EquipmentProperty[], addsSkills: Array<{
|
|
235
|
+
skillId: string;
|
|
236
|
+
level: 'proficient' | 'expertise';
|
|
237
|
+
}>, source: string): EquipmentModification;
|
|
238
|
+
/**
|
|
239
|
+
* Create a modification with spell grants
|
|
240
|
+
*
|
|
241
|
+
* Convenience factory for creating spell-granting modifications.
|
|
242
|
+
*
|
|
243
|
+
* @param id - Unique ID for the modification
|
|
244
|
+
* @param name - Display name of the modification
|
|
245
|
+
* @param properties - Properties to add
|
|
246
|
+
* @param addsSpells - Spells to grant
|
|
247
|
+
* @param source - Source type
|
|
248
|
+
* @returns EquipmentModification object
|
|
249
|
+
*/
|
|
250
|
+
static createSpellModification(id: string, name: string, properties: EquipmentProperty[], addsSpells: Array<{
|
|
251
|
+
spellId: string;
|
|
252
|
+
level?: number;
|
|
253
|
+
uses?: number;
|
|
254
|
+
recharge?: string;
|
|
255
|
+
}>, source: string): EquipmentModification;
|
|
256
|
+
/**
|
|
257
|
+
* Generate a unique modification ID
|
|
258
|
+
*
|
|
259
|
+
* @param prefix - Optional prefix for the ID
|
|
260
|
+
* @returns Unique modification ID
|
|
261
|
+
*/
|
|
262
|
+
static generateModificationId(prefix?: string): string;
|
|
263
|
+
/**
|
|
264
|
+
* Get all modification sources on an item
|
|
265
|
+
*
|
|
266
|
+
* @param equipment - Current equipment state
|
|
267
|
+
* @param itemName - Name of the item
|
|
268
|
+
* @returns Array of unique source types
|
|
269
|
+
*/
|
|
270
|
+
static getModificationSources(equipment: CharacterEquipment, itemName: string): string[];
|
|
271
|
+
/**
|
|
272
|
+
* Count modifications by source type
|
|
273
|
+
*
|
|
274
|
+
* Returns a record mapping each source type to the count of modifications
|
|
275
|
+
* from that source.
|
|
276
|
+
*
|
|
277
|
+
* @param equipment - Current equipment state
|
|
278
|
+
* @param itemName - Name of the item
|
|
279
|
+
* @returns Record of source type to modification count
|
|
280
|
+
*/
|
|
281
|
+
static countModificationsBySource(equipment: CharacterEquipment, itemName: string): Record<string, number>;
|
|
282
|
+
/**
|
|
283
|
+
* Count modifications for a specific source type
|
|
284
|
+
*
|
|
285
|
+
* @param equipment - Current equipment state
|
|
286
|
+
* @param itemName - Name of the item
|
|
287
|
+
* @param source - Source type to count
|
|
288
|
+
* @returns Number of modifications from the specified source
|
|
289
|
+
*/
|
|
290
|
+
static countModificationsForSource(equipment: CharacterEquipment, itemName: string, source: string): number;
|
|
291
|
+
/**
|
|
292
|
+
* Check if item has any curses
|
|
293
|
+
*
|
|
294
|
+
* @param equipment - Current equipment state
|
|
295
|
+
* @param itemName - Name of the item
|
|
296
|
+
* @returns True if item has any curse modifications
|
|
297
|
+
*/
|
|
298
|
+
static isCursed(equipment: CharacterEquipment, itemName: string): boolean;
|
|
299
|
+
/**
|
|
300
|
+
* Check if item is enchanted
|
|
301
|
+
*
|
|
302
|
+
* @param equipment - Current equipment state
|
|
303
|
+
* @param itemName - Name of the item
|
|
304
|
+
* @returns True if item has any enchantment modifications
|
|
305
|
+
*/
|
|
306
|
+
static isEnchanted(equipment: CharacterEquipment, itemName: string): boolean;
|
|
307
|
+
/**
|
|
308
|
+
* Get item summary including modifications
|
|
309
|
+
*
|
|
310
|
+
* @param equipment - Current equipment state
|
|
311
|
+
* @param itemName - Name of the item
|
|
312
|
+
* @returns Summary object with item info and modifications
|
|
313
|
+
*/
|
|
314
|
+
static getItemSummary(equipment: CharacterEquipment, itemName: string): {
|
|
315
|
+
name: string;
|
|
316
|
+
quantity: number;
|
|
317
|
+
equipped: boolean;
|
|
318
|
+
instanceId?: string;
|
|
319
|
+
templateId?: string;
|
|
320
|
+
modificationCount: number;
|
|
321
|
+
isCursed: boolean;
|
|
322
|
+
isEnchanted: boolean;
|
|
323
|
+
sources: string[];
|
|
324
|
+
effects: EquipmentProperty[];
|
|
325
|
+
} | null;
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=EquipmentModifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EquipmentModifier.d.ts","sourceRoot":"","sources":["../../../src/core/equipment/EquipmentModifier.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EACR,kBAAkB,EAGlB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACvB,MAAM,uBAAuB,CAAC;AAK/B;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,8BAA8B;IAC9B,SAAS,EAAE,kBAAkB,CAAC;IAC9B,2CAA2C;IAC3C,OAAO,EAAE,OAAO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,CACX,SAAS,EAAE,kBAAkB,EAC7B,QAAQ,EAAE,MAAM,GACjB,OAAO;IAIV;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CACd,SAAS,EAAE,kBAAkB,EAC7B,QAAQ,EAAE,MAAM,GACjB,OAAO;IAKV;;;;;;OAMG;IACH,MAAM,CAAC,cAAc,CACjB,SAAS,EAAE,kBAAkB,EAC7B,QAAQ,EAAE,MAAM,GACjB;QACC,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,OAAO,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,QAAQ,EAAE,OAAO,CAAC;QAClB,WAAW,EAAE,OAAO,CAAC;QACrB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,OAAO,EAAE,iBAAiB,EAAE,CAAC;KAChC,GAAG,IAAI;CAmBX"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Equipment Spawn Helper
|
|
3
|
+
*
|
|
4
|
+
* Helper functions for spawning multiple equipment items at once.
|
|
5
|
+
* NOT a full loot system - provides batch spawning utilities for:
|
|
6
|
+
* - Spawning from lists of equipment names
|
|
7
|
+
* - Spawning by rarity (common, uncommon, rare, very_rare, legendary)
|
|
8
|
+
* - Spawning by tags (weapon, armor, fire, magic, etc.)
|
|
9
|
+
* - Spawning random equipment (respecting spawn weights)
|
|
10
|
+
* - Spawning from templates (e.g., Flaming Sword)
|
|
11
|
+
* - Spawning treasure hoards (simplified D&D 5e table)
|
|
12
|
+
* - Adding spawned equipment to characters
|
|
13
|
+
*/
|
|
14
|
+
import type { CharacterSheet } from '../types/Character.js';
|
|
15
|
+
import type { EnhancedEquipment, SpawnRandomOptions, TreasureHoardResult, BoxOpenResult } from '../types/Equipment.js';
|
|
16
|
+
import { SeededRNG } from '../../utils/random.js';
|
|
17
|
+
/**
|
|
18
|
+
* EquipmentSpawnHelper - Batch spawning utilities for equipment
|
|
19
|
+
*
|
|
20
|
+
* This class provides static methods for:
|
|
21
|
+
* - Spawning multiple items from a list of names
|
|
22
|
+
* - Spawning items by rarity
|
|
23
|
+
* - Spawning items by tags
|
|
24
|
+
* - Spawning random equipment with weighted selection
|
|
25
|
+
* - Spawning from templates
|
|
26
|
+
* - Spawning treasure hoards
|
|
27
|
+
* - Adding spawned equipment to characters
|
|
28
|
+
*
|
|
29
|
+
* DESIGN NOTES:
|
|
30
|
+
* - Uses SeededRNG for deterministic results
|
|
31
|
+
* - Respects spawnWeight property (0 = never random, still usable by game logic)
|
|
32
|
+
* - Integrates with ExtensionManager for custom equipment
|
|
33
|
+
* - NOT a full loot system - just helper utilities
|
|
34
|
+
*/
|
|
35
|
+
export declare class EquipmentSpawnHelper {
|
|
36
|
+
/**
|
|
37
|
+
* Spawn multiple items from an array of equipment names
|
|
38
|
+
*
|
|
39
|
+
* @param itemNames - Array of equipment names to spawn
|
|
40
|
+
* @param rng - Optional SeededRNG for shuffling (deterministic order)
|
|
41
|
+
* @returns Array of spawned equipment (undefined for missing items)
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const rng = new SeededRNG('starter_gear');
|
|
46
|
+
* const items = EquipmentSpawnHelper.spawnFromList(
|
|
47
|
+
* ['Longsword', 'Shield', 'Scale Mail'],
|
|
48
|
+
* rng
|
|
49
|
+
* );
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
static spawnFromList(itemNames: string[], rng?: SeededRNG): (EnhancedEquipment | undefined)[];
|
|
53
|
+
/**
|
|
54
|
+
* Spawn items by rarity level
|
|
55
|
+
*
|
|
56
|
+
* Returns up to `count` items of the specified rarity.
|
|
57
|
+
* If there aren't enough items of that rarity, returns all available.
|
|
58
|
+
* Selection is random and deterministic if RNG is provided.
|
|
59
|
+
*
|
|
60
|
+
* @param rarity - Rarity level to spawn
|
|
61
|
+
* @param count - Maximum number of items to spawn
|
|
62
|
+
* @param rng - Optional SeededRNG for deterministic selection
|
|
63
|
+
* @returns Array of spawned equipment
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* const rng = new SeededRNG('rare_loot');
|
|
68
|
+
* const rareItems = EquipmentSpawnHelper.spawnByRarity('rare', 3, rng);
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
static spawnByRarity(rarity: 'common' | 'uncommon' | 'rare' | 'very_rare' | 'legendary', count: number, rng?: SeededRNG): EnhancedEquipment[];
|
|
72
|
+
/**
|
|
73
|
+
* Spawn items by tags
|
|
74
|
+
*
|
|
75
|
+
* Returns items that match ANY of the provided tags.
|
|
76
|
+
* If multiple tags provided, items matching any tag are included.
|
|
77
|
+
*
|
|
78
|
+
* @param tags - Array of tags to filter by
|
|
79
|
+
* @param count - Maximum number of items to spawn
|
|
80
|
+
* @param rng - Optional SeededRNG for deterministic selection
|
|
81
|
+
* @param options - Additional options (excludeZeroWeight, includeTypes, min/max rarity)
|
|
82
|
+
* @returns Array of spawned equipment
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* const rng = new SeededRNG('fire_weapons');
|
|
87
|
+
* const fireItems = EquipmentSpawnHelper.spawnByTags(
|
|
88
|
+
* ['fire', 'weapon'],
|
|
89
|
+
* 5,
|
|
90
|
+
* rng
|
|
91
|
+
* );
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
static spawnByTags(tags: string[], count: number, rng?: SeededRNG, options?: SpawnRandomOptions): EnhancedEquipment[];
|
|
95
|
+
/**
|
|
96
|
+
* Spawn random equipment respecting spawn weights
|
|
97
|
+
*
|
|
98
|
+
* Uses weighted random selection where items with higher spawnWeight
|
|
99
|
+
* are more likely to be selected. Items with spawnWeight: 0 are
|
|
100
|
+
* excluded when excludeZeroWeight is true.
|
|
101
|
+
*
|
|
102
|
+
* @param count - Number of items to spawn
|
|
103
|
+
* @param rng - SeededRNG for deterministic results
|
|
104
|
+
* @param options - Optional filters for spawning
|
|
105
|
+
* @returns Array of spawned equipment
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* const rng = new SeededRNG('loot_drop');
|
|
110
|
+
* const items = EquipmentSpawnHelper.spawnRandom(
|
|
111
|
+
* 3,
|
|
112
|
+
* rng,
|
|
113
|
+
* { excludeZeroWeight: true, includeTypes: ['weapon', 'armor'] }
|
|
114
|
+
* );
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
static spawnRandom(count: number, rng: SeededRNG, options?: SpawnRandomOptions): EnhancedEquipment[];
|
|
118
|
+
/**
|
|
119
|
+
* Spawn equipment from a template
|
|
120
|
+
*
|
|
121
|
+
* Creates a new equipment item by applying a template to a base item.
|
|
122
|
+
* If no base item is specified, uses a default item for the template type.
|
|
123
|
+
*
|
|
124
|
+
* Templates can be registered in ExtensionManager under 'equipment.templates'
|
|
125
|
+
* or defined in magicItemExamples.ts.
|
|
126
|
+
*
|
|
127
|
+
* @param templateId - ID of the template to apply
|
|
128
|
+
* @param baseItemName - Optional base item name (uses default if not specified)
|
|
129
|
+
* @returns New equipment with template applied, or null if template not found
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* const flamingSword = EquipmentSpawnHelper.spawnFromTemplate(
|
|
134
|
+
* 'flaming_weapon_template',
|
|
135
|
+
* 'Longsword'
|
|
136
|
+
* );
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
static spawnFromTemplate(templateId: string, baseItemName?: string): EnhancedEquipment | null;
|
|
140
|
+
/**
|
|
141
|
+
* Spawn treasure hoard (simplified D&D 5e table)
|
|
142
|
+
*
|
|
143
|
+
* Generates a treasure hoard based on challenge rating.
|
|
144
|
+
* This is a simplified version, not the full D&D 5e treasure tables.
|
|
145
|
+
*
|
|
146
|
+
* @param cr - Challenge rating for scaling (0-20+)
|
|
147
|
+
* @param rng - SeededRNG for deterministic results
|
|
148
|
+
* @returns Treasure hoard with items and estimated value
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```typescript
|
|
152
|
+
* const rng = new SeededRNG('dragon_hoard');
|
|
153
|
+
* const hoard = EquipmentSpawnHelper.spawnTreasureHoard(15, rng);
|
|
154
|
+
* console.log(`Generated ${hoard.items.length} items worth ~${hoard.totalValue} gp`);
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
static spawnTreasureHoard(cr: number, rng: SeededRNG): TreasureHoardResult;
|
|
158
|
+
/**
|
|
159
|
+
* Add spawned equipment to character
|
|
160
|
+
*
|
|
161
|
+
* Adds items to character's inventory. Optionally equips them.
|
|
162
|
+
*
|
|
163
|
+
* @param character - Character to add items to
|
|
164
|
+
* @param items - Equipment items to add
|
|
165
|
+
* @param equip - Whether to auto-equip the items (default: false)
|
|
166
|
+
* @returns Updated character
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* ```typescript
|
|
170
|
+
* const items = EquipmentSpawnHelper.spawnByRarity('rare', 2, rng);
|
|
171
|
+
* character = EquipmentSpawnHelper.addToCharacter(character, items, false);
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
static addToCharacter(character: CharacterSheet, items: EnhancedEquipment[], equip?: boolean): CharacterSheet;
|
|
175
|
+
/**
|
|
176
|
+
* Open a box item in a character's inventory
|
|
177
|
+
*
|
|
178
|
+
* Finds the named box in the character's items, opens it using BoxOpener,
|
|
179
|
+
* removes it from inventory (if consumeOnOpen), and adds the box contents
|
|
180
|
+
* to the character's inventory.
|
|
181
|
+
*
|
|
182
|
+
* If the box has opening requirements:
|
|
183
|
+
* - Checks requirements using BoxOpener.checkRequirements()
|
|
184
|
+
* - If requirements not met, returns error result without modifying character
|
|
185
|
+
* - If requirements met, consumes required items from inventory before opening
|
|
186
|
+
*
|
|
187
|
+
* @param character - Character whose inventory contains the box
|
|
188
|
+
* @param boxName - Name of the box item to open
|
|
189
|
+
* @param rng - SeededRNG for deterministic results
|
|
190
|
+
* @returns Object with updated character and BoxOpenResult, or null if box not found
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```typescript
|
|
194
|
+
* const rng = new SeededRNG('open_pack');
|
|
195
|
+
* const result = EquipmentSpawnHelper.openBoxForCharacter(character, "Explorer's Pack", rng);
|
|
196
|
+
* if (result) {
|
|
197
|
+
* character = result.character;
|
|
198
|
+
* console.log(`Received ${result.result.gold} gold`);
|
|
199
|
+
* console.log(`Received ${result.result.items.length} items`);
|
|
200
|
+
* }
|
|
201
|
+
*
|
|
202
|
+
* // With requirements
|
|
203
|
+
* const lockedResult = EquipmentSpawnHelper.openBoxForCharacter(character, "Locked Chest", rng);
|
|
204
|
+
* if (lockedResult) {
|
|
205
|
+
* if (lockedResult.result.success) {
|
|
206
|
+
* console.log('Opened chest!', lockedResult.result.consumedItems);
|
|
207
|
+
* } else {
|
|
208
|
+
* console.log('Cannot open:', lockedResult.result.error?.message);
|
|
209
|
+
* }
|
|
210
|
+
* }
|
|
211
|
+
* ```
|
|
212
|
+
*/
|
|
213
|
+
static openBoxForCharacter(character: CharacterSheet, boxName: string, rng: SeededRNG): {
|
|
214
|
+
character: CharacterSheet;
|
|
215
|
+
result: BoxOpenResult;
|
|
216
|
+
} | null;
|
|
217
|
+
/**
|
|
218
|
+
* Consume items from a character's inventory
|
|
219
|
+
*
|
|
220
|
+
* Private helper that reduces the quantity of an item in the character's
|
|
221
|
+
* items inventory, or removes it entirely if quantity reaches 0.
|
|
222
|
+
* Updates totalWeight accordingly.
|
|
223
|
+
*
|
|
224
|
+
* @param character - Character to consume from
|
|
225
|
+
* @param itemName - Name of the item to consume
|
|
226
|
+
* @param quantity - Quantity to consume
|
|
227
|
+
* @returns Object with success status and updated character
|
|
228
|
+
*/
|
|
229
|
+
private static consumeItemFromCharacter;
|
|
230
|
+
/**
|
|
231
|
+
* Get default item for a template based on template properties
|
|
232
|
+
*/
|
|
233
|
+
private static getDefaultItemForTemplate;
|
|
234
|
+
/**
|
|
235
|
+
* Get treasure item counts by rarity based on CR
|
|
236
|
+
* Simplified D&D 5e treasure table
|
|
237
|
+
* Uses provided RNG for deterministic results
|
|
238
|
+
*/
|
|
239
|
+
private static getTreasureItemCount;
|
|
240
|
+
/**
|
|
241
|
+
* Estimate gold piece value of an item
|
|
242
|
+
* Simplified value estimation based on rarity
|
|
243
|
+
*/
|
|
244
|
+
private static estimateItemValue;
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=EquipmentSpawnHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EquipmentSpawnHelper.d.ts","sourceRoot":"","sources":["../../../src/core/equipment/EquipmentSpawnHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EACR,iBAAiB,EAEjB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAgBlD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,oBAAoB;IAC7B;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,aAAa,CAChB,SAAS,EAAE,MAAM,EAAE,EACnB,GAAG,CAAC,EAAE,SAAS,GAChB,CAAC,iBAAiB,GAAG,SAAS,CAAC,EAAE;IAgBpC;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,aAAa,CAChB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,EAClE,KAAK,EAAE,MAAM,EACb,GAAG,CAAC,EAAE,SAAS,GAChB,iBAAiB,EAAE;IAkCtB;;;;;;;;;;;;;;;;;;;;;OAqBG;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