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.
Files changed (345) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +352 -0
  3. package/dist/__vite-browser-external-DYxpcVy9.js +4 -0
  4. package/dist/constants/DefaultClasses.d.ts +46 -0
  5. package/dist/constants/DefaultClasses.d.ts.map +1 -0
  6. package/dist/constants/DefaultEnchantments.d.ts +337 -0
  7. package/dist/constants/DefaultEnchantments.d.ts.map +1 -0
  8. package/dist/constants/DefaultEnemies.d.ts +83 -0
  9. package/dist/constants/DefaultEnemies.d.ts.map +1 -0
  10. package/dist/constants/DefaultEquipment.d.ts +23 -0
  11. package/dist/constants/DefaultEquipment.d.ts.map +1 -0
  12. package/dist/constants/DefaultFeatures.d.ts +22 -0
  13. package/dist/constants/DefaultFeatures.d.ts.map +1 -0
  14. package/dist/constants/DefaultRaces.d.ts +102 -0
  15. package/dist/constants/DefaultRaces.d.ts.map +1 -0
  16. package/dist/constants/DefaultSkills.d.ts +26 -0
  17. package/dist/constants/DefaultSkills.d.ts.map +1 -0
  18. package/dist/constants/DefaultSpells.d.ts +41 -0
  19. package/dist/constants/DefaultSpells.d.ts.map +1 -0
  20. package/dist/constants/EncounterBalance.d.ts +208 -0
  21. package/dist/constants/EncounterBalance.d.ts.map +1 -0
  22. package/dist/constants/EnemyEquipment.d.ts +71 -0
  23. package/dist/constants/EnemyEquipment.d.ts.map +1 -0
  24. package/dist/constants/EnemyRarity.d.ts +79 -0
  25. package/dist/constants/EnemyRarity.d.ts.map +1 -0
  26. package/dist/constants/EnemyTemplates/Construct.d.ts +63 -0
  27. package/dist/constants/EnemyTemplates/Construct.d.ts.map +1 -0
  28. package/dist/constants/EnemyTemplates/Dragon.d.ts +68 -0
  29. package/dist/constants/EnemyTemplates/Dragon.d.ts.map +1 -0
  30. package/dist/constants/EnemyTemplates/Elemental.d.ts +64 -0
  31. package/dist/constants/EnemyTemplates/Elemental.d.ts.map +1 -0
  32. package/dist/constants/EnemyTemplates/Fiend.d.ts +62 -0
  33. package/dist/constants/EnemyTemplates/Fiend.d.ts.map +1 -0
  34. package/dist/constants/EnemyTemplates/Monstrosity.d.ts +63 -0
  35. package/dist/constants/EnemyTemplates/Monstrosity.d.ts.map +1 -0
  36. package/dist/constants/EnemyTemplates/Undead.d.ts +61 -0
  37. package/dist/constants/EnemyTemplates/Undead.d.ts.map +1 -0
  38. package/dist/constants/ItemTemplates.d.ts +40 -0
  39. package/dist/constants/ItemTemplates.d.ts.map +1 -0
  40. package/dist/constants/MagicItems.d.ts +30 -0
  41. package/dist/constants/MagicItems.d.ts.map +1 -0
  42. package/dist/constants/SpellSlots.d.ts +30 -0
  43. package/dist/constants/SpellSlots.d.ts.map +1 -0
  44. package/dist/constants/StatScaling.d.ts +113 -0
  45. package/dist/constants/StatScaling.d.ts.map +1 -0
  46. package/dist/core/analysis/AudioAnalyzer.d.ts +599 -0
  47. package/dist/core/analysis/AudioAnalyzer.d.ts.map +1 -0
  48. package/dist/core/analysis/ColorExtractor.d.ts +64 -0
  49. package/dist/core/analysis/ColorExtractor.d.ts.map +1 -0
  50. package/dist/core/analysis/EssentiaPitchDetector.d.ts +282 -0
  51. package/dist/core/analysis/EssentiaPitchDetector.d.ts.map +1 -0
  52. package/dist/core/analysis/LevelSerializer.d.ts +265 -0
  53. package/dist/core/analysis/LevelSerializer.d.ts.map +1 -0
  54. package/dist/core/analysis/MelodyContourAnalyzer.d.ts +283 -0
  55. package/dist/core/analysis/MelodyContourAnalyzer.d.ts.map +1 -0
  56. package/dist/core/analysis/MultiBandAnalyzer.d.ts +214 -0
  57. package/dist/core/analysis/MultiBandAnalyzer.d.ts.map +1 -0
  58. package/dist/core/analysis/MusicClassifier.d.ts +524 -0
  59. package/dist/core/analysis/MusicClassifier.d.ts.map +1 -0
  60. package/dist/core/analysis/PitchAnalyzer.d.ts +266 -0
  61. package/dist/core/analysis/PitchAnalyzer.d.ts.map +1 -0
  62. package/dist/core/analysis/PitchDetector.d.ts +251 -0
  63. package/dist/core/analysis/PitchDetector.d.ts.map +1 -0
  64. package/dist/core/analysis/SpectrumScanner.d.ts +52 -0
  65. package/dist/core/analysis/SpectrumScanner.d.ts.map +1 -0
  66. package/dist/core/analysis/beat/BeatInterpolator.d.ts +477 -0
  67. package/dist/core/analysis/beat/BeatInterpolator.d.ts.map +1 -0
  68. package/dist/core/analysis/beat/BeatMapGenerator.d.ts +170 -0
  69. package/dist/core/analysis/beat/BeatMapGenerator.d.ts.map +1 -0
  70. package/dist/core/analysis/beat/BeatStream.d.ts +316 -0
  71. package/dist/core/analysis/beat/BeatStream.d.ts.map +1 -0
  72. package/dist/core/analysis/beat/BeatSubdivider.d.ts +205 -0
  73. package/dist/core/analysis/beat/BeatSubdivider.d.ts.map +1 -0
  74. package/dist/core/analysis/beat/BeatTracker.d.ts +137 -0
  75. package/dist/core/analysis/beat/BeatTracker.d.ts.map +1 -0
  76. package/dist/core/analysis/beat/CompositeStreamGenerator.d.ts +180 -0
  77. package/dist/core/analysis/beat/CompositeStreamGenerator.d.ts.map +1 -0
  78. package/dist/core/analysis/beat/DensityAnalyzer.d.ts +246 -0
  79. package/dist/core/analysis/beat/DensityAnalyzer.d.ts.map +1 -0
  80. package/dist/core/analysis/beat/DifficultyVariantGenerator.d.ts +1082 -0
  81. package/dist/core/analysis/beat/DifficultyVariantGenerator.d.ts.map +1 -0
  82. package/dist/core/analysis/beat/GrooveAnalyzer.d.ts +192 -0
  83. package/dist/core/analysis/beat/GrooveAnalyzer.d.ts.map +1 -0
  84. package/dist/core/analysis/beat/OnsetStrengthEnvelope.d.ts +133 -0
  85. package/dist/core/analysis/beat/OnsetStrengthEnvelope.d.ts.map +1 -0
  86. package/dist/core/analysis/beat/PhraseAnalyzer.d.ts +230 -0
  87. package/dist/core/analysis/beat/PhraseAnalyzer.d.ts.map +1 -0
  88. package/dist/core/analysis/beat/RhythmQuantizer.d.ts +399 -0
  89. package/dist/core/analysis/beat/RhythmQuantizer.d.ts.map +1 -0
  90. package/dist/core/analysis/beat/RhythmicBalancer.d.ts +262 -0
  91. package/dist/core/analysis/beat/RhythmicBalancer.d.ts.map +1 -0
  92. package/dist/core/analysis/beat/StreamScorer.d.ts +275 -0
  93. package/dist/core/analysis/beat/StreamScorer.d.ts.map +1 -0
  94. package/dist/core/analysis/beat/TempoAwareQuantizer.d.ts +256 -0
  95. package/dist/core/analysis/beat/TempoAwareQuantizer.d.ts.map +1 -0
  96. package/dist/core/analysis/beat/TempoDetector.d.ts +220 -0
  97. package/dist/core/analysis/beat/TempoDetector.d.ts.map +1 -0
  98. package/dist/core/analysis/beat/TransientDetector.d.ts +303 -0
  99. package/dist/core/analysis/beat/TransientDetector.d.ts.map +1 -0
  100. package/dist/core/analysis/beat/beatKeyHelpers.d.ts +180 -0
  101. package/dist/core/analysis/beat/beatKeyHelpers.d.ts.map +1 -0
  102. package/dist/core/analysis/beat/index.d.ts +41 -0
  103. package/dist/core/analysis/beat/index.d.ts.map +1 -0
  104. package/dist/core/analysis/beat/utils/audioUtils.d.ts +204 -0
  105. package/dist/core/analysis/beat/utils/audioUtils.d.ts.map +1 -0
  106. package/dist/core/analysis/beat/utils/beatInterpolationDebug.d.ts +404 -0
  107. package/dist/core/analysis/beat/utils/beatInterpolationDebug.d.ts.map +1 -0
  108. package/dist/core/analysis/beat/utils/subdivideBeatMap.d.ts +61 -0
  109. package/dist/core/analysis/beat/utils/subdivideBeatMap.d.ts.map +1 -0
  110. package/dist/core/analysis/beat/utils/unifyBeatMap.d.ts +33 -0
  111. package/dist/core/analysis/beat/utils/unifyBeatMap.d.ts.map +1 -0
  112. package/dist/core/analysis/index.d.ts +18 -0
  113. package/dist/core/analysis/index.d.ts.map +1 -0
  114. package/dist/core/combat/AI/AICombatRunner.d.ts +108 -0
  115. package/dist/core/combat/AI/AICombatRunner.d.ts.map +1 -0
  116. package/dist/core/combat/AI/CombatAI.d.ts +179 -0
  117. package/dist/core/combat/AI/CombatAI.d.ts.map +1 -0
  118. package/dist/core/combat/AI/CombatMetricsTracker.d.ts +30 -0
  119. package/dist/core/combat/AI/CombatMetricsTracker.d.ts.map +1 -0
  120. package/dist/core/combat/Analysis/BalanceValidator.d.ts +170 -0
  121. package/dist/core/combat/Analysis/BalanceValidator.d.ts.map +1 -0
  122. package/dist/core/combat/Analysis/ComparativeAnalyzer.d.ts +231 -0
  123. package/dist/core/combat/Analysis/ComparativeAnalyzer.d.ts.map +1 -0
  124. package/dist/core/combat/Analysis/DifficultyCalculator.d.ts +203 -0
  125. package/dist/core/combat/Analysis/DifficultyCalculator.d.ts.map +1 -0
  126. package/dist/core/combat/Analysis/ParameterSweep.d.ts +201 -0
  127. package/dist/core/combat/Analysis/ParameterSweep.d.ts.map +1 -0
  128. package/dist/core/combat/AttackResolver.d.ts +220 -0
  129. package/dist/core/combat/AttackResolver.d.ts.map +1 -0
  130. package/dist/core/combat/CombatEngine.d.ts +388 -0
  131. package/dist/core/combat/CombatEngine.d.ts.map +1 -0
  132. package/dist/core/combat/DiceRoller.d.ts +115 -0
  133. package/dist/core/combat/DiceRoller.d.ts.map +1 -0
  134. package/dist/core/combat/InitiativeRoller.d.ts +62 -0
  135. package/dist/core/combat/InitiativeRoller.d.ts.map +1 -0
  136. package/dist/core/combat/PartyAnalyzer.d.ts +215 -0
  137. package/dist/core/combat/PartyAnalyzer.d.ts.map +1 -0
  138. package/dist/core/combat/SeededDiceRoller.d.ts +120 -0
  139. package/dist/core/combat/SeededDiceRoller.d.ts.map +1 -0
  140. package/dist/core/combat/Simulation/CombatSimulator.d.ts +366 -0
  141. package/dist/core/combat/Simulation/CombatSimulator.d.ts.map +1 -0
  142. package/dist/core/combat/SpellCaster.d.ts +113 -0
  143. package/dist/core/combat/SpellCaster.d.ts.map +1 -0
  144. package/dist/core/config/index.d.ts +24 -0
  145. package/dist/core/config/index.d.ts.map +1 -0
  146. package/dist/core/config/progressionConfig.d.ts +73 -0
  147. package/dist/core/config/progressionConfig.d.ts.map +1 -0
  148. package/dist/core/config/sensorConfig.d.ts +134 -0
  149. package/dist/core/config/sensorConfig.d.ts.map +1 -0
  150. package/dist/core/equipment/BoxOpener.d.ts +175 -0
  151. package/dist/core/equipment/BoxOpener.d.ts.map +1 -0
  152. package/dist/core/equipment/EquipmentEffectApplier.d.ts +189 -0
  153. package/dist/core/equipment/EquipmentEffectApplier.d.ts.map +1 -0
  154. package/dist/core/equipment/EquipmentModifier.d.ts +327 -0
  155. package/dist/core/equipment/EquipmentModifier.d.ts.map +1 -0
  156. package/dist/core/equipment/EquipmentSpawnHelper.d.ts +246 -0
  157. package/dist/core/equipment/EquipmentSpawnHelper.d.ts.map +1 -0
  158. package/dist/core/equipment/EquipmentValidator.d.ts +173 -0
  159. package/dist/core/equipment/EquipmentValidator.d.ts.map +1 -0
  160. package/dist/core/extensions/ExtensionManager.d.ts +517 -0
  161. package/dist/core/extensions/ExtensionManager.d.ts.map +1 -0
  162. package/dist/core/extensions/WeightedSelector.d.ts +156 -0
  163. package/dist/core/extensions/WeightedSelector.d.ts.map +1 -0
  164. package/dist/core/extensions/index.d.ts +11 -0
  165. package/dist/core/extensions/index.d.ts.map +1 -0
  166. package/dist/core/extensions/initializeDefaults.d.ts +170 -0
  167. package/dist/core/extensions/initializeDefaults.d.ts.map +1 -0
  168. package/dist/core/features/FeatureEffectApplier.d.ts +102 -0
  169. package/dist/core/features/FeatureEffectApplier.d.ts.map +1 -0
  170. package/dist/core/features/FeatureQuery.d.ts +368 -0
  171. package/dist/core/features/FeatureQuery.d.ts.map +1 -0
  172. package/dist/core/features/FeatureTypes.d.ts +199 -0
  173. package/dist/core/features/FeatureTypes.d.ts.map +1 -0
  174. package/dist/core/features/FeatureValidator.d.ts +149 -0
  175. package/dist/core/features/FeatureValidator.d.ts.map +1 -0
  176. package/dist/core/features/index.d.ts +12 -0
  177. package/dist/core/features/index.d.ts.map +1 -0
  178. package/dist/core/generation/AbilityScoreCalculator.d.ts +83 -0
  179. package/dist/core/generation/AbilityScoreCalculator.d.ts.map +1 -0
  180. package/dist/core/generation/AppearanceGenerator.d.ts +32 -0
  181. package/dist/core/generation/AppearanceGenerator.d.ts.map +1 -0
  182. package/dist/core/generation/BeatConverter.d.ts +127 -0
  183. package/dist/core/generation/BeatConverter.d.ts.map +1 -0
  184. package/dist/core/generation/ButtonMapper.d.ts +346 -0
  185. package/dist/core/generation/ButtonMapper.d.ts.map +1 -0
  186. package/dist/core/generation/ButtonPatternLibrary.d.ts +92 -0
  187. package/dist/core/generation/ButtonPatternLibrary.d.ts.map +1 -0
  188. package/dist/core/generation/CRLevelConverter.d.ts +242 -0
  189. package/dist/core/generation/CRLevelConverter.d.ts.map +1 -0
  190. package/dist/core/generation/CharacterGenerator.d.ts +194 -0
  191. package/dist/core/generation/CharacterGenerator.d.ts.map +1 -0
  192. package/dist/core/generation/ClassSuggester.d.ts +184 -0
  193. package/dist/core/generation/ClassSuggester.d.ts.map +1 -0
  194. package/dist/core/generation/EnemyEquipmentGenerator.d.ts +151 -0
  195. package/dist/core/generation/EnemyEquipmentGenerator.d.ts.map +1 -0
  196. package/dist/core/generation/EnemyGenerator.d.ts +595 -0
  197. package/dist/core/generation/EnemyGenerator.d.ts.map +1 -0
  198. package/dist/core/generation/EquipmentGenerator.d.ts +204 -0
  199. package/dist/core/generation/EquipmentGenerator.d.ts.map +1 -0
  200. package/dist/core/generation/LegendaryGenerator.d.ts +213 -0
  201. package/dist/core/generation/LegendaryGenerator.d.ts.map +1 -0
  202. package/dist/core/generation/LevelGenerator.d.ts +390 -0
  203. package/dist/core/generation/LevelGenerator.d.ts.map +1 -0
  204. package/dist/core/generation/NamingEngine.d.ts +136 -0
  205. package/dist/core/generation/NamingEngine.d.ts.map +1 -0
  206. package/dist/core/generation/PitchBeatLinker.d.ts +150 -0
  207. package/dist/core/generation/PitchBeatLinker.d.ts.map +1 -0
  208. package/dist/core/generation/RaceSelector.d.ts +58 -0
  209. package/dist/core/generation/RaceSelector.d.ts.map +1 -0
  210. package/dist/core/generation/RhythmGenerator.d.ts +597 -0
  211. package/dist/core/generation/RhythmGenerator.d.ts.map +1 -0
  212. package/dist/core/generation/SkillAssigner.d.ts +78 -0
  213. package/dist/core/generation/SkillAssigner.d.ts.map +1 -0
  214. package/dist/core/generation/SpellManager.d.ts +132 -0
  215. package/dist/core/generation/SpellManager.d.ts.map +1 -0
  216. package/dist/core/generation/SpellcastingGenerator.d.ts +255 -0
  217. package/dist/core/generation/SpellcastingGenerator.d.ts.map +1 -0
  218. package/dist/core/generation/index.d.ts +41 -0
  219. package/dist/core/generation/index.d.ts.map +1 -0
  220. package/dist/core/parser/MetadataExtractor.d.ts +66 -0
  221. package/dist/core/parser/MetadataExtractor.d.ts.map +1 -0
  222. package/dist/core/parser/PlaylistParser.d.ts +45 -0
  223. package/dist/core/parser/PlaylistParser.d.ts.map +1 -0
  224. package/dist/core/playback/SubdivisionPlaybackController.d.ts +333 -0
  225. package/dist/core/playback/SubdivisionPlaybackController.d.ts.map +1 -0
  226. package/dist/core/playback/index.d.ts +5 -0
  227. package/dist/core/playback/index.d.ts.map +1 -0
  228. package/dist/core/progression/CharacterUpdater.d.ts +203 -0
  229. package/dist/core/progression/CharacterUpdater.d.ts.map +1 -0
  230. package/dist/core/progression/LevelUpProcessor.d.ts +234 -0
  231. package/dist/core/progression/LevelUpProcessor.d.ts.map +1 -0
  232. package/dist/core/progression/PrestigeSystem.d.ts +217 -0
  233. package/dist/core/progression/PrestigeSystem.d.ts.map +1 -0
  234. package/dist/core/progression/RhythmXPCalculator.d.ts +182 -0
  235. package/dist/core/progression/RhythmXPCalculator.d.ts.map +1 -0
  236. package/dist/core/progression/SessionTracker.d.ts +169 -0
  237. package/dist/core/progression/SessionTracker.d.ts.map +1 -0
  238. package/dist/core/progression/XPCalculator.d.ts +128 -0
  239. package/dist/core/progression/XPCalculator.d.ts.map +1 -0
  240. package/dist/core/progression/stat/StatIncreaseStrategy.d.ts +97 -0
  241. package/dist/core/progression/stat/StatIncreaseStrategy.d.ts.map +1 -0
  242. package/dist/core/progression/stat/StatManager.d.ts +179 -0
  243. package/dist/core/progression/stat/StatManager.d.ts.map +1 -0
  244. package/dist/core/sensors/EnvironmentalSensors.d.ts +301 -0
  245. package/dist/core/sensors/EnvironmentalSensors.d.ts.map +1 -0
  246. package/dist/core/sensors/GamingPlatformSensors.d.ts +162 -0
  247. package/dist/core/sensors/GamingPlatformSensors.d.ts.map +1 -0
  248. package/dist/core/sensors/GeolocationProvider.d.ts +156 -0
  249. package/dist/core/sensors/GeolocationProvider.d.ts.map +1 -0
  250. package/dist/core/sensors/MotionDetector.d.ts +58 -0
  251. package/dist/core/sensors/MotionDetector.d.ts.map +1 -0
  252. package/dist/core/sensors/SteamAPIClient.d.ts +108 -0
  253. package/dist/core/sensors/SteamAPIClient.d.ts.map +1 -0
  254. package/dist/core/sensors/WeatherAPIClient.d.ts +360 -0
  255. package/dist/core/sensors/WeatherAPIClient.d.ts.map +1 -0
  256. package/dist/core/sensors/schemas/weather.schema.d.ts +144 -0
  257. package/dist/core/sensors/schemas/weather.schema.d.ts.map +1 -0
  258. package/dist/core/skills/SkillQuery.d.ts +159 -0
  259. package/dist/core/skills/SkillQuery.d.ts.map +1 -0
  260. package/dist/core/skills/SkillTypes.d.ts +233 -0
  261. package/dist/core/skills/SkillTypes.d.ts.map +1 -0
  262. package/dist/core/skills/SkillValidator.d.ts +146 -0
  263. package/dist/core/skills/SkillValidator.d.ts.map +1 -0
  264. package/dist/core/skills/index.d.ts +11 -0
  265. package/dist/core/skills/index.d.ts.map +1 -0
  266. package/dist/core/spells/SpellQuery.d.ts +194 -0
  267. package/dist/core/spells/SpellQuery.d.ts.map +1 -0
  268. package/dist/core/spells/SpellTypes.d.ts +71 -0
  269. package/dist/core/spells/SpellTypes.d.ts.map +1 -0
  270. package/dist/core/spells/SpellValidator.d.ts +129 -0
  271. package/dist/core/spells/SpellValidator.d.ts.map +1 -0
  272. package/dist/core/spells/index.d.ts +11 -0
  273. package/dist/core/spells/index.d.ts.map +1 -0
  274. package/dist/core/types/AudioProfile.d.ts +143 -0
  275. package/dist/core/types/AudioProfile.d.ts.map +1 -0
  276. package/dist/core/types/BeatMap.d.ts +1825 -0
  277. package/dist/core/types/BeatMap.d.ts.map +1 -0
  278. package/dist/core/types/ButtonMapping.d.ts +345 -0
  279. package/dist/core/types/ButtonMapping.d.ts.map +1 -0
  280. package/dist/core/types/Character.d.ts +397 -0
  281. package/dist/core/types/Character.d.ts.map +1 -0
  282. package/dist/core/types/ChartedBeatMap.d.ts +169 -0
  283. package/dist/core/types/ChartedBeatMap.d.ts.map +1 -0
  284. package/dist/core/types/Combat.d.ts +268 -0
  285. package/dist/core/types/Combat.d.ts.map +1 -0
  286. package/dist/core/types/CombatAI.d.ts +143 -0
  287. package/dist/core/types/CombatAI.d.ts.map +1 -0
  288. package/dist/core/types/Enemy.d.ts +447 -0
  289. package/dist/core/types/Enemy.d.ts.map +1 -0
  290. package/dist/core/types/Environmental.d.ts +213 -0
  291. package/dist/core/types/Environmental.d.ts.map +1 -0
  292. package/dist/core/types/Equipment.d.ts +309 -0
  293. package/dist/core/types/Equipment.d.ts.map +1 -0
  294. package/dist/core/types/ISessionTracker.d.ts +48 -0
  295. package/dist/core/types/ISessionTracker.d.ts.map +1 -0
  296. package/dist/core/types/LevelExport.d.ts +366 -0
  297. package/dist/core/types/LevelExport.d.ts.map +1 -0
  298. package/dist/core/types/Playlist.d.ts +70 -0
  299. package/dist/core/types/Playlist.d.ts.map +1 -0
  300. package/dist/core/types/Prestige.d.ts +94 -0
  301. package/dist/core/types/Prestige.d.ts.map +1 -0
  302. package/dist/core/types/Progression.d.ts +214 -0
  303. package/dist/core/types/Progression.d.ts.map +1 -0
  304. package/dist/core/types/RhythmXP.d.ts +398 -0
  305. package/dist/core/types/RhythmXP.d.ts.map +1 -0
  306. package/dist/core/utils/AbilityConstants.d.ts +31 -0
  307. package/dist/core/utils/AbilityConstants.d.ts.map +1 -0
  308. package/dist/core/utils/EffectApplierUtils.d.ts +56 -0
  309. package/dist/core/utils/EffectApplierUtils.d.ts.map +1 -0
  310. package/dist/core/utils/ImageValidator.d.ts +66 -0
  311. package/dist/core/utils/ImageValidator.d.ts.map +1 -0
  312. package/dist/core/utils/PrerequisiteValidator.d.ts +88 -0
  313. package/dist/core/utils/PrerequisiteValidator.d.ts.map +1 -0
  314. package/dist/essentia-wasm.es-BUEnKUts.js +2990 -0
  315. package/dist/essentia.js-model.es-CGA0xotH.js +306 -0
  316. package/dist/index.d.ts +176 -0
  317. package/dist/index.d.ts.map +1 -0
  318. package/dist/playlist-data-engine.js +124 -0
  319. package/dist/playlist-data-engine.mjs +49251 -0
  320. package/dist/utils/EnchantmentLibrary.d.ts +378 -0
  321. package/dist/utils/EnchantmentLibrary.d.ts.map +1 -0
  322. package/dist/utils/arweaveGatewayManager.d.ts +485 -0
  323. package/dist/utils/arweaveGatewayManager.d.ts.map +1 -0
  324. package/dist/utils/arweaveUtils.d.ts +118 -0
  325. package/dist/utils/arweaveUtils.d.ts.map +1 -0
  326. package/dist/utils/constants.d.ts +439 -0
  327. package/dist/utils/constants.d.ts.map +1 -0
  328. package/dist/utils/equipmentConstants.d.ts +60 -0
  329. package/dist/utils/equipmentConstants.d.ts.map +1 -0
  330. package/dist/utils/hash.d.ts +33 -0
  331. package/dist/utils/hash.d.ts.map +1 -0
  332. package/dist/utils/logger.d.ts +192 -0
  333. package/dist/utils/logger.d.ts.map +1 -0
  334. package/dist/utils/magicItemExamples.d.ts +46 -0
  335. package/dist/utils/magicItemExamples.d.ts.map +1 -0
  336. package/dist/utils/playlistUtils.d.ts +149 -0
  337. package/dist/utils/playlistUtils.d.ts.map +1 -0
  338. package/dist/utils/random.d.ts +34 -0
  339. package/dist/utils/random.d.ts.map +1 -0
  340. package/dist/utils/sensorDashboard.d.ts +60 -0
  341. package/dist/utils/sensorDashboard.d.ts.map +1 -0
  342. package/dist/utils/validators.d.ts +189 -0
  343. package/dist/utils/validators.d.ts.map +1 -0
  344. package/dist/vite.svg +1 -0
  345. package/package.json +82 -0
