blacktrigram 0.7.45 → 0.7.48

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 (450) hide show
  1. package/lib/App2.js.map +1 -1
  2. package/lib/audio/AudioAssetLoader.js.map +1 -1
  3. package/lib/audio/AudioAssetRegistry.js.map +1 -1
  4. package/lib/audio/AudioCache.js.map +1 -1
  5. package/lib/audio/AudioManager.js.map +1 -1
  6. package/lib/audio/AudioMonitor.js.map +1 -1
  7. package/lib/audio/AudioPool.js.map +1 -1
  8. package/lib/audio/AudioProvider.js.map +1 -1
  9. package/lib/audio/AudioUtils.js.map +1 -1
  10. package/lib/audio/BoneImpactAudioMap.js.map +1 -1
  11. package/lib/audio/VariantSelector.js.map +1 -1
  12. package/lib/audio/types.js.map +1 -1
  13. package/lib/components/screens/combat/CombatScreen3D.d.ts.map +1 -1
  14. package/lib/components/screens/combat/CombatScreen3D.js +22 -11
  15. package/lib/components/screens/combat/CombatScreen3D.js.map +1 -1
  16. package/lib/components/screens/combat/components/controls/CombatButtons.js.map +1 -1
  17. package/lib/components/screens/combat/components/controls/CombatControlsPanel.js.map +1 -1
  18. package/lib/components/screens/combat/components/controls/ControlsGuide.js.map +1 -1
  19. package/lib/components/screens/combat/components/controls/KeyboardHints.js.map +1 -1
  20. package/lib/components/screens/combat/components/controls/PauseMenu.js.map +1 -1
  21. package/lib/components/screens/combat/components/controls/PauseMenuButton.js.map +1 -1
  22. package/lib/components/screens/combat/components/controls/QuickSettings.js.map +1 -1
  23. package/lib/components/screens/combat/components/effects/BloodDecals3D.js.map +1 -1
  24. package/lib/components/screens/combat/components/effects/BloodLossOverlayHtml.js.map +1 -1
  25. package/lib/components/screens/combat/components/effects/BloodParticles3D.js.map +1 -1
  26. package/lib/components/screens/combat/components/effects/BloodViscosity3D.js.map +1 -1
  27. package/lib/components/screens/combat/components/effects/CombatParticleEffects3D.js.map +1 -1
  28. package/lib/components/screens/combat/components/effects/ConsciousnessBlur.js.map +1 -1
  29. package/lib/components/screens/combat/components/effects/InternalDamage3D.js.map +1 -1
  30. package/lib/components/screens/combat/components/effects/PainVignette.js.map +1 -1
  31. package/lib/components/screens/combat/components/effects/ParticleAudio3D.js.map +1 -1
  32. package/lib/components/screens/combat/components/effects/TraumaOverlay3D.js.map +1 -1
  33. package/lib/components/screens/combat/components/feedback/MatchCountdown.js.map +1 -1
  34. package/lib/components/screens/combat/components/feedback/RoundAnnouncementOverlayHtml.js.map +1 -1
  35. package/lib/components/screens/combat/components/feedback/RoundDisplayStatus.js.map +1 -1
  36. package/lib/components/screens/combat/components/feedback/RoundStartAnnouncementOverlayHtml.js.map +1 -1
  37. package/lib/components/screens/combat/components/hud/CombatBottomHUD.js.map +1 -1
  38. package/lib/components/screens/combat/components/hud/CombatLeftHUD.js.map +1 -1
  39. package/lib/components/screens/combat/components/hud/CombatPortraitStatusStrip.js.map +1 -1
  40. package/lib/components/screens/combat/components/hud/CombatRightHUD.js.map +1 -1
  41. package/lib/components/screens/combat/components/hud/CombatTopHUD.js.map +1 -1
  42. package/lib/components/screens/combat/components/hud/DifficultyIndicator.js.map +1 -1
  43. package/lib/components/screens/combat/components/hud/FPSMonitor.js.map +1 -1
  44. package/lib/components/screens/combat/components/hud/MobileControlsWrapper.js.map +1 -1
  45. package/lib/components/screens/combat/components/hud/PlayerStateOverlayHtml.js.map +1 -1
  46. package/lib/components/screens/combat/components/indicators/BalanceIndicator.js.map +1 -1
  47. package/lib/components/screens/combat/components/indicators/InputBufferDisplay.js.map +1 -1
  48. package/lib/components/screens/combat/components/indicators/StaminaWarning.js.map +1 -1
  49. package/lib/components/screens/combat/components/indicators/TechniqueNameDisplay.js.map +1 -1
  50. package/lib/components/screens/combat/helpers/AnimationUpdater.d.ts.map +1 -1
  51. package/lib/components/screens/combat/helpers/AnimationUpdater.js +4 -2
  52. package/lib/components/screens/combat/helpers/AnimationUpdater.js.map +1 -1
  53. package/lib/components/screens/combat/helpers/combatHelpers.js.map +1 -1
  54. package/lib/components/screens/combat/hooks/useAICombat.js.map +1 -1
  55. package/lib/components/screens/combat/hooks/useCombatActions.js.map +1 -1
  56. package/lib/components/screens/combat/hooks/useCombatAttackMovement.js.map +1 -1
  57. package/lib/components/screens/combat/hooks/useCombatAudio.js.map +1 -1
  58. package/lib/components/screens/combat/hooks/useCombatLayout.js.map +1 -1
  59. package/lib/components/screens/combat/hooks/useCombatState.js.map +1 -1
  60. package/lib/components/screens/controls/ControlsScreen3D.js.map +1 -1
  61. package/lib/components/screens/controls/components/ControlBindingsOverlayHtml.js.map +1 -1
  62. package/lib/components/screens/controls/components/ControlCategoryTabsOverlayHtml.js.map +1 -1
  63. package/lib/components/screens/controls/components/GamepadVisualization3D.js.map +1 -1
  64. package/lib/components/screens/controls/components/InteractiveControlDemoOverlayHtml.js.map +1 -1
  65. package/lib/components/screens/controls/components/Key3D.js.map +1 -1
  66. package/lib/components/screens/controls/components/VisualKeyboard3D.js.map +1 -1
  67. package/lib/components/screens/controls/constants/ControlsConstants.js.map +1 -1
  68. package/lib/components/screens/controls/hooks/useControlsState.js.map +1 -1
  69. package/lib/components/screens/endscreen/EndScreen3D.js.map +1 -1
  70. package/lib/components/screens/endscreen/components/DefeatAnimation3D.js.map +1 -1
  71. package/lib/components/screens/endscreen/components/MatchStatisticsDisplayOverlayHtml.js.map +1 -1
  72. package/lib/components/screens/endscreen/components/NavigationButtonsOverlayHtml.js.map +1 -1
  73. package/lib/components/screens/endscreen/components/PerformanceBreakdownOverlayHtml.js.map +1 -1
  74. package/lib/components/screens/endscreen/components/PerformanceRatingOverlayHtml.js.map +1 -1
  75. package/lib/components/screens/endscreen/components/VictoryAnimation3D.js.map +1 -1
  76. package/lib/components/screens/endscreen/components/WinnerDisplayOverlayHtml.js.map +1 -1
  77. package/lib/components/screens/intro/IntroScreen3D.js +1 -1
  78. package/lib/components/screens/intro/IntroScreen3D.js.map +1 -1
  79. package/lib/components/screens/intro/components/AbilityListOverlayHtml.js.map +1 -1
  80. package/lib/components/screens/intro/components/ArchetypeCardGridOverlayHtml.js.map +1 -1
  81. package/lib/components/screens/intro/components/ArchetypeCardOverlayHtml.js.map +1 -1
  82. package/lib/components/screens/intro/components/ArchetypeDisplayOverlayHtml.js.map +1 -1
  83. package/lib/components/screens/intro/components/EnhancedArchetypeDisplayOverlayHtml.js.map +1 -1
  84. package/lib/components/screens/intro/components/MenuButtonsOverlayHtml.js.map +1 -1
  85. package/lib/components/screens/intro/components/MenuSectionOverlayHtml.js.map +1 -1
  86. package/lib/components/screens/intro/components/StatBarOverlayHtml.js.map +1 -1
  87. package/lib/components/screens/philosophy/PhilosophyScreen3D.js.map +1 -1
  88. package/lib/components/screens/training/TrainingScreen3D.d.ts.map +1 -1
  89. package/lib/components/screens/training/TrainingScreen3D.js +1 -0
  90. package/lib/components/screens/training/TrainingScreen3D.js.map +1 -1
  91. package/lib/components/screens/training/components/AnatomyControlsOverlayHtml.js.map +1 -1
  92. package/lib/components/screens/training/components/AnatomyOverlay3D.js.map +1 -1
  93. package/lib/components/screens/training/components/FootPlacementMarkers3D.js.map +1 -1
  94. package/lib/components/screens/training/components/FootworkDrillsOverlayHtml.js.map +1 -1
  95. package/lib/components/screens/training/components/HitFeedbackEffect3D.js.map +1 -1
  96. package/lib/components/screens/training/components/TrainingButtonsOverlayHtml.js.map +1 -1
  97. package/lib/components/screens/training/components/TrainingControlsOverlayHtml.js.map +1 -1
  98. package/lib/components/screens/training/components/TrainingDummy3D.js.map +1 -1
  99. package/lib/components/screens/training/components/TrainingFeedbackOverlayHtml.js.map +1 -1
  100. package/lib/components/screens/training/components/TrainingModeSelectorOverlayHtml.js.map +1 -1
  101. package/lib/components/screens/training/components/TrainingStatsOverlayHtml.js.map +1 -1
  102. package/lib/components/screens/training/components/VitalPointMarker3D.js.map +1 -1
  103. package/lib/components/screens/training/components/VitalPointTrainingOverlayHtml.js.map +1 -1
  104. package/lib/components/screens/training/components/hud/TrainingBottomHUD.js.map +1 -1
  105. package/lib/components/screens/training/components/hud/TrainingLeftHUD.js.map +1 -1
  106. package/lib/components/screens/training/components/hud/TrainingRightHUD.js.map +1 -1
  107. package/lib/components/screens/training/components/hud/TrainingTopHUD.js.map +1 -1
  108. package/lib/components/screens/training/hooks/useAttackMovement.js.map +1 -1
  109. package/lib/components/screens/training/hooks/useTrainingActions.d.ts +1 -0
  110. package/lib/components/screens/training/hooks/useTrainingActions.d.ts.map +1 -1
  111. package/lib/components/screens/training/hooks/useTrainingActions.js +6 -4
  112. package/lib/components/screens/training/hooks/useTrainingActions.js.map +1 -1
  113. package/lib/components/screens/training/hooks/useTrainingLayout.js.map +1 -1
  114. package/lib/components/screens/training/hooks/useTrainingState.js.map +1 -1
  115. package/lib/components/shared/base/BaseButton.js.map +1 -1
  116. package/lib/components/shared/base/BaseButtonOverlayHtml.js.map +1 -1
  117. package/lib/components/shared/base/BasePanel.js.map +1 -1
  118. package/lib/components/shared/base/BaseText.js.map +1 -1
  119. package/lib/components/shared/base/useKoreanTheme.js.map +1 -1
  120. package/lib/components/shared/debug/PerformanceDebugOverlayHtml.js.map +1 -1
  121. package/lib/components/shared/mobile/ActionButtons.js.map +1 -1
  122. package/lib/components/shared/mobile/GestureRecognizerPure.js.map +1 -1
  123. package/lib/components/shared/mobile/HapticController.js.map +1 -1
  124. package/lib/components/shared/mobile/MobileControlsPure.js.map +1 -1
  125. package/lib/components/shared/mobile/StanceWheelPure.js.map +1 -1
  126. package/lib/components/shared/mobile/TouchOptimizer.js.map +1 -1
  127. package/lib/components/shared/mobile/VirtualDPad.js.map +1 -1
  128. package/lib/components/shared/three/anatomy/BodySurface.js.map +1 -1
  129. package/lib/components/shared/three/anatomy/BoneAttachedMuscles.js.map +1 -1
  130. package/lib/components/shared/three/anatomy/BoneClothing.js.map +1 -1
  131. package/lib/components/shared/three/anatomy/BoneRenderer.js.map +1 -1
  132. package/lib/components/shared/three/anatomy/Face3D.js.map +1 -1
  133. package/lib/components/shared/three/anatomy/Foot3D.js.map +1 -1
  134. package/lib/components/shared/three/anatomy/Hand3D.js.map +1 -1
  135. package/lib/components/shared/three/effects/ActionFeedback.js.map +1 -1
  136. package/lib/components/shared/three/effects/DamageNumbers.js.map +1 -1
  137. package/lib/components/shared/three/effects/HitEffects3D.js.map +1 -1
  138. package/lib/components/shared/three/effects/PlayerStateIndicators.js.map +1 -1
  139. package/lib/components/shared/three/effects/StanceSymbol3D.js.map +1 -1
  140. package/lib/components/shared/three/effects/StanceTransitionEffect.js.map +1 -1
  141. package/lib/components/shared/three/effects/VitalPointMarkers3D.js.map +1 -1
  142. package/lib/components/shared/three/indicators/ElementalColorSystem.js.map +1 -1
  143. package/lib/components/shared/three/indicators/GuardIndicator.js.map +1 -1
  144. package/lib/components/shared/three/indicators/HapticFeedback.js.map +1 -1
  145. package/lib/components/shared/three/indicators/StanceChangeIndicator.js.map +1 -1
  146. package/lib/components/shared/three/models/Player3DWithTransitions.js.map +1 -1
  147. package/lib/components/shared/three/models/SkeletalPlayer3D.d.ts.map +1 -1
  148. package/lib/components/shared/three/models/SkeletalPlayer3D.js +7 -5
  149. package/lib/components/shared/three/models/SkeletalPlayer3D.js.map +1 -1
  150. package/lib/components/shared/three/optimization/AdaptiveQuality.js.map +1 -1
  151. package/lib/components/shared/three/scene/AtmosphericParticles3D.js.map +1 -1
  152. package/lib/components/shared/three/scene/BackgroundScene3D.js.map +1 -1
  153. package/lib/components/shared/three/scene/CombatArena3D.js.map +1 -1
  154. package/lib/components/shared/three/scene/KoreanSignage3D.js.map +1 -1
  155. package/lib/components/shared/three/ui/ArchetypeCard.js.map +1 -1
  156. package/lib/components/shared/three/ui/BodyPartHealthDisplay.js.map +1 -1
  157. package/lib/components/shared/three/ui/BreathingIndicator2.js.map +1 -1
  158. package/lib/components/shared/three/ui/CombatReadinessBar.js.map +1 -1
  159. package/lib/components/shared/three/ui/ComboCounter.js.map +1 -1
  160. package/lib/components/shared/three/ui/HealthBar.js.map +1 -1
  161. package/lib/components/shared/three/ui/KoreanButton.js.map +1 -1
  162. package/lib/components/shared/three/ui/KoreanPanel.js.map +1 -1
  163. package/lib/components/shared/three/ui/KoreanText.js.map +1 -1
  164. package/lib/components/shared/three/ui/MenuList.js.map +1 -1
  165. package/lib/components/shared/three/ui/PlayerHUD.js.map +1 -1
  166. package/lib/components/shared/three/ui/ProgressBar.js.map +1 -1
  167. package/lib/components/shared/three/ui/SpeedIndicatorHUD.js.map +1 -1
  168. package/lib/components/shared/three/ui/StaminaBar.js.map +1 -1
  169. package/lib/components/shared/three/ui/TechniqueBar.js.map +1 -1
  170. package/lib/components/shared/three/ui/TechniqueCard.js.map +1 -1
  171. package/lib/components/shared/three/ui/VitalPointOverlayControlsHtml.js.map +1 -1
  172. package/lib/components/shared/ui/BackButton.js.map +1 -1
  173. package/lib/components/shared/ui/BaseHUDContainer.js.map +1 -1
  174. package/lib/components/shared/ui/CombatTimer.js.map +1 -1
  175. package/lib/components/shared/ui/ErrorModal.js.map +1 -1
  176. package/lib/components/shared/ui/LoadingState.js.map +1 -1
  177. package/lib/components/shared/ui/SplashScreen.js +2 -2
  178. package/lib/components/shared/ui/SplashScreen.js.map +1 -1
  179. package/lib/components/shared/ui/VitalPointOverlayControlsPure.js.map +1 -1
  180. package/lib/components/shared/ui/VolumeControl.js.map +1 -1
  181. package/lib/components/shared/ui/shared/ConfirmDialog.js.map +1 -1
  182. package/lib/components/ui/combat/BalanceIndicatorOverlayHtml.js.map +1 -1
  183. package/lib/constants/bodyDimensions.js.map +1 -1
  184. package/lib/constants/bodyRenderingConstants.js.map +1 -1
  185. package/lib/data/archetypeClothing.js.map +1 -1
  186. package/lib/data/archetypePhysicalAttributes.js.map +1 -1
  187. package/lib/data/techniqueMappings.js.map +1 -1
  188. package/lib/data/techniques.js.map +1 -1
  189. package/lib/hooks/useActionFeedback.js.map +1 -1
  190. package/lib/hooks/useBalanceAnimations.js.map +1 -1
  191. package/lib/hooks/useCombatTimer.js.map +1 -1
  192. package/lib/hooks/useDebounce.js.map +1 -1
  193. package/lib/hooks/useHUDLayout.js.map +1 -1
  194. package/lib/hooks/useHandPoseTransitions.js.map +1 -1
  195. package/lib/hooks/useKeyboardControls.js.map +1 -1
  196. package/lib/hooks/useMatchCountdown.js.map +1 -1
  197. package/lib/hooks/useMuscleActivation.js.map +1 -1
  198. package/lib/hooks/usePauseMenu.js.map +1 -1
  199. package/lib/hooks/usePlayerAnimation.js.map +1 -1
  200. package/lib/hooks/useResponsiveLayout.js.map +1 -1
  201. package/lib/hooks/useRoundTransition.js.map +1 -1
  202. package/lib/hooks/useSkeletalAnimation.d.ts.map +1 -1
  203. package/lib/hooks/useSkeletalAnimation.js +1 -1
  204. package/lib/hooks/useSkeletalAnimation.js.map +1 -1
  205. package/lib/hooks/useTechniqueSelection.js.map +1 -1
  206. package/lib/hooks/useThrottle.js.map +1 -1
  207. package/lib/hooks/useTouchControls.js.map +1 -1
  208. package/lib/hooks/useWebGLContextLossHandler.js.map +1 -1
  209. package/lib/hooks/useWindowSize.js.map +1 -1
  210. package/lib/systems/CombatSystem.js.map +1 -1
  211. package/lib/systems/EffectCalculator.js.map +1 -1
  212. package/lib/systems/LayoutSystem.js.map +1 -1
  213. package/lib/systems/PlayerEffectManager.js.map +1 -1
  214. package/lib/systems/ResponsiveScaling.js.map +1 -1
  215. package/lib/systems/TrigramSystem.js.map +1 -1
  216. package/lib/systems/VitalPointSystem.js.map +1 -1
  217. package/lib/systems/ai/AIPersonality.js.map +1 -1
  218. package/lib/systems/ai/AdaptiveDifficulty.js +16 -16
  219. package/lib/systems/ai/AdaptiveDifficulty.js.map +1 -1
  220. package/lib/systems/ai/ArchetypeEnforcer.js.map +1 -1
  221. package/lib/systems/ai/ComboSystem.js.map +1 -1
  222. package/lib/systems/ai/DecisionTree.js.map +1 -1
  223. package/lib/systems/ai/TrainingAI.js.map +1 -1
  224. package/lib/systems/ai/types.js.map +1 -1
  225. package/lib/systems/animation/builders/AnimationBuilder.js.map +1 -1
  226. package/lib/systems/animation/builders/HandPoseApplicator.js.map +1 -1
  227. package/lib/systems/animation/builders/HandPoses.js.map +1 -1
  228. package/lib/systems/animation/builders/KeyframeConfig.js.map +1 -1
  229. package/lib/systems/animation/builders/KeyframeInterpolation.js.map +1 -1
  230. package/lib/systems/animation/builders/KickPhaseApplicator.d.ts +6 -0
  231. package/lib/systems/animation/builders/KickPhaseApplicator.d.ts.map +1 -1
  232. package/lib/systems/animation/builders/KickPhaseApplicator.js +16 -9
  233. package/lib/systems/animation/builders/KickPhaseApplicator.js.map +1 -1
  234. package/lib/systems/animation/builders/KoreanGuardPositions.d.ts +4 -4
  235. package/lib/systems/animation/builders/KoreanGuardPositions.js.map +1 -1
  236. package/lib/systems/animation/builders/MartialArtsAnimationBuilder.d.ts +1 -1
  237. package/lib/systems/animation/builders/MartialArtsAnimationBuilder.d.ts.map +1 -1
  238. package/lib/systems/animation/builders/MartialArtsAnimationBuilder.js +5 -5
  239. package/lib/systems/animation/builders/MartialArtsAnimationBuilder.js.map +1 -1
  240. package/lib/systems/animation/builders/MartialArtsConstants.d.ts +112 -71
  241. package/lib/systems/animation/builders/MartialArtsConstants.d.ts.map +1 -1
  242. package/lib/systems/animation/builders/MartialArtsConstants.js +113 -72
  243. package/lib/systems/animation/builders/MartialArtsConstants.js.map +1 -1
  244. package/lib/systems/animation/builders/MartialPoseApplicator.js.map +1 -1
  245. package/lib/systems/animation/builders/PunchPhaseApplicator.js.map +1 -1
  246. package/lib/systems/animation/builders/SkeletonRig.js.map +1 -1
  247. package/lib/systems/animation/builders/TrigramGuardApplicator.js.map +1 -1
  248. package/lib/systems/animation/catalogs/AttackAnimations.js.map +1 -1
  249. package/lib/systems/animation/catalogs/BasicAnimations.js.map +1 -1
  250. package/lib/systems/animation/catalogs/ComboAnimations.js.map +1 -1
  251. package/lib/systems/animation/catalogs/DarkOpsAnimations.js.map +1 -1
  252. package/lib/systems/animation/catalogs/DefensiveAnimations.js.map +1 -1
  253. package/lib/systems/animation/catalogs/ElbowKneeAnimations.js.map +1 -1
  254. package/lib/systems/animation/catalogs/EnhancedAttackAnimations.js.map +1 -1
  255. package/lib/systems/animation/catalogs/EnhancedElbowKneeAnimations.js.map +1 -1
  256. package/lib/systems/animation/catalogs/FootworkSkeletalAnimations.js.map +1 -1
  257. package/lib/systems/animation/catalogs/GamRedirectionAnimations.js.map +1 -1
  258. package/lib/systems/animation/catalogs/GamStanceAnimations.js +21 -0
  259. package/lib/systems/animation/catalogs/GamStanceAnimations.js.map +1 -0
  260. package/lib/systems/animation/catalogs/GamTechniqueAnimations.js +34 -2
  261. package/lib/systems/animation/catalogs/GamTechniqueAnimations.js.map +1 -1
  262. package/lib/systems/animation/catalogs/GanStanceAnimations.js.map +1 -1
  263. package/lib/systems/animation/catalogs/GanTechniqueAnimations.js.map +1 -1
  264. package/lib/systems/animation/catalogs/GeonStanceAnimations.js.map +1 -1
  265. package/lib/systems/animation/catalogs/GonTechniqueAnimations.d.ts +9 -0
  266. package/lib/systems/animation/catalogs/GonTechniqueAnimations.d.ts.map +1 -1
  267. package/lib/systems/animation/catalogs/GonTechniqueAnimations.js +288 -0
  268. package/lib/systems/animation/catalogs/GonTechniqueAnimations.js.map +1 -0
  269. package/lib/systems/animation/catalogs/GrapplingAnimations.js.map +1 -1
  270. package/lib/systems/animation/catalogs/JinStanceAnimations.js.map +1 -1
  271. package/lib/systems/animation/catalogs/JinTechniqueAnimations.js.map +1 -1
  272. package/lib/systems/animation/catalogs/KickAnimations.d.ts +2 -2
  273. package/lib/systems/animation/catalogs/KickAnimations.js +2 -2
  274. package/lib/systems/animation/catalogs/KickAnimations.js.map +1 -1
  275. package/lib/systems/animation/catalogs/LiStanceAnimations.js +14 -1
  276. package/lib/systems/animation/catalogs/LiStanceAnimations.js.map +1 -1
  277. package/lib/systems/animation/catalogs/LiTechniqueAnimations.js.map +1 -1
  278. package/lib/systems/animation/catalogs/MovementAnimations.js.map +1 -1
  279. package/lib/systems/animation/catalogs/PunchAnimations.d.ts +1 -1
  280. package/lib/systems/animation/catalogs/PunchAnimations.js +1 -1
  281. package/lib/systems/animation/catalogs/PunchAnimations.js.map +1 -1
  282. package/lib/systems/animation/catalogs/RecoveryAnimations.js.map +1 -1
  283. package/lib/systems/animation/catalogs/SonStanceAnimations.js.map +1 -1
  284. package/lib/systems/animation/catalogs/SonTechniqueAnimations.js.map +1 -1
  285. package/lib/systems/animation/catalogs/SpecializedPunchAnimations.js.map +1 -1
  286. package/lib/systems/animation/catalogs/StanceAnimations.js.map +1 -1
  287. package/lib/systems/animation/catalogs/StanceAttackAnimations.js.map +1 -1
  288. package/lib/systems/animation/catalogs/StanceGuardPoses.d.ts +6 -6
  289. package/lib/systems/animation/catalogs/StanceGuardPoses.js +36 -36
  290. package/lib/systems/animation/catalogs/StanceGuardPoses.js.map +1 -1
  291. package/lib/systems/animation/catalogs/StanceIdleAnimations.js.map +1 -1
  292. package/lib/systems/animation/catalogs/StanceLocomotionAnimations.js.map +1 -1
  293. package/lib/systems/animation/catalogs/StepSkeletalAnimations.js.map +1 -1
  294. package/lib/systems/animation/catalogs/TaeJointLockAnimations.js.map +1 -1
  295. package/lib/systems/animation/catalogs/TaeStanceAnimations.js.map +1 -1
  296. package/lib/systems/animation/constants/AnatomicalLimits.js.map +1 -1
  297. package/lib/systems/animation/core/AnimationHitTiming.js.map +1 -1
  298. package/lib/systems/animation/core/AnimationOptimizations.js.map +1 -1
  299. package/lib/systems/animation/core/AnimationPriority.js +15 -15
  300. package/lib/systems/animation/core/AnimationPriority.js.map +1 -1
  301. package/lib/systems/animation/core/AnimationRegistry.d.ts +30 -0
  302. package/lib/systems/animation/core/AnimationRegistry.d.ts.map +1 -1
  303. package/lib/systems/animation/core/AnimationRegistry.js +74 -12
  304. package/lib/systems/animation/core/AnimationRegistry.js.map +1 -1
  305. package/lib/systems/animation/core/AnimationStateMachine.js +16 -16
  306. package/lib/systems/animation/core/AnimationStateMachine.js.map +1 -1
  307. package/lib/systems/animation/core/AnimationTransitions.d.ts.map +1 -1
  308. package/lib/systems/animation/core/AnimationTransitions.js +34 -0
  309. package/lib/systems/animation/core/AnimationTransitions.js.map +1 -1
  310. package/lib/systems/animation/core/LateralityTransform.js.map +1 -1
  311. package/lib/systems/animation/core/RecoveryPhaseEnhancer.js.map +1 -1
  312. package/lib/systems/animation/core/TechniqueAnimationMapper.js.map +1 -1
  313. package/lib/systems/animation/core/TechniqueAnimationMapping.js.map +1 -1
  314. package/lib/systems/animation/core/index.d.ts +1 -1
  315. package/lib/systems/animation/core/index.d.ts.map +1 -1
  316. package/lib/systems/animation/core/types.d.ts +24 -0
  317. package/lib/systems/animation/core/types.d.ts.map +1 -1
  318. package/lib/systems/animation/core/types.js +27 -11
  319. package/lib/systems/animation/core/types.js.map +1 -1
  320. package/lib/systems/animation/systems/AdvancedJointMovements.js.map +1 -1
  321. package/lib/systems/animation/systems/BodyFacingSystem.js.map +1 -1
  322. package/lib/systems/animation/systems/FacialExpressions.js.map +1 -1
  323. package/lib/systems/animation/systems/FallAnimations.js.map +1 -1
  324. package/lib/systems/animation/systems/MuscleActivation.js.map +1 -1
  325. package/lib/systems/bodypart/BodyPartDamageIntegration.js.map +1 -1
  326. package/lib/systems/bodypart/BodyPartHealthSystem.js.map +1 -1
  327. package/lib/systems/bodypart/BodyPartPositionMapping.js.map +1 -1
  328. package/lib/systems/bodypart/CombatInjuryIntegration.js.map +1 -1
  329. package/lib/systems/bodypart/InjuryIntegration.js.map +1 -1
  330. package/lib/systems/bodypart/InjuryTracker.js.map +1 -1
  331. package/lib/systems/bodypart/MovementPenaltySystem.js.map +1 -1
  332. package/lib/systems/bodypart/PlayerInjuryTrackingManager.js.map +1 -1
  333. package/lib/systems/bodypart/types.js.map +1 -1
  334. package/lib/systems/breathing/BreathingDisruptionSystem.js +19 -19
  335. package/lib/systems/breathing/BreathingDisruptionSystem.js.map +1 -1
  336. package/lib/systems/breathing/feedback.js.map +1 -1
  337. package/lib/systems/breathing/integration.js.map +1 -1
  338. package/lib/systems/combat/BalanceSystem.js +19 -19
  339. package/lib/systems/combat/BalanceSystem.js.map +1 -1
  340. package/lib/systems/combat/BreakingStatusEffects.js.map +1 -1
  341. package/lib/systems/combat/CombatStateSystem.js +17 -17
  342. package/lib/systems/combat/CombatStateSystem.js.map +1 -1
  343. package/lib/systems/combat/ConsciousnessSystem.js +24 -24
  344. package/lib/systems/combat/ConsciousnessSystem.js.map +1 -1
  345. package/lib/systems/combat/FallIntegration.js.map +1 -1
  346. package/lib/systems/combat/GrappleSystem.js.map +1 -1
  347. package/lib/systems/combat/LimbExposureSystem.js.map +1 -1
  348. package/lib/systems/combat/PainResponseSystem.js +21 -21
  349. package/lib/systems/combat/PainResponseSystem.js.map +1 -1
  350. package/lib/systems/combat/TrainingCombatSystem.js.map +1 -1
  351. package/lib/systems/combat/painConsciousnessUtils.js.map +1 -1
  352. package/lib/systems/combat/typeGuards.js.map +1 -1
  353. package/lib/systems/effects.js.map +1 -1
  354. package/lib/systems/game.js.map +1 -1
  355. package/lib/systems/movement/InjuryMovementModifier.js.map +1 -1
  356. package/lib/systems/movement/helpers/AccelerationUpdater.js.map +1 -1
  357. package/lib/systems/movement/helpers/accelerationUtils.js.map +1 -1
  358. package/lib/systems/movement/integration.js.map +1 -1
  359. package/lib/systems/physics/AttackMovementPhysics.js.map +1 -1
  360. package/lib/systems/physics/CollisionDetection.js.map +1 -1
  361. package/lib/systems/physics/CoordinateMapper.js.map +1 -1
  362. package/lib/systems/physics/KnockbackPhysics.js.map +1 -1
  363. package/lib/systems/physics/MovementPhysics.js.map +1 -1
  364. package/lib/systems/physics/PhysicalReachCalculator.js.map +1 -1
  365. package/lib/systems/physics/SpeedModifierSystem.js +6 -6
  366. package/lib/systems/physics/SpeedModifierSystem.js.map +1 -1
  367. package/lib/systems/trigram/KoreanCulture.js.map +1 -1
  368. package/lib/systems/trigram/KoreanTechniques.js.map +1 -1
  369. package/lib/systems/trigram/StanceManager.js.map +1 -1
  370. package/lib/systems/trigram/TransitionCalculator.js.map +1 -1
  371. package/lib/systems/trigram/TrigramCalculator.js.map +1 -1
  372. package/lib/systems/trigram/techniques/DarkOpsTechniques.js.map +1 -1
  373. package/lib/systems/trigram/techniques/GamTechniques.js.map +1 -1
  374. package/lib/systems/trigram/techniques/GanTechniques.js.map +1 -1
  375. package/lib/systems/trigram/techniques/GeonTechniques.js.map +1 -1
  376. package/lib/systems/trigram/techniques/GonTechniques.js.map +1 -1
  377. package/lib/systems/trigram/techniques/JinTechniques.js.map +1 -1
  378. package/lib/systems/trigram/techniques/LiTechniques.js.map +1 -1
  379. package/lib/systems/trigram/techniques/SonTechniques.js.map +1 -1
  380. package/lib/systems/trigram/techniques/TaeTechniques.js.map +1 -1
  381. package/lib/systems/trigram/techniques/TechniqueConfig.js.map +1 -1
  382. package/lib/systems/trigram/techniques/index.js.map +1 -1
  383. package/lib/systems/trigram/types/GonTechniqueExtensions.js.map +1 -1
  384. package/lib/systems/trigram/types.js.map +1 -1
  385. package/lib/systems/types.js.map +1 -1
  386. package/lib/systems/vitalpoint/DamageCalculator.js.map +1 -1
  387. package/lib/systems/vitalpoint/HitDetection.js.map +1 -1
  388. package/lib/systems/vitalpoint/KoreanAnatomy.js.map +1 -1
  389. package/lib/systems/vitalpoint/KoreanVitalPoints.js.map +1 -1
  390. package/lib/systems/vitalpoint/MeridianVitalPointMapping.js.map +1 -1
  391. package/lib/systems/vitalpoint/VitalPointsData.js.map +1 -1
  392. package/lib/types/AccessibilityTypes.js.map +1 -1
  393. package/lib/types/LayoutTypes.js.map +1 -1
  394. package/lib/types/PhysicsTypes.js.map +1 -1
  395. package/lib/types/common.js.map +1 -1
  396. package/lib/types/constants/animations.js.map +1 -1
  397. package/lib/types/constants/colors.js.map +1 -1
  398. package/lib/types/constants/designSystem.js.map +1 -1
  399. package/lib/types/constants/index.js.map +1 -1
  400. package/lib/types/constants/layout.js.map +1 -1
  401. package/lib/types/constants/performance.js.map +1 -1
  402. package/lib/types/constants/typography.js.map +1 -1
  403. package/lib/types/constants/ui.js.map +1 -1
  404. package/lib/types/facial.js +19 -19
  405. package/lib/types/facial.js.map +1 -1
  406. package/lib/types/hand-animation.js.map +1 -1
  407. package/lib/types/injury.js.map +1 -1
  408. package/lib/types/muscle.js.map +1 -1
  409. package/lib/types/physics.js.map +1 -1
  410. package/lib/types/physicsConstants.js.map +1 -1
  411. package/lib/types/player-visual.d.ts +1 -1
  412. package/lib/types/player-visual.d.ts.map +1 -1
  413. package/lib/types/skeletal.js.map +1 -1
  414. package/lib/types/techniqueId.js.map +1 -1
  415. package/lib/utils/accessibility.js.map +1 -1
  416. package/lib/utils/arenaWorldDimensions.js.map +1 -1
  417. package/lib/utils/assetConfig.js.map +1 -1
  418. package/lib/utils/characterScaling.js.map +1 -1
  419. package/lib/utils/colorHelpers.js.map +1 -1
  420. package/lib/utils/colorUtils.js.map +1 -1
  421. package/lib/utils/combatReadiness.js.map +1 -1
  422. package/lib/utils/controlMapping.js.map +1 -1
  423. package/lib/utils/deviceDetection.js +6 -7
  424. package/lib/utils/deviceDetection.js.map +1 -1
  425. package/lib/utils/effectUtils.js.map +1 -1
  426. package/lib/utils/fabricTextures.js.map +1 -1
  427. package/lib/utils/hapticFeedback.js.map +1 -1
  428. package/lib/utils/haptics.js.map +1 -1
  429. package/lib/utils/htmlOverlayHelpers.js.map +1 -1
  430. package/lib/utils/inputSystem.js.map +1 -1
  431. package/lib/utils/koreanThemeHelpers.js.map +1 -1
  432. package/lib/utils/math.js.map +1 -1
  433. package/lib/utils/mobileLayoutHelpers.js.map +1 -1
  434. package/lib/utils/mobileUIUtils.js.map +1 -1
  435. package/lib/utils/performance/PerformanceMonitor.js.map +1 -1
  436. package/lib/utils/performance/PerformanceOverlay3D.js.map +1 -1
  437. package/lib/utils/performance/usePerformanceMonitor.js.map +1 -1
  438. package/lib/utils/performanceOptimization.js.map +1 -1
  439. package/lib/utils/player3DHelpers.js.map +1 -1
  440. package/lib/utils/playerUtils.js.map +1 -1
  441. package/lib/utils/responsiveLayout.js.map +1 -1
  442. package/lib/utils/responsiveLayoutHelpers.js.map +1 -1
  443. package/lib/utils/responsiveOrientationConstants.js.map +1 -1
  444. package/lib/utils/safeAreaUtils.js.map +1 -1
  445. package/lib/utils/sharedPhysicsConfig.js.map +1 -1
  446. package/lib/utils/skeletonScaling.js.map +1 -1
  447. package/lib/utils/stanceHelpers.js.map +1 -1
  448. package/lib/utils/threeObjectPool.js.map +1 -1
  449. package/lib/utils/visualEffects.js.map +1 -1
  450. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"BloodViscosity3D.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/effects/BloodViscosity3D.tsx"],"sourcesContent":["/**\n * BloodViscosity3D - Enhanced blood droplets with thicker physics for brutal combat realism\n *\n * Priority #5: Enhanced Blood Viscosity\n * - Thicker droplets with slower fall rate\n * - Variable splatter sizes (gouts vs mist)\n * - Cling/drip physics (stick to surfaces)\n * - Enhanced viscosity simulation\n *\n * PERFORMANCE OPTIMIZATION (Object Pooling):\n * - Reduced allocations from ~85+ per effect to ~4 pooled objects\n * - Pooling strategy:\n * 1. Temporary calculation objects (direction, color, velocity) use pool\n * 2. Owned objects (particle velocities) are cloned from pooled objects\n * 3. All pooled objects released after particle creation\n * - Estimated reduction: \n * - thin: 50 Color + 50 Vector3 = 100 allocations → 4 pooled objects\n * - medium: 80 Color + 80 Vector3 = 160 allocations → 4 pooled objects\n * - thick: 120 Color + 120 Vector3 = 240 allocations → 4 pooled objects\n * - gout: 200 Color + 200 Vector3 = 400 allocations → 4 pooled objects\n *\n * Korean martial arts context:\n * - 절단격 (Cutting strikes) - Thin blood mist\n * - 타격 (Impact strikes) - Medium blood splatter\n * - 관통격 (Penetrating strikes) - Thick blood droplets\n * - 깊은 상처 (Deep wounds) - Large blood gouts\n */\n\nimport React, { useEffect, useMemo } from 'react';\nimport { useFrame } from '@react-three/fiber';\nimport * as THREE from 'three';\nimport { ThreeObjectPools } from '../../../../../utils/threeObjectPool';\n\n/**\n * Viscosity types for blood splatter\n */\nexport type ViscosityType = 'thin' | 'medium' | 'thick' | 'gout';\n\n/**\n * Individual blood viscosity effect\n */\nexport interface BloodViscosityEffect {\n readonly id: string;\n readonly position: [number, number, number];\n readonly direction: [number, number, number];\n readonly viscosityType: ViscosityType;\n readonly intensity: number; // 0.0-1.0\n readonly startTime: number;\n}\n\n/**\n * Props for BloodViscosity3D component\n */\nexport interface BloodViscosity3DProps {\n readonly effects: readonly BloodViscosityEffect[];\n readonly enabled?: boolean;\n readonly isMobile?: boolean;\n readonly onEffectComplete?: (id: string) => void;\n}\n\nconst BLOOD_VISCOSITY_CONSTANTS = {\n GRAVITY: -9.8, // m/s²\n AIR_RESISTANCE: 0.94, // Thicker than arterial (0.97) or bone (0.96)\n \n PARTICLE_COUNT: {\n thin: 50, // Mist\n medium: 80, // Normal splatter\n thick: 120, // Heavy droplets\n gout: 200, // Deep wound large gouts\n },\n \n VELOCITY: {\n thin: { min: 2.0, max: 4.0 },\n medium: { min: 1.5, max: 3.0 },\n thick: { min: 1.0, max: 2.5 },\n gout: { min: 0.5, max: 2.0 },\n },\n \n SIZE: {\n thin: { min: 0.02, max: 0.04 },\n medium: { min: 0.04, max: 0.08 },\n thick: { min: 0.06, max: 0.12 },\n gout: { min: 0.10, max: 0.20 },\n },\n \n SPREAD_ANGLE: {\n thin: Math.PI / 3, // 60° wide spray\n medium: Math.PI / 4, // 45° normal\n thick: Math.PI / 6, // 30° narrow\n gout: Math.PI / 8, // 22.5° very narrow\n },\n \n ACTIVE_LIFETIME: 2.5, // Active falling time\n CLING_LIFETIME: 3.0, // Time stuck to ground\n TOTAL_LIFETIME: 5.5, // Total before cleanup\n \n GROUND_LEVEL: 0.1, // y-position for ground contact\n CLING_DAMPING: 0.3, // Velocity reduction on contact\n \n BLOOD_COLOR: 0x8b0000, // Dark red\n \n MAX_DELTA: 1 / 30,\n} as const;\n\n/**\n * BloodViscosity3D - Enhanced blood droplets with realistic thicker physics\n *\n * Features:\n * - Variable viscosity types (thin mist to thick gouts)\n * - Cling/drip physics when hitting ground\n * - Slower fall rates than arterial spray\n * - Larger droplet sizes\n * - Mobile optimization (50% particles)\n */\nexport const BloodViscosity3D: React.FC<BloodViscosity3DProps> = ({\n effects,\n enabled = true,\n isMobile = false,\n onEffectComplete,\n}) => {\n const [effectInstances, setEffectInstances] = React.useState<\n Map<\n string,\n {\n particles: THREE.Points;\n velocities: THREE.Vector3[];\n startTime: number;\n effect: BloodViscosityEffect;\n clinging: boolean[];\n }\n >\n >(new Map());\n\n const getParticleCount = useMemo(\n () => (viscosityType: ViscosityType) => {\n const baseCount = BLOOD_VISCOSITY_CONSTANTS.PARTICLE_COUNT[viscosityType];\n return isMobile ? Math.floor(baseCount * 0.5) : baseCount;\n },\n [isMobile]\n );\n\n const createBloodParticles = useMemo(\n () => (effect: BloodViscosityEffect) => {\n const count = getParticleCount(effect.viscosityType);\n const geometry = new THREE.BufferGeometry();\n const positions = new Float32Array(count * 3);\n const colors = new Float32Array(count * 3);\n const sizes = new Float32Array(count);\n const velocities: THREE.Vector3[] = [];\n const clinging: boolean[] = [];\n\n const tempDirection = ThreeObjectPools.vector3.acquire();\n const tempColor = ThreeObjectPools.color.acquire();\n const tempVelocity = ThreeObjectPools.vector3.acquire();\n const tempDeviation = ThreeObjectPools.vector3.acquire();\n\n try {\n tempDirection.set(...effect.direction).normalize();\n const spreadAngle = BLOOD_VISCOSITY_CONSTANTS.SPREAD_ANGLE[effect.viscosityType];\n const velocityRange = BLOOD_VISCOSITY_CONSTANTS.VELOCITY[effect.viscosityType];\n const sizeRange = BLOOD_VISCOSITY_CONSTANTS.SIZE[effect.viscosityType];\n\n tempColor.set(BLOOD_VISCOSITY_CONSTANTS.BLOOD_COLOR);\n\n for (let i = 0; i < count; i++) {\n positions[i * 3] = 0;\n positions[i * 3 + 1] = 0;\n positions[i * 3 + 2] = 0;\n\n colors[i * 3] = tempColor.r;\n colors[i * 3 + 1] = tempColor.g;\n colors[i * 3 + 2] = tempColor.b;\n\n const size =\n sizeRange.min +\n Math.random() * (sizeRange.max - sizeRange.min) *\n effect.intensity;\n sizes[i] = size;\n\n const speed =\n velocityRange.min +\n Math.random() * (velocityRange.max - velocityRange.min);\n\n const theta = (Math.random() - 0.5) * spreadAngle;\n const phi = Math.random() * Math.PI * 2;\n\n tempDeviation.set(\n Math.sin(theta) * Math.cos(phi),\n Math.sin(theta) * Math.sin(phi),\n Math.cos(theta)\n );\n\n tempVelocity.copy(tempDirection)\n .add(tempDeviation)\n .normalize()\n .multiplyScalar(speed);\n\n velocities.push(tempVelocity.clone());\n clinging.push(false);\n }\n } finally {\n ThreeObjectPools.vector3.release(tempDirection);\n ThreeObjectPools.color.release(tempColor);\n ThreeObjectPools.vector3.release(tempVelocity);\n ThreeObjectPools.vector3.release(tempDeviation);\n }\n\n geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));\n geometry.setAttribute('color', new THREE.BufferAttribute(colors, 3));\n geometry.setAttribute('size', new THREE.BufferAttribute(sizes, 1));\n\n const material = new THREE.PointsMaterial({\n size: 0.08,\n vertexColors: true,\n transparent: true,\n opacity: 0.9,\n blending: THREE.NormalBlending,\n depthWrite: false,\n sizeAttenuation: true,\n });\n\n const points = new THREE.Points(geometry, material);\n points.position.set(...effect.position);\n\n return { points, velocities, clinging };\n },\n [getParticleCount]\n );\n\n useEffect(() => {\n if (!enabled) return;\n\n setEffectInstances((prev) => {\n const updated = new Map(prev);\n\n effects.forEach((effect) => {\n if (!updated.has(effect.id)) {\n const { points, velocities, clinging } = createBloodParticles(effect);\n updated.set(effect.id, {\n particles: points,\n velocities,\n startTime: effect.startTime,\n effect,\n clinging,\n });\n }\n });\n\n const currentIds = new Set(effects.map((e) => e.id));\n Array.from(updated.keys()).forEach((id) => {\n if (!currentIds.has(id)) {\n const instance = updated.get(id);\n if (instance) {\n instance.particles.geometry.dispose();\n (instance.particles.material as THREE.Material).dispose();\n }\n updated.delete(id);\n }\n });\n\n return updated;\n });\n }, [effects, enabled, createBloodParticles]);\n\n useFrame((_state, delta) => {\n if (!enabled || effectInstances.size === 0) return;\n\n const clampedDelta = Math.min(delta, BLOOD_VISCOSITY_CONSTANTS.MAX_DELTA);\n const now = Date.now();\n const completedIds: string[] = [];\n\n effectInstances.forEach((instance, id) => {\n const elapsed = (now - instance.startTime) / 1000;\n\n if (elapsed >= BLOOD_VISCOSITY_CONSTANTS.TOTAL_LIFETIME) {\n completedIds.push(id);\n return;\n }\n\n const geometry = instance.particles.geometry;\n const positions = geometry.attributes.position.array as Float32Array;\n const count = positions.length / 3;\n\n for (let i = 0; i < count; i++) {\n const idx = i * 3;\n\n if (!instance.clinging[i]) {\n instance.velocities[i].y +=\n BLOOD_VISCOSITY_CONSTANTS.GRAVITY * clampedDelta;\n\n instance.velocities[i].multiplyScalar(\n BLOOD_VISCOSITY_CONSTANTS.AIR_RESISTANCE\n );\n\n positions[idx] += instance.velocities[i].x * clampedDelta;\n positions[idx + 1] += instance.velocities[i].y * clampedDelta;\n positions[idx + 2] += instance.velocities[i].z * clampedDelta;\n\n if (positions[idx + 1] <= BLOOD_VISCOSITY_CONSTANTS.GROUND_LEVEL) {\n positions[idx + 1] = BLOOD_VISCOSITY_CONSTANTS.GROUND_LEVEL;\n instance.velocities[i].multiplyScalar(\n BLOOD_VISCOSITY_CONSTANTS.CLING_DAMPING\n );\n instance.clinging[i] = true;\n }\n }\n }\n\n geometry.attributes.position.needsUpdate = true;\n\n if (elapsed >= BLOOD_VISCOSITY_CONSTANTS.ACTIVE_LIFETIME) {\n const fadeProgress =\n (elapsed - BLOOD_VISCOSITY_CONSTANTS.ACTIVE_LIFETIME) /\n BLOOD_VISCOSITY_CONSTANTS.CLING_LIFETIME;\n const material = instance.particles.material as THREE.PointsMaterial;\n material.opacity = 0.9 * (1.0 - fadeProgress);\n }\n });\n\n completedIds.forEach((id) => {\n onEffectComplete?.(id);\n });\n });\n\n return (\n <>\n {Array.from(effectInstances.values()).map((instance) => (\n <primitive key={instance.effect.id} object={instance.particles} />\n ))}\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;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MAAM,KAAK,gBAAgB,QAAQ,CAAC,CAAC,KAAK,aACzC,oBAAC,aAAD,EAAoC,QAAQ,SAAS,WAAa,EAAlD,SAAS,OAAO,GAAkC,CAClE,EACD,CAAA"}