@@ -0,0 +1,234 @@
1
+ /**
2
+ * LevelUpProcessor - Handles character leveling mechanics
3
+ * Based on specs/001-core-engine/SPEC.md and D&D 5e rules
4
+ *
5
+ * Uses FeatureQuery for class feature lookup.
6
+ * - Replaces hardcoded getClassFeaturesForLevel() with FeatureQuery lookup
7
+ * - Validates prerequisite chains on level up
8
+ * - Applies new feature effects when leveling up
9
+ * - Handles conditional features (player choice)
10
+ * - Returns feature IDs instead of display strings
11
+ */
12
+ import type { CharacterSheet, Ability } from '../types/Character.js';
13
+ import type { StatManager } from './stat/StatManager.js';
14
+ /**
15
+ * Level-up benefits returned after processing a level-up
16
+ */
17
+ export interface LevelUpBenefits {
18
+ newLevel: number;
19
+ hitPointIncrease: number;
20
+ newHitPointsTotal: number;
21
+ proficiencyBonusIncrease: number;
22
+ newProficiencyBonus: number;
23
+ /** New: Support multiple stat increases */
24
+ abilityScoreIncreases?: Array<{
25
+ ability: Ability;
26
+ increase: number;
27
+ }>;
28
+ /** Deprecated: Kept for backward compatibility */
29
+ abilityScoreIncrease?: {
30
+ ability: Ability;
31
+ increase: number;
32
+ };
33
+ newSpellSlots?: Record<number, {
34
+ total: number;
35
+ used: number;
36
+ }>;
37
+ /**
38
+ * Class features gained at this level
39
+ * Returns feature IDs instead of display strings
40
+ * OLD: ['Barbarian Level 2', 'Reckless Attack']
41
+ * NEW: ['reckless_attack', 'danger_sense']
42
+ */
43
+ classFeatures?: string[];
44
+ /**
45
+ * Feature effects applied during level-up
46
+ * Stores effects that were applied to the character
47
+ */
48
+ featureEffects?: Array<{
49
+ featureId: string;
50
+ featureName: string;
51
+ effectsApplied: number;
52
+ }>;
53
+ }
54
+ /**
55
+ * Configuration for uncapped mode progression
56
+ * Provide formulas that work for ALL levels (1-infinity), not just beyond 20
57
+ */
58
+ export interface UncappedProgressionConfig {
59
+ /** Custom formula for calculating XP threshold for ANY level */
60
+ xpFormula?: (level: number) => number;
61
+ /** Custom formula for calculating proficiency bonus for ANY level */
62
+ proficiencyBonusFormula?: (level: number) => number;
63
+ }
64
+ /**
65
+ * LevelUpProcessor class - Processes character level-ups
66
+ * Handles HP increases, ability score improvements, spell slots, and features
67
+ */
68
+ export declare class LevelUpProcessor {
69
+ /** Optional StatManager for advanced stat increase handling */
70
+ private static statManager?;
71
+ /** Optional configuration for uncapped mode progression */
72
+ private static uncappedConfig?;
73
+ /**
74
+ * Set configuration for uncapped mode progression
75
+ * @param config - Configuration with optional custom formulas
76
+ */
77
+ static setUncappedConfig(config: UncappedProgressionConfig): void;
78
+ /**
79
+ * Get the current uncapped configuration
80
+ */
81
+ static getUncappedConfig(): UncappedProgressionConfig | undefined;
82
+ /**
83
+ * Set the StatManager instance for stat increase handling
84
+ * Call this before processing level-ups to enable smart stat selection
85
+ *
86
+ * @param statManager - The StatManager instance to use
87
+ */
88
+ static setStatManager(statManager: StatManager): void;
89
+ /**
90
+ * Get the current StatManager instance
91
+ */
92
+ static getStatManager(): StatManager | undefined;
93
+ /**
94
+ * Process a character level-up
95
+ * @param character - The character to level up
96
+ * @param newLevel - The new level (should be previous level + 1 for normal progression)
97
+ * @param seed - Optional seed for deterministic HP rolls
98
+ * @returns Benefits granted by leveling up
99
+ */
100
+ static processLevelUp(character: CharacterSheet, newLevel: number, seed?: string): LevelUpBenefits;
101
+ /**
102
+ * Get class features gained at a specific level for a character
103
+ * Uses FeatureQuery to look up features and validates prerequisites
104
+ *
105
+ * @param character - The character to check features for
106
+ * @param characterClass - The character class
107
+ * @param level - The level to get features for
108
+ * @returns Array of ClassFeature objects gained at this level
109
+ */
110
+ private static getClassFeaturesForLevel;
111
+ /**
112
+ * Apply a level-up to a character
113
+ * @param character - The character to level up
114
+ * @param benefits - Benefits from processLevelUp
115
+ * @returns Updated character
116
+ */
117
+ static applyLevelUp(character: CharacterSheet, benefits: LevelUpBenefits): CharacterSheet;
118
+ /**
119
+ * Calculate HP increase for a level
120
+ * @param hitDie - The hit die size (d6, d8, d10, d12)
121
+ * @param conModifier - Constitution modifier
122
+ * @param seed - Optional seed for deterministic rolling
123
+ * @returns HP increase
124
+ */
125
+ private static calculateHPIncrease;
126
+ /**
127
+ * Check if a class is a spellcaster
128
+ * @param characterClass - The character class
129
+ * @returns True if the class can cast spells
130
+ */
131
+ private static isSpellcaster;
132
+ /**
133
+ * Calculate spell slots for a level
134
+ * Based on D&D 5e spell slot progression
135
+ * @param characterClass - The character class
136
+ * @param level - The character level
137
+ * @returns Record of spell slots by level
138
+ */
139
+ private static calculateSpellSlots;
140
+ /**
141
+ * Get spell slot count for a specific slot level
142
+ * Simplified version - would be expanded in full implementation
143
+ * @param characterLevel - The character level
144
+ * @param slotLevel - The spell slot level (1-9)
145
+ * @returns Number of slots available
146
+ */
147
+ private static getSpellSlotCount;
148
+ /**
149
+ * Get the XP threshold for a specific level
150
+ * - Standard mode: Uses D&D 5e tables (levels 1-20 only)
151
+ * - Uncapped mode with custom formula: Uses your formula for ALL levels
152
+ * - Uncapped mode without custom formula: Continues D&D 5e pattern naturally
153
+ * @param level - The level
154
+ * @param isUncapped - Whether this is for uncapped mode
155
+ * @returns XP required to reach that level
156
+ */
157
+ static getXPThreshold(level: number, isUncapped?: boolean): number;
158
+ /**
159
+ * Get the proficiency bonus for a specific level
160
+ * - Standard mode: Uses D&D 5e tables (levels 1-20 only)
161
+ * - Uncapped mode with custom formula: Uses your formula for ALL levels
162
+ * - Uncapped mode without custom formula: Continues D&D 5e pattern (+1 every 4 levels)
163
+ * @param level - The level
164
+ * @param isUncapped - Whether this is for uncapped mode
165
+ * @returns Proficiency bonus for that level
166
+ */
167
+ static getProficiencyBonus(level: number, isUncapped?: boolean): number;
168
+ /**
169
+ * Calculate level from total XP
170
+ * @param totalXP - Total experience points
171
+ * @param isUncapped - Whether this is for uncapped mode (allows infinite levels)
172
+ * @returns Character level
173
+ */
174
+ static calculateLevel(totalXP: number, isUncapped?: boolean): number;
175
+ /**
176
+ * Get XP needed to reach next level
177
+ * @param currentLevel - Current character level
178
+ * @param isUncapped - Whether this is for uncapped mode
179
+ * @returns XP needed to advance to next level, or 0 if at max (or if uncapped, always returns next threshold)
180
+ */
181
+ static getXPToNextLevel(currentLevel: number, isUncapped?: boolean): number;
182
+ /**
183
+ * Get progress to next level as a percentage
184
+ * @param currentLevel - Current level
185
+ * @param currentXP - Total XP within level thresholds
186
+ * @param isUncapped - Whether this is for uncapped mode
187
+ * @returns Percentage (0-100) towards next level
188
+ */
189
+ static getProgressPercentage(currentLevel: number, currentXP: number, isUncapped?: boolean): number;
190
+ /**
191
+ * Process level-up without stat increases
192
+ * Used for pending level-up system where stats are applied later
193
+ *
194
+ * @param character - The character to level up
195
+ * @param newLevel - The new level
196
+ * @param seed - Optional seed for deterministic HP rolls
197
+ * @returns Benefits without stat increases
198
+ */
199
+ static processLevelUpWithoutStats(character: CharacterSheet, newLevel: number, seed?: string): Omit<LevelUpBenefits, 'abilityScoreIncreases' | 'abilityScoreIncrease'>;
200
+ /**
201
+ * Apply automatic level-up benefits (HP, proficiency, features, spell slots)
202
+ * Does NOT apply stat increases
203
+ *
204
+ * @param character - The character to update
205
+ * @param benefits - Benefits without stat increases
206
+ * @returns Updated character
207
+ */
208
+ static applyAutomaticBenefitsOnly(character: CharacterSheet, benefits: Omit<LevelUpBenefits, 'abilityScoreIncreases' | 'abilityScoreIncrease'>): CharacterSheet;
209
+ /**
210
+ * Apply ONLY stat increases to a character
211
+ * Used when completing a pending level-up
212
+ *
213
+ * @param character - The character to update
214
+ * @param statIncreases - Array of stat increases to apply
215
+ * @returns Updated character
216
+ */
217
+ static applyStatIncreasesOnly(character: CharacterSheet, statIncreases: Array<{
218
+ ability: Ability;
219
+ amount: number;
220
+ }>): CharacterSheet;
221
+ /**
222
+ * Re-apply all equipment effects after a level-up
223
+ * Ensures equipment effects persist when character stats change
224
+ *
225
+ * This method uses EquipmentEffectApplier's reapplyEquipmentEffects which:
226
+ * - Clears the equipment_effects array
227
+ * - Re-applies all properties, features, skills, and spells
228
+ * - Rebuilds the equipment_effects tracking array
229
+ *
230
+ * @param character - The character to reapply equipment effects to
231
+ */
232
+ private static reapplyEquipmentEffects;
233
+ }
234
+ //# sourceMappingURL=LevelUpProcessor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LevelUpProcessor.d.ts","sourceRoot":"","sources":["../../../src/core/progression/LevelUpProcessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAA2B,OAAO,EAAY,MAAM,uBAAuB,CAAC;AAIxG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMzD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wBAAwB,EAAE,MAAM,CAAC;IACjC,mBAAmB,EAAE,MAAM,CAAC;IAE5B,2CAA2C;IAC3C,qBAAqB,CAAC,EAAE,KAAK,CAAC;QAC1B,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IAEH,kDAAkD;IAClD,oBAAoB,CAAC,EAAE;QACnB,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEhE;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB;;;OAGG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,EAAE,MAAM,CAAC;KAC1B,CAAC,CAAC;CACN;AAQD;;;GAGG;AACH,MAAM,WAAW,yBAAyB;I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AG,MAAM;IAoCzE;;;;;;;;OAQG;IACH,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,GAAE,OAAe,GAAG,MAAM;IAwB9E;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,GAAE,OAAe,GAAG,MAAM;IAmB3E;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,GAAE,OAAe,GAAG,MAAM;IAWlF;;;;;;OAMG;IACH,MAAM,CAAC,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAE,OAAe,GAAG,MAAM;IAc1G;;;;;;;;OAQG;IACH,MAAM,CAAC,0BAA0B,CAC7B,SAAS,EAAE,cAAc,EACzB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,MAAM,GACd,IAAI,CAAC,eAAe,EAAE,uBAAuB,GAAG,sBAAsB,CAAC;IA2E1E;;;;;;;OAOG;IACH,MAAM,CAAC,0BAA0B,CAC7B,SAAS,EAAE,cAAc,EACzB,QAAQ,EAAE,IAAI,CAAC,eAAe,EAAE,uBAAuB,GAAG,sBAAsB,CAAC,GAClF,cAAc;IA4BjB;;;;;;;OAOG;IACH,MAAM,CAAC,sBAAsB,CACzB,SAAS,EAAE,cAAc,EACzB,aAAa,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,GAC3D,cAAc;IAyBjB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;CAOzC"}
@@ -0,0 +1,217 @@
1
+ /**
2
+ * Prestige System - Core prestige logic for track mastery
3
+ *
4
+ * Handles the prestige mechanic where players reset their character after mastering
5
+ * a track in exchange for visual badge upgrades.
6
+ *
7
+ * Features:
8
+ * - 10 prestige levels (Roman numerals I-X)
9
+ * - 1.5x scaling for plays: Prestige 0=10, I=15, II=23, III=34, IV=51, V=77, VI=115, VII=173, VIII=259, IX=389, X=584
10
+ * - 1.5x scaling for XP: Prestige 0=1,000, I=1,500, II=2,250, III=3,375, IV=5,063, V=7,594, VI=11,391, VII=17,086, VIII=25,629, IX=38,444, X=57,666
11
+ * - Dual requirement (plays AND XP) prevents "cheesing" the system
12
+ * - Custom threshold override support for manual control
13
+ */
14
+ import { type PrestigeLevel, type PrestigeInfo, type PrestigeResult, type CustomThresholds } from '../types/Prestige.js';
15
+ /**
16
+ * PrestigeSystem handles all prestige-related calculations and logic.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * // Check if a track is mastered
21
+ * const isMastered = PrestigeSystem.isMastered(15, 2000, 1);
22
+ *
23
+ * // Get full prestige info for UI
24
+ * const info = PrestigeSystem.getPrestigeInfo(1, 15, 2000);
25
+ *
26
+ * // Set custom thresholds
27
+ * PrestigeSystem.setCustomThresholds(5, { playsThreshold: 100, xpThreshold: 10000 });
28
+ * ```
29
+ */
30
+ export declare class PrestigeSystem {
31
+ /**
32
+ * Custom thresholds that override calculated defaults
33
+ * Map<prestigeLevel, CustomThresholds>
34
+ */
35
+ private static customThresholds;
36
+ /**
37
+ * Get the plays threshold for a given prestige level.
38
+ * Returns custom threshold if set, otherwise calculates using 1.5x scaling.
39
+ *
40
+ * Calculated values:
41
+ * - Prestige 0: 10 plays
42
+ * - Prestige I: 15 plays
43
+ * - Prestige II: 23 plays
44
+ * - Prestige III: 34 plays
45
+ * - Prestige IV: 51 plays
46
+ * - Prestige V: 77 plays
47
+ * - Prestige VI: 115 plays
48
+ * - Prestige VII: 173 plays
49
+ * - Prestige VIII: 259 plays
50
+ * - Prestige IX: 389 plays
51
+ * - Prestige X: 584 plays
52
+ *
53
+ * @param prestigeLevel - The prestige level to get threshold for
54
+ * @returns Number of plays required to master
55
+ */
56
+ static getPlaysThreshold(prestigeLevel: PrestigeLevel): number;
57
+ /**
58
+ * Get the XP threshold for a given prestige level.
59
+ * Returns custom threshold if set, otherwise calculates using 1.5x scaling.
60
+ *
61
+ * Calculated values:
62
+ * - Prestige 0: 1,000 XP
63
+ * - Prestige I: 1,500 XP
64
+ * - Prestige II: 2,250 XP
65
+ * - Prestige III: 3,375 XP
66
+ * - Prestige IV: 5,063 XP
67
+ * - Prestige V: 7,594 XP
68
+ * - Prestige VI: 11,391 XP
69
+ * - Prestige VII: 17,086 XP
70
+ * - Prestige VIII: 25,629 XP
71
+ * - Prestige IX: 38,444 XP
72
+ * - Prestige X: 57,666 XP
73
+ *
74
+ * @param prestigeLevel - The prestige level to get threshold for
75
+ * @returns XP required to master
76
+ */
77
+ static getXPThreshold(prestigeLevel: PrestigeLevel): number;
78
+ /**
79
+ * Set custom thresholds for a specific prestige level.
80
+ * Pass null to use calculated value, omit to keep existing setting.
81
+ *
82
+ * @param prestigeLevel - The prestige level to customize
83
+ * @param thresholds - Custom threshold values (null = use calculated, omit = keep existing)
84
+ *
85
+ * @example
86
+ * ```typescript
87
+ * // Set both custom thresholds
88
+ * PrestigeSystem.setCustomThresholds(5, { playsThreshold: 100, xpThreshold: 10000 });
89
+ *
90
+ * // Set only plays threshold, keep XP calculated
91
+ * PrestigeSystem.setCustomThresholds(3, { playsThreshold: 50 });
92
+ *
93
+ * // Reset plays to calculated value
94
+ * PrestigeSystem.setCustomThresholds(3, { playsThreshold: null });
95
+ * ```
96
+ */
97
+ static setCustomThresholds(prestigeLevel: PrestigeLevel, thresholds: CustomThresholds): void;
98
+ /**
99
+ * Clear custom thresholds for a specific prestige level or all levels.
100
+ * After clearing, calculated defaults will be used.
101
+ *
102
+ * @param prestigeLevel - Optional prestige level to clear. If omitted, clears all.
103
+ *
104
+ * @example
105
+ * ```typescript
106
+ * // Clear custom thresholds for prestige level 5
107
+ * PrestigeSystem.clearCustomThresholds(5);
108
+ *
109
+ * // Clear all custom thresholds
110
+ * PrestigeSystem.clearCustomThresholds();
111
+ * ```
112
+ */
113
+ static clearCustomThresholds(prestigeLevel?: PrestigeLevel): void;
114
+ /**
115
+ * Check if custom thresholds are set for a prestige level.
116
+ *
117
+ * @param prestigeLevel - The prestige level to check
118
+ * @returns Whether custom thresholds exist for this level
119
+ */
120
+ static hasCustomThresholds(prestigeLevel: PrestigeLevel): boolean;
121
+ /**
122
+ * Get the current custom thresholds for a prestige level.
123
+ *
124
+ * @param prestigeLevel - The prestige level to get thresholds for
125
+ * @returns Custom thresholds or undefined if none set
126
+ */
127
+ static getCustomThresholds(prestigeLevel: PrestigeLevel): CustomThresholds | undefined;
128
+ /**
129
+ * Check if a track is mastered based on plays AND XP.
130
+ * Both thresholds must be met to be considered mastered.
131
+ *
132
+ * @param listenCount - Number of times the track has been listened to
133
+ * @param totalXP - Total XP earned from this track
134
+ * @param prestigeLevel - Current prestige level
135
+ * @returns True if BOTH thresholds are met
136
+ */
137
+ static isMastered(listenCount: number, totalXP: number, prestigeLevel: PrestigeLevel): boolean;
138
+ /**
139
+ * Check if a character can prestige (mastered AND not at max level).
140
+ *
141
+ * @param prestigeLevel - Current prestige level
142
+ * @param listenCount - Number of times the track has been listened to
143
+ * @param totalXP - Total XP earned from this track
144
+ * @returns True if character can prestige
145
+ */
146
+ static canPrestige(prestigeLevel: PrestigeLevel, listenCount: number, totalXP: number): boolean;
147
+ /**
148
+ * Determine if a track just reached mastery status in this session.
149
+ * Checks if the track went from not mastered to mastered between the two states.
150
+ *
151
+ * @param previousListenCount - Listen count before the current session
152
+ * @param currentListenCount - Listen count including the current session
153
+ * @param previousXP - Total XP before the current session
154
+ * @param currentXP - Total XP including the current session
155
+ * @param prestigeLevel - Current prestige level
156
+ * @returns True if mastery was achieved exactly in this session
157
+ */
158
+ static isJustMastered(previousListenCount: number, currentListenCount: number, previousXP: number, currentXP: number, prestigeLevel: PrestigeLevel): boolean;
159
+ /**
160
+ * Calculate the bonus XP awarded for achieving mastery.
161
+ *
162
+ * @param isMastered - Whether the track is mastered
163
+ * @returns Bonus XP amount if mastered, 0 otherwise
164
+ */
165
+ static calculateMasteryBonus(isMastered: boolean): number;
166
+ /**
167
+ * Get complete prestige information for UI display.
168
+ *
169
+ * @param prestigeLevel - Current prestige level
170
+ * @param listenCount - Number of times the track has been listened to
171
+ * @param totalXP - Total XP earned from this track
172
+ * @returns Complete PrestigeInfo object
173
+ */
174
+ static getPrestigeInfo(prestigeLevel: PrestigeLevel, listenCount: number, totalXP: number): PrestigeInfo;
175
+ /**
176
+ * Convert a prestige level to its Roman numeral representation.
177
+ *
178
+ * @param level - The prestige level
179
+ * @returns Roman numeral string (empty string for level 0)
180
+ */
181
+ static toRomanNumeral(level: PrestigeLevel): string;
182
+ /**
183
+ * Get the next prestige level after prestiging.
184
+ * Returns null if already at max level.
185
+ *
186
+ * @param currentLevel - Current prestige level
187
+ * @returns Next prestige level or null if at max
188
+ */
189
+ static getNextPrestigeLevel(currentLevel: PrestigeLevel): PrestigeLevel | null;
190
+ /**
191
+ * Create a PrestigeResult for a successful prestige operation.
192
+ *
193
+ * @param previousLevel - The prestige level before prestiging
194
+ * @param newLevel - The prestige level after prestiging
195
+ * @returns PrestigeResult object
196
+ */
197
+ static createSuccessResult(previousLevel: PrestigeLevel, newLevel: PrestigeLevel): PrestigeResult;
198
+ /**
199
+ * Create a PrestigeResult for a failed prestige operation.
200
+ *
201
+ * @param reason - The reason for failure
202
+ * @param currentLevel - The current prestige level
203
+ * @returns PrestigeResult object
204
+ */
205
+ static createFailureResult(reason: string, currentLevel: PrestigeLevel): PrestigeResult;
206
+ /**
207
+ * Get all threshold values for display/debugging purposes.
208
+ *
209
+ * @returns Array of { level, plays, xp } objects
210
+ */
211
+ static getAllThresholds(): Array<{
212
+ level: PrestigeLevel;
213
+ plays: number;
214
+ xp: number;
215
+ }>;
216
+ }
217
+ //# sourceMappingURL=PrestigeSystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrestigeSystem.d.ts","sourceRoot":"","sources":["../../../src/core/progression/PrestigeSystem.ts"],"names":[],"mappings":"AAAA;;;;;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;;;OAOG;WACW,eAAe,CACzB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GAChB,YAAY;IAwBf;;;;;OAKG;WACW,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM;IAI1D;;;;;;OAMG;WACW,oBAAoB,CAAC,YAAY,EAAE,aAAa,GAAG,aAAa,GAAG,IAAI;IAOrF;;;;;;OAMG;WACW,mBAAmB,CAC7B,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,aAAa,GACxB,cAAc;IAYjB;;;;;;OAMG;WACW,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,GAAG,cAAc;IAS9F;;;;OAIG;WACW,gBAAgB,IAAI,KAAK,CAAC;QAAE,KAAK,EAAE,aAAa,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CAY/F"}
@@ -0,0 +1,182 @@
1
+ /**
2
+ * RhythmXPCalculator - Calculates XP for rhythm game button presses
3
+ *
4
+ * This calculator handles two parallel systems:
5
+ * 1. Per-button-press XP (this class) - rewards timing accuracy, combos, groove
6
+ * 2. Listening session XP boost (XPCalculator) - boosts background listening XP
7
+ *
8
+ * The system separates "score points" (for display/leaderboards) from
9
+ * "character XP" (for progression) via the `xpRatio` parameter.
10
+ */
11
+ import type { BeatAccuracy } from '../types/BeatMap.js';
12
+ import type { RhythmXPConfig, RhythmXPResult, ComboEndBonusResult, GrooveEndStats, GrooveEndBonusResult, RhythmSessionTotals } from '../types/RhythmXP.js';
13
+ /**
14
+ * Calculates XP rewards for rhythm game button presses
15
+ *
16
+ * The RhythmXPCalculator can be used in two modes:
17
+ * 1. **Stateless**: Call `calculateButtonPressXP()` directly, frontend tracks combo/session
18
+ * 2. **Stateful**: Use `startSession()`, `recordHit()`, `getSessionTotals()`, `endSession()`
19
+ *
20
+ * @example Stateless usage
21
+ * ```typescript
22
+ * const calculator = new RhythmXPCalculator({ xpRatio: 0.1 });
23
+ * const result = calculator.calculateButtonPressXP(buttonResult, { comboLength: 50 });
24
+ * console.log(`Score: ${result.finalScore}, XP: ${result.finalXP}`);
25
+ * ```
26
+ *
27
+ * @example Stateful session tracking
28
+ * ```typescript
29
+ * const calculator = new RhythmXPCalculator();
30
+ * calculator.startSession();
31
+ *
32
+ * // On each hit
33
+ * const result = calculator.recordHit(buttonResult, { comboLength, grooveHotness });
34
+ *
35
+ * // Get running totals for UI
36
+ * const totals = calculator.getSessionTotals();
37
+ *
38
+ * // End session
39
+ * const finalTotals = calculator.endSession();
40
+ * ```
41
+ */
42
+ export declare class RhythmXPCalculator {
43
+ private config;
44
+ private sessionTotals;
45
+ private sessionStartTime;
46
+ /**
47
+ * Create a new RhythmXPCalculator instance
48
+ *
49
+ * @param config - Optional partial configuration to override defaults
50
+ */
51
+ constructor(config?: Partial<RhythmXPConfig>);
52
+ /**
53
+ * Calculate XP for a single button press
54
+ *
55
+ * This is the main method for calculating XP rewards. It considers:
56
+ * - Base XP from accuracy level (via xpRatio conversion)
57
+ * - Combo multiplier (if enabled)
58
+ * - Groove multiplier (if per-hit groove is enabled)
59
+ *
60
+ * @param accuracy - The accuracy level of the hit
61
+ * @param options - Optional combo length and groove hotness
62
+ * @returns RhythmXPResult with score and XP values
63
+ */
64
+ calculateButtonPressXP(accuracy: BeatAccuracy, options?: {
65
+ comboLength?: number;
66
+ grooveHotness?: number;
67
+ }): RhythmXPResult;
68
+ /**
69
+ * Calculate combo end bonus
70
+ *
71
+ * Call this when a combo breaks (miss or wrongKey) to award a bonus
72
+ * based on the combo length achieved.
73
+ *
74
+ * @param comboLength - The combo length that just ended (before reset)
75
+ * @returns ComboEndBonusResult with bonus score and XP
76
+ */
77
+ calculateComboEndBonus(comboLength: number): ComboEndBonusResult;
78
+ /**
79
+ * Calculate groove end bonus
80
+ *
81
+ * Call this when a groove ends (hotness drops to 0 or session ends).
82
+ * Uses weighted calculation based on groove statistics.
83
+ *
84
+ * Note: Requires a minimum streak of 2 to award any bonus. Short grooves
85
+ * (maxStreak < 2) return 0 bonus to prevent excessive rewards for brief streaks.
86
+ *
87
+ * @param stats - Groove statistics from GrooveAnalyzer.getGrooveStats()
88
+ * @returns GrooveEndBonusResult with bonus score and XP
89
+ */
90
+ calculateGrooveEndBonus(stats: GrooveEndStats): GrooveEndBonusResult;
91
+ /**
92
+ * Get base score points for an accuracy level
93
+ *
94
+ * These are "score points" - raw values before xpRatio is applied.
95
+ *
96
+ * @param accuracy - The accuracy level
97
+ * @returns Base score points for this accuracy
98
+ */
99
+ getBaseXP(accuracy: BeatAccuracy): number;
100
+ /**
101
+ * Calculate combo multiplier from combo length
102
+ *
103
+ * Default formula: 1 + (comboLength / 50), capped at config.combo.cap
104
+ * At 50 combo = 2x, at 100 combo = 3x, at 200 combo = 5x (with default cap)
105
+ *
106
+ * @param comboLength - Current combo count
107
+ * @returns Multiplier value (capped at config.combo.cap)
108
+ */
109
+ getComboMultiplier(comboLength: number): number;
110
+ /**
111
+ * Default combo multiplier formula
112
+ *
113
+ * 1 + (comboLength / 25), capped at config.combo.cap
114
+ * - At 0 combo = 1x (no bonus)
115
+ * - At 25 combo = 2x
116
+ * - At 50 combo = 3x
117
+ * - At 100 combo = 5x (cap with default config)
118
+ */
119
+ private defaultComboFormula;
120
+ /**
121
+ * Start a new session
122
+ *
123
+ * Resets all totals and records the start time.
124
+ * Call this at the beginning of a rhythm game session.
125
+ */
126
+ startSession(): void;
127
+ /**
128
+ * Record a hit and update session totals
129
+ *
130
+ * Calculates XP for the hit AND updates internal session totals.
131
+ * This is a convenience method for stateful session tracking.
132
+ *
133
+ * @param accuracy - The accuracy level of the hit
134
+ * @param options - Optional combo length and groove hotness
135
+ * @returns RhythmXPResult with score and XP values
136
+ */
137
+ recordHit(accuracy: BeatAccuracy, options?: {
138
+ comboLength?: number;
139
+ grooveHotness?: number;
140
+ }): RhythmXPResult;
141
+ /**
142
+ * Get current session totals for UI display
143
+ *
144
+ * Returns a snapshot of the current session statistics.
145
+ *
146
+ * @returns RhythmSessionTotals or null if no session is active
147
+ */
148
+ getSessionTotals(): RhythmSessionTotals | null;
149
+ /**
150
+ * End session and get final totals
151
+ *
152
+ * Returns final session statistics and clears session state.
153
+ *
154
+ * @returns RhythmSessionTotals or null if no session was active
155
+ */
156
+ endSession(): RhythmSessionTotals | null;
157
+ /**
158
+ * Create empty session totals object
159
+ */
160
+ private createEmptyTotals;
161
+ /**
162
+ * Recalculate accuracy percentage
163
+ *
164
+ * Accuracy = (perfect + great + good + ok) / total hits
165
+ */
166
+ private recalculateAccuracyPercentage;
167
+ /**
168
+ * Get current configuration
169
+ *
170
+ * @returns Current RhythmXPConfig
171
+ */
172
+ getConfig(): RhythmXPConfig;
173
+ /**
174
+ * Update configuration
175
+ *
176
+ * Merges provided partial config with current configuration.
177
+ *
178
+ * @param config - Partial configuration to merge
179
+ */
180
+ updateConfig(config: Partial<RhythmXPConfig>): void;
181
+ }
182
+ //# sourceMappingURL=RhythmXPCalculator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RhythmXPCalculator.d.ts","sourceRoot":"","sources":["../../../src/core/progression/RhythmXPCalculator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EACR,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACtB,MAAM,sBAAsB,CAAC;AAM9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,MAAM,CAAiB;IAG/B,OAAO,CAAC,aAAa,CAAoC;IACzD,OAAO,CAAC,gBAAgB,CAAuB;IAE/C;;;;OAIG;gBACS,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC;IAQ5C;;;;;;;;;;;OAWG;IACH,sBAAsB,CAClB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