1
+ {"version":3,"file":"BloodViscosity3D.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/effects/BloodViscosity3D.tsx"],"sourcesContent":["/**\n * BloodViscosity3D - Enhanced blood droplets with thicker physics for brutal combat realism\n *\n * Priority #5: Enhanced Blood Viscosity\n * - Thicker droplets with slower fall rate\n * - Variable splatter sizes (gouts vs mist)\n * - Cling/drip physics (stick to surfaces)\n * - Enhanced viscosity simulation\n *\n * PERFORMANCE OPTIMIZATION (Object Pooling):\n * - Reduced allocations from ~85+ per effect to ~4 pooled objects\n * - Pooling strategy:\n * 1. Temporary calculation objects (direction, color, velocity) use pool\n * 2. Owned objects (particle velocities) are cloned from pooled objects\n * 3. All pooled objects released after particle creation\n * - Estimated reduction: \n * - thin: 50 Color + 50 Vector3 = 100 allocations → 4 pooled objects\n * - medium: 80 Color + 80 Vector3 = 160 allocations → 4 pooled objects\n * - thick: 120 Color + 120 Vector3 = 240 allocations → 4 pooled objects\n * - gout: 200 Color + 200 Vector3 = 400 allocations → 4 pooled objects\n *\n * Korean martial arts context:\n * - 절단격 (Cutting strikes) - Thin blood mist\n * - 타격 (Impact strikes) - Medium blood splatter\n * - 관통격 (Penetrating strikes) - Thick blood droplets\n * - 깊은 상처 (Deep wounds) - Large blood gouts\n */\n\nimport React, { useEffect, useMemo } from 'react';\nimport { useFrame } from '@react-three/fiber';\nimport * as THREE from 'three';\nimport { ThreeObjectPools } from '../../../../../utils/threeObjectPool';\n\n/**\n * Viscosity types for blood splatter\n */\nexport type ViscosityType = 'thin' | 'medium' | 'thick' | 'gout';\n\n/**\n * Individual blood viscosity effect\n */\nexport interface BloodViscosityEffect {\n readonly id: string;\n readonly position: [number, number, number];\n readonly direction: [number, number, number];\n readonly viscosityType: ViscosityType;\n readonly intensity: number; // 0.0-1.0\n readonly startTime: number;\n}\n\n/**\n * Props for BloodViscosity3D component\n */\nexport interface BloodViscosity3DProps {\n readonly effects: readonly BloodViscosityEffect[];\n readonly enabled?: boolean;\n readonly isMobile?: boolean;\n readonly onEffectComplete?: (id: string) => void;\n}\n\nconst BLOOD_VISCOSITY_CONSTANTS = {\n GRAVITY: -9.8, // m/s²\n AIR_RESISTANCE: 0.94, // Thicker than arterial (0.97) or bone (0.96)\n \n PARTICLE_COUNT: {\n thin: 50, // Mist\n medium: 80, // Normal splatter\n thick: 120, // Heavy droplets\n gout: 200, // Deep wound large gouts\n },\n \n VELOCITY: {\n thin: { min: 2.0, max: 4.0 },\n medium: { min: 1.5, max: 3.0 },\n thick: { min: 1.0, max: 2.5 },\n gout: { min: 0.5, max: 2.0 },\n },\n \n SIZE: {\n thin: { min: 0.02, max: 0.04 },\n medium: { min: 0.04, max: 0.08 },\n thick: { min: 0.06, max: 0.12 },\n gout: { min: 0.10, max: 0.20 },\n },\n \n SPREAD_ANGLE: {\n thin: Math.PI / 3, // 60° wide spray\n medium: Math.PI / 4, // 45° normal\n thick: Math.PI / 6, // 30° narrow\n gout: Math.PI / 8, // 22.5° very narrow\n },\n \n ACTIVE_LIFETIME: 2.5, // Active falling time\n CLING_LIFETIME: 3.0, // Time stuck to ground\n TOTAL_LIFETIME: 5.5, // Total before cleanup\n \n GROUND_LEVEL: 0.1, // y-position for ground contact\n CLING_DAMPING: 0.3, // Velocity reduction on contact\n \n BLOOD_COLOR: 0x8b0000, // Dark red\n \n MAX_DELTA: 1 / 30,\n} as const;\n\n/**\n * BloodViscosity3D - Enhanced blood droplets with realistic thicker physics\n *\n * Features:\n * - Variable viscosity types (thin mist to thick gouts)\n * - Cling/drip physics when hitting ground\n * - Slower fall rates than arterial spray\n * - Larger droplet sizes\n * - Mobile optimization (50% particles)\n */\nexport const BloodViscosity3D: React.FC<BloodViscosity3DProps> = ({\n effects,\n enabled = true,\n isMobile = false,\n onEffectComplete,\n}) => {\n const [effectInstances, setEffectInstances] = React.useState<\n Map<\n string,\n {\n particles: THREE.Points;\n velocities: THREE.Vector3[];\n startTime: number;\n effect: BloodViscosityEffect;\n clinging: boolean[];\n }\n >\n >(new Map());\n\n const getParticleCount = useMemo(\n () => (viscosityType: ViscosityType) => {\n const baseCount = BLOOD_VISCOSITY_CONSTANTS.PARTICLE_COUNT[viscosityType];\n return isMobile ? Math.floor(baseCount * 0.5) : baseCount;\n },\n [isMobile]\n );\n\n const createBloodParticles = useMemo(\n () => (effect: BloodViscosityEffect) => {\n const count = getParticleCount(effect.viscosityType);\n const geometry = new THREE.BufferGeometry();\n const positions = new Float32Array(count * 3);\n const colors = new Float32Array(count * 3);\n const sizes = new Float32Array(count);\n const velocities: THREE.Vector3[] = [];\n const clinging: boolean[] = [];\n\n const tempDirection = ThreeObjectPools.vector3.acquire();\n const tempColor = ThreeObjectPools.color.acquire();\n const tempVelocity = ThreeObjectPools.vector3.acquire();\n const tempDeviation = ThreeObjectPools.vector3.acquire();\n\n try {\n tempDirection.set(...effect.direction).normalize();\n const spreadAngle = BLOOD_VISCOSITY_CONSTANTS.SPREAD_ANGLE[effect.viscosityType];\n const velocityRange = BLOOD_VISCOSITY_CONSTANTS.VELOCITY[effect.viscosityType];\n const sizeRange = BLOOD_VISCOSITY_CONSTANTS.SIZE[effect.viscosityType];\n\n tempColor.set(BLOOD_VISCOSITY_CONSTANTS.BLOOD_COLOR);\n\n for (let i = 0; i < count; i++) {\n positions[i * 3] = 0;\n positions[i * 3 + 1] = 0;\n positions[i * 3 + 2] = 0;\n\n colors[i * 3] = tempColor.r;\n colors[i * 3 + 1] = tempColor.g;\n colors[i * 3 + 2] = tempColor.b;\n\n const size =\n sizeRange.min +\n Math.random() * (sizeRange.max - sizeRange.min) *\n effect.intensity;\n sizes[i] = size;\n\n const speed =\n velocityRange.min +\n Math.random() * (velocityRange.max - velocityRange.min);\n\n const theta = (Math.random() - 0.5) * spreadAngle;\n const phi = Math.random() * Math.PI * 2;\n\n tempDeviation.set(\n Math.sin(theta) * Math.cos(phi),\n Math.sin(theta) * Math.sin(phi),\n Math.cos(theta)\n );\n\n tempVelocity.copy(tempDirection)\n .add(tempDeviation)\n .normalize()\n .multiplyScalar(speed);\n\n velocities.push(tempVelocity.clone());\n clinging.push(false);\n }\n } finally {\n ThreeObjectPools.vector3.release(tempDirection);\n ThreeObjectPools.color.release(tempColor);\n ThreeObjectPools.vector3.release(tempVelocity);\n ThreeObjectPools.vector3.release(tempDeviation);\n }\n\n geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));\n geometry.setAttribute('color', new THREE.BufferAttribute(colors, 3));\n geometry.setAttribute('size', new THREE.BufferAttribute(sizes, 1));\n\n const material = new THREE.PointsMaterial({\n size: 0.08,\n vertexColors: true,\n transparent: true,\n opacity: 0.9,\n blending: THREE.NormalBlending,\n depthWrite: false,\n sizeAttenuation: true,\n });\n\n const points = new THREE.Points(geometry, material);\n points.position.set(...effect.position);\n\n return { points, velocities, clinging };\n },\n [getParticleCount]\n );\n\n useEffect(() => {\n if (!enabled) return;\n\n setEffectInstances((prev) => {\n const updated = new Map(prev);\n\n effects.forEach((effect) => {\n if (!updated.has(effect.id)) {\n const { points, velocities, clinging } = createBloodParticles(effect);\n updated.set(effect.id, {\n particles: points,\n velocities,\n startTime: effect.startTime,\n effect,\n clinging,\n });\n }\n });\n\n const currentIds = new Set(effects.map((e) => e.id));\n Array.from(updated.keys()).forEach((id) => {\n if (!currentIds.has(id)) {\n const instance = updated.get(id);\n if (instance) {\n instance.particles.geometry.dispose();\n (instance.particles.material as THREE.Material).dispose();\n }\n updated.delete(id);\n }\n });\n\n return updated;\n });\n }, [effects, enabled, createBloodParticles]);\n\n useFrame((_state, delta) => {\n if (!enabled || effectInstances.size === 0) return;\n\n const clampedDelta = Math.min(delta, BLOOD_VISCOSITY_CONSTANTS.MAX_DELTA);\n const now = Date.now();\n const completedIds: string[] = [];\n\n effectInstances.forEach((instance, id) => {\n const elapsed = (now - instance.startTime) / 1000;\n\n if (elapsed >= BLOOD_VISCOSITY_CONSTANTS.TOTAL_LIFETIME) {\n completedIds.push(id);\n return;\n }\n\n const geometry = instance.particles.geometry;\n const positions = geometry.attributes.position.array as Float32Array;\n const count = positions.length / 3;\n\n for (let i = 0; i < count; i++) {\n const idx = i * 3;\n\n if (!instance.clinging[i]) {\n instance.velocities[i].y +=\n BLOOD_VISCOSITY_CONSTANTS.GRAVITY * clampedDelta;\n\n instance.velocities[i].multiplyScalar(\n BLOOD_VISCOSITY_CONSTANTS.AIR_RESISTANCE\n );\n\n positions[idx] += instance.velocities[i].x * clampedDelta;\n positions[idx + 1] += instance.velocities[i].y * clampedDelta;\n positions[idx + 2] += instance.velocities[i].z * clampedDelta;\n\n if (positions[idx + 1] <= BLOOD_VISCOSITY_CONSTANTS.GROUND_LEVEL) {\n positions[idx + 1] = BLOOD_VISCOSITY_CONSTANTS.GROUND_LEVEL;\n instance.velocities[i].multiplyScalar(\n BLOOD_VISCOSITY_CONSTANTS.CLING_DAMPING\n );\n instance.clinging[i] = true;\n }\n }\n }\n\n geometry.attributes.position.needsUpdate = true;\n\n if (elapsed >= BLOOD_VISCOSITY_CONSTANTS.ACTIVE_LIFETIME) {\n const fadeProgress =\n (elapsed - BLOOD_VISCOSITY_CONSTANTS.ACTIVE_LIFETIME) /\n BLOOD_VISCOSITY_CONSTANTS.CLING_LIFETIME;\n const material = instance.particles.material as THREE.PointsMaterial;\n material.opacity = 0.9 * (1.0 - fadeProgress);\n }\n });\n\n completedIds.forEach((id) => {\n onEffectComplete?.(id);\n });\n });\n\n return (\n <>\n {Array.from(effectInstances.values()).map((instance) => (\n <primitive key={instance.effect.id} object={instance.particles} />\n ))}\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,IAAM,4BAA4B;CAChC,SAAS;CACT,gBAAgB;CAEhB,gBAAgB;EACd,MAAM;EACN,QAAQ;EACR,OAAO;EACP,MAAM;CACR;CAEA,U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KAAK,aACzC,oBAAC,aAAD,EAAoC,QAAQ,SAAS,UAAY,GAAjD,SAAS,OAAO,EAAiC,CAClE,EACD,CAAA;AAEN"}
@@ -1 +1 @@
1
- {"version":3,"file":"CombatParticleEffects3D.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/effects/CombatParticleEffects3D.tsx"],"sourcesContent":["/**\n * CombatParticleEffects3D - Particle effects coordinator for combat\n * 전투 입자 효과 통합 관리\n *\n * Maps HitEffect events to advanced particle effects:\n * - BloodViscosity3D for blood physics on hits\n * - InternalDamage3D for organ damage visualization on vital point strikes\n * - ParticleAudio3D for synchronized combat audio\n *\n * @module components/effects\n * @category Combat Effects\n * @korean 전투입자효과\n */\n\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { HitEffect } from \"../../../../../systems\";\nimport { HitEffectType } from \"../../../../../systems/effects\";\nimport {\n BloodViscosity3D,\n type BloodViscosityEffect,\n type ViscosityType,\n} from \"./BloodViscosity3D\";\nimport {\n InternalDamage3D,\n type InternalDamageEffect,\n type OrganType,\n type PenetrationDepth,\n} from \"./InternalDamage3D\";\nimport {\n ParticleAudio3D,\n type ParticleAudioTrigger,\n type ParticleEffectType,\n} from \"./ParticleAudio3D\";\n\n/**\n * Props for CombatParticleEffects3D\n */\nexport interface CombatParticleEffects3DProps {\n /** Active hit effects from the combat state */\n readonly hitEffects: readonly HitEffect[];\n /** Whether effects are enabled */\n readonly enabled?: boolean;\n /** Mobile optimization flag */\n readonly isMobile?: boolean;\n}\n\n/**\n * Map HitEffectType → blood viscosity type\n * 타격 유형 → 혈액 점도 매핑\n */\nfunction getViscosityForHitType(type: HitEffectType): ViscosityType | null {\n switch (type) {\n case HitEffectType.HIT:\n return \"thin\";\n case HitEffectType.COUNTER:\n return \"medium\";\n case HitEffectType.CRITICAL_HIT:\n return \"thick\";\n case HitEffectType.VITAL_POINT_STRIKE:\n return \"gout\";\n default:\n return null;\n }\n}\n\n/**\n * Map HitEffectType → organ type based on strike position\n * 급소 유형 → 장기 매핑 (타격 위치 기반)\n */\nfunction getOrganForPosition(\n position: { x: number; y: number } | undefined,\n): OrganType {\n if (!position) return \"stomach\";\n const y = position.y;\n if (y > 1.4) return \"heart\"; // 심장 - upper chest\n if (y > 1.1) return \"stomach\"; // 명치 - solar plexus\n if (y > 0.8) return \"liver\"; // 간 - right side mid-torso\n if (y > 0.5) return \"spleen\"; // 비장 - left side mid-torso\n return \"kidney\"; // 신장 - lower back\n}\n\n/**\n * Map HitEffect intensity → penetration depth\n * 타격 강도 → 관통 깊이 매핑\n */\nfunction getPenetrationDepth(intensity: number): PenetrationDepth {\n if (intensity >= 1.5) return \"critical\";\n if (intensity >= 1.0) return \"deep\";\n if (intensity >= 0.5) return \"shallow\";\n return \"surface\";\n}\n\n/**\n * Map HitEffectType → audio effect type\n * 타격 유형 → 오디오 효과 매핑\n */\nfunction getAudioEffectType(type: HitEffectType): ParticleEffectType | null {\n switch (type) {\n case HitEffectType.HIT:\n case HitEffectType.COUNTER:\n return \"viscosity\";\n case HitEffectType.CRITICAL_HIT:\n return \"bone\";\n case HitEffectType.VITAL_POINT_STRIKE:\n return \"organ\";\n case HitEffectType.BLOCK:\n case HitEffectType.PARRY:\n return \"bone\";\n default:\n return null;\n }\n}\n\n/** Maximum concurrent effects to prevent performance issues */\nconst MAX_BLOOD_EFFECTS = 8;\nconst MAX_ORGAN_EFFECTS = 4;\n\n/**\n * Simple deterministic hash from string → [0, 1)\n * Used for deterministic direction calculations inside useMemo\n */\nfunction hashToFloat(str: string): number {\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n hash = (hash * 31 + str.charCodeAt(i)) | 0;\n }\n return Math.abs(hash % 10000) / 10000;\n}\n\n/**\n * CombatParticleEffects3D - Coordinates particle effects for combat\n *\n * Converts HitEffect events into:\n * - Blood viscosity particles (thin/medium/thick/gout based on strike type)\n * - Internal organ damage pulses (for vital point strikes)\n * - Synchronized audio triggers\n *\n * @korean 전투 입자 효과 통합 (타격→혈액물리+장기손상+오디오)\n */\nexport const CombatParticleEffects3D: React.FC<\n CombatParticleEffects3DProps\n> = ({ hitEffects, enabled = true, isMobile = false }) => {\n const processedIds = useRef<Set<string>>(new Set());\n\n const [bloodEffects, setBloodEffects] = useState<BloodViscosityEffect[]>([]);\n const [organEffects, setOrganEffects] = useState<InternalDamageEffect[]>([]);\n const [audioTriggers, setAudioTriggers] = useState<ParticleAudioTrigger[]>(\n [],\n );\n\n useEffect(() => {\n const newBlood: BloodViscosityEffect[] = [];\n const newOrgan: InternalDamageEffect[] = [];\n const newAudio: ParticleAudioTrigger[] = [];\n\n for (const hit of hitEffects) {\n if (processedIds.current.has(hit.id)) continue;\n processedIds.current.add(hit.id);\n\n const pos: [number, number, number] = [\n hit.position?.x ?? 0,\n hit.position?.y ?? 1.0,\n 0,\n ];\n\n const viscosity = getViscosityForHitType(hit.type);\n if (viscosity) {\n const angle = hashToFloat(hit.id) * Math.PI * 2;\n const ySpread = 0.3 + hashToFloat(hit.id + \"_y\") * 0.4;\n const dir: [number, number, number] = [\n Math.cos(angle) * 0.5,\n ySpread,\n Math.sin(angle) * 0.5,\n ];\n\n newBlood.push({\n id: `blood_${hit.id}`,\n position: pos,\n direction: dir,\n viscosityType: viscosity,\n intensity: Math.min(1, hit.intensity),\n startTime: hit.startTime,\n });\n }\n\n if (hit.type === HitEffectType.VITAL_POINT_STRIKE) {\n newOrgan.push({\n id: `organ_${hit.id}`,\n position: pos,\n organType: getOrganForPosition(hit.position),\n penetrationDepth: getPenetrationDepth(hit.intensity),\n startTime: hit.startTime,\n });\n }\n\n const audioType = getAudioEffectType(hit.type);\n if (audioType) {\n newAudio.push({\n effectType: audioType,\n intensity: Math.min(1, hit.intensity),\n timestamp: hit.timestamp,\n });\n }\n }\n\n if (newBlood.length > 0) {\n setBloodEffects((prev) =>\n [...prev, ...newBlood].slice(-MAX_BLOOD_EFFECTS),\n );\n }\n if (newOrgan.length > 0) {\n setOrganEffects((prev) =>\n [...prev, ...newOrgan].slice(-MAX_ORGAN_EFFECTS),\n );\n }\n if (newAudio.length > 0) {\n setAudioTriggers((prev) => [...prev, ...newAudio]);\n }\n\n if (processedIds.current.size > 500) {\n const arr = Array.from(processedIds.current);\n processedIds.current = new Set(arr.slice(-250));\n }\n }, [hitEffects]);\n\n const handleBloodComplete = useCallback((id: string) => {\n setBloodEffects((prev) => prev.filter((e) => e.id !== id));\n }, []);\n\n const handleOrganComplete = useCallback((id: string) => {\n setOrganEffects((prev) => prev.filter((e) => e.id !== id));\n }, []);\n\n const handleAudioProcessed = useCallback((timestamp: number) => {\n setAudioTriggers((prev) => prev.filter((t) => t.timestamp !== timestamp));\n }, []);\n\n if (!enabled) return null;\n\n return (\n <>\n {/* Blood Viscosity Particles - 혈액 점도 입자 */}\n <BloodViscosity3D\n effects={bloodEffects}\n enabled={enabled}\n isMobile={isMobile}\n onEffectComplete={handleBloodComplete}\n />\n\n {/* Internal Organ Damage Pulses - 장기 손상 시각화 */}\n <InternalDamage3D\n effects={organEffects}\n enabled={enabled}\n isMobile={isMobile}\n onEffectComplete={handleOrganComplete}\n />\n\n {/* Audio Coordination - 입자 효과 오디오 동기화 */}\n <ParticleAudio3D\n triggers={audioTriggers}\n enabled={enabled}\n onTriggerProcessed={handleAudioProcessed}\n />\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkDA,SAAS,uBAAuB,MAA2C;CACzE,QAAQ,MAAR;EACE,KAAK,cAAc,KACjB,OAAO;EACT,KAAK,cAAc,SACjB,OAAO;EACT,KAAK,cAAc,cACjB,OAAO;EACT,KAAK,cAAc,oBACjB,OAAO;EACT,SACE,OAAO;;;;;;;AAQb,SAAS,oBACP,UACW;CACX,IAAI,CAAC,UAAU,OAAO;CACtB,MAAM,IAAI,SAAS;CACnB,IAAI,IAAI,KAAK,OAAO;CACpB,IAAI,IAAI,KAAK,OAAO;CACpB,IAAI,IAAI,IAAK,OAAO;CACpB,IAAI,IAAI,IAAK,OAAO;CACpB,OAAO;;;;;;AAO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N,MAAM,sBAAsB,aAAa,OAAe;EACtD,iBAAiB,SAAS,KAAK,QAAQ,MAAM,EAAE,OAAO,GAAG,CAAC;IACzD,EAAE,CAAC;CAEN,MAAM,uBAAuB,aAAa,cAAsB;EAC9D,kBAAkB,SAAS,KAAK,QAAQ,MAAM,EAAE,cAAc,UAAU,CAAC;IACxE,EAAE,CAAC;CAEN,IAAI,CAAC,SAAS,OAAO;CAErB,OACE,qBAAA,UAAA,EAAA,UAAA;EAEE,oBAAC,kBAAD;GACE,SAAS;GACA;GACC;GACV,kBAAkB;GAClB,CAAA;EAGF,oBAAC,kBAAD;GACE,SAAS;GACA;GACC;GACV,kBAAkB;GAClB,CAAA;EAGF,oBAAC,iBAAD;GACE,UAAU;GACD;GACT,oBAAoB;GACpB,CAAA;EACD,EAAA,CAAA"}
1
+ {"version":3,"file":"CombatParticleEffects3D.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/effects/CombatParticleEffects3D.tsx"],"sourcesContent":["/**\n * CombatParticleEffects3D - Particle effects coordinator for combat\n * 전투 입자 효과 통합 관리\n *\n * Maps HitEffect events to advanced particle effects:\n * - BloodViscosity3D for blood physics on hits\n * - InternalDamage3D for organ damage visualization on vital point strikes\n * - ParticleAudio3D for synchronized combat audio\n *\n * @module components/effects\n * @category Combat Effects\n * @korean 전투입자효과\n */\n\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { HitEffect } from \"../../../../../systems\";\nimport { HitEffectType } from \"../../../../../systems/effects\";\nimport {\n BloodViscosity3D,\n type BloodViscosityEffect,\n type ViscosityType,\n} from \"./BloodViscosity3D\";\nimport {\n InternalDamage3D,\n type InternalDamageEffect,\n type OrganType,\n type PenetrationDepth,\n} from \"./InternalDamage3D\";\nimport {\n ParticleAudio3D,\n type ParticleAudioTrigger,\n type ParticleEffectType,\n} from \"./ParticleAudio3D\";\n\n/**\n * Props for CombatParticleEffects3D\n */\nexport interface CombatParticleEffects3DProps {\n /** Active hit effects from the combat state */\n readonly hitEffects: readonly HitEffect[];\n /** Whether effects are enabled */\n readonly enabled?: boolean;\n /** Mobile optimization flag */\n readonly isMobile?: boolean;\n}\n\n/**\n * Map HitEffectType → blood viscosity type\n * 타격 유형 → 혈액 점도 매핑\n */\nfunction getViscosityForHitType(type: HitEffectType): ViscosityType | null {\n switch (type) {\n case HitEffectType.HIT:\n return \"thin\";\n case HitEffectType.COUNTER:\n return \"medium\";\n case HitEffectType.CRITICAL_HIT:\n return \"thick\";\n case HitEffectType.VITAL_POINT_STRIKE:\n return \"gout\";\n default:\n return null;\n }\n}\n\n/**\n * Map HitEffectType → organ type based on strike position\n * 급소 유형 → 장기 매핑 (타격 위치 기반)\n */\nfunction getOrganForPosition(\n position: { x: number; y: number } | undefined,\n): OrganType {\n if (!position) return \"stomach\";\n const y = position.y;\n if (y > 1.4) return \"heart\"; // 심장 - upper chest\n if (y > 1.1) return \"stomach\"; // 명치 - solar plexus\n if (y > 0.8) return \"liver\"; // 간 - right side mid-torso\n if (y > 0.5) return \"spleen\"; // 비장 - left side mid-torso\n return \"kidney\"; // 신장 - lower back\n}\n\n/**\n * Map HitEffect intensity → penetration depth\n * 타격 강도 → 관통 깊이 매핑\n */\nfunction getPenetrationDepth(intensity: number): PenetrationDepth {\n if (intensity >= 1.5) return \"critical\";\n if (intensity >= 1.0) return \"deep\";\n if (intensity >= 0.5) return \"shallow\";\n return \"surface\";\n}\n\n/**\n * Map HitEffectType → audio effect type\n * 타격 유형 → 오디오 효과 매핑\n */\nfunction getAudioEffectType(type: HitEffectType): ParticleEffectType | null {\n switch (type) {\n case HitEffectType.HIT:\n case HitEffectType.COUNTER:\n return \"viscosity\";\n case HitEffectType.CRITICAL_HIT:\n return \"bone\";\n case HitEffectType.VITAL_POINT_STRIKE:\n return \"organ\";\n case HitEffectType.BLOCK:\n case HitEffectType.PARRY:\n return \"bone\";\n default:\n return null;\n }\n}\n\n/** Maximum concurrent effects to prevent performance issues */\nconst MAX_BLOOD_EFFECTS = 8;\nconst MAX_ORGAN_EFFECTS = 4;\n\n/**\n * Simple deterministic hash from string → [0, 1)\n * Used for deterministic direction calculations inside useMemo\n */\nfunction hashToFloat(str: string): number {\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n hash = (hash * 31 + str.charCodeAt(i)) | 0;\n }\n return Math.abs(hash % 10000) / 10000;\n}\n\n/**\n * CombatParticleEffects3D - Coordinates particle effects for combat\n *\n * Converts HitEffect events into:\n * - Blood viscosity particles (thin/medium/thick/gout based on strike type)\n * - Internal organ damage pulses (for vital point strikes)\n * - Synchronized audio triggers\n *\n * @korean 전투 입자 효과 통합 (타격→혈액물리+장기손상+오디오)\n */\nexport const CombatParticleEffects3D: React.FC<\n CombatParticleEffects3DProps\n> = ({ hitEffects, enabled = true, isMobile = false }) => {\n const processedIds = useRef<Set<string>>(new Set());\n\n const [bloodEffects, setBloodEffects] = useState<BloodViscosityEffect[]>([]);\n const [organEffects, setOrganEffects] = useState<InternalDamageEffect[]>([]);\n const [audioTriggers, setAudioTriggers] = useState<ParticleAudioTrigger[]>(\n [],\n );\n\n useEffect(() => {\n const newBlood: BloodViscosityEffect[] = [];\n const newOrgan: InternalDamageEffect[] = [];\n const newAudio: ParticleAudioTrigger[] = [];\n\n for (const hit of hitEffects) {\n if (processedIds.current.has(hit.id)) continue;\n processedIds.current.add(hit.id);\n\n const pos: [number, number, number] = [\n hit.position?.x ?? 0,\n hit.position?.y ?? 1.0,\n 0,\n ];\n\n const viscosity = getViscosityForHitType(hit.type);\n if (viscosity) {\n const angle = hashToFloat(hit.id) * Math.PI * 2;\n const ySpread = 0.3 + hashToFloat(hit.id + \"_y\") * 0.4;\n const dir: [number, number, number] = [\n Math.cos(angle) * 0.5,\n ySpread,\n Math.sin(angle) * 0.5,\n ];\n\n newBlood.push({\n id: `blood_${hit.id}`,\n position: pos,\n direction: dir,\n viscosityType: viscosity,\n intensity: Math.min(1, hit.intensity),\n startTime: hit.startTime,\n });\n }\n\n if (hit.type === HitEffectType.VITAL_POINT_STRIKE) {\n newOrgan.push({\n id: `organ_${hit.id}`,\n position: pos,\n organType: getOrganForPosition(hit.position),\n penetrationDepth: getPenetrationDepth(hit.intensity),\n startTime: hit.startTime,\n });\n }\n\n const audioType = getAudioEffectType(hit.type);\n if (audioType) {\n newAudio.push({\n effectType: audioType,\n intensity: Math.min(1, hit.intensity),\n timestamp: hit.timestamp,\n });\n }\n }\n\n if (newBlood.length > 0) {\n setBloodEffects((prev) =>\n [...prev, ...newBlood].slice(-MAX_BLOOD_EFFECTS),\n );\n }\n if (newOrgan.length > 0) {\n setOrganEffects((prev) =>\n [...prev, ...newOrgan].slice(-MAX_ORGAN_EFFECTS),\n );\n }\n if (newAudio.length > 0) {\n setAudioTriggers((prev) => [...prev, ...newAudio]);\n }\n\n if (processedIds.current.size > 500) {\n const arr = Array.from(processedIds.current);\n processedIds.current = new Set(arr.slice(-250));\n }\n }, [hitEffects]);\n\n const handleBloodComplete = useCallback((id: string) => {\n setBloodEffects((prev) => prev.filter((e) => e.id !== id));\n }, []);\n\n const handleOrganComplete = useCallback((id: string) => {\n setOrganEffects((prev) => prev.filter((e) => e.id !== id));\n }, []);\n\n const handleAudioProcessed = useCallback((timestamp: number) => {\n setAudioTriggers((prev) => prev.filter((t) => t.timestamp !== timestamp));\n }, []);\n\n if (!enabled) return null;\n\n return (\n <>\n {/* Blood Viscosity Particles - 혈액 점도 입자 */}\n <BloodViscosity3D\n effects={bloodEffects}\n enabled={enabled}\n isMobile={isMobile}\n onEffectComplete={handleBloodComplete}\n />\n\n {/* Internal Organ Damage Pulses - 장기 손상 시각화 */}\n <InternalDamage3D\n effects={organEffects}\n enabled={enabled}\n isMobile={isMobile}\n onEffectComplete={handleOrganComplete}\n />\n\n {/* Audio Coordination - 입자 효과 오디오 동기화 */}\n <ParticleAudio3D\n triggers={audioTriggers}\n enabled={enabled}\n onTriggerProcessed={handleAudioProcessed}\n />\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkDA,SAAS,uB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,CAAC,GAAG,MAAM,GAAG,QAAQ,EAAE,MAAM,CAAC,iBAAiB,CACjD;EAEF,IAAI,SAAS,SAAS,GACpB,kBAAkB,SAAS,CAAC,GAAG,MAAM,GAAG,QAAQ,CAAC;EAGnD,IAAI,aAAa,QAAQ,OAAO,KAAK;GACnC,MAAM,MAAM,MAAM,KAAK,aAAa,OAAO;GAC3C,aAAa,UAAU,IAAI,IAAI,IAAI,MAAM,IAAI,CAAC;EAChD;CACF,GAAG,CAAC,UAAU,CAAC;CAEf,MAAM,sBAAsB,aAAa,OAAe;EACtD,iBAAiB,SAAS,KAAK,QAAQ,MAAM,EAAE,OAAO,EAAE,CAAC;CAC3D,GAAG,CAAC,CAAC;CAEL,MAAM,sBAAsB,aAAa,OAAe;EACtD,iBAAiB,SAAS,KAAK,QAAQ,MAAM,EAAE,OAAO,EAAE,CAAC;CAC3D,GAAG,CAAC,CAAC;CAEL,MAAM,uBAAuB,aAAa,cAAsB;EAC9D,kBAAkB,SAAS,KAAK,QAAQ,MAAM,EAAE,cAAc,SAAS,CAAC;CAC1E,GAAG,CAAC,CAAC;CAEL,IAAI,CAAC,SAAS,OAAO;CAErB,OACE,qBAAA,UAAA,EAAA,UAAA;EAEE,oBAAC,kBAAD;GACE,SAAS;GACA;GACC;GACV,kBAAkB;EACnB,CAAA;EAGD,oBAAC,kBAAD;GACE,SAAS;GACA;GACC;GACV,kBAAkB;EACnB,CAAA;EAGD,oBAAC,iBAAD;GACE,UAAU;GACD;GACT,oBAAoB;EACrB,CAAA;CACD,EAAA,CAAA;AAEN"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConsciousnessBlur.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/effects/ConsciousnessBlur.tsx"],"sourcesContent":["/**\n * ConsciousnessBlur Component - Visual effect for consciousness impairment\n *\n * Applies a blur effect to the screen that intensifies as consciousness decreases.\n * Uses CSS backdrop-filter for performance-efficient blur rendering.\n *\n * NOTE: This component is rendered OUTSIDE the Canvas as part of the HTML overlay.\n * It does NOT use Html from drei - it's a standard React component.\n *\n * @module components/combat/ConsciousnessBlur\n * @category Combat UI\n * @korean 의식흐림효과\n */\n\nimport React, { useMemo } from \"react\";\n\nexport interface ConsciousnessBlurProps {\n /**\n * Current consciousness level (0-100)\n * 100 = fully conscious, 0 = unconscious\n * @korean 의식수준\n */\n readonly consciousness: number;\n\n /**\n * Mobile responsive mode (reduced blur strength)\n * @korean 모바일여부\n */\n readonly isMobile: boolean;\n\n /**\n * Multiplier applied to the effect's maximum blur + darkening (0.0-1.0).\n *\n * Use this to soften the fullscreen effect when the 3D arena is already\n * visually compressed (e.g. portrait mobile). Default is `1.0`.\n *\n * @korean 효과강도배수\n */\n readonly intensityScale?: number;\n}\n\n/**\n * ConsciousnessBlur - Screen blur effect based on consciousness level\n *\n * Renders a fullscreen overlay with blur effect that intensifies as\n * consciousness decreases. Only visible when consciousness is 90 or below.\n * Optimized for 60fps with CSS backdrop-filter.\n * \n * Accessibility behavior:\n * - Purely decorative visual effect\n * - Marked with aria-hidden=\"true\" and excluded from the accessibility tree\n * - Does not announce consciousness level to screen readers\n * (use a separate, dedicated announcement channel if needed)\n *\n * @example\n * ```tsx\n * <ConsciousnessBlur consciousness={45} isMobile={false} />\n * // No render if consciousness > 90\n * <ConsciousnessBlur consciousness={95} isMobile={false} />\n * ```\n */\nexport const ConsciousnessBlur: React.FC<ConsciousnessBlurProps> = ({\n consciousness,\n isMobile,\n intensityScale = 1,\n}) => {\n const blurStyle = useMemo(() => {\n const clampedConsciousness = Math.max(0, Math.min(100, consciousness));\n\n const safeScale = Math.max(0, Math.min(1, intensityScale));\n\n const maxBlur = (isMobile ? 8 : 12) * safeScale;\n const blurAmount = Math.round(\n ((100 - clampedConsciousness) / 100) * maxBlur\n );\n\n const opacity =\n Math.pow((100 - clampedConsciousness) / 100, 2) * 0.3 * safeScale;\n\n if (clampedConsciousness > 90) {\n return null;\n }\n\n return {\n position: \"fixed\" as const,\n inset: 0,\n pointerEvents: \"none\" as const,\n backdropFilter: `blur(${blurAmount}px)`,\n WebkitBackdropFilter: `blur(${blurAmount}px)`, // Safari support\n backgroundColor: `rgba(0, 0, 0, ${opacity})`,\n transition:\n \"backdrop-filter 0.5s ease-out, background-color 0.5s ease-out\",\n zIndex: 60, // Above game content but below HUD\n };\n }, [consciousness, isMobile, intensityScale]);\n\n if (consciousness > 90 || !blurStyle) {\n return null;\n }\n\n return (\n <div\n data-testid=\"consciousness-blur\"\n style={blurStyle}\n aria-hidden=\"true\"\n />\n );\n};\n\nConsciousnessBlur.displayName = \"ConsciousnessBlur\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,IAAa,qBAAuD,EAClE,eACA,UACA,iBAAiB,QACb;CACJ,MAAM,YAAY,cAAc;EAC9B,MAAM,uBAAuB,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,cAAc,CAAC;EAEtE,MAAM,YAAY,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,eAAe,CAAC;EAE1D,MAAM,WAAW,WAAW,IAAI,MAAM;EACtC,MAAM,aAAa,KAAK,OACpB,MAAM,wBAAwB,MAAO,QACxC;EAED,MAAM,UACJ,KAAK,KAAK,MAAM,wBAAwB,KAAK,EAAE,GAAG,KAAM;EAE1D,IAAI,uBAAuB,IACzB,OAAO;EAGT,OAAO;GACL,UAAU;GACV,OAAO;GACP,eAAe;GACf,gBAAgB,QAAQ,WAAW;GACnC,sBAAsB,QAAQ,WAAW;GACzC,iBAAiB,iBAAiB,QAAQ;GAC1C,YACE;GACF,QAAQ;GACT;IACA;EAAC;EAAe;EAAU;EAAe,CAAC;CAE7C,IAAI,gBAAgB,MAAM,CAAC,WACzB,OAAO;CAGT,OACE,oBAAC,OAAD;EACE,eAAY;EACZ,OAAO;EACP,eAAY;EACZ,CAAA;;AAIN,kBAAkB,cAAc"}
1
+ {"version":3,"file":"ConsciousnessBlur.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/effects/ConsciousnessBlur.tsx"],"sourcesContent":["/**\n * ConsciousnessBlur Component - Visual effect for consciousness impairment\n *\n * Applies a blur effect to the screen that intensifies as consciousness decreases.\n * Uses CSS backdrop-filter for performance-efficient blur rendering.\n *\n * NOTE: This component is rendered OUTSIDE the Canvas as part of the HTML overlay.\n * It does NOT use Html from drei - it's a standard React component.\n *\n * @module components/combat/ConsciousnessBlur\n * @category Combat UI\n * @korean 의식흐림효과\n */\n\nimport React, { useMemo } from \"react\";\n\nexport interface ConsciousnessBlurProps {\n /**\n * Current consciousness level (0-100)\n * 100 = fully conscious, 0 = unconscious\n * @korean 의식수준\n */\n readonly consciousness: number;\n\n /**\n * Mobile responsive mode (reduced blur strength)\n * @korean 모바일여부\n */\n readonly isMobile: boolean;\n\n /**\n * Multiplier applied to the effect's maximum blur + darkening (0.0-1.0).\n *\n * Use this to soften the fullscreen effect when the 3D arena is already\n * visually compressed (e.g. portrait mobile). Default is `1.0`.\n *\n * @korean 효과강도배수\n */\n readonly intensityScale?: number;\n}\n\n/**\n * ConsciousnessBlur - Screen blur effect based on consciousness level\n *\n * Renders a fullscreen overlay with blur effect that intensifies as\n * consciousness decreases. Only visible when consciousness is 90 or below.\n * Optimized for 60fps with CSS backdrop-filter.\n * \n * Accessibility behavior:\n * - Purely decorative visual effect\n * - Marked with aria-hidden=\"true\" and excluded from the accessibility tree\n * - Does not announce consciousness level to screen readers\n * (use a separate, dedicated announcement channel if needed)\n *\n * @example\n * ```tsx\n * <ConsciousnessBlur consciousness={45} isMobile={false} />\n * // No render if consciousness > 90\n * <ConsciousnessBlur consciousness={95} isMobile={false} />\n * ```\n */\nexport const ConsciousnessBlur: React.FC<ConsciousnessBlurProps> = ({\n consciousness,\n isMobile,\n intensityScale = 1,\n}) => {\n const blurStyle = useMemo(() => {\n const clampedConsciousness = Math.max(0, Math.min(100, consciousness));\n\n const safeScale = Math.max(0, Math.min(1, intensityScale));\n\n const maxBlur = (isMobile ? 8 : 12) * safeScale;\n const blurAmount = Math.round(\n ((100 - clampedConsciousness) / 100) * maxBlur\n );\n\n const opacity =\n Math.pow((100 - clampedConsciousness) / 100, 2) * 0.3 * safeScale;\n\n if (clampedConsciousness > 90) {\n return null;\n }\n\n return {\n position: \"fixed\" as const,\n inset: 0,\n pointerEvents: \"none\" as const,\n backdropFilter: `blur(${blurAmount}px)`,\n WebkitBackdropFilter: `blur(${blurAmount}px)`, // Safari support\n backgroundColor: `rgba(0, 0, 0, ${opacity})`,\n transition:\n \"backdrop-filter 0.5s ease-out, background-color 0.5s ease-out\",\n zIndex: 60, // Above game content but below HUD\n };\n }, [consciousness, isMobile, intensityScale]);\n\n if (consciousness > 90 || !blurStyle) {\n return null;\n }\n\n return (\n <div\n data-testid=\"consciousness-blur\"\n style={blurStyle}\n aria-hidden=\"true\"\n />\n );\n};\n\nConsciousnessBlur.displayName = \"ConsciousnessBlur\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,IAAa,qBAAuD,EAClE,eACA,UACA,iBAAiB,QACb;CACJ,MAAM,YAAY,cAAc;EAC9B,MAAM,uBAAuB,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,aAAa,CAAC;EAErE,MAAM,YAAY,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,cAAc,CAAC;EAEzD,MAAM,WAAW,WAAW,IAAI,MAAM;EACtC,MAAM,aAAa,KAAK,OACpB,MAAM,wBAAwB,MAAO,OACzC;EAEA,MAAM,UACJ,KAAK,KAAK,MAAM,wBAAwB,KAAK,CAAC,IAAI,KAAM;EAE1D,IAAI,uBAAuB,IACzB,OAAO;EAGT,OAAO;GACL,UAAU;GACV,OAAO;GACP,eAAe;GACf,gBAAgB,QAAQ,WAAW;GACnC,sBAAsB,QAAQ,WAAW;GACzC,iBAAiB,iBAAiB,QAAQ;GAC1C,YACE;GACF,QAAQ;EACV;CACF,GAAG;EAAC;EAAe;EAAU;CAAc,CAAC;CAE5C,IAAI,gBAAgB,MAAM,CAAC,WACzB,OAAO;CAGT,OACE,oBAAC,OAAD;EACE,eAAY;EACZ,OAAO;EACP,eAAY;CACb,CAAA;AAEL;AAEA,kBAAkB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"InternalDamage3D.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/effects/InternalDamage3D.tsx"],"sourcesContent":["/**\n * InternalDamage3D - Deep red organ pulses for Korean martial arts organ strikes\n *\n * Priority #4: Internal Damage Visualization\n * - Deep red organ pulses (liver, kidney, spleen, stomach, heart)\n * - Tissue deformation ripples\n * - Penetration depth visualization\n * - Critical organ damage feedback\n *\n * PERFORMANCE OPTIMIZATION (Object Pooling):\n * - Reduced allocations from ~120+ per effect to 2 pooled objects\n * - Pooling strategy:\n * 1. Temporary Color objects for particle initialization use pool\n * 2. Colors are copied to Float32Array (no ownership needed)\n * 3. All pooled objects released after particle system creation\n * - Estimated reduction:\n * - Pulse particles: 60 Color allocations → 1 pooled object\n * - Ripple particles: 30 Color allocations → 1 pooled object\n * - Total: ~90 Color allocations per effect → 2 pooled objects\n *\n * Korean martial arts context (내장 공격 - Internal organ strikes):\n * - 간격 (Liver strike) - Right side body blow\n * - 신장격 (Kidney strike) - Lower back strike\n * - 비장격 (Spleen strike) - Left side body blow\n * - 명치격 (Solar plexus) - Stomach strike\n * - 심장격 (Heart strike) - Chest strike (critical)\n */\n\nimport React, { useEffect, useMemo, useRef } from 'react';\nimport { useFrame } from '@react-three/fiber';\nimport * as THREE from 'three';\nimport { ThreeObjectPools } from '../../../../../utils/threeObjectPool';\n\n/**\n * Organ types for Korean martial arts internal strikes\n */\nexport type OrganType = 'liver' | 'kidney' | 'spleen' | 'stomach' | 'heart';\n\n/**\n * Penetration depth levels for organ damage\n */\nexport type PenetrationDepth = 'surface' | 'shallow' | 'deep' | 'critical';\n\n/**\n * Individual internal damage effect\n */\nexport interface InternalDamageEffect {\n readonly id: string;\n readonly position: [number, number, number];\n readonly organType: OrganType;\n readonly penetrationDepth: PenetrationDepth;\n readonly startTime: number;\n}\n\n/**\n * Props for InternalDamage3D component\n */\nexport interface InternalDamage3DProps {\n readonly effects: readonly InternalDamageEffect[];\n readonly enabled?: boolean;\n readonly isMobile?: boolean;\n readonly onEffectComplete?: (id: string) => void;\n}\n\nconst INTERNAL_DAMAGE_CONSTANTS = {\n PULSE_SPEED: 2.5, // m/s expansion rate\n \n PULSE_LIFETIME: 1.5, // seconds for pulse to complete\n RIPPLE_LIFETIME: 0.8, // seconds for tissue ripple\n \n MAX_RADIUS: {\n surface: 0.4,\n shallow: 0.7,\n deep: 1.0,\n critical: 1.2,\n },\n \n INTENSITY: {\n surface: 0.5,\n shallow: 0.8,\n deep: 1.2,\n critical: 1.5,\n },\n \n PULSE_PARTICLES: 60,\n RIPPLE_PARTICLES: 30,\n \n ORGAN_COLOR: 0x8b0000, // Dark red for organs\n RIPPLE_COLOR: 0xdc143c, // Crimson for tissue ripples\n \n EMISSIVE_INTENSITY: 0.8,\n} as const;\n\n/**\n * InternalDamage3D - Visualizes internal organ damage with deep red pulses\n *\n * Features:\n * - Expanding sphere pulses from organ impacts\n * - Tissue deformation ripples\n * - Penetration depth-based sizing\n * - Korean martial arts organ strike feedback\n * - Mobile optimization (50% particles)\n */\nexport const InternalDamage3D: React.FC<InternalDamage3DProps> = ({\n effects,\n enabled = true,\n isMobile = false,\n onEffectComplete,\n}) => {\n const [effectInstances, setEffectInstances] = React.useState<\n Map<\n string,\n {\n pulseParticles: THREE.Points;\n rippleParticles: THREE.Points;\n startTime: number;\n effect: InternalDamageEffect;\n }\n >\n >(new Map());\n\n const particleCounts = useMemo(() => {\n const pulseCount = isMobile\n ? Math.floor(INTERNAL_DAMAGE_CONSTANTS.PULSE_PARTICLES * 0.5)\n : INTERNAL_DAMAGE_CONSTANTS.PULSE_PARTICLES;\n const rippleCount = isMobile\n ? Math.floor(INTERNAL_DAMAGE_CONSTANTS.RIPPLE_PARTICLES * 0.5)\n : INTERNAL_DAMAGE_CONSTANTS.RIPPLE_PARTICLES;\n return { pulseCount, rippleCount };\n }, [isMobile]);\n\n const createPulseParticles = useMemo(\n () => (effect: InternalDamageEffect) => {\n const { pulseCount } = particleCounts;\n const geometry = new THREE.BufferGeometry();\n const positions = new Float32Array(pulseCount * 3);\n const colors = new Float32Array(pulseCount * 3);\n const sizes = new Float32Array(pulseCount);\n\n const tempColor = ThreeObjectPools.color.acquire();\n\n try {\n tempColor.set(INTERNAL_DAMAGE_CONSTANTS.ORGAN_COLOR);\n\n for (let i = 0; i < pulseCount; i++) {\n\n positions[i * 3] = 0;\n positions[i * 3 + 1] = 0;\n positions[i * 3 + 2] = 0;\n\n colors[i * 3] = tempColor.r;\n colors[i * 3 + 1] = tempColor.g;\n colors[i * 3 + 2] = tempColor.b;\n\n const baseSize = 0.03;\n const depthMultiplier =\n INTERNAL_DAMAGE_CONSTANTS.INTENSITY[effect.penetrationDepth];\n sizes[i] = baseSize * depthMultiplier;\n }\n } finally {\n ThreeObjectPools.color.release(tempColor);\n }\n\n geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));\n geometry.setAttribute('color', new THREE.BufferAttribute(colors, 3));\n geometry.setAttribute('size', new THREE.BufferAttribute(sizes, 1));\n\n const material = new THREE.PointsMaterial({\n size: 0.05,\n vertexColors: true,\n transparent: true,\n opacity: 1.0,\n blending: THREE.AdditiveBlending,\n depthWrite: false,\n sizeAttenuation: true,\n });\n\n const points = new THREE.Points(geometry, material);\n points.position.set(...effect.position);\n\n (geometry as THREE.BufferGeometry & { sphereData: Record<string, number | Float32Array> }).sphereData = { positions: positions.slice() };\n for (let i = 0; i < pulseCount; i++) {\n const phi = Math.acos(1 - 2 * (i + 0.5) / pulseCount);\n const theta = Math.PI * (1 + Math.sqrt(5)) * i;\n (geometry as THREE.BufferGeometry & { sphereData: Record<string, number | Float32Array> }).sphereData[`phi_${i}`] = phi;\n (geometry as THREE.BufferGeometry & { sphereData: Record<string, number | Float32Array> }).sphereData[`theta_${i}`] = theta;\n }\n\n return points;\n },\n [particleCounts]\n );\n\n const createRippleParticles = useMemo(\n () => (effect: InternalDamageEffect) => {\n const { rippleCount } = particleCounts;\n const geometry = new THREE.BufferGeometry();\n const positions = new Float32Array(rippleCount * 3);\n const colors = new Float32Array(rippleCount * 3);\n const sizes = new Float32Array(rippleCount);\n\n const tempColor = ThreeObjectPools.color.acquire();\n\n try {\n tempColor.set(INTERNAL_DAMAGE_CONSTANTS.RIPPLE_COLOR);\n\n for (let i = 0; i < rippleCount; i++) {\n const angle = (i / rippleCount) * Math.PI * 2;\n positions[i * 3] = 0;\n positions[i * 3 + 1] = 0;\n positions[i * 3 + 2] = 0;\n\n colors[i * 3] = tempColor.r;\n colors[i * 3 + 1] = tempColor.g;\n colors[i * 3 + 2] = tempColor.b;\n\n sizes[i] = 0.02;\n\n (geometry as THREE.BufferGeometry & { [key: string]: number })[`angle_${i}`] = angle;\n }\n } finally {\n ThreeObjectPools.color.release(tempColor);\n }\n\n geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));\n geometry.setAttribute('color', new THREE.BufferAttribute(colors, 3));\n geometry.setAttribute('size', new THREE.BufferAttribute(sizes, 1));\n\n const material = new THREE.PointsMaterial({\n size: 0.03,\n vertexColors: true,\n transparent: true,\n opacity: 1.0,\n blending: THREE.NormalBlending,\n depthWrite: false,\n sizeAttenuation: true,\n });\n\n const points = new THREE.Points(geometry, material);\n points.position.set(...effect.position);\n\n return points;\n },\n [particleCounts]\n );\n\n useEffect(() => {\n if (!enabled) return;\n\n setEffectInstances((prev) => {\n const updated = new Map(prev);\n\n effects.forEach((effect) => {\n if (!updated.has(effect.id)) {\n const pulseParticles = createPulseParticles(effect);\n const rippleParticles = createRippleParticles(effect);\n updated.set(effect.id, {\n pulseParticles,\n rippleParticles,\n startTime: effect.startTime,\n effect,\n });\n }\n });\n\n const currentIds = new Set(effects.map((e) => e.id));\n Array.from(updated.keys()).forEach((id) => {\n if (!currentIds.has(id)) {\n const instance = updated.get(id);\n if (instance) {\n instance.pulseParticles.geometry.dispose();\n (instance.pulseParticles.material as THREE.Material).dispose();\n instance.rippleParticles.geometry.dispose();\n (instance.rippleParticles.material as THREE.Material).dispose();\n }\n updated.delete(id);\n }\n });\n\n return updated;\n });\n }, [effects, enabled, createPulseParticles, createRippleParticles]);\n\n const effectInstancesRef = useRef<Map<\n string,\n {\n pulseParticles: THREE.Points;\n rippleParticles: THREE.Points;\n startTime: number;\n effect: InternalDamageEffect;\n }\n >>(effectInstances);\n useEffect(() => {\n effectInstancesRef.current = effectInstances;\n }, [effectInstances]);\n\n useEffect(() => {\n return () => {\n effectInstancesRef.current.forEach((instance: {\n pulseParticles: THREE.Points;\n rippleParticles: THREE.Points;\n startTime: number;\n effect: InternalDamageEffect;\n }) => {\n instance.pulseParticles.geometry.dispose();\n (instance.pulseParticles.material as THREE.Material).dispose();\n instance.rippleParticles.geometry.dispose();\n (instance.rippleParticles.material as THREE.Material).dispose();\n });\n };\n }, []); // Empty deps - cleanup on unmount only\n\n useFrame(() => {\n if (!enabled || effectInstances.size === 0) return;\n\n const now = Date.now();\n const completedIds: string[] = [];\n\n effectInstances.forEach((instance, id) => {\n const elapsed = (now - instance.startTime) / 1000;\n const { effect } = instance;\n\n const pulseProgress = Math.min(\n elapsed / INTERNAL_DAMAGE_CONSTANTS.PULSE_LIFETIME,\n 1.0\n );\n if (pulseProgress < 1.0) {\n const pulseGeometry = instance.pulseParticles.geometry;\n const pulsePositions = pulseGeometry.attributes.position\n .array as Float32Array;\n const maxRadius =\n INTERNAL_DAMAGE_CONSTANTS.MAX_RADIUS[effect.penetrationDepth];\n\n const { pulseCount } = particleCounts;\n const sphereData = (pulseGeometry as THREE.BufferGeometry & { sphereData: Record<string, number | Float32Array> }).sphereData;\n for (let i = 0; i < pulseCount; i++) {\n const phi = sphereData[`phi_${i}`] as number;\n const theta = sphereData[`theta_${i}`] as number;\n const radius = maxRadius * pulseProgress;\n\n pulsePositions[i * 3] = radius * Math.sin(phi) * Math.cos(theta);\n pulsePositions[i * 3 + 1] = radius * Math.sin(phi) * Math.sin(theta);\n pulsePositions[i * 3 + 2] = radius * Math.cos(phi);\n }\n\n pulseGeometry.attributes.position.needsUpdate = true;\n\n const material = instance.pulseParticles.material as THREE.PointsMaterial;\n material.opacity = 1.0 - pulseProgress * 0.7;\n }\n\n const rippleProgress = Math.min(\n elapsed / INTERNAL_DAMAGE_CONSTANTS.RIPPLE_LIFETIME,\n 1.0\n );\n if (rippleProgress < 1.0) {\n const rippleGeometry = instance.rippleParticles.geometry;\n const ripplePositions = rippleGeometry.attributes.position\n .array as Float32Array;\n\n const { rippleCount } = particleCounts;\n const rippleRadius = 0.6 * rippleProgress;\n for (let i = 0; i < rippleCount; i++) {\n const angle = (rippleGeometry as THREE.BufferGeometry & { [key: string]: number })[`angle_${i}`];\n ripplePositions[i * 3] = rippleRadius * Math.cos(angle);\n ripplePositions[i * 3 + 1] = 0;\n ripplePositions[i * 3 + 2] = rippleRadius * Math.sin(angle);\n }\n\n rippleGeometry.attributes.position.needsUpdate = true;\n\n const material = instance.rippleParticles\n .material as THREE.PointsMaterial;\n material.opacity = 1.0 - rippleProgress;\n }\n\n if (\n elapsed >= INTERNAL_DAMAGE_CONSTANTS.PULSE_LIFETIME &&\n elapsed >= INTERNAL_DAMAGE_CONSTANTS.RIPPLE_LIFETIME\n ) {\n completedIds.push(id);\n }\n });\n\n completedIds.forEach((id) => {\n onEffectComplete?.(id);\n });\n });\n\n return (\n <>\n {Array.from(effectInstances.values()).map((instance) => (\n <React.Fragment key={instance.effect.id}>\n <primitive object={instance.pulseParticles} />\n <primitive object={instance.rippleParticles} />\n </React.Fragment>\n ))}\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,IAAM,4BAA4B;CAChC,aAAa;CAEb,gBAAgB;CAChB,iBAAiB;CAEjB,YAAY;EACV,SAAS;EACT,SAAS;EACT,MAAM;EACN,UAAU;EACX;CAED,WAAW;EACT,SAAS;EACT,SAAS;EACT,MAAM;EACN,UAAU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1B,UAAU,0BAA0B,iBACpC,EACD;GACD,IAAI,iBAAiB,GAAK;IACxB,MAAM,iBAAiB,SAAS,gBAAgB;IAChD,MAAM,kBAAkB,eAAe,WAAW,SAC/C;IAEH,MAAM,EAAE,gBAAgB;IACxB,MAAM,eAAe,KAAM;IAC3B,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,KAAK;KACpC,MAAM,QAAS,eAAoE,SAAS;KAC5F,gBAAgB,IAAI,KAAK,eAAe,KAAK,IAAI,MAAM;KACvD,gBAAgB,IAAI,IAAI,KAAK;KAC7B,gBAAgB,IAAI,IAAI,KAAK,eAAe,KAAK,IAAI,MAAM;;IAG7D,eAAe,WAAW,SAAS,cAAc;IAEjD,MAAM,WAAW,SAAS,gBACvB;IACH,SAAS,UAAU,IAAM;;GAG3B,IACE,WAAW,0BAA0B,kBACrC,WAAW,0BAA0B,iBAErC,aAAa,KAAK,GAAG;IAEvB;EAEF,aAAa,SAAS,OAAO;GAC3B,mBAAmB,GAAG;IACtB;GACF;CAEF,OACE,oBAAA,UAAA,EAAA,UACG,MAAM,KAAK,gBAAgB,QAAQ,CAAC,CAAC,KAAK,aACzC,qBAAC,MAAM,UAAP,EAAA,UAAA,CACE,oBAAC,aAAD,EAAW,QAAQ,SAAS,gBAAkB,CAAA,EAC9C,oBAAC,aAAD,EAAW,QAAQ,SAAS,iBAAmB,CAAA,CAChC,EAAA,EAHI,SAAS,OAAO,GAGpB,CACjB,EACD,CAAA"}
1
+ {"version":3,"file":"InternalDamage3D.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/effects/InternalDamage3D.tsx"],"sourcesContent":["/**\n * InternalDamage3D - Deep red organ pulses for Korean martial arts organ strikes\n *\n * Priority #4: Internal Damage Visualization\n * - Deep red organ pulses (liver, kidney, spleen, stomach, heart)\n * - Tissue deformation ripples\n * - Penetration depth visualization\n * - Critical organ damage feedback\n *\n * PERFORMANCE OPTIMIZATION (Object Pooling):\n * - Reduced allocations from ~120+ per effect to 2 pooled objects\n * - Pooling strategy:\n * 1. Temporary Color objects for particle initialization use pool\n * 2. Colors are copied to Float32Array (no ownership needed)\n * 3. All pooled objects released after particle system creation\n * - Estimated reduction:\n * - Pulse particles: 60 Color allocations → 1 pooled object\n * - Ripple particles: 30 Color allocations → 1 pooled object\n * - Total: ~90 Color allocations per effect → 2 pooled objects\n *\n * Korean martial arts context (내장 공격 - Internal organ strikes):\n * - 간격 (Liver strike) - Right side body blow\n * - 신장격 (Kidney strike) - Lower back strike\n * - 비장격 (Spleen strike) - Left side body blow\n * - 명치격 (Solar plexus) - Stomach strike\n * - 심장격 (Heart strike) - Chest strike (critical)\n */\n\nimport React, { useEffect, useMemo, useRef } from 'react';\nimport { useFrame } from '@react-three/fiber';\nimport * as THREE from 'three';\nimport { ThreeObjectPools } from '../../../../../utils/threeObjectPool';\n\n/**\n * Organ types for Korean martial arts internal strikes\n */\nexport type OrganType = 'liver' | 'kidney' | 'spleen' | 'stomach' | 'heart';\n\n/**\n * Penetration depth levels for organ damage\n */\nexport type PenetrationDepth = 'surface' | 'shallow' | 'deep' | 'critical';\n\n/**\n * Individual internal damage effect\n */\nexport interface InternalDamageEffect {\n readonly id: string;\n readonly position: [number, number, number];\n readonly organType: OrganType;\n readonly penetrationDepth: PenetrationDepth;\n readonly startTime: number;\n}\n\n/**\n * Props for InternalDamage3D component\n */\nexport interface InternalDamage3DProps {\n readonly effects: readonly InternalDamageEffect[];\n readonly enabled?: boolean;\n readonly isMobile?: boolean;\n readonly onEffectComplete?: (id: string) => void;\n}\n\nconst INTERNAL_DAMAGE_CONSTANTS = {\n PULSE_SPEED: 2.5, // m/s expansion rate\n \n PULSE_LIFETIME: 1.5, // seconds for pulse to complete\n RIPPLE_LIFETIME: 0.8, // seconds for tissue ripple\n \n MAX_RADIUS: {\n surface: 0.4,\n shallow: 0.7,\n deep: 1.0,\n critical: 1.2,\n },\n \n INTENSITY: {\n surface: 0.5,\n shallow: 0.8,\n deep: 1.2,\n critical: 1.5,\n },\n \n PULSE_PARTICLES: 60,\n RIPPLE_PARTICLES: 30,\n \n ORGAN_COLOR: 0x8b0000, // Dark red for organs\n RIPPLE_COLOR: 0xdc143c, // Crimson for tissue ripples\n \n EMISSIVE_INTENSITY: 0.8,\n} as const;\n\n/**\n * InternalDamage3D - Visualizes internal organ damage with deep red pulses\n *\n * Features:\n * - Expanding sphere pulses from organ impacts\n * - Tissue deformation ripples\n * - Penetration depth-based sizing\n * - Korean martial arts organ strike feedback\n * - Mobile optimization (50% particles)\n */\nexport const InternalDamage3D: React.FC<InternalDamage3DProps> = ({\n effects,\n enabled = true,\n isMobile = false,\n onEffectComplete,\n}) => {\n const [effectInstances, setEffectInstances] = React.useState<\n Map<\n string,\n {\n pulseParticles: THREE.Points;\n rippleParticles: THREE.Points;\n startTime: number;\n effect: InternalDamageEffect;\n }\n >\n >(new Map());\n\n const particleCounts = useMemo(() => {\n const pulseCount = isMobile\n ? Math.floor(INTERNAL_DAMAGE_CONSTANTS.PULSE_PARTICLES * 0.5)\n : INTERNAL_DAMAGE_CONSTANTS.PULSE_PARTICLES;\n const rippleCount = isMobile\n ? Math.floor(INTERNAL_DAMAGE_CONSTANTS.RIPPLE_PARTICLES * 0.5)\n : INTERNAL_DAMAGE_CONSTANTS.RIPPLE_PARTICLES;\n return { pulseCount, rippleCount };\n }, [isMobile]);\n\n const createPulseParticles = useMemo(\n () => (effect: InternalDamageEffect) => {\n const { pulseCount } = particleCounts;\n const geometry = new THREE.BufferGeometry();\n const positions = new Float32Array(pulseCount * 3);\n const colors = new Float32Array(pulseCount * 3);\n const sizes = new Float32Array(pulseCount);\n\n const tempColor = ThreeObjectPools.color.acquire();\n\n try {\n tempColor.set(INTERNAL_DAMAGE_CONSTANTS.ORGAN_COLOR);\n\n for (let i = 0; i < pulseCount; i++) {\n\n positions[i * 3] = 0;\n positions[i * 3 + 1] = 0;\n positions[i * 3 + 2] = 0;\n\n colors[i * 3] = tempColor.r;\n colors[i * 3 + 1] = tempColor.g;\n colors[i * 3 + 2] = tempColor.b;\n\n const baseSize = 0.03;\n const depthMultiplier =\n INTERNAL_DAMAGE_CONSTANTS.INTENSITY[effect.penetrationDepth];\n sizes[i] = baseSize * depthMultiplier;\n }\n } finally {\n ThreeObjectPools.color.release(tempColor);\n }\n\n geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));\n geometry.setAttribute('color', new THREE.BufferAttribute(colors, 3));\n geometry.setAttribute('size', new THREE.BufferAttribute(sizes, 1));\n\n const material = new THREE.PointsMaterial({\n size: 0.05,\n vertexColors: true,\n transparent: true,\n opacity: 1.0,\n blending: THREE.AdditiveBlending,\n depthWrite: false,\n sizeAttenuation: true,\n });\n\n const points = new THREE.Points(geometry, material);\n points.position.set(...effect.position);\n\n (geometry as THREE.BufferGeometry & { sphereData: Record<string, number | Float32Array> }).sphereData = { positions: positions.slice() };\n for (let i = 0; i < pulseCount; i++) {\n const phi = Math.acos(1 - 2 * (i + 0.5) / pulseCount);\n const theta = Math.PI * (1 + Math.sqrt(5)) * i;\n (geometry as THREE.BufferGeometry & { sphereData: Record<string, number | Float32Array> }).sphereData[`phi_${i}`] = phi;\n (geometry as THREE.BufferGeometry & { sphereData: Record<string, number | Float32Array> }).sphereData[`theta_${i}`] = theta;\n }\n\n return points;\n },\n [particleCounts]\n );\n\n const createRippleParticles = useMemo(\n () => (effect: InternalDamageEffect) => {\n const { rippleCount } = particleCounts;\n const geometry = new THREE.BufferGeometry();\n const positions = new Float32Array(rippleCount * 3);\n const colors = new Float32Array(rippleCount * 3);\n const sizes = new Float32Array(rippleCount);\n\n const tempColor = ThreeObjectPools.color.acquire();\n\n try {\n tempColor.set(INTERNAL_DAMAGE_CONSTANTS.RIPPLE_COLOR);\n\n for (let i = 0; i < rippleCount; i++) {\n const angle = (i / rippleCount) * Math.PI * 2;\n positions[i * 3] = 0;\n positions[i * 3 + 1] = 0;\n positions[i * 3 + 2] = 0;\n\n colors[i * 3] = tempColor.r;\n colors[i * 3 + 1] = tempColor.g;\n colors[i * 3 + 2] = tempColor.b;\n\n sizes[i] = 0.02;\n\n (geometry as THREE.BufferGeometry & { [key: string]: number })[`angle_${i}`] = angle;\n }\n } finally {\n ThreeObjectPools.color.release(tempColor);\n }\n\n geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));\n geometry.setAttribute('color', new THREE.BufferAttribute(colors, 3));\n geometry.setAttribute('size', new THREE.BufferAttribute(sizes, 1));\n\n const material = new THREE.PointsMaterial({\n size: 0.03,\n vertexColors: true,\n transparent: true,\n opacity: 1.0,\n blending: THREE.NormalBlending,\n depthWrite: false,\n sizeAttenuation: true,\n });\n\n const points = new THREE.Points(geometry, material);\n points.position.set(...effect.position);\n\n return points;\n },\n [particleCounts]\n );\n\n useEffect(() => {\n if (!enabled) return;\n\n setEffectInstances((prev) => {\n const updated = new Map(prev);\n\n effects.forEach((effect) => {\n if (!updated.has(effect.id)) {\n const pulseParticles = createPulseParticles(effect);\n const rippleParticles = createRippleParticles(effect);\n updated.set(effect.id, {\n pulseParticles,\n rippleParticles,\n startTime: effect.startTime,\n effect,\n });\n }\n });\n\n const currentIds = new Set(effects.map((e) => e.id));\n Array.from(updated.keys()).forEach((id) => {\n if (!currentIds.has(id)) {\n const instance = updated.get(id);\n if (instance) {\n instance.pulseParticles.geometry.dispose();\n (instance.pulseParticles.material as THREE.Material).dispose();\n instance.rippleParticles.geometry.dispose();\n (instance.rippleParticles.material as THREE.Material).dispose();\n }\n updated.delete(id);\n }\n });\n\n return updated;\n });\n }, [effects, enabled, createPulseParticles, createRippleParticles]);\n\n const effectInstancesRef = useRef<Map<\n string,\n {\n pulseParticles: THREE.Points;\n rippleParticles: THREE.Points;\n startTime: number;\n effect: InternalDamageEffect;\n }\n >>(effectInstances);\n useEffect(() => {\n effectInstancesRef.current = effectInstances;\n }, [effectInstances]);\n\n useEffect(() => {\n return () => {\n effectInstancesRef.current.forEach((instance: {\n pulseParticles: THREE.Points;\n rippleParticles: THREE.Points;\n startTime: number;\n effect: InternalDamageEffect;\n }) => {\n instance.pulseParticles.geometry.dispose();\n (instance.pulseParticles.material as THREE.Material).dispose();\n instance.rippleParticles.geometry.dispose();\n (instance.rippleParticles.material as THREE.Material).dispose();\n });\n };\n }, []); // Empty deps - cleanup on unmount only\n\n useFrame(() => {\n if (!enabled || effectInstances.size === 0) return;\n\n const now = Date.now();\n const completedIds: string[] = [];\n\n effectInstances.forEach((instance, id) => {\n const elapsed = (now - instance.startTime) / 1000;\n const { effect } = instance;\n\n const pulseProgress = Math.min(\n elapsed / INTERNAL_DAMAGE_CONSTANTS.PULSE_LIFETIME,\n 1.0\n );\n if (pulseProgress < 1.0) {\n const pulseGeometry = instance.pulseParticles.geometry;\n const pulsePositions = pulseGeometry.attributes.position\n .array as Float32Array;\n const maxRadius =\n INTERNAL_DAMAGE_CONSTANTS.MAX_RADIUS[effect.penetrationDepth];\n\n const { pulseCount } = particleCounts;\n const sphereData = (pulseGeometry as THREE.BufferGeometry & { sphereData: Record<string, number | Float32Array> }).sphereData;\n for (let i = 0; i < pulseCount; i++) {\n const phi = sphereData[`phi_${i}`] as number;\n const theta = sphereData[`theta_${i}`] as number;\n const radius = maxRadius * pulseProgress;\n\n pulsePositions[i * 3] = radius * Math.sin(phi) * Math.cos(theta);\n pulsePositions[i * 3 + 1] = radius * Math.sin(phi) * Math.sin(theta);\n pulsePositions[i * 3 + 2] = radius * Math.cos(phi);\n }\n\n pulseGeometry.attributes.position.needsUpdate = true;\n\n const material = instance.pulseParticles.material as THREE.PointsMaterial;\n material.opacity = 1.0 - pulseProgress * 0.7;\n }\n\n const rippleProgress = Math.min(\n elapsed / INTERNAL_DAMAGE_CONSTANTS.RIPPLE_LIFETIME,\n 1.0\n );\n if (rippleProgress < 1.0) {\n const rippleGeometry = instance.rippleParticles.geometry;\n const ripplePositions = rippleGeometry.attributes.position\n .array as Float32Array;\n\n const { rippleCount } = particleCounts;\n const rippleRadius = 0.6 * rippleProgress;\n for (let i = 0; i < rippleCount; i++) {\n const angle = (rippleGeometry as THREE.BufferGeometry & { [key: string]: number })[`angle_${i}`];\n ripplePositions[i * 3] = rippleRadius * Math.cos(angle);\n ripplePositions[i * 3 + 1] = 0;\n ripplePositions[i * 3 + 2] = rippleRadius * Math.sin(angle);\n }\n\n rippleGeometry.attributes.position.needsUpdate = true;\n\n const material = instance.rippleParticles\n .material as THREE.PointsMaterial;\n material.opacity = 1.0 - rippleProgress;\n }\n\n if (\n elapsed >= INTERNAL_DAMAGE_CONSTANTS.PULSE_LIFETIME &&\n elapsed >= INTERNAL_DAMAGE_CONSTANTS.RIPPLE_LIFETIME\n ) {\n completedIds.push(id);\n }\n });\n\n completedIds.forEach((id) => {\n onEffectComplete?.(id);\n });\n });\n\n return (\n <>\n {Array.from(effectInstances.values()).map((instance) => (\n <React.Fragment key={instance.effect.id}>\n <primitive object={instance.pulseParticles} />\n <primitive object={instance.rippleParticles} />\n </React.Fragment>\n ))}\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,IAAM,4BAA4B;CAChC,aAAa;CAEb,gBAAgB;CAChB,iBAAiB;CAEjB,YAAY;EACV,SAAS;EACT,SAAS;EACT,MAAM;EACN,UAAU;CACZ;CAEA,WAAW;EACT,SAAS;EACT,SAAS;EACT,MAAM;EACN,UAAU;CACZ;CAEA,iBAAiB;CACjB,kBAAkB;CAElB,aAAa;CACb,cAAc;CAEd,oBAAoB;AACtB;;;;;;;;;;;AAYA,IAAa,oBAAqD,EAChE,SACA,UAAU,MACV,WAAW,OACX,uBACI;CACJ,MAAM,CAAC,iBAAiB,sBAAsB,MAAM,yBAUlD,IAAI,IAAI,CAAC;CAEX,MAAM,iBAAiB,cAAc;EAOnC,OAAO;GAAE,YANU,WACf,KAAK,MAAM,0BAA0B,kBAAkB,EAAG,IAC1D,0BAA0B;GAIT,aAHD,WAChB,KAAK,MAAM,0BAA0B,mBAAmB,EAAG,IAC3D,0BAA0B;EACG;CACnC,GAAG,CAAC,QAAQ,CAAC;CAEb,MAA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AAgB,IAAI,IAAI,KAAK;KAC7B,gBAAgB,IAAI,IAAI,KAAK,eAAe,KAAK,IAAI,KAAK;IAC5D;IAEA,eAAe,WAAW,SAAS,cAAc;IAEjD,MAAM,WAAW,SAAS,gBACvB;IACH,SAAS,UAAU,IAAM;GAC3B;GAEA,IACE,WAAW,0BAA0B,kBACrC,WAAW,0BAA0B,iBAErC,aAAa,KAAK,EAAE;EAExB,CAAC;EAED,aAAa,SAAS,OAAO;GAC3B,mBAAmB,EAAE;EACvB,CAAC;CACH,CAAC;CAED,OACE,oBAAA,UAAA,EAAA,UACG,MAAM,KAAK,gBAAgB,OAAO,CAAC,EAAE,KAAK,aACzC,qBAAC,MAAM,UAAP,EAAA,UAAA,CACE,oBAAC,aAAD,EAAW,QAAQ,SAAS,eAAiB,CAAA,GAC7C,oBAAC,aAAD,EAAW,QAAQ,SAAS,gBAAkB,CAAA,CAChC,EAAA,GAHK,SAAS,OAAO,EAGrB,CACjB,EACD,CAAA;AAEN"}
@@ -1 +1 @@
1
- {"version":3,"file":"PainVignette.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/effects/PainVignette.tsx"],"sourcesContent":["/**\n * PainVignette Component - Visual overlay for pain intensity\n *\n * Displays a red vignette effect around the screen edges that intensifies\n * as the player's pain level increases. Uses CSS box-shadow for performance.\n *\n * NOTE: This component is rendered OUTSIDE the Canvas as part of the HTML overlay.\n * It does NOT use Html from drei - it's a standard React component.\n *\n * @module components/combat/PainVignette\n * @category Combat UI\n * @korean 통증비네트\n */\n\nimport React, { useMemo } from \"react\";\nimport { KOREAN_COLORS } from \"../../../../../types/constants\";\n\nexport interface PainVignetteProps {\n /**\n * Current pain level (0-100)\n * @korean 통증수준\n */\n readonly pain: number;\n\n /**\n * Mobile responsive mode (subtle effects)\n * @korean 모바일여부\n */\n readonly isMobile: boolean;\n\n /**\n * Multiplier applied to the effect's maximum opacity (0.0-1.0).\n *\n * Use this to soften the fullscreen effect when the 3D arena is already\n * visually compressed (e.g. portrait mobile) so the vignette does not\n * further obscure the view. Default is `1.0` (no attenuation).\n *\n * @korean 효과강도배수\n */\n readonly intensityScale?: number;\n}\n\n/**\n * PainVignette - Red edge vignette overlay for pain visualization\n *\n * Renders a fullscreen overlay with red vignette effect that intensifies\n * as pain increases. Only visible when pain is 5 or higher. Optimized\n * for 60fps with CSS transitions.\n * \n * Accessibility:\n * - Purely visual, decorative-only overlay\n * - Hidden from assistive technologies via aria-hidden=\"true\"\n * - Does not announce pain levels; use a separate mechanism if announcements are required\n *\n * @example\n * ```tsx\n * <PainVignette pain={65} isMobile={false} />\n * // No render if pain < 5\n * <PainVignette pain={2} isMobile={false} />\n * ```\n */\nexport const PainVignette: React.FC<PainVignetteProps> = ({\n pain,\n isMobile,\n intensityScale = 1,\n}) => {\n const vignetteStyle = useMemo(() => {\n const clampedPain = Math.max(0, Math.min(100, pain));\n\n const normalizedPain = clampedPain / 100;\n const intensity = Math.pow(normalizedPain, 1.5);\n\n const vignetteSize = isMobile ? \"80px\" : \"150px\";\n\n const safeScale = Math.max(0, Math.min(1, intensityScale));\n const maxOpacity = (isMobile ? 0.5 : 0.7) * safeScale;\n const opacity = intensity * maxOpacity;\n\n const rgb = KOREAN_COLORS.PAIN_INDICATOR;\n const painColor = `rgba(${(rgb >> 16) & 255}, ${(rgb >> 8) & 255}, ${\n rgb & 255\n }, ${opacity})`;\n\n return {\n position: \"fixed\" as const,\n inset: 0,\n pointerEvents: \"none\" as const,\n boxShadow: `inset 0 0 ${vignetteSize} ${painColor}`,\n transition: \"box-shadow 0.5s ease-out\",\n zIndex: 50, // Below UI controls but above game content\n };\n }, [pain, isMobile, intensityScale]);\n\n if (pain < 5) {\n return null;\n }\n\n return (\n <div \n data-testid=\"pain-vignette\" \n style={vignetteStyle} \n aria-hidden=\"true\"\n />\n );\n};\n\nPainVignette.displayName = \"PainVignette\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,IAAa,gBAA6C,EACxD,MACA,UACA,iBAAiB,QACb;CACJ,MAAM,gBAAgB,cAAc;EAGlC,MAAM,iBAFc,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,KAAK,CAE5B,GAAc;EACrC,MAAM,YAAY,KAAK,IAAI,gBAAgB,IAAI;EAE/C,MAAM,eAAe,WAAW,SAAS;EAIzC,MAAM,UAAU,cADI,WAAW,KAAM,MADnB,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,eAAe,CACb;EAG5C,MAAM,MAAM,cAAc;EAK1B,OAAO;GACL,UAAU;GACV,OAAO;GACP,eAAe;GACf,WAAW,aAAa,aAAa,GAAG,QARf,OAAO,KAAM,IAAI,IAAK,OAAO,IAAK,IAAI,IAC/D,MAAM,IACP,IAAI,QAAQ;GAOX,YAAY;GACZ,QAAQ;GACT;IACA;EAAC;EAAM;EAAU;EAAe,CAAC;CAEpC,IAAI,OAAO,GACT,OAAO;CAGT,OACE,oBAAC,OAAD;EACE,eAAY;EACZ,OAAO;EACP,eAAY;EACZ,CAAA;;AAIN,aAAa,cAAc"}
1
+ {"version":3,"file":"PainVignette.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/effects/PainVignette.tsx"],"sourcesContent":["/**\n * PainVignette Component - Visual overlay for pain intensity\n *\n * Displays a red vignette effect around the screen edges that intensifies\n * as the player's pain level increases. Uses CSS box-shadow for performance.\n *\n * NOTE: This component is rendered OUTSIDE the Canvas as part of the HTML overlay.\n * It does NOT use Html from drei - it's a standard React component.\n *\n * @module components/combat/PainVignette\n * @category Combat UI\n * @korean 통증비네트\n */\n\nimport React, { useMemo } from \"react\";\nimport { KOREAN_COLORS } from \"../../../../../types/constants\";\n\nexport interface PainVignetteProps {\n /**\n * Current pain level (0-100)\n * @korean 통증수준\n */\n readonly pain: number;\n\n /**\n * Mobile responsive mode (subtle effects)\n * @korean 모바일여부\n */\n readonly isMobile: boolean;\n\n /**\n * Multiplier applied to the effect's maximum opacity (0.0-1.0).\n *\n * Use this to soften the fullscreen effect when the 3D arena is already\n * visually compressed (e.g. portrait mobile) so the vignette does not\n * further obscure the view. Default is `1.0` (no attenuation).\n *\n * @korean 효과강도배수\n */\n readonly intensityScale?: number;\n}\n\n/**\n * PainVignette - Red edge vignette overlay for pain visualization\n *\n * Renders a fullscreen overlay with red vignette effect that intensifies\n * as pain increases. Only visible when pain is 5 or higher. Optimized\n * for 60fps with CSS transitions.\n * \n * Accessibility:\n * - Purely visual, decorative-only overlay\n * - Hidden from assistive technologies via aria-hidden=\"true\"\n * - Does not announce pain levels; use a separate mechanism if announcements are required\n *\n * @example\n * ```tsx\n * <PainVignette pain={65} isMobile={false} />\n * // No render if pain < 5\n * <PainVignette pain={2} isMobile={false} />\n * ```\n */\nexport const PainVignette: React.FC<PainVignetteProps> = ({\n pain,\n isMobile,\n intensityScale = 1,\n}) => {\n const vignetteStyle = useMemo(() => {\n const clampedPain = Math.max(0, Math.min(100, pain));\n\n const normalizedPain = clampedPain / 100;\n const intensity = Math.pow(normalizedPain, 1.5);\n\n const vignetteSize = isMobile ? \"80px\" : \"150px\";\n\n const safeScale = Math.max(0, Math.min(1, intensityScale));\n const maxOpacity = (isMobile ? 0.5 : 0.7) * safeScale;\n const opacity = intensity * maxOpacity;\n\n const rgb = KOREAN_COLORS.PAIN_INDICATOR;\n const painColor = `rgba(${(rgb >> 16) & 255}, ${(rgb >> 8) & 255}, ${\n rgb & 255\n }, ${opacity})`;\n\n return {\n position: \"fixed\" as const,\n inset: 0,\n pointerEvents: \"none\" as const,\n boxShadow: `inset 0 0 ${vignetteSize} ${painColor}`,\n transition: \"box-shadow 0.5s ease-out\",\n zIndex: 50, // Below UI controls but above game content\n };\n }, [pain, isMobile, intensityScale]);\n\n if (pain < 5) {\n return null;\n }\n\n return (\n <div \n data-testid=\"pain-vignette\" \n style={vignetteStyle} \n aria-hidden=\"true\"\n />\n );\n};\n\nPainVignette.displayName = \"PainVignette\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,IAAa,gBAA6C,EACxD,MACA,UACA,iBAAiB,QACb;CACJ,MAAM,gBAAgB,cAAc;EAGlC,MAAM,iBAFc,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,IAAI,CAE3B,IAAc;EACrC,MAAM,YAAY,KAAK,IAAI,gBAAgB,GAAG;EAE9C,MAAM,eAAe,WAAW,SAAS;EAIzC,MAAM,UAAU,cADI,WAAW,KAAM,MADnB,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,cAAc,CACZ;EAG5C,MAAM,MAAM,cAAc;EAK1B,OAAO;GACL,UAAU;GACV,OAAO;GACP,eAAe;GACf,WAAW,aAAa,aAAa,GAAG,QARf,OAAO,KAAM,IAAI,IAAK,OAAO,IAAK,IAAI,IAC/D,MAAM,IACP,IAAI,QAAQ;GAOX,YAAY;GACZ,QAAQ;EACV;CACF,GAAG;EAAC;EAAM;EAAU;CAAc,CAAC;CAEnC,IAAI,OAAO,GACT,OAAO;CAGT,OACE,oBAAC,OAAD;EACE,eAAY;EACZ,OAAO;EACP,eAAY;CACb,CAAA;AAEL;AAEA,aAAa,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"ParticleAudio3D.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/effects/ParticleAudio3D.tsx"],"sourcesContent":["/* eslint-disable react-refresh/only-export-components */\n/**\n * ParticleAudio3D - Audio integration for particle effects\n *\n * Priority #6: Combat Audio Integration\n * - Maps particle effects to appropriate sounds\n * - Uses existing sound assets only\n * - Synchronizes with particle lifecycles\n * - Debounces rapid triggers\n *\n * Sound mappings (existing assets):\n * - Arterial spray → ki_release variants (electric energy release)\n * - Bone fractures → block_break variants (bone crack sounds)\n * - Nerve strikes → energy_pulse variants (electric pulse)\n * - Organ damage → hit_flesh + body_realistic_sound (layered impact)\n * - Blood viscosity → hit_flesh variants (lighter flesh impacts)\n */\n\nimport { useEffect, useRef } from \"react\";\nimport { useAudio } from \"../../../../../audio/AudioProvider\";\n\n/**\n * Particle effect types for audio mapping\n */\nexport type ParticleEffectType =\n | \"arterial\"\n | \"bone\"\n | \"nerve\"\n | \"organ\"\n | \"viscosity\";\n\n/**\n * Audio trigger for particle effect\n */\nexport interface ParticleAudioTrigger {\n readonly effectType: ParticleEffectType;\n readonly intensity: number; // 0.0-1.0, affects volume\n readonly timestamp: number; // Used for deduplication\n}\n\n/**\n * Props for ParticleAudio3D component\n */\nexport interface ParticleAudio3DProps {\n readonly triggers: readonly ParticleAudioTrigger[];\n readonly enabled?: boolean;\n readonly onTriggerProcessed?: (timestamp: number) => void;\n}\n\nconst DEBOUNCE_TIME = 100;\n\nconst SOUND_MAPPINGS: Record<ParticleEffectType, string[]> = {\n arterial: [\n \"ki_release\",\n \"ki_release_1\",\n \"ki_release_2\",\n \"ki_release_3\",\n \"ki_release_4\",\n ],\n bone: [\n \"block_break\",\n \"block_break_1\",\n \"block_break_2\",\n \"block_break_3\",\n \"block_break_4\",\n ],\n nerve: [\n \"energy_pulse\",\n \"energy_pulse_1\",\n \"energy_pulse_2\",\n \"energy_pulse_3\",\n \"energy_pulse_4\",\n ],\n organ: [\"hit_flesh\", \"hit_flesh_1\", \"hit_flesh_2\", \"body_realistic_sound\"],\n viscosity: [\"hit_flesh_3\", \"hit_flesh_4\"],\n};\n\n/**\n * ParticleAudio3D - Lightweight audio coordination for particle effects\n *\n * Features:\n * - Debounced audio triggers (max 1 per 100ms per type)\n * - Intensity-based volume scaling\n * - Random sound variant selection\n * - Uses existing audio assets only\n * - No Three.js rendering (pure coordination logic)\n */\nexport const ParticleAudio3D: React.FC<ParticleAudio3DProps> = ({\n triggers,\n enabled = true,\n onTriggerProcessed,\n}) => {\n const audio = useAudio();\n\n const lastTriggerTime = useRef<Record<ParticleEffectType, number>>({\n arterial: 0,\n bone: 0,\n nerve: 0,\n organ: 0,\n viscosity: 0,\n });\n\n const processedTimestamps = useRef<Set<number>>(new Set());\n\n useEffect(() => {\n if (!enabled || !audio.isInitialized) return;\n\n const now = Date.now();\n\n triggers.forEach((trigger) => {\n if (processedTimestamps.current.has(trigger.timestamp)) {\n return;\n }\n\n const lastTime = lastTriggerTime.current[trigger.effectType];\n if (now - lastTime < DEBOUNCE_TIME) {\n return;\n }\n\n const soundIds = SOUND_MAPPINGS[trigger.effectType];\n const soundId = soundIds[Math.floor(Math.random() * soundIds.length)];\n\n try {\n audio.playSFX(soundId);\n } catch (error) {\n console.warn(`Failed to play particle audio: ${soundId}`, error);\n }\n\n lastTriggerTime.current[trigger.effectType] = now;\n processedTimestamps.current.add(trigger.timestamp);\n\n onTriggerProcessed?.(trigger.timestamp);\n });\n\n if (processedTimestamps.current.size > 1000) {\n const timestamps = Array.from(processedTimestamps.current).sort(\n (a, b) => b - a,\n );\n processedTimestamps.current = new Set(timestamps.slice(0, 500));\n }\n }, [triggers, enabled, audio, onTriggerProcessed]);\n\n return null;\n};\n\n/**\n * Helper function to create audio triggers from particle effects\n */\nexport function createAudioTrigger(\n effectType: ParticleEffectType,\n intensity: number,\n): ParticleAudioTrigger {\n return {\n effectType,\n intensity: Math.max(0, Math.min(1, intensity)),\n timestamp: Date.now(),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiDA,IAAM,gBAAgB;AAEtB,IAAM,iBAAuD;CAC3D,UAAU;EACR;EACA;EACA;EACA;EACA;EACD;CACD,MAAM;EACJ;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EACL;EACA;EACA;EACA;EACA;EACD;CACD,OAAO;EAAC;EAAa;EAAe;EAAe;EAAuB;CAC1E,WAAW,CAAC,eAAe,cAAc;CAC1C;;;;;;;;;;;AAYD,IAAa,mBAAmD,EAC9D,UACA,UAAU,MACV,yBACI;CACJ,MAAM,QAAQ,UAAU;CAExB,MAAM,kBAAkB,OAA2C;EACjE,UAAU;EACV,MAAM;EACN,OAAO;EACP,OAAO;EACP,WAAW;EACZ,CAAC;CAEF,MAAM,sBAAsB,uBAAoB,IAAI,KAAK,CAAC;CAE1D,gBAAgB;EACd,IAAI,CAAC,WAAW,CAAC,MAAM,eAAe;EAEtC,MAAM,MAAM,KAAK,KAAK;EAEtB,SAAS,SAAS,YAAY;GAC5B,IAAI,oBAAoB,QAAQ,IAAI,QAAQ,UAAU,EACpD;GAIF,IAAI,MADa,gBAAgB,QAAQ,QAAQ,cAC5B,eACnB;GAGF,MAAM,WAAW,eAAe,QAAQ;GACxC,MAAM,UAAU,SAAS,KAAK,MAAM,KAAK,QAAQ,GAAG,SAAS,OAAO;GAEpE,IAAI;IACF,MAAM,QAAQ,QAAQ;YACf,OAAO;IACd,QAAQ,KAAK,kCAAkC,WAAW,MAAM;;GAGlE,gBAAgB,QAAQ,QAAQ,cAAc;GAC9C,oBAAoB,QAAQ,IAAI,QAAQ,UAAU;GAElD,qBAAqB,QAAQ,UAAU;IACvC;EAEF,IAAI,oBAAoB,QAAQ,OAAO,KAAM;GAC3C,MAAM,aAAa,MAAM,KAAK,oBAAoB,QAAQ,CAAC,MACxD,GAAG,MAAM,IAAI,EACf;GACD,oBAAoB,UAAU,IAAI,IAAI,WAAW,MAAM,GAAG,IAAI,CAAC;;IAEhE;EAAC;EAAU;EAAS;EAAO;EAAmB,CAAC;CAElD,OAAO"}
1
+ {"version":3,"file":"ParticleAudio3D.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/effects/ParticleAudio3D.tsx"],"sourcesContent":["/* eslint-disable react-refresh/only-export-components */\n/**\n * ParticleAudio3D - Audio integration for particle effects\n *\n * Priority #6: Combat Audio Integration\n * - Maps particle effects to appropriate sounds\n * - Uses existing sound assets only\n * - Synchronizes with particle lifecycles\n * - Debounces rapid triggers\n *\n * Sound mappings (existing assets):\n * - Arterial spray → ki_release variants (electric energy release)\n * - Bone fractures → block_break variants (bone crack sounds)\n * - Nerve strikes → energy_pulse variants (electric pulse)\n * - Organ damage → hit_flesh + body_realistic_sound (layered impact)\n * - Blood viscosity → hit_flesh variants (lighter flesh impacts)\n */\n\nimport { useEffect, useRef } from \"react\";\nimport { useAudio } from \"../../../../../audio/AudioProvider\";\n\n/**\n * Particle effect types for audio mapping\n */\nexport type ParticleEffectType =\n | \"arterial\"\n | \"bone\"\n | \"nerve\"\n | \"organ\"\n | \"viscosity\";\n\n/**\n * Audio trigger for particle effect\n */\nexport interface ParticleAudioTrigger {\n readonly effectType: ParticleEffectType;\n readonly intensity: number; // 0.0-1.0, affects volume\n readonly timestamp: number; // Used for deduplication\n}\n\n/**\n * Props for ParticleAudio3D component\n */\nexport interface ParticleAudio3DProps {\n readonly triggers: readonly ParticleAudioTrigger[];\n readonly enabled?: boolean;\n readonly onTriggerProcessed?: (timestamp: number) => void;\n}\n\nconst DEBOUNCE_TIME = 100;\n\nconst SOUND_MAPPINGS: Record<ParticleEffectType, string[]> = {\n arterial: [\n \"ki_release\",\n \"ki_release_1\",\n \"ki_release_2\",\n \"ki_release_3\",\n \"ki_release_4\",\n ],\n bone: [\n \"block_break\",\n \"block_break_1\",\n \"block_break_2\",\n \"block_break_3\",\n \"block_break_4\",\n ],\n nerve: [\n \"energy_pulse\",\n \"energy_pulse_1\",\n \"energy_pulse_2\",\n \"energy_pulse_3\",\n \"energy_pulse_4\",\n ],\n organ: [\"hit_flesh\", \"hit_flesh_1\", \"hit_flesh_2\", \"body_realistic_sound\"],\n viscosity: [\"hit_flesh_3\", \"hit_flesh_4\"],\n};\n\n/**\n * ParticleAudio3D - Lightweight audio coordination for particle effects\n *\n * Features:\n * - Debounced audio triggers (max 1 per 100ms per type)\n * - Intensity-based volume scaling\n * - Random sound variant selection\n * - Uses existing audio assets only\n * - No Three.js rendering (pure coordination logic)\n */\nexport const ParticleAudio3D: React.FC<ParticleAudio3DProps> = ({\n triggers,\n enabled = true,\n onTriggerProcessed,\n}) => {\n const audio = useAudio();\n\n const lastTriggerTime = useRef<Record<ParticleEffectType, number>>({\n arterial: 0,\n bone: 0,\n nerve: 0,\n organ: 0,\n viscosity: 0,\n });\n\n const processedTimestamps = useRef<Set<number>>(new Set());\n\n useEffect(() => {\n if (!enabled || !audio.isInitialized) return;\n\n const now = Date.now();\n\n triggers.forEach((trigger) => {\n if (processedTimestamps.current.has(trigger.timestamp)) {\n return;\n }\n\n const lastTime = lastTriggerTime.current[trigger.effectType];\n if (now - lastTime < DEBOUNCE_TIME) {\n return;\n }\n\n const soundIds = SOUND_MAPPINGS[trigger.effectType];\n const soundId = soundIds[Math.floor(Math.random() * soundIds.length)];\n\n try {\n audio.playSFX(soundId);\n } catch (error) {\n console.warn(`Failed to play particle audio: ${soundId}`, error);\n }\n\n lastTriggerTime.current[trigger.effectType] = now;\n processedTimestamps.current.add(trigger.timestamp);\n\n onTriggerProcessed?.(trigger.timestamp);\n });\n\n if (processedTimestamps.current.size > 1000) {\n const timestamps = Array.from(processedTimestamps.current).sort(\n (a, b) => b - a,\n );\n processedTimestamps.current = new Set(timestamps.slice(0, 500));\n }\n }, [triggers, enabled, audio, onTriggerProcessed]);\n\n return null;\n};\n\n/**\n * Helper function to create audio triggers from particle effects\n */\nexport function createAudioTrigger(\n effectType: ParticleEffectType,\n intensity: number,\n): ParticleAudioTrigger {\n return {\n effectType,\n intensity: Math.max(0, Math.min(1, intensity)),\n timestamp: Date.now(),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiDA,IAAM,gBAAgB;AAEtB,IAAM,iBAAuD;CAC3D,UAAU;EACR;EACA;EACA;EACA;EACA;CACF;CACA,MAAM;EACJ;EACA;EACA;EACA;EACA;CACF;CACA,OAAO;EACL;EACA;EACA;EACA;EACA;CACF;CACA,OAAO;EAAC;EAAa;EAAe;EAAe;CAAsB;CACzE,WAAW,CAAC,eAAe,aAAa;AAC1C;;;;;;;;;;;AAYA,IAAa,mBAAmD,EAC9D,UACA,UAAU,MACV,yBACI;CACJ,MAAM,QAAQ,SAAS;CAEvB,MAAM,kBAAkB,OAA2C;EACjE,UAAU;EACV,MAAM;EACN,OAAO;EACP,OAAO;EACP,WAAW;CACb,CAAC;CAED,MAAM,sBAAsB,uBAAoB,IAAI,IAAI,CAAC;CAEzD,gBAAgB;EACd,IAAI,CAAC,WAAW,CAAC,MAAM,eAAe;EAEtC,MAAM,MAAM,KAAK,IAAI;EAErB,SAAS,SAAS,YAAY;GAC5B,IAAI,oBAAoB,QAAQ,IAAI,QAAQ,SAAS,GACnD;GAIF,IAAI,MADa,gBAAgB,QAAQ,QAAQ,cAC5B,eACnB;GAGF,MAAM,WAAW,eAAe,QAAQ;GACxC,MAAM,UAAU,SAAS,KAAK,MAAM,KAAK,OAAO,IAAI,SAAS,MAAM;GAEnE,IAAI;IACF,MAAM,QAAQ,OAAO;GACvB,SAAS,OAAO;IACd,QAAQ,KAAK,kCAAkC,WAAW,KAAK;GACjE;GAEA,gBAAgB,QAAQ,QAAQ,cAAc;GAC9C,oBAAoB,QAAQ,IAAI,QAAQ,SAAS;GAEjD,qBAAqB,QAAQ,SAAS;EACxC,CAAC;EAED,IAAI,oBAAoB,QAAQ,OAAO,KAAM;GAC3C,MAAM,aAAa,MAAM,KAAK,oBAAoB,OAAO,EAAE,MACxD,GAAG,MAAM,IAAI,CAChB;GACA,oBAAoB,UAAU,IAAI,IAAI,WAAW,MAAM,GAAG,GAAG,CAAC;EAChE;CACF,GAAG;EAAC;EAAU;EAAS;EAAO;CAAkB,CAAC;CAEjD,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"TraumaOverlay3D.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/effects/TraumaOverlay3D.tsx"],"sourcesContent":["/**\n * TraumaOverlay3D - Bruising and injury visualization system\n *\n * Renders progressive bruising, cuts, and bone fracture indicators on 3D character models\n * using shader-based texture overlays with color blending. Bruises darken with repeated\n * hits to the same body region and persist across combat rounds.\n *\n * Features:\n * - Progressive bruising (purple/black gradients)\n * - Cut/laceration marks for sharp strikes\n * - Bone fracture indicators at <30% health\n * - Injury persistence across rounds\n * - Korean-themed injury visualization\n *\n * @module components/combat/TraumaOverlay3D\n * @category Combat Effects\n * @korean 외상오버레이3D\n */\n\nimport { Html } from \"@react-three/drei\";\nimport React, { useMemo } from \"react\";\nimport * as THREE from \"three\";\nimport { KOREAN_COLORS, FONT_FAMILY } from \"../../../../../types/constants\";\nimport { hexToRgbaString } from \"../../../../../utils/colorUtils\";\nimport { InjuryType, Injury } from \"../../../../../types/injury\";\n\n/**\n * Props for TraumaOverlay3D component\n */\nexport interface TraumaOverlay3DProps {\n /** Character ID for injury tracking */\n readonly playerId: string;\n /** Current health (0-100) */\n readonly health: number;\n /** Active injuries to visualize */\n readonly injuries: readonly Injury[];\n /** Character position in world space */\n readonly characterPosition: [number, number, number];\n /** Whether character is mobile (simplified visualization) */\n readonly isMobile?: boolean;\n /** Whether to show fracture indicators */\n readonly showFractures?: boolean;\n}\n\nexport { InjuryType };\nexport type { Injury };\n\n/**\n * Color constants for injury visualization\n */\nconst INJURY_COLORS = {\n BRUISE_FRESH: 0x8B0000, // Dark red (fresh bruise)\n BRUISE_OLD: 0x4B0082, // Indigo (aging bruise)\n BRUISE_SEVERE: 0x000000, // Black (severe bruising)\n CUT_COLOR: 0xFF0000, // Bright red (cut)\n FRACTURE_INDICATOR: KOREAN_COLORS.ACCENT_GOLD, // Gold (bone fracture)\n} as const;\n\n/**\n * Get bruise color based on severity and hit count\n */\nconst getBruiseColor = (severity: number, hitCount: number): number => {\n if (hitCount >= 3 || severity > 0.8) {\n return INJURY_COLORS.BRUISE_SEVERE; // Black for severe/repeated trauma\n } else if (hitCount >= 2 || severity > 0.5) {\n return INJURY_COLORS.BRUISE_OLD; // Indigo for moderate bruising\n } else {\n return INJURY_COLORS.BRUISE_FRESH; // Dark red for fresh bruise\n }\n};\n\n/**\n * Get injury size based on severity\n */\nconst getInjurySize = (severity: number): number => {\n return 0.1 + severity * 0.3; // 0.1 to 0.4 units\n};\n\n/**\n * InjuryMarker - Individual injury visualization\n */\nconst InjuryMarker: React.FC<{\n injury: Injury;\n characterPosition: [number, number, number];\n isMobile: boolean;\n}> = ({ injury, characterPosition, isMobile }) => {\n const worldPosition: [number, number, number] = useMemo(() => {\n return [\n characterPosition[0] + injury.position[0],\n characterPosition[1] + injury.position[1],\n characterPosition[2] + injury.position[2],\n ];\n }, [characterPosition, injury.position]);\n\n const size = useMemo(() => getInjurySize(injury.severity), [injury.severity]);\n\n switch (injury.type) {\n case InjuryType.BRUISE: {\n const color = getBruiseColor(injury.severity, injury.hitCount);\n const opacity = Math.min(0.8, 0.3 + injury.severity * 0.5);\n\n return (\n <mesh position={worldPosition} data-testid={`injury-${injury.id}`}>\n <sphereGeometry args={[size, isMobile ? 8 : 16, isMobile ? 8 : 16]} />\n <meshBasicMaterial\n color={color}\n transparent\n opacity={opacity}\n depthTest={true}\n />\n </mesh>\n );\n }\n\n case InjuryType.CUT:\n case InjuryType.LACERATION: {\n const cutLength = injury.type === InjuryType.LACERATION ? size * 3 : size * 2;\n return (\n <group position={worldPosition} data-testid={`injury-${injury.id}`}>\n {/* Cut mark - thin red line */}\n <mesh>\n <boxGeometry args={[cutLength, 0.02, 0.02]} />\n <meshBasicMaterial\n color={INJURY_COLORS.CUT_COLOR}\n transparent\n opacity={0.9}\n />\n </mesh>\n {/* Blood trail for lacerations */}\n {injury.type === InjuryType.LACERATION && (\n <mesh position={[0, -size * 0.5, 0]}>\n <boxGeometry args={[0.02, size, 0.02]} />\n <meshBasicMaterial\n color={KOREAN_COLORS.BLOODLOSS_INDICATOR}\n transparent\n opacity={0.7}\n />\n </mesh>\n )}\n </group>\n );\n }\n\n case InjuryType.FRACTURE: {\n return (\n <group position={worldPosition} data-testid={`injury-${injury.id}`}>\n {/* Fracture indicator - pulsing gold ring */}\n <mesh rotation={[-Math.PI / 2, 0, 0]}>\n <ringGeometry args={[size * 0.8, size, 16]} />\n <meshBasicMaterial\n color={INJURY_COLORS.FRACTURE_INDICATOR}\n transparent\n opacity={0.6}\n side={THREE.DoubleSide}\n />\n </mesh>\n {/* Cross indicator */}\n <mesh>\n <boxGeometry args={[size * 2, 0.02, 0.02]} />\n <meshBasicMaterial\n color={INJURY_COLORS.FRACTURE_INDICATOR}\n transparent\n opacity={0.8}\n />\n </mesh>\n <mesh rotation={[0, 0, Math.PI / 2]}>\n <boxGeometry args={[size * 2, 0.02, 0.02]} />\n <meshBasicMaterial\n color={INJURY_COLORS.FRACTURE_INDICATOR}\n transparent\n opacity={0.8}\n />\n </mesh>\n </group>\n );\n }\n\n default:\n return null;\n }\n};\n\n/**\n * FractureWarning - Html overlay warning for critical bone damage\n * \n * Rendered as a styled Html overlay with Korean/English text and alert semantics.\n */\nconst FractureWarning: React.FC<{\n health: number;\n isMobile: boolean;\n}> = ({ health, isMobile }) => {\n const warningOpacity = useMemo(() => {\n const rawOpacity = 0.5 + (30 - health) / 60; // 0.5 at 30% health, 1.0 at 0% health\n return Math.min(1, Math.max(0, rawOpacity));\n }, [health]);\n\n if (health >= 30) return null;\n\n return (\n <Html center position={[0, 2.5, 0]}>\n <div\n style={{\n padding: isMobile ? \"8px 12px\" : \"10px 16px\",\n backgroundColor: hexToRgbaString(INJURY_COLORS.FRACTURE_INDICATOR, warningOpacity * 0.3),\n border: `2px solid ${hexToRgbaString(INJURY_COLORS.FRACTURE_INDICATOR, 1)}`,\n borderRadius: \"6px\",\n fontSize: isMobile ? \"12px\" : \"14px\",\n color: hexToRgbaString(INJURY_COLORS.FRACTURE_INDICATOR, 1),\n fontWeight: \"bold\",\n textShadow: \"0 0 4px rgba(0,0,0,0.8)\",\n animation: \"fracturePulse 1s ease-in-out infinite\",\n fontFamily: FONT_FAMILY.KOREAN,\n }}\n data-testid=\"fracture-warning\"\n role=\"alert\"\n aria-live=\"assertive\"\n >\n ⚠️ 골절위험 | Bone Fracture Risk\n </div>\n <style>\n {`\n @keyframes fracturePulse {\n 0%, 100% { opacity: 0.7; transform: scale(1); }\n 50% { opacity: 1; transform: scale(1.05); }\n }\n `}\n </style>\n </Html>\n );\n};\n\n/**\n * TraumaOverlay3D Component\n *\n * Visualizes progressive combat trauma including bruising, cuts, and bone damage\n * on 3D character models. Injuries persist across rounds and darken with repeated\n * hits to the same body region.\n *\n * @example\n * ```tsx\n * const [injuries, setInjuries] = useState<Injury[]>([]);\n *\n * // On hit event\n * const handleHit = (region: BodyRegion, position: [number, number, number], type: InjuryType) => {\n * const existingInjury = injuries.find(i => \n * i.region === region && \n * distance(i.position, position) < 0.2\n * );\n *\n * if (existingInjury) {\n * // Progressive bruising - increase hit count\n * setInjuries(prev => prev.map(i => \n * i.id === existingInjury.id \n * ? { ...i, hitCount: i.hitCount + 1, severity: Math.min(1.0, i.severity + 0.2) }\n * : i\n * ));\n * } else {\n * // New injury\n * setInjuries([...injuries, {\n * id: generateId(),\n * region,\n * type,\n * position,\n * severity: 0.5,\n * hitCount: 1,\n * timestamp: Date.now(),\n * }]);\n * }\n * };\n *\n * <TraumaOverlay3D\n * playerId={playerId}\n * health={playerHealth}\n * injuries={injuries}\n * characterPosition={characterPosition}\n * isMobile={isMobile}\n * showFractures={true}\n * />\n * ```\n */\nexport const TraumaOverlay3D: React.FC<TraumaOverlay3DProps> = ({\n playerId,\n health,\n injuries,\n characterPosition,\n isMobile = false,\n showFractures = true,\n}) => {\n const playerInjuries = useMemo(() => {\n if (playerId === null || playerId === undefined) {\n return injuries;\n }\n\n return injuries.filter((injury) => {\n if (injury.playerId === null || injury.playerId === undefined) {\n return true;\n }\n return injury.playerId === playerId;\n });\n }, [injuries, playerId]);\n\n const { fractures, otherInjuries } = useMemo(() => {\n const frac = playerInjuries.filter((i) => i.type === InjuryType.FRACTURE);\n const other = playerInjuries.filter((i) => i.type !== InjuryType.FRACTURE);\n return { fractures: frac, otherInjuries: other };\n }, [playerInjuries]);\n\n return (\n <group data-testid={`trauma-overlay-${playerId}`}>\n {/* Render non-fracture injuries */}\n {otherInjuries.map((injury) => (\n <InjuryMarker\n key={injury.id}\n injury={injury}\n characterPosition={characterPosition}\n isMobile={isMobile}\n />\n ))}\n\n {/* Render fractures if enabled and health is critical */}\n {showFractures &&\n health < 30 &&\n fractures.map((injury) => (\n <InjuryMarker\n key={injury.id}\n injury={injury}\n characterPosition={characterPosition}\n isMobile={isMobile}\n />\n ))}\n\n {/* Fracture warning overlay */}\n {showFractures && health < 30 && fractures.length > 0 && (\n <FractureWarning health={health} isMobile={isMobile} />\n )}\n </group>\n );\n};\n\nexport default TraumaOverlay3D;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,IAAM,gBAAgB;CACpB,cAAc;CACd,YAAY;CACZ,eAAe;CACf,WAAW;CACX,oBAAoB,cAAc;CACnC;;;;AAKD,IAAM,kBAAkB,UAAkB,aAA6B;CACrE,IAAI,YAAY,KAAK,WAAW,IAC9B,OAAO,cAAc;MAChB,IAAI,YAAY,KAAK,WAAW,IACrC,OAAO,cAAc;MAErB,OAAO,cAAc;;;;;AAOzB,IAAM,iBAAiB,aAA6B;CAClD,OAAO,KAAM,WAAW;;;;;AAM1B,IAAM,gBAIA,EAAE,QAAQ,mBAAmB,eAAe;CAChD,MAAM,gBAA0C,cAAc;EAC5D,OAAO;GACL,kBAAkB,KAAK,OAAO,SAAS;GACvC,kBAAkB,KAAK,OAAO,SAAS;GACvC,kBAAkB,KAAK,OAAO,SAAS;GACxC;IACA,CAAC,mBAAmB,OAAO,SAAS,CAAC;CAExC,MAAM,OAAO,cAAc,cAAc,OAAO,SAAS,EAAE,CAAC,OAAO,SAAS,CAAC;CAE7E,QAAQ,OAAO,MAAf;EACE,KAAK,WAAW,QAAQ;GACtB,MAAM,QAAQ,eAAe,OAAO,UAAU,OAAO,SAAS;GAC9D,MAAM,UAAU,KAAK,IAAI,IAAK,KAAM,OAAO,WAAW,GAAI;GAE1D,OACE,qBAAC,QAAD;IAAM,UAAU;IAAe,eAAa,UAAU,OAAO;cAA7D,CACE,oBAAC,kBAAD,EAAgB,MAAM;KAAC;KAAM,WAAW,IAAI;KAAI,WAAW,IAAI;KAAG,EAAI,CAAA,EACtE,oBAAC,qBAAD;KACS;KACP,aAAA;KACS;KACT,WAAW;KACX,CAAA,CACG;;;EAIX,KAAK,WAAW;EAChB,KAAK,WAAW,YAAY;GAC1B,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QAAQ,MAAM,EAAE,SAAS,WAAW,SAE5C;GAAM,eADZ,eAAe,QAAQ,MAAM,EAAE,SAAS,WAAW,SACxB;GAAO;IAC/C,CAAC,eAAe,CAAC;CAEpB,OACE,qBAAC,SAAD;EAAO,eAAa,kBAAkB;YAAtC;GAEG,cAAc,KAAK,WAClB,oBAAC,cAAD;IAEU;IACW;IACT;IACV,EAJK,OAAO,GAIZ,CACF;GAGD,iBACC,SAAS,MACT,UAAU,KAAK,WACb,oBAAC,cAAD;IAEU;IACW;IACT;IACV,EAJK,OAAO,GAIZ,CACF;GAGH,iBAAiB,SAAS,MAAM,UAAU,SAAS,KAClD,oBAAC,iBAAD;IAAyB;IAAkB;IAAY,CAAA;GAEnD"}
1
+ {"version":3,"file":"TraumaOverlay3D.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/effects/TraumaOverlay3D.tsx"],"sourcesContent":["/**\n * TraumaOverlay3D - Bruising and injury visualization system\n *\n * Renders progressive bruising, cuts, and bone fracture indicators on 3D character models\n * using shader-based texture overlays with color blending. Bruises darken with repeated\n * hits to the same body region and persist across combat rounds.\n *\n * Features:\n * - Progressive bruising (purple/black gradients)\n * - Cut/laceration marks for sharp strikes\n * - Bone fracture indicators at <30% health\n * - Injury persistence across rounds\n * - Korean-themed injury visualization\n *\n * @module components/combat/TraumaOverlay3D\n * @category Combat Effects\n * @korean 외상오버레이3D\n */\n\nimport { Html } from \"@react-three/drei\";\nimport React, { useMemo } from \"react\";\nimport * as THREE from \"three\";\nimport { KOREAN_COLORS, FONT_FAMILY } from \"../../../../../types/constants\";\nimport { hexToRgbaString } from \"../../../../../utils/colorUtils\";\nimport { InjuryType, Injury } from \"../../../../../types/injury\";\n\n/**\n * Props for TraumaOverlay3D component\n */\nexport interface TraumaOverlay3DProps {\n /** Character ID for injury tracking */\n readonly playerId: string;\n /** Current health (0-100) */\n readonly health: number;\n /** Active injuries to visualize */\n readonly injuries: readonly Injury[];\n /** Character position in world space */\n readonly characterPosition: [number, number, number];\n /** Whether character is mobile (simplified visualization) */\n readonly isMobile?: boolean;\n /** Whether to show fracture indicators */\n readonly showFractures?: boolean;\n}\n\nexport { InjuryType };\nexport type { Injury };\n\n/**\n * Color constants for injury visualization\n */\nconst INJURY_COLORS = {\n BRUISE_FRESH: 0x8B0000, // Dark red (fresh bruise)\n BRUISE_OLD: 0x4B0082, // Indigo (aging bruise)\n BRUISE_SEVERE: 0x000000, // Black (severe bruising)\n CUT_COLOR: 0xFF0000, // Bright red (cut)\n FRACTURE_INDICATOR: KOREAN_COLORS.ACCENT_GOLD, // Gold (bone fracture)\n} as const;\n\n/**\n * Get bruise color based on severity and hit count\n */\nconst getBruiseColor = (severity: number, hitCount: number): number => {\n if (hitCount >= 3 || severity > 0.8) {\n return INJURY_COLORS.BRUISE_SEVERE; // Black for severe/repeated trauma\n } else if (hitCount >= 2 || severity > 0.5) {\n return INJURY_COLORS.BRUISE_OLD; // Indigo for moderate bruising\n } else {\n return INJURY_COLORS.BRUISE_FRESH; // Dark red for fresh bruise\n }\n};\n\n/**\n * Get injury size based on severity\n */\nconst getInjurySize = (severity: number): number => {\n return 0.1 + severity * 0.3; // 0.1 to 0.4 units\n};\n\n/**\n * InjuryMarker - Individual injury visualization\n */\nconst InjuryMarker: React.FC<{\n injury: Injury;\n characterPosition: [number, number, number];\n isMobile: boolean;\n}> = ({ injury, characterPosition, isMobile }) => {\n const worldPosition: [number, number, number] = useMemo(() => {\n return [\n characterPosition[0] + injury.position[0],\n characterPosition[1] + injury.position[1],\n characterPosition[2] + injury.position[2],\n ];\n }, [characterPosition, injury.position]);\n\n const size = useMemo(() => getInjurySize(injury.severity), [injury.severity]);\n\n switch (injury.type) {\n case InjuryType.BRUISE: {\n const color = getBruiseColor(injury.severity, injury.hitCount);\n const opacity = Math.min(0.8, 0.3 + injury.severity * 0.5);\n\n return (\n <mesh position={worldPosition} data-testid={`injury-${injury.id}`}>\n <sphereGeometry args={[size, isMobile ? 8 : 16, isMobile ? 8 : 16]} />\n <meshBasicMaterial\n color={color}\n transparent\n opacity={opacity}\n depthTest={true}\n />\n </mesh>\n );\n }\n\n case InjuryType.CUT:\n case InjuryType.LACERATION: {\n const cutLength = injury.type === InjuryType.LACERATION ? size * 3 : size * 2;\n return (\n <group position={worldPosition} data-testid={`injury-${injury.id}`}>\n {/* Cut mark - thin red line */}\n <mesh>\n <boxGeometry args={[cutLength, 0.02, 0.02]} />\n <meshBasicMaterial\n color={INJURY_COLORS.CUT_COLOR}\n transparent\n opacity={0.9}\n />\n </mesh>\n {/* Blood trail for lacerations */}\n {injury.type === InjuryType.LACERATION && (\n <mesh position={[0, -size * 0.5, 0]}>\n <boxGeometry args={[0.02, size, 0.02]} />\n <meshBasicMaterial\n color={KOREAN_COLORS.BLOODLOSS_INDICATOR}\n transparent\n opacity={0.7}\n />\n </mesh>\n )}\n </group>\n );\n }\n\n case InjuryType.FRACTURE: {\n return (\n <group position={worldPosition} data-testid={`injury-${injury.id}`}>\n {/* Fracture indicator - pulsing gold ring */}\n <mesh rotation={[-Math.PI / 2, 0, 0]}>\n <ringGeometry args={[size * 0.8, size, 16]} />\n <meshBasicMaterial\n color={INJURY_COLORS.FRACTURE_INDICATOR}\n transparent\n opacity={0.6}\n side={THREE.DoubleSide}\n />\n </mesh>\n {/* Cross indicator */}\n <mesh>\n <boxGeometry args={[size * 2, 0.02, 0.02]} />\n <meshBasicMaterial\n color={INJURY_COLORS.FRACTURE_INDICATOR}\n transparent\n opacity={0.8}\n />\n </mesh>\n <mesh rotation={[0, 0, Math.PI / 2]}>\n <boxGeometry args={[size * 2, 0.02, 0.02]} />\n <meshBasicMaterial\n color={INJURY_COLORS.FRACTURE_INDICATOR}\n transparent\n opacity={0.8}\n />\n </mesh>\n </group>\n );\n }\n\n default:\n return null;\n }\n};\n\n/**\n * FractureWarning - Html overlay warning for critical bone damage\n * \n * Rendered as a styled Html overlay with Korean/English text and alert semantics.\n */\nconst FractureWarning: React.FC<{\n health: number;\n isMobile: boolean;\n}> = ({ health, isMobile }) => {\n const warningOpacity = useMemo(() => {\n const rawOpacity = 0.5 + (30 - health) / 60; // 0.5 at 30% health, 1.0 at 0% health\n return Math.min(1, Math.max(0, rawOpacity));\n }, [health]);\n\n if (health >= 30) return null;\n\n return (\n <Html center position={[0, 2.5, 0]}>\n <div\n style={{\n padding: isMobile ? \"8px 12px\" : \"10px 16px\",\n backgroundColor: hexToRgbaString(INJURY_COLORS.FRACTURE_INDICATOR, warningOpacity * 0.3),\n border: `2px solid ${hexToRgbaString(INJURY_COLORS.FRACTURE_INDICATOR, 1)}`,\n borderRadius: \"6px\",\n fontSize: isMobile ? \"12px\" : \"14px\",\n color: hexToRgbaString(INJURY_COLORS.FRACTURE_INDICATOR, 1),\n fontWeight: \"bold\",\n textShadow: \"0 0 4px rgba(0,0,0,0.8)\",\n animation: \"fracturePulse 1s ease-in-out infinite\",\n fontFamily: FONT_FAMILY.KOREAN,\n }}\n data-testid=\"fracture-warning\"\n role=\"alert\"\n aria-live=\"assertive\"\n >\n ⚠️ 골절위험 | Bone Fracture Risk\n </div>\n <style>\n {`\n @keyframes fracturePulse {\n 0%, 100% { opacity: 0.7; transform: scale(1); }\n 50% { opacity: 1; transform: scale(1.05); }\n }\n `}\n </style>\n </Html>\n );\n};\n\n/**\n * TraumaOverlay3D Component\n *\n * Visualizes progressive combat trauma including bruising, cuts, and bone damage\n * on 3D character models. Injuries persist across rounds and darken with repeated\n * hits to the same body region.\n *\n * @example\n * ```tsx\n * const [injuries, setInjuries] = useState<Injury[]>([]);\n *\n * // On hit event\n * const handleHit = (region: BodyRegion, position: [number, number, number], type: InjuryType) => {\n * const existingInjury = injuries.find(i => \n * i.region === region && \n * distance(i.position, position) < 0.2\n * );\n *\n * if (existingInjury) {\n * // Progressive bruising - increase hit count\n * setInjuries(prev => prev.map(i => \n * i.id === existingInjury.id \n * ? { ...i, hitCount: i.hitCount + 1, severity: Math.min(1.0, i.severity + 0.2) }\n * : i\n * ));\n * } else {\n * // New injury\n * setInjuries([...injuries, {\n * id: generateId(),\n * region,\n * type,\n * position,\n * severity: 0.5,\n * hitCount: 1,\n * timestamp: Date.now(),\n * }]);\n * }\n * };\n *\n * <TraumaOverlay3D\n * playerId={playerId}\n * health={playerHealth}\n * injuries={injuries}\n * characterPosition={characterPosition}\n * isMobile={isMobile}\n * showFractures={true}\n * />\n * ```\n */\nexport const TraumaOverlay3D: React.FC<TraumaOverlay3DProps> = ({\n playerId,\n health,\n injuries,\n characterPosition,\n isMobile = false,\n showFractures = true,\n}) => {\n const playerInjuries = useMemo(() => {\n if (playerId === null || playerId === undefined) {\n return injuries;\n }\n\n return injuries.filter((injury) => {\n if (injury.playerId === null || injury.playerId === undefined) {\n return true;\n }\n return injury.playerId === playerId;\n });\n }, [injuries, playerId]);\n\n const { fractures, otherInjuries } = useMemo(() => {\n const frac = playerInjuries.filter((i) => i.type === InjuryType.FRACTURE);\n const other = playerInjuries.filter((i) => i.type !== InjuryType.FRACTURE);\n return { fractures: frac, otherInjuries: other };\n }, [playerInjuries]);\n\n return (\n <group data-testid={`trauma-overlay-${playerId}`}>\n {/* Render non-fracture injuries */}\n {otherInjuries.map((injury) => (\n <InjuryMarker\n key={injury.id}\n injury={injury}\n characterPosition={characterPosition}\n isMobile={isMobile}\n />\n ))}\n\n {/* Render fractures if enabled and health is critical */}\n {showFractures &&\n health < 30 &&\n fractures.map((injury) => (\n <InjuryMarker\n key={injury.id}\n injury={injury}\n characterPosition={characterPosition}\n isMobile={isMobile}\n />\n ))}\n\n {/* Fracture warning overlay */}\n {showFractures && health < 30 && fractures.length > 0 && (\n <FractureWarning health={health} isMobile={isMobile} />\n )}\n </group>\n );\n};\n\nexport default TraumaOverlay3D;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,IAAM,gBAAgB;CACpB,cAAc;CACd,YAAY;CACZ,eAAe;CACf,WAAW;CACX,oBAAoB,cAAc;AACpC;;;;AAKA,IAAM,kBAAkB,UAAkB,aAA6B;CACrE,IAAI,Y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;GAGA,iBACC,SAAS,MACT,UAAU,KAAK,WACb,oBAAC,cAAD;IAEU;IACW;IACT;GACX,GAJM,OAAO,EAIb,CACF;GAGF,iBAAiB,SAAS,MAAM,UAAU,SAAS,KAClD,oBAAC,iBAAD;IAAyB;IAAkB;GAAW,CAAA;EAEnD;;AAEX"}
@@ -1 +1 @@
1
- {"version":3,"file":"MatchCountdown.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/feedback/MatchCountdown.tsx"],"sourcesContent":["/**\n * MatchCountdown Component - Displays match start countdown sequence\n *\n * Korean: 매치 시작 카운트다운 (Match Start Countdown)\n *\n * Shows \"Ready?\" → \"3... 2... 1...\" → \"Fight!\" sequence with animations.\n * Implements Korean cyberpunk aesthetic with bilingual text support.\n * Plays audio cues for countdown and fight announcement.\n *\n * Refactored to use useKoreanTheme for consistent styling.\n *\n * @module components/combat/MatchCountdown\n * @category Combat UI\n */\n\nimport React, { useEffect, useMemo, useRef } from \"react\";\nimport { useAudio } from \"../../../../../audio/AudioProvider\";\nimport {\n MatchCountdownState,\n useMatchCountdown,\n} from \"../../../../../hooks/useMatchCountdown\";\nimport { useKoreanTheme } from \"../../../../shared/base/useKoreanTheme\";\nimport { hexColorToCSS } from \"../../../../../utils/colorUtils\";\n\n/**\n * Props for the MatchCountdown component\n */\nexport interface MatchCountdownProps {\n /** Callback when countdown completes */\n readonly onComplete: () => void;\n /** Whether layout should adapt for mobile screens */\n readonly isMobile: boolean;\n /** Optional callback for skip button */\n readonly onSkip?: () => void;\n /** Whether skip button should be shown */\n readonly showSkip?: boolean;\n}\n\n/**\n * Get display text for current countdown state\n */\nfunction getDisplayText(\n state: MatchCountdownState,\n currentNumber: number\n): {\n ko: string;\n en: string;\n} | null {\n switch (state) {\n case \"ready\":\n return { ko: \"준비?\", en: \"Ready?\" };\n case \"counting\":\n return { ko: String(currentNumber), en: String(currentNumber) };\n case \"fight\":\n return { ko: \"전투!\", en: \"Fight!\" };\n default:\n return null;\n }\n}\n\n/**\n * MatchCountdown Component\n *\n * Displays match start countdown with:\n * - \"Ready?\" announcement (1 second)\n * - Countdown from 3 to 1 (1 second intervals)\n * - \"Fight!\" announcement (1 second)\n * - Pulse/scale animations for emphasis\n * - Bilingual Korean-English text\n * - Audio cues for countdown and fight\n * - Optional skip button\n * - Responsive sizing for mobile/tablet/desktop\n *\n * Korean: 매치 시작 카운트다운 컴포넌트\n */\nconst COUNTDOWN_CONFIG = {\n readyDuration: 1,\n countdownInterval: 1,\n fightDuration: 1,\n startNumber: 3,\n} as const;\n\nexport const MatchCountdown: React.FC<MatchCountdownProps> = ({\n onComplete,\n isMobile,\n onSkip,\n showSkip = false,\n}) => {\n const audio = useAudio();\n const theme = useKoreanTheme({ variant: \"primary\", size: \"xlarge\", isMobile });\n\n const { state, currentNumber, startCountdown, skipCountdown, isActive } =\n useMatchCountdown(COUNTDOWN_CONFIG, onComplete);\n\n const hasStartedRef = useRef(false);\n\n useEffect(() => {\n if (!hasStartedRef.current) {\n hasStartedRef.current = true;\n startCountdown();\n }\n }, [startCountdown]);\n\n useEffect(() => {\n if (!audio.isAudioReady) return;\n\n if (state === \"counting\" && currentNumber > 0) {\n audio.playSFX(\"attack_light\"); // Using placeholder - will be countdown_beep\n } else if (state === \"fight\") {\n audio.playSFX(\"attack_heavy\"); // Using placeholder - will be fight_start\n }\n }, [state, currentNumber, audio]);\n\n const handleSkip = () => {\n skipCountdown();\n onSkip?.();\n };\n\n const displayText = getDisplayText(state, currentNumber);\n\n const getMainFontSize = (): string => {\n if (isMobile) {\n return state === \"fight\" ? \"72px\" : \"64px\";\n }\n return state === \"fight\" ? \"120px\" : \"96px\";\n };\n\n const getSubFontSize = (): string => {\n if (isMobile) {\n return state === \"fight\" ? \"48px\" : \"40px\";\n }\n return state === \"fight\" ? \"72px\" : \"56px\";\n };\n\n const mainFontSize = getMainFontSize();\n const subFontSize = getSubFontSize();\n\n const goldColor = useMemo(() => hexColorToCSS(theme.colors.ACCENT_GOLD), [theme.colors.ACCENT_GOLD]);\n const cyanColor = useMemo(\n () => hexColorToCSS(theme.colors.PRIMARY_CYAN),\n [theme.colors.PRIMARY_CYAN]\n );\n const darkBg = useMemo(\n () => hexColorToCSS(theme.colors.UI_BACKGROUND_DARK),\n [theme.colors.UI_BACKGROUND_DARK]\n );\n\n if (!isActive || !displayText) {\n return null;\n }\n\n return (\n <>\n <div\n data-testid=\"match-countdown\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Match countdown in progress\"\n aria-live=\"assertive\"\n style={{\n position: \"fixed\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: state === \"fight\" ? `${darkBg}cc` : `${darkBg}ee`,\n zIndex: 1000,\n animation: state === \"ready\" ? \"fadeIn 0.3s ease-in\" : \"none\",\n }}\n >\n <div\n style={{\n fontSize: mainFontSize,\n fontWeight: \"bold\",\n color: state === \"fight\" ? goldColor : cyanColor,\n fontFamily: theme.fontFamily.KOREAN,\n textShadow: `0 0 ${state === \"fight\" ? \"40px\" : \"30px\"} ${\n state === \"fight\" ? goldColor : cyanColor\n }`,\n animation:\n state === \"ready\"\n ? \"pulse 0.8s ease-out\"\n : state === \"counting\"\n ? \"countdownPulse 0.8s ease-out\"\n : state === \"fight\"\n ? \"flash 0.3s ease-out\"\n : \"none\",\n textAlign: \"center\",\n userSelect: \"none\",\n }}\n data-testid=\"countdown-text\"\n >\n {displayText.ko}\n <br />\n <span\n style={{\n fontSize: subFontSize,\n }}\n >\n {displayText.en}\n </span>\n </div>\n\n {/* Optional Skip Button */}\n {showSkip && state !== \"fight\" && (\n <button\n onClick={handleSkip}\n data-testid=\"skip-countdown-button\"\n aria-label=\"Skip countdown\"\n style={{\n position: \"absolute\",\n bottom: isMobile ? \"40px\" : \"60px\",\n padding: isMobile ? \"10px 24px\" : \"12px 32px\",\n fontSize: isMobile ? \"14px\" : \"16px\",\n backgroundColor: cyanColor,\n color: darkBg,\n border: \"none\",\n borderRadius: \"6px\",\n fontFamily: theme.fontFamily.KOREAN,\n fontWeight: \"bold\",\n cursor: \"pointer\",\n transition: \"all 0.2s ease\",\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.transform = \"scale(1.05)\";\n e.currentTarget.style.boxShadow = `0 0 20px ${cyanColor}`;\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.transform = \"scale(1)\";\n e.currentTarget.style.boxShadow = \"none\";\n }}\n onFocus={(e) => {\n e.currentTarget.style.transform = \"scale(1.05)\";\n e.currentTarget.style.boxShadow = `0 0 20px ${cyanColor}`;\n e.currentTarget.style.outline = `2px solid ${cyanColor}`;\n }}\n onBlur={(e) => {\n e.currentTarget.style.transform = \"scale(1)\";\n e.currentTarget.style.boxShadow = \"none\";\n e.currentTarget.style.outline = \"none\";\n }}\n >\n 건너뛰기 | Skip\n </button>\n )}\n </div>\n\n {/* CSS Animations */}\n <style>\n {`\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes pulse {\n 0% {\n opacity: 0;\n transform: scale(0.9);\n }\n 50% {\n opacity: 1;\n transform: scale(1.05);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n @keyframes countdownPulse {\n 0% {\n opacity: 0;\n transform: scale(1.2);\n }\n 50% {\n opacity: 1;\n transform: scale(1.1);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n @keyframes flash {\n 0% {\n opacity: 0;\n transform: scale(1.5);\n }\n 30% {\n opacity: 1;\n transform: scale(1.3);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n }\n `}\n </style>\n </>\n );\n};\n\nexport default MatchCountdown;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyCA,SAAS,eACP,OACA,eAIO;CACP,QAAQ,OAAR;EACE,KAAK,SACH,OAAO;GAAE,IAAI;GAAO,IAAI;GAAU;EACpC,KAAK,YACH,OAAO;GAAE,IAAI,OA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hD,eAAe,MAAM;IACnB,EAAE,cAAc,MAAM,YAAY;IAClC,EAAE,cAAc,MAAM,YAAY;;GAEpC,UAAU,MAAM;IACd,EAAE,cAAc,MAAM,YAAY;IAClC,EAAE,cAAc,MAAM,YAAY,YAAY;IAC9C,EAAE,cAAc,MAAM,UAAU,aAAa;;GAE/C,SAAS,MAAM;IACb,EAAE,cAAc,MAAM,YAAY;IAClC,EAAE,cAAc,MAAM,YAAY;IAClC,EAAE,cAAc,MAAM,UAAU;;aAEnC;GAEQ,CAAA,CAEP;KAGN,oBAAC,SAAD,EAAA,UACG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAuDK,CAAA,CACP,EAAA,CAAA"}
1
+ {"version":3,"file":"MatchCountdown.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/feedback/MatchCountdown.tsx"],"sourcesContent":["/**\n * MatchCountdown Component - Displays match start countdown sequence\n *\n * Korean: 매치 시작 카운트다운 (Match Start Countdown)\n *\n * Shows \"Ready?\" → \"3... 2... 1...\" → \"Fight!\" sequence with animations.\n * Implements Korean cyberpunk aesthetic with bilingual text support.\n * Plays audio cues for countdown and fight announcement.\n *\n * Refactored to use useKoreanTheme for consistent styling.\n *\n * @module components/combat/MatchCountdown\n * @category Combat UI\n */\n\nimport React, { useEffect, useMemo, useRef } from \"react\";\nimport { useAudio } from \"../../../../../audio/AudioProvider\";\nimport {\n MatchCountdownState,\n useMatchCountdown,\n} from \"../../../../../hooks/useMatchCountdown\";\nimport { useKoreanTheme } from \"../../../../shared/base/useKoreanTheme\";\nimport { hexColorToCSS } from \"../../../../../utils/colorUtils\";\n\n/**\n * Props for the MatchCountdown component\n */\nexport interface MatchCountdownProps {\n /** Callback when countdown completes */\n readonly onComplete: () => void;\n /** Whether layout should adapt for mobile screens */\n readonly isMobile: boolean;\n /** Optional callback for skip button */\n readonly onSkip?: () => void;\n /** Whether skip button should be shown */\n readonly showSkip?: boolean;\n}\n\n/**\n * Get display text for current countdown state\n */\nfunction getDisplayText(\n state: MatchCountdownState,\n currentNumber: number\n): {\n ko: string;\n en: string;\n} | null {\n switch (state) {\n case \"ready\":\n return { ko: \"준비?\", en: \"Ready?\" };\n case \"counting\":\n return { ko: String(currentNumber), en: String(currentNumber) };\n case \"fight\":\n return { ko: \"전투!\", en: \"Fight!\" };\n default:\n return null;\n }\n}\n\n/**\n * MatchCountdown Component\n *\n * Displays match start countdown with:\n * - \"Ready?\" announcement (1 second)\n * - Countdown from 3 to 1 (1 second intervals)\n * - \"Fight!\" announcement (1 second)\n * - Pulse/scale animations for emphasis\n * - Bilingual Korean-English text\n * - Audio cues for countdown and fight\n * - Optional skip button\n * - Responsive sizing for mobile/tablet/desktop\n *\n * Korean: 매치 시작 카운트다운 컴포넌트\n */\nconst COUNTDOWN_CONFIG = {\n readyDuration: 1,\n countdownInterval: 1,\n fightDuration: 1,\n startNumber: 3,\n} as const;\n\nexport const MatchCountdown: React.FC<MatchCountdownProps> = ({\n onComplete,\n isMobile,\n onSkip,\n showSkip = false,\n}) => {\n const audio = useAudio();\n const theme = useKoreanTheme({ variant: \"primary\", size: \"xlarge\", isMobile });\n\n const { state, currentNumber, startCountdown, skipCountdown, isActive } =\n useMatchCountdown(COUNTDOWN_CONFIG, onComplete);\n\n const hasStartedRef = useRef(false);\n\n useEffect(() => {\n if (!hasStartedRef.current) {\n hasStartedRef.current = true;\n startCountdown();\n }\n }, [startCountdown]);\n\n useEffect(() => {\n if (!audio.isAudioReady) return;\n\n if (state === \"counting\" && currentNumber > 0) {\n audio.playSFX(\"attack_light\"); // Using placeholder - will be countdown_beep\n } else if (state === \"fight\") {\n audio.playSFX(\"attack_heavy\"); // Using placeholder - will be fight_start\n }\n }, [state, currentNumber, audio]);\n\n const handleSkip = () => {\n skipCountdown();\n onSkip?.();\n };\n\n const displayText = getDisplayText(state, currentNumber);\n\n const getMainFontSize = (): string => {\n if (isMobile) {\n return state === \"fight\" ? \"72px\" : \"64px\";\n }\n return state === \"fight\" ? \"120px\" : \"96px\";\n };\n\n const getSubFontSize = (): string => {\n if (isMobile) {\n return state === \"fight\" ? \"48px\" : \"40px\";\n }\n return state === \"fight\" ? \"72px\" : \"56px\";\n };\n\n const mainFontSize = getMainFontSize();\n const subFontSize = getSubFontSize();\n\n const goldColor = useMemo(() => hexColorToCSS(theme.colors.ACCENT_GOLD), [theme.colors.ACCENT_GOLD]);\n const cyanColor = useMemo(\n () => hexColorToCSS(theme.colors.PRIMARY_CYAN),\n [theme.colors.PRIMARY_CYAN]\n );\n const darkBg = useMemo(\n () => hexColorToCSS(theme.colors.UI_BACKGROUND_DARK),\n [theme.colors.UI_BACKGROUND_DARK]\n );\n\n if (!isActive || !displayText) {\n return null;\n }\n\n return (\n <>\n <div\n data-testid=\"match-countdown\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Match countdown in progress\"\n aria-live=\"assertive\"\n style={{\n position: \"fixed\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: state === \"fight\" ? `${darkBg}cc` : `${darkBg}ee`,\n zIndex: 1000,\n animation: state === \"ready\" ? \"fadeIn 0.3s ease-in\" : \"none\",\n }}\n >\n <div\n style={{\n fontSize: mainFontSize,\n fontWeight: \"bold\",\n color: state === \"fight\" ? goldColor : cyanColor,\n fontFamily: theme.fontFamily.KOREAN,\n textShadow: `0 0 ${state === \"fight\" ? \"40px\" : \"30px\"} ${\n state === \"fight\" ? goldColor : cyanColor\n }`,\n animation:\n state === \"ready\"\n ? \"pulse 0.8s ease-out\"\n : state === \"counting\"\n ? \"countdownPulse 0.8s ease-out\"\n : state === \"fight\"\n ? \"flash 0.3s ease-out\"\n : \"none\",\n textAlign: \"center\",\n userSelect: \"none\",\n }}\n data-testid=\"countdown-text\"\n >\n {displayText.ko}\n <br />\n <span\n style={{\n fontSize: subFontSize,\n }}\n >\n {displayText.en}\n </span>\n </div>\n\n {/* Optional Skip Button */}\n {showSkip && state !== \"fight\" && (\n <button\n onClick={handleSkip}\n data-testid=\"skip-countdown-button\"\n aria-label=\"Skip countdown\"\n style={{\n position: \"absolute\",\n bottom: isMobile ? \"40px\" : \"60px\",\n padding: isMobile ? \"10px 24px\" : \"12px 32px\",\n fontSize: isMobile ? \"14px\" : \"16px\",\n backgroundColor: cyanColor,\n color: darkBg,\n border: \"none\",\n borderRadius: \"6px\",\n fontFamily: theme.fontFamily.KOREAN,\n fontWeight: \"bold\",\n cursor: \"pointer\",\n transition: \"all 0.2s ease\",\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.transform = \"scale(1.05)\";\n e.currentTarget.style.boxShadow = `0 0 20px ${cyanColor}`;\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.transform = \"scale(1)\";\n e.currentTarget.style.boxShadow = \"none\";\n }}\n onFocus={(e) => {\n e.currentTarget.style.transform = \"scale(1.05)\";\n e.currentTarget.style.boxShadow = `0 0 20px ${cyanColor}`;\n e.currentTarget.style.outline = `2px solid ${cyanColor}`;\n }}\n onBlur={(e) => {\n e.currentTarget.style.transform = \"scale(1)\";\n e.currentTarget.style.boxShadow = \"none\";\n e.currentTarget.style.outline = \"none\";\n }}\n >\n 건너뛰기 | Skip\n </button>\n )}\n </div>\n\n {/* CSS Animations */}\n <style>\n {`\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes pulse {\n 0% {\n opacity: 0;\n transform: scale(0.9);\n }\n 50% {\n opacity: 1;\n transform: scale(1.05);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n @keyframes countdownPulse {\n 0% {\n opacity: 0;\n transform: scale(1.2);\n }\n 50% {\n opacity: 1;\n transform: scale(1.1);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n @keyframes flash {\n 0% {\n opacity: 0;\n transform: scale(1.5);\n }\n 30% {\n opacity: 1;\n transform: scale(1.3);\n }\n 100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AU;IACV,QAAQ,WAAW,SAAS;IAC5B,SAAS,WAAW,cAAc;IAClC,UAAU,WAAW,SAAS;IAC9B,iBAAiB;IACjB,OAAO;IACP,QAAQ;IACR,cAAc;IACd,YAAY,MAAM,WAAW;IAC7B,YAAY;IACZ,QAAQ;IACR,YAAY;GACd;GACA,eAAe,MAAM;IACnB,EAAE,cAAc,MAAM,YAAY;IAClC,EAAE,cAAc,MAAM,YAAY,YAAY;GAChD;GACA,eAAe,MAAM;IACnB,EAAE,cAAc,MAAM,YAAY;IAClC,EAAE,cAAc,MAAM,YAAY;GACpC;GACA,UAAU,MAAM;IACd,EAAE,cAAc,MAAM,YAAY;IAClC,EAAE,cAAc,MAAM,YAAY,YAAY;IAC9C,EAAE,cAAc,MAAM,UAAU,aAAa;GAC/C;GACA,SAAS,MAAM;IACb,EAAE,cAAc,MAAM,YAAY;IAClC,EAAE,cAAc,MAAM,YAAY;IAClC,EAAE,cAAc,MAAM,UAAU;GAClC;aACD;EAEO,CAAA,CAEP;KAGL,oBAAC,SAAD,EAAA,UACG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAuDI,CAAA,CACP,EAAA,CAAA;AAEN"}
@@ -1 +1 @@
1
- {"version":3,"file":"RoundAnnouncementOverlayHtml.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/feedback/RoundAnnouncementOverlayHtml.tsx"],"sourcesContent":["/**\n * RoundAnnouncement Component - Displays round completion and transition UI\n *\n * Korean: 라운드 발표 (Round Announcement)\n *\n * Shows round winner, current score, statistics, and countdown to next round.\n * Implements Korean cyberpunk aesthetic with bilingual text support.\n *\n * Refactored to use useKoreanTheme for consistent styling.\n *\n * @module components/combat/RoundAnnouncement\n * @category Combat UI\n */\n\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { PlayerState } from \"../../../../../systems\";\nimport { useKoreanTheme } from \"../../../../shared/base/useKoreanTheme\";\nimport { hexColorToCSS } from \"../../../../../utils/colorUtils\";\n\n/**\n * Round statistics displayed between rounds\n *\n * Korean: 라운드 통계 (Round Statistics)\n */\nexport interface RoundStats {\n /** Total damage dealt by player */\n readonly damageDealt: number;\n /** Number of hits successfully landed */\n readonly hitsLanded: number;\n /** Number of vital points struck */\n readonly vitalPointsHit: number;\n /** Combat accuracy percentage */\n readonly accuracy: number;\n}\n\n/**\n * Props for the RoundAnnouncement component\n */\nexport interface RoundAnnouncementProps {\n /** Current round number (1-based) */\n readonly roundNumber: number;\n /** Round winner, or null if round was a draw */\n readonly roundWinner: PlayerState | null;\n /** Current match score (player1 wins, player2 wins) */\n readonly currentScore: { readonly player1: number; readonly player2: number };\n /** Round statistics to display */\n readonly roundStats?: RoundStats;\n /** Callback when countdown completes */\n readonly onCountdownComplete: () => void;\n /** Callback when skip button is pressed */\n readonly onSkip: () => void;\n /** Whether layout should adapt for mobile screens */\n readonly isMobile: boolean;\n /** Total number of rounds in match (for match point detection) */\n readonly totalRounds?: number;\n /** Countdown duration in seconds */\n readonly countdownDuration?: number;\n}\n\n/**\n * RoundAnnouncement Component\n *\n * Displays round completion announcement with:\n * - Bilingual round completion title\n * - Round winner display\n * - Current match score\n * - Round statistics (damage, hits, accuracy)\n * - Countdown to next round\n * - Skip button for quick play\n * - Match point indicator for final rounds\n * - Uses useKoreanTheme for consistent styling\n *\n * Korean: 라운드 종료 발표 컴포넌트\n */\nexport const RoundAnnouncement: React.FC<RoundAnnouncementProps> = ({\n roundNumber,\n roundWinner,\n currentScore,\n roundStats,\n onCountdownComplete,\n onSkip,\n isMobile,\n totalRounds = 3,\n countdownDuration = 3,\n}) => {\n const theme = useKoreanTheme({ variant: \"primary\", size: \"large\", isMobile });\n const [countdown, setCountdown] = useState(countdownDuration);\n const [isVisible, setIsVisible] = useState(false);\n const hasCompletedRef = useRef(false);\n\n const onCountdownCompleteRef = useRef(onCountdownComplete);\n useEffect(() => {\n onCountdownCompleteRef.current = onCountdownComplete;\n }, [onCountdownComplete]);\n\n const handleCountdownComplete = useCallback(() => {\n onCountdownCompleteRef.current();\n }, []);\n\n useEffect(() => {\n const timer = setTimeout(() => setIsVisible(true), 50);\n return () => clearTimeout(timer);\n }, []);\n\n useEffect(() => {\n if (countdown <= 0) {\n if (!hasCompletedRef.current) {\n hasCompletedRef.current = true;\n handleCountdownComplete();\n }\n return;\n }\n\n const timer = setInterval(() => {\n setCountdown((prev) => {\n if (prev <= 1) {\n return 0;\n }\n return prev - 1;\n });\n }, 1000);\n\n return () => clearInterval(timer);\n }, [countdown, handleCountdownComplete]);\n\n const isMatchPoint = useMemo(() => {\n const maxScore = Math.max(currentScore.player1, currentScore.player2);\n const roundsToWin = Math.ceil(totalRounds / 2);\n return maxScore === roundsToWin - 1;\n }, [currentScore, totalRounds]);\n\n const goldColor = useMemo(\n () => hexColorToCSS(theme.colors.ACCENT_GOLD),\n [theme.colors.ACCENT_GOLD]\n );\n const cyanColor = useMemo(\n () => hexColorToCSS(theme.colors.PRIMARY_CYAN),\n [theme.colors.PRIMARY_CYAN]\n );\n const darkBg = useMemo(\n () => hexColorToCSS(theme.colors.UI_BACKGROUND_DARK),\n [theme.colors.UI_BACKGROUND_DARK]\n );\n const textSecondary = useMemo(\n () => hexColorToCSS(theme.colors.TEXT_SECONDARY),\n [theme.colors.TEXT_SECONDARY]\n );\n\n const containerStyle = useMemo(\n () => ({\n position: \"fixed\" as const,\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n flexDirection: \"column\" as const,\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: `${darkBg}dd`,\n zIndex: 1000,\n opacity: isVisible ? 1 : 0,\n transition: \"opacity 0.3s ease-in-out\",\n }),\n [darkBg, isVisible]\n );\n\n return (\n <div data-testid=\"round-announcement\" style={containerStyle}>\n {/* Match Point Indicator */}\n {isMatchPoint && (\n <div\n style={{\n fontSize: isMobile ? \"20px\" : \"28px\",\n color: goldColor,\n fontFamily: theme.fontFamily.KOREAN,\n fontWeight: \"bold\",\n marginBottom: isMobile ? \"10px\" : \"20px\",\n textShadow: `0 0 20px ${goldColor}`,\n animation: \"pulse 1s infinite\",\n }}\n data-testid=\"match-point-indicator\"\n >\n 매치 포인트! | Match Point!\n </div>\n )}\n\n {/* Round Complete Title */}\n <h1\n style={{\n fontSize: isMobile ? \"36px\" : \"56px\",\n color: goldColor,\n fontFamily: theme.fontFamily.KOREAN,\n fontWeight: \"bold\",\n margin: `0 0 ${isMobile ? \"20px\" : \"30px\"} 0`,\n textShadow: `0 0 30px ${goldColor}`,\n textAlign: \"center\",\n }}\n data-testid=\"round-complete-title\"\n >\n 라운드 {roundNumber} 완료!\n <br />\n Round {roundNumber} Complete!\n </h1>\n\n {/* Round Winner */}\n {roundWinner && (\n <div\n style={{\n fontSize: isMobile ? \"24px\" : \"36px\",\n color: cyanColor,\n fontFamily: theme.fontFamily.KOREAN,\n margin: `0 0 ${isMobile ? \"20px\" : \"30px\"} 0`,\n textAlign: \"center\",\n }}\n data-testid=\"round-winner\"\n >\n 승자 | Winner: {roundWinner.name.korean} | {roundWinner.name.english}\n </div>\n )}\n\n {/* Current Score */}\n <div\n style={{\n display: \"flex\",\n gap: isMobile ? \"40px\" : \"80px\",\n marginBottom: isMobile ? \"20px\" : \"30px\",\n fontSize: isMobile ? \"32px\" : \"48px\",\n fontWeight: \"bold\",\n }}\n data-testid=\"current-score\"\n >\n <div style={{ textAlign: \"center\" }}>\n <div\n style={{\n fontSize: isMobile ? \"14px\" : \"18px\",\n color: cyanColor,\n marginBottom: \"8px\",\n }}\n >\n Player 1\n </div>\n <div style={{ color: goldColor }}>{currentScore.player1}</div>\n </div>\n <div style={{ color: cyanColor }}>-</div>\n <div style={{ textAlign: \"center\" }}>\n <div\n style={{\n fontSize: isMobile ? \"14px\" : \"18px\",\n color: cyanColor,\n marginBottom: \"8px\",\n }}\n >\n Player 2\n </div>\n <div style={{ color: goldColor }}>{currentScore.player2}</div>\n </div>\n </div>\n\n {/* Round Statistics */}\n {roundStats && (\n <div\n style={{\n display: \"flex\",\n flexDirection: isMobile ? \"column\" : \"row\",\n gap: isMobile ? \"12px\" : \"24px\",\n marginBottom: isMobile ? \"20px\" : \"30px\",\n fontSize: isMobile ? \"14px\" : \"16px\",\n color: textSecondary,\n fontFamily: theme.fontFamily.KOREAN,\n }}\n data-testid=\"round-stats\"\n >\n <div>피해량 | Damage: {roundStats.damageDealt.toFixed(0)}</div>\n <div>명중 | Hits: {roundStats.hitsLanded}</div>\n <div>급소타격 | Vital Points: {roundStats.vitalPointsHit}</div>\n <div>정확도 | Accuracy: {roundStats.accuracy.toFixed(1)}%</div>\n </div>\n )}\n\n {/* Countdown */}\n <div\n style={{\n fontSize: isMobile ? \"48px\" : \"72px\",\n color: goldColor,\n fontWeight: \"bold\",\n marginBottom: isMobile ? \"20px\" : \"30px\",\n textShadow: `0 0 40px ${goldColor}`,\n }}\n data-testid=\"countdown-display\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n aria-label={`Countdown: ${countdown} seconds remaining`}\n >\n {countdown}\n </div>\n\n {/* Skip Button */}\n <button\n onClick={onSkip}\n data-testid=\"skip-countdown-button\"\n className=\"skip-countdown-button\"\n style={{\n padding: isMobile ? \"10px 24px\" : \"12px 32px\",\n fontSize: isMobile ? \"14px\" : \"16px\",\n backgroundColor: cyanColor,\n color: darkBg,\n border: \"none\",\n borderRadius: \"6px\",\n fontFamily: theme.fontFamily.KOREAN,\n fontWeight: \"bold\",\n cursor: \"pointer\",\n }}\n >\n 건너뛰기 | Skip\n </button>\n\n {/* CSS Animation for pulse effect and button hover */}\n <style>\n {`\n @keyframes pulse {\n 0%, 100% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.7;\n transform: scale(1.05);\n }\n }\n \n .skip-countdown-button {\n transition: all 0.2s ease;\n }\n \n .skip-countdown-button:hover {\n transform: scale(1.05);\n box-shadow: 0 0 20px ${cyanColor};\n }\n \n .skip-countdown-button:focus {\n outline: 2px solid ${c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YAAY;KACZ,cAAc,WAAW,SAAS;KAClC,YAAY,YAAY;KACzB;IACD,eAAY;IACZ,aAAU;IACV,eAAY;IACZ,cAAY,cAAc,UAAU;cAEnC;IACG,CAAA;GAGN,oBAAC,UAAD;IACE,SAAS;IACT,eAAY;IACZ,WAAU;IACV,OAAO;KACL,SAAS,WAAW,cAAc;KAClC,UAAU,WAAW,SAAS;KAC9B,iBAAiB;KACjB,OAAO;KACP,QAAQ;KACR,cAAc;KACd,YAAY,MAAM,WAAW;KAC7B,YAAY;KACZ,QAAQ;KACT;cACF;IAEQ,CAAA;GAGT,oBAAC,SAAD,EAAA,UACG;;;;;;;;;;;;;;;;;;mCAkB0B,UAAU;;;;iCAIZ,UAAU;;;WAI7B,CAAA;GACJ"}
1
+ {"version":3,"file":"RoundAnnouncementOverlayHtml.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/feedback/RoundAnnouncementOverlayHtml.tsx"],"sourcesContent":["/**\n * RoundAnnouncement Component - Displays round completion and transition UI\n *\n * Korean: 라운드 발표 (Round Announcement)\n *\n * Shows round winner, current score, statistics, and countdown to next round.\n * Implements Korean cyberpunk aesthetic with bilingual text support.\n *\n * Refactored to use useKoreanTheme for consistent styling.\n *\n * @module components/combat/RoundAnnouncement\n * @category Combat UI\n */\n\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { PlayerState } from \"../../../../../systems\";\nimport { useKoreanTheme } from \"../../../../shared/base/useKoreanTheme\";\nimport { hexColorToCSS } from \"../../../../../utils/colorUtils\";\n\n/**\n * Round statistics displayed between rounds\n *\n * Korean: 라운드 통계 (Round Statistics)\n */\nexport interface RoundStats {\n /** Total damage dealt by player */\n readonly damageDealt: number;\n /** Number of hits successfully landed */\n readonly hitsLanded: number;\n /** Number of vital points struck */\n readonly vitalPointsHit: number;\n /** Combat accuracy percentage */\n readonly accuracy: number;\n}\n\n/**\n * Props for the RoundAnnouncement component\n */\nexport interface RoundAnnouncementProps {\n /** Current round number (1-based) */\n readonly roundNumber: number;\n /** Round winner, or null if round was a draw */\n readonly roundWinner: PlayerState | null;\n /** Current match score (player1 wins, player2 wins) */\n readonly currentScore: { readonly player1: number; readonly player2: number };\n /** Round statistics to display */\n readonly roundStats?: RoundStats;\n /** Callback when countdown completes */\n readonly onCountdownComplete: () => void;\n /** Callback when skip button is pressed */\n readonly onSkip: () => void;\n /** Whether layout should adapt for mobile screens */\n readonly isMobile: boolean;\n /** Total number of rounds in match (for match point detection) */\n readonly totalRounds?: number;\n /** Countdown duration in seconds */\n readonly countdownDuration?: number;\n}\n\n/**\n * RoundAnnouncement Component\n *\n * Displays round completion announcement with:\n * - Bilingual round completion title\n * - Round winner display\n * - Current match score\n * - Round statistics (damage, hits, accuracy)\n * - Countdown to next round\n * - Skip button for quick play\n * - Match point indicator for final rounds\n * - Uses useKoreanTheme for consistent styling\n *\n * Korean: 라운드 종료 발표 컴포넌트\n */\nexport const RoundAnnouncement: React.FC<RoundAnnouncementProps> = ({\n roundNumber,\n roundWinner,\n currentScore,\n roundStats,\n onCountdownComplete,\n onSkip,\n isMobile,\n totalRounds = 3,\n countdownDuration = 3,\n}) => {\n const theme = useKoreanTheme({ variant: \"primary\", size: \"large\", isMobile });\n const [countdown, setCountdown] = useState(countdownDuration);\n const [isVisible, setIsVisible] = useState(false);\n const hasCompletedRef = useRef(false);\n\n const onCountdownCompleteRef = useRef(onCountdownComplete);\n useEffect(() => {\n onCountdownCompleteRef.current = onCountdownComplete;\n }, [onCountdownComplete]);\n\n const handleCountdownComplete = useCallback(() => {\n onCountdownCompleteRef.current();\n }, []);\n\n useEffect(() => {\n const timer = setTimeout(() => setIsVisible(true), 50);\n return () => clearTimeout(timer);\n }, []);\n\n useEffect(() => {\n if (countdown <= 0) {\n if (!hasCompletedRef.current) {\n hasCompletedRef.current = true;\n handleCountdownComplete();\n }\n return;\n }\n\n const timer = setInterval(() => {\n setCountdown((prev) => {\n if (prev <= 1) {\n return 0;\n }\n return prev - 1;\n });\n }, 1000);\n\n return () => clearInterval(timer);\n }, [countdown, handleCountdownComplete]);\n\n const isMatchPoint = useMemo(() => {\n const maxScore = Math.max(currentScore.player1, currentScore.player2);\n const roundsToWin = Math.ceil(totalRounds / 2);\n return maxScore === roundsToWin - 1;\n }, [currentScore, totalRounds]);\n\n const goldColor = useMemo(\n () => hexColorToCSS(theme.colors.ACCENT_GOLD),\n [theme.colors.ACCENT_GOLD]\n );\n const cyanColor = useMemo(\n () => hexColorToCSS(theme.colors.PRIMARY_CYAN),\n [theme.colors.PRIMARY_CYAN]\n );\n const darkBg = useMemo(\n () => hexColorToCSS(theme.colors.UI_BACKGROUND_DARK),\n [theme.colors.UI_BACKGROUND_DARK]\n );\n const textSecondary = useMemo(\n () => hexColorToCSS(theme.colors.TEXT_SECONDARY),\n [theme.colors.TEXT_SECONDARY]\n );\n\n const containerStyle = useMemo(\n () => ({\n position: \"fixed\" as const,\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n flexDirection: \"column\" as const,\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: `${darkBg}dd`,\n zIndex: 1000,\n opacity: isVisible ? 1 : 0,\n transition: \"opacity 0.3s ease-in-out\",\n }),\n [darkBg, isVisible]\n );\n\n return (\n <div data-testid=\"round-announcement\" style={containerStyle}>\n {/* Match Point Indicator */}\n {isMatchPoint && (\n <div\n style={{\n fontSize: isMobile ? \"20px\" : \"28px\",\n color: goldColor,\n fontFamily: theme.fontFamily.KOREAN,\n fontWeight: \"bold\",\n marginBottom: isMobile ? \"10px\" : \"20px\",\n textShadow: `0 0 20px ${goldColor}`,\n animation: \"pulse 1s infinite\",\n }}\n data-testid=\"match-point-indicator\"\n >\n 매치 포인트! | Match Point!\n </div>\n )}\n\n {/* Round Complete Title */}\n <h1\n style={{\n fontSize: isMobile ? \"36px\" : \"56px\",\n color: goldColor,\n fontFamily: theme.fontFamily.KOREAN,\n fontWeight: \"bold\",\n margin: `0 0 ${isMobile ? \"20px\" : \"30px\"} 0`,\n textShadow: `0 0 30px ${goldColor}`,\n textAlign: \"center\",\n }}\n data-testid=\"round-complete-title\"\n >\n 라운드 {roundNumber} 완료!\n <br />\n Round {roundNumber} Complete!\n </h1>\n\n {/* Round Winner */}\n {roundWinner && (\n <div\n style={{\n fontSize: isMobile ? \"24px\" : \"36px\",\n color: cyanColor,\n fontFamily: theme.fontFamily.KOREAN,\n margin: `0 0 ${isMobile ? \"20px\" : \"30px\"} 0`,\n textAlign: \"center\",\n }}\n data-testid=\"round-winner\"\n >\n 승자 | Winner: {roundWinner.name.korean} | {roundWinner.name.english}\n </div>\n )}\n\n {/* Current Score */}\n <div\n style={{\n display: \"flex\",\n gap: isMobile ? \"40px\" : \"80px\",\n marginBottom: isMobile ? \"20px\" : \"30px\",\n fontSize: isMobile ? \"32px\" : \"48px\",\n fontWeight: \"bold\",\n }}\n data-testid=\"current-score\"\n >\n <div style={{ textAlign: \"center\" }}>\n <div\n style={{\n fontSize: isMobile ? \"14px\" : \"18px\",\n color: cyanColor,\n marginBottom: \"8px\",\n }}\n >\n Player 1\n </div>\n <div style={{ color: goldColor }}>{currentScore.player1}</div>\n </div>\n <div style={{ color: cyanColor }}>-</div>\n <div style={{ textAlign: \"center\" }}>\n <div\n style={{\n fontSize: isMobile ? \"14px\" : \"18px\",\n color: cyanColor,\n marginBottom: \"8px\",\n }}\n >\n Player 2\n </div>\n <div style={{ color: goldColor }}>{currentScore.player2}</div>\n </div>\n </div>\n\n {/* Round Statistics */}\n {roundStats && (\n <div\n style={{\n display: \"flex\",\n flexDirection: isMobile ? \"column\" : \"row\",\n gap: isMobile ? \"12px\" : \"24px\",\n marginBottom: isMobile ? \"20px\" : \"30px\",\n fontSize: isMobile ? \"14px\" : \"16px\",\n color: textSecondary,\n fontFamily: theme.fontFamily.KOREAN,\n }}\n data-testid=\"round-stats\"\n >\n <div>피해량 | Damage: {roundStats.damageDealt.toFixed(0)}</div>\n <div>명중 | Hits: {roundStats.hitsLanded}</div>\n <div>급소타격 | Vital Points: {roundStats.vitalPointsHit}</div>\n <div>정확도 | Accuracy: {roundStats.accuracy.toFixed(1)}%</div>\n </div>\n )}\n\n {/* Countdown */}\n <div\n style={{\n fontSize: isMobile ? \"48px\" : \"72px\",\n color: goldColor,\n fontWeight: \"bold\",\n marginBottom: isMobile ? \"20px\" : \"30px\",\n textShadow: `0 0 40px ${goldColor}`,\n }}\n data-testid=\"countdown-display\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n aria-label={`Countdown: ${countdown} seconds remaining`}\n >\n {countdown}\n </div>\n\n {/* Skip Button */}\n <button\n onClick={onSkip}\n data-testid=\"skip-countdown-button\"\n className=\"skip-countdown-button\"\n style={{\n padding: isMobile ? \"10px 24px\" : \"12px 32px\",\n fontSize: isMobile ? \"14px\" : \"16px\",\n backgroundColor: cyanColor,\n color: darkBg,\n border: \"none\",\n borderRadius: \"6px\",\n fontFamily: theme.fontFamily.KOREAN,\n fontWeight: \"bold\",\n cursor: \"pointer\",\n }}\n >\n 건너뛰기 | Skip\n </button>\n\n {/* CSS Animation for pulse effect and button hover */}\n <style>\n {`\n @keyframes pulse {\n 0%, 100% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.7;\n transform: scale(1.05);\n }\n }\n \n .skip-countdown-button {\n transition: all 0.2s ease;\n }\n \n .skip-countdown-button:hover {\n transform: scale(1.05);\n box-shadow: 0 0 20px ${cyanColor};\n }\n \n .skip-countdown-button:focus {\n outline: 2px solid ${cyanColor};\n outline-offset: 2px;\n }\n `}\n </style>\n </div>\n );\n};\n\nexport default RoundAnnouncement;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,IAAa,qBAAuD,EAClE,aACA,aACA,cACA,YACA,qBACA,QACA,UACA,cAAc,GACd,oBAAoB,QAChB;CACJ,MAAM,QAAQ,eAAe;EAAE,SAAS;EAAW,MAAM;EAAS;CAAS,CAAC;CAC5E,MAAM,CAAC,WAAW,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C9B,iBAAiB;KACjB,OAAO;KACP,QAAQ;KACR,cAAc;KACd,YAAY,MAAM,WAAW;KAC7B,YAAY;KACZ,QAAQ;IACV;cACD;GAEO,CAAA;GAGR,oBAAC,SAAD,EAAA,UACG;;;;;;;;;;;;;;;;;;mCAkB0B,UAAU;;;;iCAIZ,UAAU;;;UAI9B,CAAA;EACJ;;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"RoundDisplayStatus.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/feedback/RoundDisplayStatus.tsx"],"sourcesContent":["/**\n * RoundDisplayStatus - Brief round status messages\n * \n * Displays quick status messages like \"라운드 시작!\", \"전투!\", \"라운드 종료\", \"K.O.!\"\n * Rendered as a fullscreen overlay outside the Canvas.\n * \n * @korean 라운드 상태 표시 - 간단한 라운드 상태 메시지\n */\n\nimport React from \"react\";\nimport { Z_INDEX } from \"../../../../../types/LayoutTypes\";\nimport { hexToRgbaString } from \"../../../../../utils/colorUtils\";\nimport { useKoreanTheme } from \"../../../../shared/base/useKoreanTheme\";\n\nexport type RoundDisplayStatus = \"start\" | \"fight\" | \"end\" | \"ko\" | null;\n\nexport interface RoundDisplayStatusProps {\n /** Current round status to display */\n readonly status: RoundDisplayStatus;\n /** Whether mobile layout is active */\n readonly isMobile?: boolean;\n}\n\n/**\n * RoundDisplayStatus Component\n * \n * Large centered text overlay showing brief round status messages.\n * Auto-fades based on combatState.roundDisplayStatus timing.\n */\nexport const RoundDisplayStatus: React.FC<RoundDisplayStatusProps> = ({\n status,\n isMobile = false,\n}) => {\n const theme = useKoreanTheme({\n variant: \"primary\",\n size: \"md\",\n isMobile,\n });\n\n if (!status) {\n return null;\n }\n\n const statusMessages: Record<Exclude<RoundDisplayStatus, null>, string> = {\n start: \"라운드 시작!\",\n fight: \"전투!\",\n end: \"라운드 종료\",\n ko: \"K.O.!\",\n };\n\n const fontSize = isMobile ? \"48px\" : \"72px\";\n\n return (\n <div\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n pointerEvents: \"none\",\n zIndex: Z_INDEX.MODAL,\n }}\n data-testid=\"round-display-status\"\n >\n <div\n style={{\n fontSize,\n fontWeight: \"bold\",\n fontFamily: theme.koreanTypography.fontFamily,\n lineHeight: theme.koreanTypography.lineHeight,\n letterSpacing: theme.koreanTypography.letterSpacing,\n wordBreak: theme.koreanTypography.wordBreak,\n textAlign: \"center\",\n color: hexToRgbaString(theme.colors.ACCENT_GOLD, 1),\n textShadow: \"0 0 20px rgba(255, 215, 0, 0.8)\",\n }}\n data-testid={`round-display-status-${status}`}\n >\n {statusMessages[status]}\n </div>\n </div>\n );\n};\n\nexport default RoundDisplayStatus;\n"],"mappings":";;;;;;;;;;;;AA6BA,IAAa,sBAAyD,EACpE,QACA,WAAW,YACP;CACJ,MAAM,QAAQ,eAAe;EAC3B,SAAS;EACT,MAAM;EACN;EACD,CAAC;CAEF,IAAI,CAAC,QACH,OAAO;CAGT,MAAM,iBAAoE;EACxE,OAAO;EACP,OAAO;EACP,KAAK;EACL,IAAI;EACL;CAED,MAAM,WAAW,WAAW,SAAS;CAErC,OACE,oBAAC,OAAD;EACE,OAAO;GACL,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO;GACP,QAAQ;GACR,SAAS;GACT,gBAAgB;GAChB,YAAY;GACZ,eAAe;GACf,QAAQ,QAAQ;GACjB;EACD,eAAY;YAEZ,oBAAC,OAAD;GACE,OAAO;IACL;IACA,YAAY;IACZ,YAAY,MAAM,iBAAiB;IACnC,YAAY,MAAM,iBAAiB;IACnC,eAAe,MAAM,iBAAiB;IACtC,WAAW,MAAM,iBAAiB;IAClC,WAAW;IACX,OAAO,gBAAgB,MAAM,OAAO,aAAa,EAAE;IACnD,YAAY;IACb;GACD,eAAa,wBAAwB;aAEpC,eAAe;GACZ,CAAA;EACF,CAAA"}
1
+ {"version":3,"file":"RoundDisplayStatus.js","names":[],"sources":["../../../../../../src/components/screens/combat/components/feedback/RoundDisplayStatus.tsx"],"sourcesContent":["/**\n * RoundDisplayStatus - Brief round status messages\n * \n * Displays quick status messages like \"라운드 시작!\", \"전투!\", \"라운드 종료\", \"K.O.!\"\n * Rendered as a fullscreen overlay outside the Canvas.\n * \n * @korean 라운드 상태 표시 - 간단한 라운드 상태 메시지\n */\n\nimport React from \"react\";\nimport { Z_INDEX } from \"../../../../../types/LayoutTypes\";\nimport { hexToRgbaString } from \"../../../../../utils/colorUtils\";\nimport { useKoreanTheme } from \"../../../../shared/base/useKoreanTheme\";\n\nexport type RoundDisplayStatus = \"start\" | \"fight\" | \"end\" | \"ko\" | null;\n\nexport interface RoundDisplayStatusProps {\n /** Current round status to display */\n readonly status: RoundDisplayStatus;\n /** Whether mobile layout is active */\n readonly isMobile?: boolean;\n}\n\n/**\n * RoundDisplayStatus Component\n * \n * Large centered text overlay showing brief round status messages.\n * Auto-fades based on combatState.roundDisplayStatus timing.\n */\nexport const RoundDisplayStatus: React.FC<RoundDisplayStatusProps> = ({\n status,\n isMobile = false,\n}) => {\n const theme = useKoreanTheme({\n variant: \"primary\",\n size: \"md\",\n isMobile,\n });\n\n if (!status) {\n return null;\n }\n\n const statusMessages: Record<Exclude<RoundDisplayStatus, null>, string> = {\n start: \"라운드 시작!\",\n fight: \"전투!\",\n end: \"라운드 종료\",\n ko: \"K.O.!\",\n };\n\n const fontSize = isMobile ? \"48px\" : \"72px\";\n\n return (\n <div\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n pointerEvents: \"none\",\n zIndex: Z_INDEX.MODAL,\n }}\n data-testid=\"round-display-status\"\n >\n <div\n style={{\n fontSize,\n fontWeight: \"bold\",\n fontFamily: theme.koreanTypography.fontFamily,\n lineHeight: theme.koreanTypography.lineHeight,\n letterSpacing: theme.koreanTypography.letterSpacing,\n wordBreak: theme.koreanTypography.wordBreak,\n textAlign: \"center\",\n color: hexToRgbaString(theme.colors.ACCENT_GOLD, 1),\n textShadow: \"0 0 20px rgba(255, 215, 0, 0.8)\",\n }}\n data-testid={`round-display-status-${status}`}\n >\n {statusMessages[status]}\n </div>\n </div>\n );\n};\n\nexport default RoundDisplayStatus;\n"],"mappings":";;;;;;;;;;;;AA6BA,IAAa,sBAAyD,EACpE,QACA,WAAW,YACP;CACJ,MAAM,QAAQ,eAAe;EAC3B,SAAS;EACT,MAAM;EACN;CACF,CAAC;CAED,IAAI,CAAC,QACH,OAAO;CAGT,MAAM,iBAAoE;EACxE,OAAO;EACP,OAAO;EACP,KAAK;EACL,IAAI;CACN;CAEA,MAAM,WAAW,WAAW,SAAS;CAErC,OACE,oBAAC,OAAD;EACE,OAAO;GACL,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO;GACP,QAAQ;GACR,SAAS;GACT,gBAAgB;GAChB,YAAY;GACZ,eAAe;GACf,QAAQ,QAAQ;EAClB;EACA,eAAY;YAEZ,oBAAC,OAAD;GACE,OAAO;IACL;IACA,YAAY;IACZ,YAAY,MAAM,iBAAiB;IACnC,YAAY,MAAM,iBAAiB;IACnC,eAAe,MAAM,iBAAiB;IACtC,WAAW,MAAM,iBAAiB;IAClC,WAAW;IACX,OAAO,gBAAgB,MAAM,OAAO,aAAa,CAAC;IAClD,YAAY;GACd;GACA,eAAa,wBAAwB;aAEpC,eAAe;EACb,CAAA;CACF,CAAA;AAET"}