blacktrigram 0.7.6 → 0.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARCHITECTURE.md +2404 -0
- package/COMBAT_ARCHITECTURE.md +3322 -0
- package/CONTROLS.md +639 -0
- package/CRA-ASSESSMENT.md +508 -0
- package/DATA_MODEL.md +675 -0
- package/ISMS_REFERENCE_MAPPING.md +513 -0
- package/README.md +1 -1
- package/SECURITY_ARCHITECTURE.md +1160 -0
- package/THREAT_MODEL.md +1163 -0
- package/lib/audio/AudioAssetLoader.js.map +1 -1
- package/lib/components/screens/combat/hooks/useCombatActions.js.map +1 -1
- package/lib/components/screens/combat/hooks/useCombatAudio.js.map +1 -1
- package/lib/components/screens/intro/IntroScreen3D.js +1 -1
- package/lib/components/screens/training/TrainingScreen3D.js.map +1 -1
- package/lib/components/screens/training/components/HitFeedbackEffect3D.js.map +1 -1
- package/lib/components/screens/training/hooks/useTrainingActions.js.map +1 -1
- package/lib/components/shared/ui/SplashScreen.js +2 -2
- package/lib/data/archetypeClothing.js +1 -1
- package/lib/data/archetypePhysicalAttributes.js +158 -1
- package/lib/data/archetypePhysicalAttributes.js.map +1 -1
- package/lib/data/index.d.ts +14 -0
- package/lib/data/index.d.ts.map +1 -0
- package/lib/data/index.js +43 -0
- package/lib/data/index.js.map +1 -0
- package/lib/data/techniqueMappings.js +47 -2
- package/lib/data/techniqueMappings.js.map +1 -1
- package/lib/data/techniques.js +1 -1
- package/lib/hooks/index.d.ts +29 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/index.js +53 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useCombatTimer.js.map +1 -1
- package/lib/hooks/useDebounce.js +52 -0
- package/lib/hooks/useDebounce.js.map +1 -0
- package/lib/hooks/usePauseMenu.js +60 -0
- package/lib/hooks/usePauseMenu.js.map +1 -0
- package/lib/hooks/useResponsiveLayout.js +160 -0
- package/lib/hooks/useResponsiveLayout.js.map +1 -0
- package/lib/hooks/useRoundTransition.js.map +1 -1
- package/lib/hooks/useTechniqueSelection.js.map +1 -1
- package/lib/hooks/useThrottle.js.map +1 -1
- package/lib/hooks/useWebGLContextLossHandler.js +36 -1
- package/lib/hooks/useWebGLContextLossHandler.js.map +1 -1
- package/lib/hooks/useWindowSize.js +19 -1
- package/lib/hooks/useWindowSize.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/package.json +22 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTrainingActions.js","names":[],"sources":["../../../../../src/components/screens/training/hooks/useTrainingActions.ts"],"sourcesContent":["/**\n * useTrainingActions Hook - Training Action Handlers\n *\n * Custom hook for managing training action handlers.\n * Mirrors useCombatActions pattern for consistency.\n *\n * @korean 훈련액션훅 - 훈련 액션 핸들러 관리\n */\n\nimport { useCallback, useRef } from \"react\";\nimport {\n AudioBodyRegion,\n ImpactIntensity,\n} from \"../../../../audio/types\";\nimport type { AttackIntensity } from \"../../../screens/combat/hooks/useCombatAudio\";\nimport { getArchetypePhysicalAttributes } from \"../../../../data/archetypePhysicalAttributes\";\nimport {\n AnimationState,\n AnimationType,\n getAnimationForTechnique,\n} from \"../../../../systems/animation\";\nimport { physicalReachCalculator } from \"../../../../systems/physics\";\nimport { getTechniquesByStance } from \"../../../../systems/trigram/techniques\";\nimport { KoreanTechniquesSystem } from \"../../../../systems/trigram/KoreanTechniques\";\nimport { TRIGRAM_STANCES_ORDER } from \"../../../../systems/trigram/types\";\nimport type { KoreanTechnique } from \"../../../../systems/vitalpoint/types\";\nimport {\n CombatAttackType,\n DamageType,\n PlayerArchetype,\n Position,\n TrigramStance,\n} from \"../../../../types/common\";\nimport {\n DEFAULT_BODY_RADIUS_METERS,\n METERS_TO_TRAINING_UNITS,\n} from \"../../../../types/physicsConstants\";\nimport { calculateDistance3D } from \"../../../../utils/math\";\nimport { TrainingActions, TrainingScreenState } from \"./useTrainingState\";\n\nexport interface UseTrainingActionsConfig {\n readonly state: TrainingScreenState;\n readonly actions: TrainingActions;\n readonly playerPosition: Position;\n readonly player3DPosition: [number, number, number];\n readonly dummyPosition: [number, number, number];\n readonly playerArchetype: import(\"../../../../types/common\").PlayerArchetype;\n readonly playerStance: TrigramStance;\n /** Ref to current selected technique's animation type for distance-based hit detection */\n readonly currentTechniqueAnimationTypeRef: React.MutableRefObject<AnimationType>;\n readonly audio: {\n readonly playSFX: (sound: string, volume?: number) => Promise<void>;\n };\n /** Attack sound function from useCombatAudio for playing attack whoosh sounds */\n readonly playAttackSound?: (intensity: AttackIntensity) => Promise<void>;\n /** Bone impact audio function from useCombatAudio or similar hook */\n readonly playBoneImpactSound?: (options: {\n region?: AudioBodyRegion;\n intensity?: ImpactIntensity;\n damage?: number;\n remainingHealth?: number;\n vitalPoint?: boolean;\n hitPosition?: { x: number; y: number; z?: number };\n }) => Promise<void>;\n readonly onPlayerUpdate: (updates: {\n currentStance?: TrigramStance;\n lastActionTime?: number;\n position?: Position;\n }) => void;\n readonly playerAnimation: {\n readonly transitionTo: (state: AnimationState) => boolean;\n readonly transitionToStanceGuard: (stance: TrigramStance) => boolean;\n readonly currentState: string;\n };\n /** External ref to store pending attack data - shared with animation events */\n readonly pendingAttackRef: React.MutableRefObject<{\n accuracy: number;\n vitalPoint: string;\n animationType?: AnimationType;\n startTime?: number;\n techniqueId?: string;\n } | null>;\n /** Currently selected technique ID (from technique bar) */\n readonly selectedTechniqueId?: string;\n /** Callback to set the visual attack animation */\n readonly setAttackAnimation?: (animationName: string | undefined) => void;\n}\n\nexport interface UseTrainingActionsReturn {\n readonly handleStartTraining: () => void;\n readonly handleStopTraining: () => void;\n readonly handleDummyHit: (\n vitalPointId: string,\n attackContext?: {\n animationType?: AnimationType;\n techniqueId?: string;\n },\n ) => boolean;\n readonly handleDummyDefeated: () => void;\n readonly handleStanceChange: (stanceIndex: number) => void;\n readonly handleAttack: () => void;\n}\n\n/**\n * Get the best default technique for an archetype based on current stance.\n *\n * Each archetype has preferred combat styles:\n * - MUSA: Direct strikes, joint techniques (BLUNT/JOINT damage)\n * - AMSALJA: Nerve strikes, pressure points (NERVE/PRESSURE damage)\n * - HACKER: Precise calculated strikes (high accuracy)\n * - JEONGBO_YOWON: Psychological pressure, submissions (PRESSURE/JOINT)\n * - JOJIK_POKRYEOKBAE: High damage brutal strikes\n *\n * @korean 원형별 기본 기술 선택 - 8개 자세에 따른 최적 기술\n */\nfunction getDefaultTechniqueForArchetype(\n archetype: PlayerArchetype,\n stance: TrigramStance,\n): KoreanTechnique | undefined {\n const techniques = getTechniquesByStance(stance);\n if (techniques.length === 0) return undefined;\n\n // Score each technique based on archetype preference\n const scoredTechniques = techniques.map((tech) => {\n let score = 0;\n const damageType = tech.damageType;\n const attackType = tech.type;\n const isAdvanced =\n (tech.kiCost || 0) >= 10 || (tech.staminaCost || 0) >= 15;\n\n switch (archetype) {\n case PlayerArchetype.MUSA:\n // Musa prefers: strikes, blocks, counter-attacks (BLUNT/JOINT/CRUSHING)\n if (damageType === DamageType.JOINT) score += 30;\n if (damageType === DamageType.CRUSHING) score += 25;\n if (damageType === DamageType.BLUNT) score += 20;\n if (attackType === CombatAttackType.STRIKE) score += 15;\n if (attackType === CombatAttackType.PUNCH) score += 10;\n if (isAdvanced) score += 10;\n break;\n\n case PlayerArchetype.AMSALJA:\n // Amsalja prefers: nerve strikes, pressure points, thrusts\n if (damageType === DamageType.NERVE) score += 35;\n if (damageType === DamageType.PRESSURE) score += 30;\n if (attackType === CombatAttackType.NERVE_STRIKE) score += 25;\n if (attackType === CombatAttackType.PRESSURE_POINT) score += 25;\n if (attackType === CombatAttackType.THRUST) score += 15;\n if ((tech.accuracy || 0) >= 0.9) score += 10;\n break;\n\n case PlayerArchetype.HACKER:\n // Hacker prefers: high accuracy, calculated strikes\n if ((tech.accuracy || 0) >= 0.9) score += 30;\n if ((tech.accuracy || 0) >= 0.8) score += 15;\n if (damageType === DamageType.NERVE) score += 20;\n if (damageType === DamageType.INTERNAL) score += 20;\n if (attackType === CombatAttackType.PRESSURE_POINT) score += 15;\n break;\n\n case PlayerArchetype.JEONGBO_YOWON:\n // Jeongbo prefers: psychological pressure, submissions\n if (damageType === DamageType.PRESSURE) score += 30;\n if (damageType === DamageType.JOINT) score += 25;\n if (attackType === CombatAttackType.GRAPPLE) score += 20;\n if (attackType === CombatAttackType.PRESSURE_POINT) score += 15;\n break;\n\n case PlayerArchetype.JOJIK_POKRYEOKBAE:\n // Jojik prefers: high damage, brutal techniques\n if ((tech.damage || 0) >= 35) score += 35;\n if ((tech.damage || 0) >= 30) score += 20;\n if (damageType === DamageType.SLASHING) score += 20;\n if (damageType === DamageType.PIERCING) score += 15;\n if (damageType === DamageType.CRUSHING) score += 15;\n if (attackType === CombatAttackType.KICK) score += 10;\n break;\n }\n\n return { technique: tech, score };\n });\n\n // Sort by score descending, return highest scoring technique\n scoredTechniques.sort((a, b) => b.score - a.score);\n return scoredTechniques[0]?.technique;\n}\n\n/**\n * Calculate hit accuracy based on distance and effective reach.\n * Uses PhysicalReachCalculator for animation-aware reach calculation.\n *\n * Distance logic matches CombatSystem: if out of reach, guaranteed miss (accuracy 0).\n * Training scene coordinates are in meters, using METERS_TO_TRAINING_UNITS = 1.0.\n *\n * **IMPORTANT**: Distance calculation accounts for body radius.\n * Center-to-center distance is adjusted by subtracting target body radius\n * because attacks hit the body surface, not the center point.\n * The target body radius is calculated from physical attributes for archetypes,\n * or uses DEFAULT_BODY_RADIUS_METERS for training dummies.\n *\n * Example: If player center is 1.5m from dummy center, but dummy body\n * extends 0.23m from center, the effective distance to hit is 1.27m.\n *\n * @korean 거리 기반 명중률 계산 - 사정거리 밖이면 빗나감\n */\nfunction calculateHitAccuracy(\n playerPos: [number, number, number],\n dummyPos: [number, number, number],\n archetype: import(\"../../../../types/common\").PlayerArchetype,\n stance: TrigramStance,\n animationType?: AnimationType,\n reachConfig?: import(\"../../../../types/physics\").PhysicalReachConfig,\n): number {\n // Calculate 3D distance between player and dummy centers (in meters)\n const centerToCenterDistance = calculateDistance3D(playerPos, dummyPos);\n\n // Get player's physical attributes for reach calculation\n const playerPhysicalAttributes = getArchetypePhysicalAttributes(archetype);\n\n // Training dummy uses default body radius since it has no archetype\n // For combat between players, we would use calculateBodyRadius(targetPhysicalAttributes)\n // 훈련 더미는 원형이 없으므로 기본 몸체 반경 사용\n const targetBodyRadius = DEFAULT_BODY_RADIUS_METERS;\n\n // Effective distance = center-to-center minus target body radius only\n // Note: PhysicalReachCalculator already includes player body pivot/offset in reach calculation,\n // so we only subtract the target radius to avoid double-counting.\n // 유효 거리 = 중심간 거리 - 더미 몸체 반경 (플레이어 몸체 오프셋은 도달 거리에 포함됨)\n const effectiveDistance = Math.max(\n 0,\n centerToCenterDistance - targetBodyRadius,\n );\n\n // If animation type is available, use physics-based reach calculation\n // We use calculateMaxReach (peak time reach) because:\n // 1. Training hit detection happens at animation frame 6 (~100ms)\n // 2. But technique hit timings expect longer animations (e.g., roundhouse 200-480ms)\n // 3. Using max reach ensures the technique can hit if within peak reach range\n // 4. This matches intuitive behavior - if you're close enough to be hit by the kick, it hits\n // 훈련 타격 감지는 최대 도달 거리 사용 (애니메이션 타이밍과 기술 타이밍 불일치 보정)\n if (animationType !== undefined) {\n const maxReachMeters = physicalReachCalculator.calculateMaxReach(\n playerPhysicalAttributes,\n animationType,\n stance,\n reachConfig, // Use technique's designed reach if provided\n );\n\n // Convert reach from meters to training scene units.\n // Training scenes are authored in real-world meters, so we intentionally\n // use a 1:1 conversion here (METERS_TO_TRAINING_UNITS = 1.0).\n // Combat AI uses METERS_TO_PIXELS_SCALE (100) for pixel coordinates.\n const reachInUnits = maxReachMeters * METERS_TO_TRAINING_UNITS;\n\n // STRICT DISTANCE CHECK (matches CombatSystem behavior):\n // Out of reach = guaranteed miss with accuracy 0\n if (effectiveDistance > reachInUnits) {\n return 0;\n }\n\n // Within reach: accuracy based on how centered the hit is\n // Closer = higher accuracy (0.7 to 1.0 range)\n return Math.max(0.7, 1.0 - (effectiveDistance / reachInUnits) * 0.3);\n }\n\n // Fallback: use default punch reach (0.7 meters) for legacy behavior\n const defaultReach = 0.7 * METERS_TO_TRAINING_UNITS;\n if (effectiveDistance > defaultReach) {\n return 0; // Out of reach = miss\n }\n // Within default reach: linear accuracy based on distance\n return Math.max(0.5, 1.0 - (effectiveDistance / defaultReach) * 0.5);\n}\n\n/**\n * useTrainingActions hook\n * Provides training action handlers with proper memoization\n */\nexport function useTrainingActions(\n config: UseTrainingActionsConfig,\n): UseTrainingActionsReturn {\n const {\n state,\n actions,\n player3DPosition,\n dummyPosition,\n playerArchetype,\n playerStance,\n currentTechniqueAnimationTypeRef,\n audio,\n playBoneImpactSound,\n playAttackSound,\n onPlayerUpdate,\n playerAnimation,\n pendingAttackRef,\n selectedTechniqueId,\n setAttackAnimation,\n } = config;\n\n // Ref to store timeout for dummy reset\n const dummyResetTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n const handleStartTraining = useCallback(() => {\n actions.startTraining();\n audio.playSFX(\"menu_select\");\n }, [actions, audio]);\n\n const handleStopTraining = useCallback(() => {\n // Clear any pending dummy reset timeout\n if (dummyResetTimeoutRef.current) {\n clearTimeout(dummyResetTimeoutRef.current);\n dummyResetTimeoutRef.current = null;\n }\n actions.stopTraining();\n audio.playSFX(\"menu_back\");\n }, [actions, audio]);\n\n const handleDummyDefeated = useCallback(() => {\n actions.setFeedback(\"훈련 더미 무력화! | Dummy Defeated!\");\n audio.playSFX(\"ki_release\");\n\n // Clear any existing timeout\n if (dummyResetTimeoutRef.current) {\n clearTimeout(dummyResetTimeoutRef.current);\n }\n\n // Reset dummy health after delay\n dummyResetTimeoutRef.current = setTimeout(() => {\n actions.resetDummy();\n }, 2000);\n }, [actions, audio]);\n\n const handleDummyHit = useCallback(\n (\n _vitalPointId: string,\n attackContext?: {\n animationType?: AnimationType;\n techniqueId?: string;\n },\n ): boolean => {\n // Get animation context from the passed attackContext parameter\n // (TrainingScreen3D.tsx should pass the attackData before clearing the ref)\n const animationType = attackContext?.animationType;\n\n // Get technique's reachConfig for accurate reach calculation\n // Priority: attackContext.techniqueId (resolved in handleAttack) > selectedTechniqueId\n // This ensures default techniques (chosen when no explicit selection) also get their reachConfig\n let reachConfig: import(\"../../../../types/physics\").PhysicalReachConfig | undefined;\n const resolvedTechniqueId =\n attackContext?.techniqueId ?? selectedTechniqueId;\n if (resolvedTechniqueId) {\n const technique = KoreanTechniquesSystem.getTechniqueById(resolvedTechniqueId);\n reachConfig = technique?.reachConfig;\n }\n\n const accuracy = calculateHitAccuracy(\n player3DPosition,\n dummyPosition,\n playerArchetype,\n playerStance,\n animationType,\n reachConfig,\n );\n\n // Determine hit position (dummy center)\n const hitPosition: [number, number, number] = [\n dummyPosition[0],\n 1.5,\n dummyPosition[2],\n ];\n\n if (accuracy > 0.5) {\n const points = Math.round(accuracy * 100);\n const damage = Math.round(accuracy * 15); // 0-15 damage based on accuracy\n const isPerfect = accuracy > 0.9;\n\n // Register hit with state (only counts if training)\n if (state.isTraining) {\n actions.registerHit(points, damage, isPerfect);\n }\n\n // Play bone impact audio with anatomical feedback using proper audio system\n if (playBoneImpactSound) {\n void playBoneImpactSound({\n damage,\n remainingHealth: 100, // Dummy has 100 health\n vitalPoint: false,\n hitPosition: { x: hitPosition[0], y: hitPosition[1], z: hitPosition[2] },\n });\n }\n\n // Determine feedback and sound\n let effectType: \"success\" | \"perfect\";\n if (isPerfect) {\n actions.setFeedback(\"완벽한 타격! | Perfect Strike!\");\n audio.playSFX(\"ki_release\");\n effectType = \"perfect\";\n } else if (accuracy > 0.7) {\n actions.setFeedback(\"좋은 타격! | Good Strike!\");\n audio.playSFX(\"ki_charge\");\n effectType = \"success\";\n } else {\n actions.setFeedback(\"타격 성공 | Strike Success\");\n audio.playSFX(\"menu_click\");\n effectType = \"success\";\n }\n\n // Add hit effect\n actions.addHitEffect({\n position: hitPosition,\n type: effectType,\n visible: true,\n damage,\n });\n\n return true;\n } else {\n // Register miss (only counts if training)\n if (state.isTraining) {\n actions.registerMiss();\n }\n actions.setFeedback(\"빗나감 | Miss - Out of reach!\");\n audio.playSFX(\"menu_navigate\");\n\n // Add miss effect\n actions.addHitEffect({\n position: hitPosition,\n type: \"miss\",\n visible: true,\n });\n\n return false;\n }\n },\n [\n state.isTraining,\n player3DPosition,\n dummyPosition,\n playerArchetype,\n playerStance,\n actions,\n audio,\n playBoneImpactSound,\n selectedTechniqueId,\n ],\n );\n\n const handleStanceChange = useCallback(\n (stanceIndex: number) => {\n actions.setStanceIndex(stanceIndex);\n const stance = TRIGRAM_STANCES_ORDER[stanceIndex];\n if (stance) {\n // Directly transition to stance guard animation (skips transitional animation)\n // 자세 가드 애니메이션으로 직접 전환 (전환 애니메이션 생략)\n playerAnimation.transitionToStanceGuard(stance);\n onPlayerUpdate({ currentStance: stance });\n audio.playSFX(\"stance_change\");\n }\n },\n [actions, onPlayerUpdate, audio, playerAnimation],\n );\n\n const handleAttack = useCallback(() => {\n // Determine which technique to use:\n // 1. If a technique is explicitly selected from the TechniqueBar, use that\n // 2. Otherwise, use the best default technique for the archetype + stance\n // 사용할 기술 결정: 명시적 선택 또는 원형+자세 기반 기본 기술\n let techniqueToUse: KoreanTechnique | undefined;\n let techniqueId = selectedTechniqueId;\n\n if (!techniqueId) {\n // No technique explicitly selected - get default for archetype + stance\n // 명시적 선택 없음 - 원형과 자세에 맞는 기본 기술 사용\n const defaultTechnique = getDefaultTechniqueForArchetype(\n playerArchetype,\n playerStance,\n );\n if (defaultTechnique) {\n techniqueToUse = defaultTechnique;\n techniqueId = defaultTechnique.id;\n }\n }\n\n // Get the animation type from the technique\n // 기술에서 애니메이션 타입 가져오기\n let animationType = currentTechniqueAnimationTypeRef.current;\n if (techniqueToUse?.animationType) {\n animationType = techniqueToUse.animationType;\n currentTechniqueAnimationTypeRef.current = animationType;\n }\n\n const startTime = performance.now() / 1000; // Current time in seconds\n\n const accuracy = calculateHitAccuracy(\n player3DPosition,\n dummyPosition,\n playerArchetype,\n playerStance,\n animationType,\n techniqueToUse?.reachConfig, // Pass technique's reachConfig for accurate reach\n );\n\n pendingAttackRef.current = {\n accuracy,\n vitalPoint: state.selectedVitalPoint ?? \"generic\",\n animationType,\n startTime,\n techniqueId, // Store resolved technique ID for handleDummyHit\n };\n\n // Set visual attack animation based on technique (AnimationRegistry lookup)\n // This ensures the 3D model plays the correct technique animation (kick vs punch vs elbow)\n // 기술에 따른 시각적 공격 애니메이션 설정 (발차기 vs 주먹 vs 팔꿈치)\n if (setAttackAnimation && techniqueId) {\n const animationName = getAnimationForTechnique(techniqueId);\n setAttackAnimation(animationName);\n }\n\n // Trigger attack animation - this will fire onFrame event at frame 6\n playerAnimation.transitionTo(AnimationState.ATTACK);\n\n // Play attack sound based on technique damage/intensity\n // Resolve technique data if we only have an ID (from TechniqueBar selection)\n if (!techniqueToUse && selectedTechniqueId) {\n // Technique selected from TechniqueBar but not yet resolved\n techniqueToUse = KoreanTechniquesSystem.getTechniqueById(selectedTechniqueId);\n }\n\n if (playAttackSound) {\n // Prefer explicit technique damage when available\n const damage = techniqueToUse?.damage ?? 10;\n const intensity: AttackIntensity =\n damage >= 40\n ? \"critical\"\n : damage >= 25\n ? \"heavy\"\n : damage >= 10\n ? \"medium\"\n : \"light\";\n void playAttackSound(intensity);\n } else {\n // Fallback to generic whoosh if playAttackSound not available\n audio.playSFX(\"whoosh\");\n }\n }, [\n state.selectedVitalPoint,\n player3DPosition,\n dummyPosition,\n playerArchetype,\n playerStance,\n currentTechniqueAnimationTypeRef,\n playerAnimation,\n audio,\n playAttackSound,\n pendingAttackRef,\n selectedTechniqueId,\n setAttackAnimation,\n ]);\n\n return {\n handleStartTraining,\n handleStopTraining,\n handleDummyHit,\n handleDummyDefeated,\n handleStanceChange,\n handleAttack,\n };\n}\n\nexport default useTrainingActions;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmHA,SAAS,gCACP,WACA,QAC6B;CAC7B,MAAM,aAA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AQ,SAAS;KAExB;GACD,MAAM;GACN;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC;EASD"}
|
|
1
|
+
{"version":3,"file":"useTrainingActions.js","names":[],"sources":["../../../../../src/components/screens/training/hooks/useTrainingActions.ts"],"sourcesContent":["/**\n * useTrainingActions Hook - Training Action Handlers\n *\n * Custom hook for managing training action handlers.\n * Mirrors useCombatActions pattern for consistency.\n *\n * @korean 훈련액션훅 - 훈련 액션 핸들러 관리\n */\n\nimport { useCallback, useRef } from \"react\";\nimport {\n AudioBodyRegion,\n ImpactIntensity,\n} from \"../../../../audio/types\";\nimport type { AttackIntensity } from \"../../../screens/combat/hooks/useCombatAudio\";\nimport { getArchetypePhysicalAttributes } from \"../../../../data/archetypePhysicalAttributes\";\nimport {\n AnimationState,\n AnimationType,\n getAnimationForTechnique,\n} from \"../../../../systems/animation\";\nimport { physicalReachCalculator } from \"../../../../systems/physics\";\nimport { getTechniquesByStance } from \"../../../../systems/trigram/techniques\";\nimport { KoreanTechniquesSystem } from \"../../../../systems/trigram/KoreanTechniques\";\nimport { TRIGRAM_STANCES_ORDER } from \"../../../../systems/trigram/types\";\nimport type { KoreanTechnique } from \"../../../../systems/vitalpoint/types\";\nimport {\n CombatAttackType,\n DamageType,\n PlayerArchetype,\n Position,\n TrigramStance,\n} from \"../../../../types/common\";\nimport {\n DEFAULT_BODY_RADIUS_METERS,\n METERS_TO_TRAINING_UNITS,\n} from \"../../../../types/physicsConstants\";\nimport { calculateDistance3D } from \"../../../../utils/math\";\nimport { TrainingActions, TrainingScreenState } from \"./useTrainingState\";\n\nexport interface UseTrainingActionsConfig {\n readonly state: TrainingScreenState;\n readonly actions: TrainingActions;\n readonly playerPosition: Position;\n readonly player3DPosition: [number, number, number];\n readonly dummyPosition: [number, number, number];\n readonly playerArchetype: import(\"../../../../types/common\").PlayerArchetype;\n readonly playerStance: TrigramStance;\n /** Ref to current selected technique's animation type for distance-based hit detection */\n readonly currentTechniqueAnimationTypeRef: React.MutableRefObject<AnimationType>;\n readonly audio: {\n readonly playSFX: (sound: string, volume?: number) => Promise<void>;\n };\n /** Attack sound function from useCombatAudio for playing attack whoosh sounds */\n readonly playAttackSound?: (intensity: AttackIntensity) => Promise<void>;\n /** Bone impact audio function from useCombatAudio or similar hook */\n readonly playBoneImpactSound?: (options: {\n region?: AudioBodyRegion;\n intensity?: ImpactIntensity;\n damage?: number;\n remainingHealth?: number;\n vitalPoint?: boolean;\n hitPosition?: { x: number; y: number; z?: number };\n }) => Promise<void>;\n readonly onPlayerUpdate: (updates: {\n currentStance?: TrigramStance;\n lastActionTime?: number;\n position?: Position;\n }) => void;\n readonly playerAnimation: {\n readonly transitionTo: (state: AnimationState) => boolean;\n readonly transitionToStanceGuard: (stance: TrigramStance) => boolean;\n readonly currentState: string;\n };\n /** External ref to store pending attack data - shared with animation events */\n readonly pendingAttackRef: React.MutableRefObject<{\n accuracy: number;\n vitalPoint: string;\n animationType?: AnimationType;\n startTime?: number;\n techniqueId?: string;\n } | null>;\n /** Currently selected technique ID (from technique bar) */\n readonly selectedTechniqueId?: string;\n /** Callback to set the visual attack animation */\n readonly setAttackAnimation?: (animationName: string | undefined) => void;\n}\n\nexport interface UseTrainingActionsReturn {\n readonly handleStartTraining: () => void;\n readonly handleStopTraining: () => void;\n readonly handleDummyHit: (\n vitalPointId: string,\n attackContext?: {\n animationType?: AnimationType;\n techniqueId?: string;\n },\n ) => boolean;\n readonly handleDummyDefeated: () => void;\n readonly handleStanceChange: (stanceIndex: number) => void;\n readonly handleAttack: () => void;\n}\n\n/**\n * Get the best default technique for an archetype based on current stance.\n *\n * Each archetype has preferred combat styles:\n * - MUSA: Direct strikes, joint techniques (BLUNT/JOINT damage)\n * - AMSALJA: Nerve strikes, pressure points (NERVE/PRESSURE damage)\n * - HACKER: Precise calculated strikes (high accuracy)\n * - JEONGBO_YOWON: Psychological pressure, submissions (PRESSURE/JOINT)\n * - JOJIK_POKRYEOKBAE: High damage brutal strikes\n *\n * @korean 원형별 기본 기술 선택 - 8개 자세에 따른 최적 기술\n */\nfunction getDefaultTechniqueForArchetype(\n archetype: PlayerArchetype,\n stance: TrigramStance,\n): KoreanTechnique | undefined {\n const techniques = getTechniquesByStance(stance);\n if (techniques.length === 0) return undefined;\n\n // Score each technique based on archetype preference\n const scoredTechniques = techniques.map((tech) => {\n let score = 0;\n const damageType = tech.damageType;\n const attackType = tech.type;\n const isAdvanced =\n (tech.kiCost || 0) >= 10 || (tech.staminaCost || 0) >= 15;\n\n switch (archetype) {\n case PlayerArchetype.MUSA:\n // Musa prefers: strikes, blocks, counter-attacks (BLUNT/JOINT/CRUSHING)\n if (damageType === DamageType.JOINT) score += 30;\n if (damageType === DamageType.CRUSHING) score += 25;\n if (damageType === DamageType.BLUNT) score += 20;\n if (attackType === CombatAttackType.STRIKE) score += 15;\n if (attackType === CombatAttackType.PUNCH) score += 10;\n if (isAdvanced) score += 10;\n break;\n\n case PlayerArchetype.AMSALJA:\n // Amsalja prefers: nerve strikes, pressure points, thrusts\n if (damageType === DamageType.NERVE) score += 35;\n if (damageType === DamageType.PRESSURE) score += 30;\n if (attackType === CombatAttackType.NERVE_STRIKE) score += 25;\n if (attackType === CombatAttackType.PRESSURE_POINT) score += 25;\n if (attackType === CombatAttackType.THRUST) score += 15;\n if ((tech.accuracy || 0) >= 0.9) score += 10;\n break;\n\n case PlayerArchetype.HACKER:\n // Hacker prefers: high accuracy, calculated strikes\n if ((tech.accuracy || 0) >= 0.9) score += 30;\n if ((tech.accuracy || 0) >= 0.8) score += 15;\n if (damageType === DamageType.NERVE) score += 20;\n if (damageType === DamageType.INTERNAL) score += 20;\n if (attackType === CombatAttackType.PRESSURE_POINT) score += 15;\n break;\n\n case PlayerArchetype.JEONGBO_YOWON:\n // Jeongbo prefers: psychological pressure, submissions\n if (damageType === DamageType.PRESSURE) score += 30;\n if (damageType === DamageType.JOINT) score += 25;\n if (attackType === CombatAttackType.GRAPPLE) score += 20;\n if (attackType === CombatAttackType.PRESSURE_POINT) score += 15;\n break;\n\n case PlayerArchetype.JOJIK_POKRYEOKBAE:\n // Jojik prefers: high damage, brutal techniques\n if ((tech.damage || 0) >= 35) score += 35;\n if ((tech.damage || 0) >= 30) score += 20;\n if (damageType === DamageType.SLASHING) score += 20;\n if (damageType === DamageType.PIERCING) score += 15;\n if (damageType === DamageType.CRUSHING) score += 15;\n if (attackType === CombatAttackType.KICK) score += 10;\n break;\n }\n\n return { technique: tech, score };\n });\n\n // Sort by score descending, return highest scoring technique\n scoredTechniques.sort((a, b) => b.score - a.score);\n return scoredTechniques[0]?.technique;\n}\n\n/**\n * Calculate hit accuracy based on distance and effective reach.\n * Uses PhysicalReachCalculator for animation-aware reach calculation.\n *\n * Distance logic matches CombatSystem: if out of reach, guaranteed miss (accuracy 0).\n * Training scene coordinates are in meters, using METERS_TO_TRAINING_UNITS = 1.0.\n *\n * **IMPORTANT**: Distance calculation accounts for body radius.\n * Center-to-center distance is adjusted by subtracting target body radius\n * because attacks hit the body surface, not the center point.\n * The target body radius is calculated from physical attributes for archetypes,\n * or uses DEFAULT_BODY_RADIUS_METERS for training dummies.\n *\n * Example: If player center is 1.5m from dummy center, but dummy body\n * extends 0.23m from center, the effective distance to hit is 1.27m.\n *\n * @korean 거리 기반 명중률 계산 - 사정거리 밖이면 빗나감\n */\nfunction calculateHitAccuracy(\n playerPos: [number, number, number],\n dummyPos: [number, number, number],\n archetype: import(\"../../../../types/common\").PlayerArchetype,\n stance: TrigramStance,\n animationType?: AnimationType,\n reachConfig?: import(\"../../../../types/physics\").PhysicalReachConfig,\n): number {\n // Calculate 3D distance between player and dummy centers (in meters)\n const centerToCenterDistance = calculateDistance3D(playerPos, dummyPos);\n\n // Get player's physical attributes for reach calculation\n const playerPhysicalAttributes = getArchetypePhysicalAttributes(archetype);\n\n // Training dummy uses default body radius since it has no archetype\n // For combat between players, we would use calculateBodyRadius(targetPhysicalAttributes)\n // 훈련 더미는 원형이 없으므로 기본 몸체 반경 사용\n const targetBodyRadius = DEFAULT_BODY_RADIUS_METERS;\n\n // Effective distance = center-to-center minus target body radius only\n // Note: PhysicalReachCalculator already includes player body pivot/offset in reach calculation,\n // so we only subtract the target radius to avoid double-counting.\n // 유효 거리 = 중심간 거리 - 더미 몸체 반경 (플레이어 몸체 오프셋은 도달 거리에 포함됨)\n const effectiveDistance = Math.max(\n 0,\n centerToCenterDistance - targetBodyRadius,\n );\n\n // If animation type is available, use physics-based reach calculation\n // We use calculateMaxReach (peak time reach) because:\n // 1. Training hit detection happens at animation frame 6 (~100ms)\n // 2. But technique hit timings expect longer animations (e.g., roundhouse 200-480ms)\n // 3. Using max reach ensures the technique can hit if within peak reach range\n // 4. This matches intuitive behavior - if you're close enough to be hit by the kick, it hits\n // 훈련 타격 감지는 최대 도달 거리 사용 (애니메이션 타이밍과 기술 타이밍 불일치 보정)\n if (animationType !== undefined) {\n const maxReachMeters = physicalReachCalculator.calculateMaxReach(\n playerPhysicalAttributes,\n animationType,\n stance,\n reachConfig, // Use technique's designed reach if provided\n );\n\n // Convert reach from meters to training scene units.\n // Training scenes are authored in real-world meters, so we intentionally\n // use a 1:1 conversion here (METERS_TO_TRAINING_UNITS = 1.0).\n // Combat AI uses METERS_TO_PIXELS_SCALE (100) for pixel coordinates.\n const reachInUnits = maxReachMeters * METERS_TO_TRAINING_UNITS;\n\n // STRICT DISTANCE CHECK (matches CombatSystem behavior):\n // Out of reach = guaranteed miss with accuracy 0\n if (effectiveDistance > reachInUnits) {\n return 0;\n }\n\n // Within reach: accuracy based on how centered the hit is\n // Closer = higher accuracy (0.7 to 1.0 range)\n return Math.max(0.7, 1.0 - (effectiveDistance / reachInUnits) * 0.3);\n }\n\n // Fallback: use default punch reach (0.7 meters) for legacy behavior\n const defaultReach = 0.7 * METERS_TO_TRAINING_UNITS;\n if (effectiveDistance > defaultReach) {\n return 0; // Out of reach = miss\n }\n // Within default reach: linear accuracy based on distance\n return Math.max(0.5, 1.0 - (effectiveDistance / defaultReach) * 0.5);\n}\n\n/**\n * useTrainingActions hook\n * Provides training action handlers with proper memoization\n */\nexport function useTrainingActions(\n config: UseTrainingActionsConfig,\n): UseTrainingActionsReturn {\n const {\n state,\n actions,\n player3DPosition,\n dummyPosition,\n playerArchetype,\n playerStance,\n currentTechniqueAnimationTypeRef,\n audio,\n playBoneImpactSound,\n playAttackSound,\n onPlayerUpdate,\n playerAnimation,\n pendingAttackRef,\n selectedTechniqueId,\n setAttackAnimation,\n } = config;\n\n // Ref to store timeout for dummy reset\n const dummyResetTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const handleStartTraining = useCallback(() => {\n actions.startTraining();\n audio.playSFX(\"menu_select\");\n }, [actions, audio]);\n\n const handleStopTraining = useCallback(() => {\n // Clear any pending dummy reset timeout\n if (dummyResetTimeoutRef.current) {\n clearTimeout(dummyResetTimeoutRef.current);\n dummyResetTimeoutRef.current = null;\n }\n actions.stopTraining();\n audio.playSFX(\"menu_back\");\n }, [actions, audio]);\n\n const handleDummyDefeated = useCallback(() => {\n actions.setFeedback(\"훈련 더미 무력화! | Dummy Defeated!\");\n audio.playSFX(\"ki_release\");\n\n // Clear any existing timeout\n if (dummyResetTimeoutRef.current) {\n clearTimeout(dummyResetTimeoutRef.current);\n }\n\n // Reset dummy health after delay\n dummyResetTimeoutRef.current = setTimeout(() => {\n actions.resetDummy();\n }, 2000);\n }, [actions, audio]);\n\n const handleDummyHit = useCallback(\n (\n _vitalPointId: string,\n attackContext?: {\n animationType?: AnimationType;\n techniqueId?: string;\n },\n ): boolean => {\n // Get animation context from the passed attackContext parameter\n // (TrainingScreen3D.tsx should pass the attackData before clearing the ref)\n const animationType = attackContext?.animationType;\n\n // Get technique's reachConfig for accurate reach calculation\n // Priority: attackContext.techniqueId (resolved in handleAttack) > selectedTechniqueId\n // This ensures default techniques (chosen when no explicit selection) also get their reachConfig\n let reachConfig: import(\"../../../../types/physics\").PhysicalReachConfig | undefined;\n const resolvedTechniqueId =\n attackContext?.techniqueId ?? selectedTechniqueId;\n if (resolvedTechniqueId) {\n const technique = KoreanTechniquesSystem.getTechniqueById(resolvedTechniqueId);\n reachConfig = technique?.reachConfig;\n }\n\n const accuracy = calculateHitAccuracy(\n player3DPosition,\n dummyPosition,\n playerArchetype,\n playerStance,\n animationType,\n reachConfig,\n );\n\n // Determine hit position (dummy center)\n const hitPosition: [number, number, number] = [\n dummyPosition[0],\n 1.5,\n dummyPosition[2],\n ];\n\n if (accuracy > 0.5) {\n const points = Math.round(accuracy * 100);\n const damage = Math.round(accuracy * 15); // 0-15 damage based on accuracy\n const isPerfect = accuracy > 0.9;\n\n // Register hit with state (only counts if training)\n if (state.isTraining) {\n actions.registerHit(points, damage, isPerfect);\n }\n\n // Play bone impact audio with anatomical feedback using proper audio system\n if (playBoneImpactSound) {\n void playBoneImpactSound({\n damage,\n remainingHealth: 100, // Dummy has 100 health\n vitalPoint: false,\n hitPosition: { x: hitPosition[0], y: hitPosition[1], z: hitPosition[2] },\n });\n }\n\n // Determine feedback and sound\n let effectType: \"success\" | \"perfect\";\n if (isPerfect) {\n actions.setFeedback(\"완벽한 타격! | Perfect Strike!\");\n audio.playSFX(\"ki_release\");\n effectType = \"perfect\";\n } else if (accuracy > 0.7) {\n actions.setFeedback(\"좋은 타격! | Good Strike!\");\n audio.playSFX(\"ki_charge\");\n effectType = \"success\";\n } else {\n actions.setFeedback(\"타격 성공 | Strike Success\");\n audio.playSFX(\"menu_click\");\n effectType = \"success\";\n }\n\n // Add hit effect\n actions.addHitEffect({\n position: hitPosition,\n type: effectType,\n visible: true,\n damage,\n });\n\n return true;\n } else {\n // Register miss (only counts if training)\n if (state.isTraining) {\n actions.registerMiss();\n }\n actions.setFeedback(\"빗나감 | Miss - Out of reach!\");\n audio.playSFX(\"menu_navigate\");\n\n // Add miss effect\n actions.addHitEffect({\n position: hitPosition,\n type: \"miss\",\n visible: true,\n });\n\n return false;\n }\n },\n [\n state.isTraining,\n player3DPosition,\n dummyPosition,\n playerArchetype,\n playerStance,\n actions,\n audio,\n playBoneImpactSound,\n selectedTechniqueId,\n ],\n );\n\n const handleStanceChange = useCallback(\n (stanceIndex: number) => {\n actions.setStanceIndex(stanceIndex);\n const stance = TRIGRAM_STANCES_ORDER[stanceIndex];\n if (stance) {\n // Directly transition to stance guard animation (skips transitional animation)\n // 자세 가드 애니메이션으로 직접 전환 (전환 애니메이션 생략)\n playerAnimation.transitionToStanceGuard(stance);\n onPlayerUpdate({ currentStance: stance });\n audio.playSFX(\"stance_change\");\n }\n },\n [actions, onPlayerUpdate, audio, playerAnimation],\n );\n\n const handleAttack = useCallback(() => {\n // Determine which technique to use:\n // 1. If a technique is explicitly selected from the TechniqueBar, use that\n // 2. Otherwise, use the best default technique for the archetype + stance\n // 사용할 기술 결정: 명시적 선택 또는 원형+자세 기반 기본 기술\n let techniqueToUse: KoreanTechnique | undefined;\n let techniqueId = selectedTechniqueId;\n\n if (!techniqueId) {\n // No technique explicitly selected - get default for archetype + stance\n // 명시적 선택 없음 - 원형과 자세에 맞는 기본 기술 사용\n const defaultTechnique = getDefaultTechniqueForArchetype(\n playerArchetype,\n playerStance,\n );\n if (defaultTechnique) {\n techniqueToUse = defaultTechnique;\n techniqueId = defaultTechnique.id;\n }\n }\n\n // Get the animation type from the technique\n // 기술에서 애니메이션 타입 가져오기\n let animationType = currentTechniqueAnimationTypeRef.current;\n if (techniqueToUse?.animationType) {\n animationType = techniqueToUse.animationType;\n currentTechniqueAnimationTypeRef.current = animationType;\n }\n\n const startTime = performance.now() / 1000; // Current time in seconds\n\n const accuracy = calculateHitAccuracy(\n player3DPosition,\n dummyPosition,\n playerArchetype,\n playerStance,\n animationType,\n techniqueToUse?.reachConfig, // Pass technique's reachConfig for accurate reach\n );\n\n pendingAttackRef.current = {\n accuracy,\n vitalPoint: state.selectedVitalPoint ?? \"generic\",\n animationType,\n startTime,\n techniqueId, // Store resolved technique ID for handleDummyHit\n };\n\n // Set visual attack animation based on technique (AnimationRegistry lookup)\n // This ensures the 3D model plays the correct technique animation (kick vs punch vs elbow)\n // 기술에 따른 시각적 공격 애니메이션 설정 (발차기 vs 주먹 vs 팔꿈치)\n if (setAttackAnimation && techniqueId) {\n const animationName = getAnimationForTechnique(techniqueId);\n setAttackAnimation(animationName);\n }\n\n // Trigger attack animation - this will fire onFrame event at frame 6\n playerAnimation.transitionTo(AnimationState.ATTACK);\n\n // Play attack sound based on technique damage/intensity\n // Resolve technique data if we only have an ID (from TechniqueBar selection)\n if (!techniqueToUse && selectedTechniqueId) {\n // Technique selected from TechniqueBar but not yet resolved\n techniqueToUse = KoreanTechniquesSystem.getTechniqueById(selectedTechniqueId);\n }\n\n if (playAttackSound) {\n // Prefer explicit technique damage when available\n const damage = techniqueToUse?.damage ?? 10;\n const intensity: AttackIntensity =\n damage >= 40\n ? \"critical\"\n : damage >= 25\n ? \"heavy\"\n : damage >= 10\n ? \"medium\"\n : \"light\";\n void playAttackSound(intensity);\n } else {\n // Fallback to generic whoosh if playAttackSound not available\n audio.playSFX(\"whoosh\");\n }\n }, [\n state.selectedVitalPoint,\n player3DPosition,\n dummyPosition,\n playerArchetype,\n playerStance,\n currentTechniqueAnimationTypeRef,\n playerAnimation,\n audio,\n playAttackSound,\n pendingAttackRef,\n selectedTechniqueId,\n setAttackAnimation,\n ]);\n\n return {\n handleStartTraining,\n handleStopTraining,\n handleDummyHit,\n handleDummyDefeated,\n handleStanceChange,\n handleAttack,\n };\n}\n\nexport default useTrainingActions;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmHA,SAAS,gCACP,WACA,QAC6B;CAC7B,MAAM,aAAa,sBAAsB,OAAO;AAChD,KAAI,WAAW,WAAW,EAAG,QAAO,KAAA;CAGpC,MAAM,mBAAmB,WAAW,KAAK,SAAS;EAChD,IAAI,QAAQ;EACZ,MAAM,aAAa,KAAK;EACxB,MAAM,aAAa,KAAK;EACxB,MAAM,cACH,KAAK,UAAU,MAAM,OAAO,KAAK,eAAe,MAAM;AAEzD,UAAQ,WA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D,CACF;EAsHC;EACA,oBArHyB,aACxB,gBAAwB;AACvB,WAAQ,eAAe,YAAY;GACnC,MAAM,SAAS,sBAAsB;AACrC,OAAI,QAAQ;AAGV,oBAAgB,wBAAwB,OAAO;AAC/C,mBAAe,EAAE,eAAe,QAAQ,CAAC;AACzC,UAAM,QAAQ,gBAAgB;;KAGlC;GAAC;GAAS;GAAgB;GAAO;GAAgB,CAClD;EAyGC,cAvGmB,kBAAkB;GAKrC,IAAI;GACJ,IAAI,cAAc;AAElB,OAAI,CAAC,aAAa;IAGhB,MAAM,mBAAmB,gCACvB,iBACA,aACD;AACD,QAAI,kBAAkB;AACpB,sBAAiB;AACjB,mBAAc,iBAAiB;;;GAMnC,IAAI,gBAAgB,iCAAiC;AACrD,OAAI,gBAAgB,eAAe;AACjC,oBAAgB,eAAe;AAC/B,qCAAiC,UAAU;;GAG7C,MAAM,YAAY,YAAY,KAAK,GAAG;AAWtC,oBAAiB,UAAU;IACzB,UAVe,qBACf,kBACA,eACA,iBACA,cACA,eACA,gBAAgB,YACjB;IAIC,YAAY,MAAM,sBAAsB;IACxC;IACA;IACA;IACD;AAKD,OAAI,sBAAsB,YAExB,oBADsB,yBAAyB,YAAY,CAC1B;AAInC,mBAAgB,aAAa,eAAe,OAAO;AAInD,OAAI,CAAC,kBAAkB,oBAErB,kBAAiB,uBAAuB,iBAAiB,oBAAoB;AAG/E,OAAI,iBAAiB;IAEnB,MAAM,SAAS,gBAAgB,UAAU;AASpC,oBAPH,UAAU,KACN,aACA,UAAU,KACR,UACA,UAAU,KACR,WACA,QACqB;SAG/B,OAAM,QAAQ,SAAS;KAExB;GACD,MAAM;GACN;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC;EASD"}
|
|
@@ -184,7 +184,7 @@ var SplashScreen = ({ onStart, width, height }) => {
|
|
|
184
184
|
}),
|
|
185
185
|
/* @__PURE__ */ jsxs("div", {
|
|
186
186
|
role: "contentinfo",
|
|
187
|
-
"aria-label": `Application version 0.7.
|
|
187
|
+
"aria-label": `Application version 0.7.9`,
|
|
188
188
|
style: {
|
|
189
189
|
position: "absolute",
|
|
190
190
|
bottom: "20px",
|
|
@@ -193,7 +193,7 @@ var SplashScreen = ({ onStart, width, height }) => {
|
|
|
193
193
|
fontSize: "10px",
|
|
194
194
|
zIndex: 1
|
|
195
195
|
},
|
|
196
|
-
children: ["v", "0.7.
|
|
196
|
+
children: ["v", "0.7.9"]
|
|
197
197
|
})
|
|
198
198
|
]
|
|
199
199
|
});
|
|
@@ -579,6 +579,6 @@ function getArchetypeClothing(archetype) {
|
|
|
579
579
|
return ARCHETYPE_CLOTHING[archetype];
|
|
580
580
|
}
|
|
581
581
|
//#endregion
|
|
582
|
-
export { getArchetypeClothing };
|
|
582
|
+
export { AMSALJA_CLOTHING, ARCHETYPE_CLOTHING, HACKER_CLOTHING, JEONGBO_CLOTHING, JOJIK_CLOTHING, MUSA_CLOTHING, getArchetypeClothing };
|
|
583
583
|
|
|
584
584
|
//# sourceMappingURL=archetypeClothing.js.map
|
|
@@ -221,7 +221,164 @@ var ARCHETYPE_PHYSICAL_ATTRIBUTES = {
|
|
|
221
221
|
function getArchetypePhysicalAttributes(archetype) {
|
|
222
222
|
return ARCHETYPE_PHYSICAL_ATTRIBUTES[archetype];
|
|
223
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* Calculate effective reach based on limb length and stance.
|
|
226
|
+
*
|
|
227
|
+
* **Korean**: 유효 거리 계산 (Calculate Effective Reach)
|
|
228
|
+
*
|
|
229
|
+
* Computes the effective combat reach considering limb length and
|
|
230
|
+
* body positioning. Different techniques use different limbs and
|
|
231
|
+
* leverage different amounts of body extension.
|
|
232
|
+
*
|
|
233
|
+
* @param limbLength - Length of the limb in centimeters
|
|
234
|
+
* @param extension - Percentage of full extension (0.0 to 1.0)
|
|
235
|
+
* @returns Effective reach in centimeters
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* ```typescript
|
|
239
|
+
* // Full extension punch
|
|
240
|
+
* const punchReach = calculateEffectiveReach(75, 1.0); // 75cm
|
|
241
|
+
*
|
|
242
|
+
* // 70% extension kick (stable stance)
|
|
243
|
+
* const kickReach = calculateEffectiveReach(95, 0.7); // 66.5cm
|
|
244
|
+
* ```
|
|
245
|
+
*
|
|
246
|
+
* @public
|
|
247
|
+
* @korean 유효거리계산
|
|
248
|
+
*/
|
|
249
|
+
function calculateEffectiveReach(limbLength, extension = 1) {
|
|
250
|
+
return limbLength * Math.max(0, Math.min(1, extension));
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Calculate movement speed modifier based on weight and leg length.
|
|
254
|
+
*
|
|
255
|
+
* **Korean**: 이동 속도 계산 (Calculate Movement Speed)
|
|
256
|
+
*
|
|
257
|
+
* Computes movement speed modifier based on body weight (inversely)
|
|
258
|
+
* and leg length (positively). Heavier fighters move slower, while
|
|
259
|
+
* longer legs provide faster base movement.
|
|
260
|
+
*
|
|
261
|
+
* Formula: baseSpeed * (legLength / 95) * (75 / weight)
|
|
262
|
+
* - Normalized around 95cm legs and 75kg weight
|
|
263
|
+
*
|
|
264
|
+
* @param physical - Physical attributes of the fighter
|
|
265
|
+
* @param baseSpeed - Base movement speed (default: 100)
|
|
266
|
+
* @returns Modified movement speed
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
* ```typescript
|
|
270
|
+
* const musaSpeed = calculateMovementSpeed(MUSA_PHYSICAL);
|
|
271
|
+
* // Result: 100 * (95/95) * (75/75) = 100
|
|
272
|
+
*
|
|
273
|
+
* const jojikSpeed = calculateMovementSpeed(JOJIK_PHYSICAL);
|
|
274
|
+
* // Result: 100 * (90/95) * (75/85) = ~88.2 (slower)
|
|
275
|
+
* ```
|
|
276
|
+
*
|
|
277
|
+
* @public
|
|
278
|
+
* @korean 이동속도계산
|
|
279
|
+
*/
|
|
280
|
+
function calculateMovementSpeed(physical, baseSpeed = 100) {
|
|
281
|
+
const legFactor = physical.legLength / 95;
|
|
282
|
+
const weightFactor = 75 / physical.weight;
|
|
283
|
+
return baseSpeed * legFactor * weightFactor;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Calculate damage modifier based on muscle mass.
|
|
287
|
+
*
|
|
288
|
+
* **Korean**: 공격력 계산 (Calculate Damage Output)
|
|
289
|
+
*
|
|
290
|
+
* Computes damage output modifier based on muscle mass. More muscle
|
|
291
|
+
* means more power in strikes, but with diminishing returns.
|
|
292
|
+
*
|
|
293
|
+
* Formula: 1.0 + ((muscleMass - 35) / 35) * 0.3
|
|
294
|
+
* - Normalized around 35kg muscle mass
|
|
295
|
+
* - Maximum 30% bonus from muscle
|
|
296
|
+
*
|
|
297
|
+
* @param physical - Physical attributes of the fighter
|
|
298
|
+
* @returns Damage multiplier (typically 0.7 to 1.3)
|
|
299
|
+
*
|
|
300
|
+
* @example
|
|
301
|
+
* ```typescript
|
|
302
|
+
* const musaDamage = calculateDamageModifier(MUSA_PHYSICAL);
|
|
303
|
+
* // Result: 1.0 + ((38-35)/35)*0.3 = ~1.026
|
|
304
|
+
*
|
|
305
|
+
* const jojikDamage = calculateDamageModifier(JOJIK_PHYSICAL);
|
|
306
|
+
* // Result: 1.0 + ((42-35)/35)*0.3 = ~1.06 (stronger)
|
|
307
|
+
* ```
|
|
308
|
+
*
|
|
309
|
+
* @public
|
|
310
|
+
* @korean 공격력계산
|
|
311
|
+
*/
|
|
312
|
+
function calculateDamageModifier(physical) {
|
|
313
|
+
return 1 + (physical.muscleMass - 35) / 35 * .3;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Calculate defense modifier based on fat mass and muscle mass.
|
|
317
|
+
*
|
|
318
|
+
* **Korean**: 방어력 계산 (Calculate Defense)
|
|
319
|
+
*
|
|
320
|
+
* Computes defense modifier based on fat mass (padding) and muscle mass
|
|
321
|
+
* (structural integrity). Fat absorbs blunt damage, muscle protects
|
|
322
|
+
* against impact.
|
|
323
|
+
*
|
|
324
|
+
* Formula: 1.0 + (fatMass / 100) + (muscleMass / 200)
|
|
325
|
+
*
|
|
326
|
+
* @param physical - Physical attributes of the fighter
|
|
327
|
+
* @returns Defense multiplier (typically 1.0 to 1.3)
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* ```typescript
|
|
331
|
+
* const amsaljaDefense = calculateDefenseModifier(AMSALJA_PHYSICAL);
|
|
332
|
+
* // Result: 1.0 + (9/100) + (32/200) = 1.25
|
|
333
|
+
*
|
|
334
|
+
* const jojikDefense = calculateDefenseModifier(JOJIK_PHYSICAL);
|
|
335
|
+
* // Result: 1.0 + (18/100) + (42/200) = 1.39 (tankier)
|
|
336
|
+
* ```
|
|
337
|
+
*
|
|
338
|
+
* @public
|
|
339
|
+
* @korean 방어력계산
|
|
340
|
+
*/
|
|
341
|
+
function calculateDefenseModifier(physical) {
|
|
342
|
+
const fatPadding = physical.fatMass / 100;
|
|
343
|
+
const muscleStructure = physical.muscleMass / 200;
|
|
344
|
+
return 1 + fatPadding + muscleStructure;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Calculate stamina regeneration rate based on age and fat mass.
|
|
348
|
+
*
|
|
349
|
+
* **Korean**: 체력 회복 속도 (Stamina Recovery Rate)
|
|
350
|
+
*
|
|
351
|
+
* Computes stamina recovery speed based on age (optimal 25-35) and
|
|
352
|
+
* fat mass (lower is better for recovery). Younger fighters and leaner
|
|
353
|
+
* builds recover faster.
|
|
354
|
+
*
|
|
355
|
+
* Formula: baseRate * ageFactor * fatFactor
|
|
356
|
+
* - Age factor peaks at 30 years (1.0), decreases before and after
|
|
357
|
+
* - Fat factor = 1.0 - (fatMass - 10) / 50
|
|
358
|
+
*
|
|
359
|
+
* @param physical - Physical attributes of the fighter
|
|
360
|
+
* @param baseRate - Base recovery rate (default: 10 per second)
|
|
361
|
+
* @returns Modified stamina recovery rate
|
|
362
|
+
*
|
|
363
|
+
* @example
|
|
364
|
+
* ```typescript
|
|
365
|
+
* const amsaljaRecovery = calculateStaminaRecovery(AMSALJA_PHYSICAL);
|
|
366
|
+
* // Age 28, fat 9kg: ~10.2 per second
|
|
367
|
+
*
|
|
368
|
+
* const jojikRecovery = calculateStaminaRecovery(JOJIK_PHYSICAL);
|
|
369
|
+
* // Age 36, fat 18kg: ~8.4 per second (slower)
|
|
370
|
+
* ```
|
|
371
|
+
*
|
|
372
|
+
* @public
|
|
373
|
+
* @korean 체력회복계산
|
|
374
|
+
*/
|
|
375
|
+
function calculateStaminaRecovery(physical, baseRate = 10) {
|
|
376
|
+
const ageDiff = Math.abs(physical.age - 30);
|
|
377
|
+
const ageFactor = Math.max(.7, 1 - ageDiff / 30);
|
|
378
|
+
const fatFactor = Math.max(.7, 1 - (physical.fatMass - 10) / 50);
|
|
379
|
+
return baseRate * ageFactor * fatFactor;
|
|
380
|
+
}
|
|
224
381
|
//#endregion
|
|
225
|
-
export { getArchetypePhysicalAttributes };
|
|
382
|
+
export { AMSALJA_PHYSICAL, ARCHETYPE_PHYSICAL_ATTRIBUTES, HACKER_PHYSICAL, JEONGBO_PHYSICAL, JOJIK_PHYSICAL, MUSA_PHYSICAL, calculateDamageModifier, calculateDefenseModifier, calculateEffectiveReach, calculateMovementSpeed, calculateStaminaRecovery, getArchetypePhysicalAttributes };
|
|
226
383
|
|
|
227
384
|
//# sourceMappingURL=archetypePhysicalAttributes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archetypePhysicalAttributes.js","names":[],"sources":["../../src/data/archetypePhysicalAttributes.ts"],"sourcesContent":["/**\n * Physical attribute profiles for each player archetype.\n *\n * **Korean**: 원형별 신체 속성 (Archetype Physical Attributes)\n *\n * Defines realistic body dimensions and composition for each of the five\n * player archetypes based on their combat style and background. These\n * attributes directly affect combat calculations including reach, movement\n * speed, damage, and stamina.\n *\n * ## Design Philosophy\n *\n * Each archetype's physical profile reflects their training, lifestyle, and\n * combat specialization:\n *\n * - **무사 (Musa)**: Balanced warrior with traditional training\n * - **암살자 (Amsalja)**: Lean and agile for stealth operations\n * - **해커 (Hacker)**: Average build with tech enhancements\n * - **정보요원 (Jeongbo)**: Fit operative with intelligence background\n * - **조직폭력배 (Jojik)**: Heavy and brutal street fighter\n *\n * @module data/archetypePhysicalAttributes\n * @category Player & Archetypes\n * @korean 원형신체데이터\n */\n\nimport { PhysicalAttributes, PlayerArchetype } from \"@/types\";\n\n/**\n * 무사 (Musa) - Traditional Warrior Physical Profile\n *\n * **Philosophy**: Honor through disciplined strength\n * **Training**: Military special forces with traditional martial arts\n * **Build**: Balanced, athletic, well-conditioned warrior\n *\n * Physical characteristics reflect years of traditional Korean martial arts\n * training combined with modern military conditioning. Optimal balance between\n * strength, speed, and endurance for prolonged combat effectiveness.\n *\n * @korean 무사신체\n */\nexport const MUSA_PHYSICAL: PhysicalAttributes = {\n /**\n * Weight: 82 kg\n * Athletic military build for strength and mobility\n * Korean Special Forces standard physique\n * Optimal power-to-weight ratio for combat\n */\n weight: 82,\n\n /**\n * Leg Length: 96 cm\n * Athletic leg length for powerful kicks\n * Trained for devastating Taekwondo kicks\n * Balanced reach and stability\n */\n legLength: 96,\n\n /**\n * Arm Length: 77 cm\n * Strong arm reach for disciplined striking\n * Conditioned for both precision and power\n * Effective grappling range\n */\n armLength: 77,\n\n /**\n * Muscle Mass: 35 kg (43% of body weight)\n * High muscle mass from military training\n * Realistic for trained special forces soldier\n * Excellent functional strength\n */\n muscleMass: 35,\n\n /**\n * Fat Mass: 13 kg (16% body fat)\n * Athletic body fat percentage\n * Maintains energy reserves for combat endurance\n * Optimal for sustained operations\n */\n fatMass: 13,\n\n /**\n * Age: 32 years\n * Prime combat age combining experience and physical capability\n * Peak of martial arts mastery and physical conditioning\n * Balanced wisdom and reflexes\n */\n age: 32,\n\n /**\n * Total Height: 180 cm\n * Solid military build height\n * Above average for imposing presence\n * Good proportions for all-around combat\n */\n totalHeight: 180,\n\n /**\n * Torso Length: 59 cm\n * Strong core providing stable base\n * Optimal for breath control and Ki cultivation\n * Protected vital points\n */\n torsoLength: 59,\n\n /**\n * Head Size: 22 cm\n * Average head diameter\n * Standard vital point target area\n * Balanced consciousness vulnerability\n */\n headSize: 22,\n\n /**\n * Neck Length: 11 cm\n * Strong, trained neck\n * Moderate vulnerability to chokes\n * Conditioned for impact resistance\n */\n neckLength: 11,\n\n /**\n * Shoulder Width: 46 cm\n * Broad military shoulders\n * Strong defense coverage\n * Excellent grappling control points\n */\n shoulderWidth: 46,\n\n /**\n * Walk Speed: 6.0 m/s\n * Balanced tactical movement\n * Military conditioning for sustained mobility\n * Optimal for disciplined combat approach\n */\n walkSpeed: 6.0,\n\n /**\n * Run Speed: 9.5 m/s\n * Strong sprint capability\n * Combat-ready rapid repositioning\n * Efficient for tactical advances\n */\n runSpeed: 9.5,\n\n /**\n * Acceleration: 12.0 m/s²\n * Balanced explosiveness\n * Military conditioning for quick reactions\n * Optimal muscle-to-weight ratio for combat\n */\n acceleration: 12.0,\n};\n\n/**\n * 암살자 (Amsalja) - Shadow Assassin Physical Profile\n *\n * **Philosophy**: Efficiency through invisibility\n * **Training**: Covert operations and silent elimination specialist\n * **Build**: Lean, agile, optimized for stealth and precision\n *\n * Physical characteristics emphasize low body mass for stealth movement,\n * exceptional reach for vital point targeting, and minimal fat for maximum\n * agility. Every attribute optimized for silent, deadly efficiency.\n *\n * @korean 암살자신체\n */\nexport const AMSALJA_PHYSICAL: PhysicalAttributes = {\n /**\n * Weight: 75 kg\n * Lean athletic build like a kickboxer (Israel Adesanya type)\n * Optimized for speed, reach, and precision\n * Light enough for stealth, heavy enough for power\n */\n weight: 75,\n\n /**\n * Leg Length: 102 cm\n * Long legs for exceptional reach and stride\n * Enables precise high kicks to vital points\n * Excellent for maintaining distance\n */\n legLength: 102,\n\n /**\n * Arm Length: 82 cm\n * Extended reach for range advantage\n * Crucial for vital point precision strikes\n * Keeps opponents at safe distance\n */\n armLength: 82,\n\n /**\n * Muscle Mass: 30 kg (40% of body weight)\n * Lean, functional muscle for speed\n * Optimized for explosive movements\n * Sufficient for devastating precision strikes\n */\n muscleMass: 30,\n\n /**\n * Fat Mass: 10 kg (13% body fat)\n * Very low fat for maximum definition\n * Peak agility and flexibility\n * Athletic performance optimized\n */\n fatMass: 10,\n\n /**\n * Age: 28 years\n * Young and at peak physical agility\n * Optimal reflexes for split-second decisions\n * Experience balanced with peak conditioning\n */\n age: 28,\n\n /**\n * Total Height: 186 cm\n * Tall for exceptional reach advantage\n * Long limb ratios for vital point access\n * Intimidating presence while maintaining agility\n */\n totalHeight: 186,\n\n /**\n * Torso Length: 58 cm\n * Compact torso for lower center of gravity\n * Agile core for quick movement\n * Reduced vital point target area\n */\n torsoLength: 58,\n\n /**\n * Head Size: 22 cm\n * Normal head profile\n * Standard target area for head strikes\n * Balanced consciousness vulnerability\n */\n headSize: 22,\n\n /**\n * Neck Length: 11 cm\n * Longer neck for head movement evasion\n * Slightly increased choke vulnerability\n * Requires skilled guard positioning\n */\n neckLength: 11,\n\n /**\n * Shoulder Width: 44 cm\n * Lean but athletic shoulders\n * Good mobility with adequate coverage\n * Efficient for striking mechanics\n */\n shoulderWidth: 44,\n\n /**\n * Walk Speed: 6.5 m/s\n * FASTEST tactical movement\n * Optimized for silent, rapid repositioning\n * Assassin-level agility and speed\n */\n walkSpeed: 6.5,\n\n /**\n * Run Speed: 11.0 m/s\n * FASTEST sprint capability\n * Peak athletic conditioning for pursuit\n * Exceptional for closing distance quickly\n */\n runSpeed: 11.0,\n\n /**\n * Acceleration: 15.0 m/s²\n * HIGHEST explosiveness\n * Exceptional muscle-to-weight ratio\n * Lightning-fast direction changes\n */\n acceleration: 15.0,\n};\n\n/**\n * 해커 (Hacker) - Cyber Warrior Physical Profile\n *\n * **Philosophy**: Information as power through technology\n * **Training**: Digital native with supplemental physical training\n * **Build**: Average physique enhanced by technological augmentation\n *\n * Physical characteristics reflect a tech-focused lifestyle with functional\n * fitness rather than peak athletic conditioning. Attributes are average\n * but compensated by cybernetic enhancements and data-driven combat analysis.\n *\n * @korean 해커신체\n */\nexport const HACKER_PHYSICAL: PhysicalAttributes = {\n /**\n * Weight: 72 kg\n * Average weight for height\n * Functional fitness from regular training\n * Tech worker who maintains fitness\n */\n weight: 72,\n\n /**\n * Leg Length: 92 cm\n * Standard leg proportions\n * Adequate for tech-assisted movement\n * Compensated by augmented targeting systems\n */\n legLength: 92,\n\n /**\n * Arm Length: 73 cm\n * Average arm reach\n * Sufficient when aided by cybernetic enhancements\n * Precision compensated by data analysis\n */\n armLength: 73,\n\n /**\n * Muscle Mass: 28 kg (39% of body weight)\n * Moderate muscle mass for tech worker\n * Maintained through efficient training\n * Relies more on tech than raw strength\n */\n muscleMass: 28,\n\n /**\n * Fat Mass: 15 kg (21% body fat)\n * Average body fat from desk work\n * Still functional for combat\n * Less emphasis on peak conditioning\n */\n fatMass: 15,\n\n /**\n * Age: 26 years\n * Young digital native\n * High neuroplasticity for tech integration\n * Peak learning and adaptation capabilities\n */\n age: 26,\n\n /**\n * Total Height: 175 cm\n * Average Korean male height\n * Standard proportions for tech integration\n * Balanced body type for augmentation\n */\n totalHeight: 175,\n\n /**\n * Torso Length: 57 cm\n * Average torso length\n * Standard core for cyber implants\n * Balanced Ki flow for tech-bio integration\n */\n torsoLength: 57,\n\n /**\n * Head Size: 22 cm\n * Average head size\n * Standard neural interface compatibility\n * Balanced for augmented reality overlays\n */\n headSize: 22,\n\n /**\n * Neck Length: 10 cm\n * Average neck length\n * Standard vulnerability to chokes\n * Adequate for neural interface cables\n */\n neckLength: 10,\n\n /**\n * Shoulder Width: 43 cm\n * Average shoulder span\n * Standard defense coverage\n * Balanced for wearable tech integration\n */\n shoulderWidth: 43,\n\n /**\n * Walk Speed: 5.5 m/s\n * Average tactical movement\n * Tech-focused rather than athletic\n * Compensated by cybernetic enhancements\n */\n walkSpeed: 5.5,\n\n /**\n * Run Speed: 8.5 m/s\n * Moderate sprint capability\n * Supplemental physical training\n * Relies on tech for combat advantage\n */\n runSpeed: 8.5,\n\n /**\n * Acceleration: 10.0 m/s²\n * Moderate explosiveness\n * Average physical conditioning\n * Compensated by tech-enhanced reactions\n */\n acceleration: 10.0,\n};\n\n/**\n * 정보요원 (Jeongbo Yowon) - Intelligence Operative Physical Profile\n *\n * **Philosophy**: Knowledge through observation and strategy\n * **Training**: Government intelligence agency with specialized combat\n * **Build**: Athletic operative with strategic fitness\n *\n * Physical characteristics reflect intelligence agency fitness standards\n * with emphasis on versatility, endurance, and adaptability. Balanced\n * attributes suitable for varied operational requirements.\n *\n * @korean 정보요원신체\n */\nexport const JEONGBO_PHYSICAL: PhysicalAttributes = {\n /**\n * Weight: 78 kg\n * Fit intelligence operative build\n * Government agency fitness standard\n * Balance between capability and inconspicuousness\n */\n weight: 78,\n\n /**\n * Leg Length: 95 cm\n * Balanced leg length for varied terrain\n * Standard proportions for operational flexibility\n * Suitable for extended pursuit or evasion\n */\n legLength: 95,\n\n /**\n * Arm Length: 76 cm\n * Standard operative reach\n * Trained for weapon and hand-to-hand versatility\n * Balanced for multiple combat scenarios\n */\n armLength: 76,\n\n /**\n * Muscle Mass: 32 kg (41% of body weight)\n * Agency-required conditioning\n * Balanced strength for operational demands\n * Emphasis on functional fitness\n */\n muscleMass: 32,\n\n /**\n * Fat Mass: 12 kg (15% body fat)\n * Low but sustainable body fat\n * Maintains energy reserves for long operations\n * Within intelligence service standards\n */\n fatMass: 12,\n\n /**\n * Age: 34 years\n * Experienced operative\n * Peak of analytical and physical capability\n * Wisdom from field experience\n */\n age: 34,\n\n /**\n * Total Height: 179 cm\n * Standard government agency height\n * Balanced proportions for versatility\n * Neither imposing nor inconspicuous\n */\n totalHeight: 179,\n\n /**\n * Torso Length: 58 cm\n * Balanced torso for varied operations\n * Good breath control and stamina\n * Standard vital point distribution\n */\n torsoLength: 58,\n\n /**\n * Head Size: 22 cm\n * Average head size\n * Standard tactical gear compatibility\n * Balanced consciousness resilience\n */\n headSize: 22,\n\n /**\n * Neck Length: 10 cm\n * Average neck length\n * Trained resistance to chokes\n * Standard blood choke vulnerability\n */\n neckLength: 10,\n\n /**\n * Shoulder Width: 45 cm\n * Athletic shoulder width\n * Good defense coverage\n * Versatile grappling control\n */\n shoulderWidth: 45,\n\n /**\n * Walk Speed: 6.2 m/s\n * Fast tactical movement\n * Agency fitness standards\n * Excellent for varied operations\n */\n walkSpeed: 6.2,\n\n /**\n * Run Speed: 10.0 m/s\n * Strong sprint capability\n * Intelligence operative conditioning\n * Efficient pursuit and evasion\n */\n runSpeed: 10.0,\n\n /**\n * Acceleration: 14.0 m/s²\n * High explosiveness\n * Agency combat training\n * Quick response for tactical situations\n */\n acceleration: 14.0,\n};\n\n/**\n * 조직폭력배 (Jojik Pokryeokbae) - Organized Crime Physical Profile\n *\n * **Philosophy**: Survival through ruthlessness and brutality\n * **Training**: Street fighting and underground martial arts\n * **Build**: Heavy, powerful, intimidating presence\n *\n * Physical characteristics emphasize raw power and intimidation over\n * refined technique. Heavier build with high muscle mass for brutal\n * effectiveness and street-proven durability.\n *\n * @korean 조직폭력배신체\n */\nexport const JOJIK_PHYSICAL: PhysicalAttributes = {\n /**\n * Weight: 105 kg\n * MASSIVE build for power and intimidation\n * Like a heavyweight MMA fighter or large taekwondo practitioner\n * Dominant mass advantage in any confrontation\n */\n weight: 105,\n\n /**\n * Leg Length: 100 cm\n * Long, powerful legs despite heavy build\n * Devastating kicks with massive power\n * Surprising mobility for size\n */\n legLength: 100,\n\n /**\n * Arm Length: 84 cm\n * Long, thick arms for crushing power\n * Exceptional reach for grappling and strikes\n * Street-fighting dominance\n */\n armLength: 84,\n\n /**\n * Muscle Mass: 48 kg (46% of body weight)\n * Highest muscle mass of all archetypes\n * Built through intense street combat and heavy training\n * Raw, overwhelming power\n */\n muscleMass: 48,\n\n /**\n * Fat Mass: 20 kg (19% body fat)\n * Functional body fat for damage absorption\n * Provides padding against strikes\n * Still very fit despite bulk\n */\n fatMass: 20,\n\n /**\n * Age: 36 years\n * Veteran of street conflicts\n * Battle-scarred and experienced\n * Peak brutality and survival instincts\n */\n age: 36,\n\n /**\n * Total Height: 188 cm\n * Tall AND massive build\n * Physically imposing presence\n * Dominates any confrontation visually\n */\n totalHeight: 188,\n\n /**\n * Torso Length: 64 cm\n * Thick, powerful torso\n * Massive core strength\n * Enhanced durability and power generation\n */\n torsoLength: 64,\n\n /**\n * Head Size: 24 cm\n * Large, thick skull\n * Significant head strike resistance\n * High consciousness resilience\n */\n headSize: 24,\n\n /**\n * Neck Length: 11 cm\n * Thick, muscular neck\n * Very difficult to choke\n * Protected blood vessels\n */\n neckLength: 11,\n\n /**\n * Shoulder Width: 54 cm\n * WIDEST shoulders - intimidating presence\n * Maximum defense coverage\n * Overwhelming physical dominance\n */\n shoulderWidth: 54,\n\n /**\n * Walk Speed: 5.0 m/s\n * Slower tactical movement\n * Heavy build reduces mobility\n * Compensated by raw power and reach\n */\n walkSpeed: 5.0,\n\n /**\n * Run Speed: 8.0 m/s\n * Moderate sprint capability\n * Mass limits top speed\n * Still intimidating when charging\n */\n runSpeed: 8.0,\n\n /**\n * Acceleration: 9.0 m/s²\n * Lower explosiveness\n * Heavy mass requires more force to move\n * Compensated by devastating power on contact\n */\n acceleration: 9.0,\n};\n\n/**\n * Archetype physical attributes lookup map.\n *\n * **Korean**: 원형 신체 속성 맵 (Archetype Physical Attributes Map)\n *\n * Provides quick access to physical attribute profiles by archetype.\n * Used by combat system to retrieve realistic body dimensions and\n * composition for calculations.\n *\n * @example\n * ```typescript\n * const playerArchetype = PlayerArchetype.MUSA;\n * const physicalAttrs = ARCHETYPE_PHYSICAL_ATTRIBUTES[playerArchetype];\n * const kickRange = calculateKickRange(physicalAttrs.legLength);\n * ```\n *\n * @public\n * @korean 원형신체맵\n */\nexport const ARCHETYPE_PHYSICAL_ATTRIBUTES: Record<\n PlayerArchetype,\n PhysicalAttributes\n> = {\n [PlayerArchetype.MUSA]: MUSA_PHYSICAL,\n [PlayerArchetype.AMSALJA]: AMSALJA_PHYSICAL,\n [PlayerArchetype.HACKER]: HACKER_PHYSICAL,\n [PlayerArchetype.JEONGBO_YOWON]: JEONGBO_PHYSICAL,\n [PlayerArchetype.JOJIK_POKRYEOKBAE]: JOJIK_PHYSICAL,\n};\n\n/**\n * Get physical attributes for a specific archetype.\n *\n * **Korean**: 원형 신체 속성 가져오기 (Get Archetype Physical Attributes)\n *\n * Retrieves the physical attribute profile for the specified player archetype.\n * Returns a readonly copy to prevent accidental mutations.\n *\n * @param archetype - The player archetype to get attributes for\n * @returns Physical attributes for the specified archetype\n *\n * @example\n * ```typescript\n * const musaAttrs = getArchetypePhysicalAttributes(PlayerArchetype.MUSA);\n * console.log(`Musa weight: ${musaAttrs.weight}kg`);\n * console.log(`Musa arm reach: ${musaAttrs.armLength}cm`);\n * ```\n *\n * @public\n * @korean 원형신체가져오기\n */\nexport function getArchetypePhysicalAttributes(\n archetype: PlayerArchetype,\n): Readonly<PhysicalAttributes> {\n return ARCHETYPE_PHYSICAL_ATTRIBUTES[archetype];\n}\n\n/**\n * Calculate effective reach based on limb length and stance.\n *\n * **Korean**: 유효 거리 계산 (Calculate Effective Reach)\n *\n * Computes the effective combat reach considering limb length and\n * body positioning. Different techniques use different limbs and\n * leverage different amounts of body extension.\n *\n * @param limbLength - Length of the limb in centimeters\n * @param extension - Percentage of full extension (0.0 to 1.0)\n * @returns Effective reach in centimeters\n *\n * @example\n * ```typescript\n * // Full extension punch\n * const punchReach = calculateEffectiveReach(75, 1.0); // 75cm\n *\n * // 70% extension kick (stable stance)\n * const kickReach = calculateEffectiveReach(95, 0.7); // 66.5cm\n * ```\n *\n * @public\n * @korean 유효거리계산\n */\nexport function calculateEffectiveReach(\n limbLength: number,\n extension: number = 1.0,\n): number {\n return limbLength * Math.max(0, Math.min(1, extension));\n}\n\n/**\n * Calculate movement speed modifier based on weight and leg length.\n *\n * **Korean**: 이동 속도 계산 (Calculate Movement Speed)\n *\n * Computes movement speed modifier based on body weight (inversely)\n * and leg length (positively). Heavier fighters move slower, while\n * longer legs provide faster base movement.\n *\n * Formula: baseSpeed * (legLength / 95) * (75 / weight)\n * - Normalized around 95cm legs and 75kg weight\n *\n * @param physical - Physical attributes of the fighter\n * @param baseSpeed - Base movement speed (default: 100)\n * @returns Modified movement speed\n *\n * @example\n * ```typescript\n * const musaSpeed = calculateMovementSpeed(MUSA_PHYSICAL);\n * // Result: 100 * (95/95) * (75/75) = 100\n *\n * const jojikSpeed = calculateMovementSpeed(JOJIK_PHYSICAL);\n * // Result: 100 * (90/95) * (75/85) = ~88.2 (slower)\n * ```\n *\n * @public\n * @korean 이동속도계산\n */\nexport function calculateMovementSpeed(\n physical: PhysicalAttributes,\n baseSpeed: number = 100,\n): number {\n const legFactor = physical.legLength / 95; // Normalized to 95cm average\n const weightFactor = 75 / physical.weight; // Normalized to 75kg average\n return baseSpeed * legFactor * weightFactor;\n}\n\n/**\n * Calculate damage modifier based on muscle mass.\n *\n * **Korean**: 공격력 계산 (Calculate Damage Output)\n *\n * Computes damage output modifier based on muscle mass. More muscle\n * means more power in strikes, but with diminishing returns.\n *\n * Formula: 1.0 + ((muscleMass - 35) / 35) * 0.3\n * - Normalized around 35kg muscle mass\n * - Maximum 30% bonus from muscle\n *\n * @param physical - Physical attributes of the fighter\n * @returns Damage multiplier (typically 0.7 to 1.3)\n *\n * @example\n * ```typescript\n * const musaDamage = calculateDamageModifier(MUSA_PHYSICAL);\n * // Result: 1.0 + ((38-35)/35)*0.3 = ~1.026\n *\n * const jojikDamage = calculateDamageModifier(JOJIK_PHYSICAL);\n * // Result: 1.0 + ((42-35)/35)*0.3 = ~1.06 (stronger)\n * ```\n *\n * @public\n * @korean 공격력계산\n */\nexport function calculateDamageModifier(physical: PhysicalAttributes): number {\n const normalizedMuscle = (physical.muscleMass - 35) / 35;\n return 1.0 + normalizedMuscle * 0.3;\n}\n\n/**\n * Calculate defense modifier based on fat mass and muscle mass.\n *\n * **Korean**: 방어력 계산 (Calculate Defense)\n *\n * Computes defense modifier based on fat mass (padding) and muscle mass\n * (structural integrity). Fat absorbs blunt damage, muscle protects\n * against impact.\n *\n * Formula: 1.0 + (fatMass / 100) + (muscleMass / 200)\n *\n * @param physical - Physical attributes of the fighter\n * @returns Defense multiplier (typically 1.0 to 1.3)\n *\n * @example\n * ```typescript\n * const amsaljaDefense = calculateDefenseModifier(AMSALJA_PHYSICAL);\n * // Result: 1.0 + (9/100) + (32/200) = 1.25\n *\n * const jojikDefense = calculateDefenseModifier(JOJIK_PHYSICAL);\n * // Result: 1.0 + (18/100) + (42/200) = 1.39 (tankier)\n * ```\n *\n * @public\n * @korean 방어력계산\n */\nexport function calculateDefenseModifier(physical: PhysicalAttributes): number {\n const fatPadding = physical.fatMass / 100;\n const muscleStructure = physical.muscleMass / 200;\n return 1.0 + fatPadding + muscleStructure;\n}\n\n/**\n * Calculate stamina regeneration rate based on age and fat mass.\n *\n * **Korean**: 체력 회복 속도 (Stamina Recovery Rate)\n *\n * Computes stamina recovery speed based on age (optimal 25-35) and\n * fat mass (lower is better for recovery). Younger fighters and leaner\n * builds recover faster.\n *\n * Formula: baseRate * ageFactor * fatFactor\n * - Age factor peaks at 30 years (1.0), decreases before and after\n * - Fat factor = 1.0 - (fatMass - 10) / 50\n *\n * @param physical - Physical attributes of the fighter\n * @param baseRate - Base recovery rate (default: 10 per second)\n * @returns Modified stamina recovery rate\n *\n * @example\n * ```typescript\n * const amsaljaRecovery = calculateStaminaRecovery(AMSALJA_PHYSICAL);\n * // Age 28, fat 9kg: ~10.2 per second\n *\n * const jojikRecovery = calculateStaminaRecovery(JOJIK_PHYSICAL);\n * // Age 36, fat 18kg: ~8.4 per second (slower)\n * ```\n *\n * @public\n * @korean 체력회복계산\n */\nexport function calculateStaminaRecovery(\n physical: PhysicalAttributes,\n baseRate: number = 10,\n): number {\n // Age factor: peaks at 30, decreases before and after\n const ageOptimal = 30;\n const ageDiff = Math.abs(physical.age - ageOptimal);\n const ageFactor = Math.max(0.7, 1.0 - ageDiff / 30);\n\n // Fat factor: lower fat = faster recovery\n const fatFactor = Math.max(0.7, 1.0 - (physical.fatMass - 10) / 50);\n\n return baseRate * ageF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AS;EACzB,gBAAgB,gBAAgB;EAChC,gBAAgB,oBAAoB;CACtC;;;;;;;;;;;;;;;;;;;;;;AAuBD,SAAgB,+BACd,WAC8B;AAC9B,QAAO,8BAA8B"}
|
|
1
|
+
{"version":3,"file":"archetypePhysicalAttributes.js","names":[],"sources":["../../src/data/archetypePhysicalAttributes.ts"],"sourcesContent":["/**\n * Physical attribute profiles for each player archetype.\n *\n * **Korean**: 원형별 신체 속성 (Archetype Physical Attributes)\n *\n * Defines realistic body dimensions and composition for each of the five\n * player archetypes based on their combat style and background. These\n * attributes directly affect combat calculations including reach, movement\n * speed, damage, and stamina.\n *\n * ## Design Philosophy\n *\n * Each archetype's physical profile reflects their training, lifestyle, and\n * combat specialization:\n *\n * - **무사 (Musa)**: Balanced warrior with traditional training\n * - **암살자 (Amsalja)**: Lean and agile for stealth operations\n * - **해커 (Hacker)**: Average build with tech enhancements\n * - **정보요원 (Jeongbo)**: Fit operative with intelligence background\n * - **조직폭력배 (Jojik)**: Heavy and brutal street fighter\n *\n * @module data/archetypePhysicalAttributes\n * @category Player & Archetypes\n * @korean 원형신체데이터\n */\n\nimport { PhysicalAttributes, PlayerArchetype } from \"@/types\";\n\n/**\n * 무사 (Musa) - Traditional Warrior Physical Profile\n *\n * **Philosophy**: Honor through disciplined strength\n * **Training**: Military special forces with traditional martial arts\n * **Build**: Balanced, athletic, well-conditioned warrior\n *\n * Physical characteristics reflect years of traditional Korean martial arts\n * training combined with modern military conditioning. Optimal balance between\n * strength, speed, and endurance for prolonged combat effectiveness.\n *\n * @korean 무사신체\n */\nexport const MUSA_PHYSICAL: PhysicalAttributes = {\n /**\n * Weight: 82 kg\n * Athletic military build for strength and mobility\n * Korean Special Forces standard physique\n * Optimal power-to-weight ratio for combat\n */\n weight: 82,\n\n /**\n * Leg Length: 96 cm\n * Athletic leg length for powerful kicks\n * Trained for devastating Taekwondo kicks\n * Balanced reach and stability\n */\n legLength: 96,\n\n /**\n * Arm Length: 77 cm\n * Strong arm reach for disciplined striking\n * Conditioned for both precision and power\n * Effective grappling range\n */\n armLength: 77,\n\n /**\n * Muscle Mass: 35 kg (43% of body weight)\n * High muscle mass from military training\n * Realistic for trained special forces soldier\n * Excellent functional strength\n */\n muscleMass: 35,\n\n /**\n * Fat Mass: 13 kg (16% body fat)\n * Athletic body fat percentage\n * Maintains energy reserves for combat endurance\n * Optimal for sustained operations\n */\n fatMass: 13,\n\n /**\n * Age: 32 years\n * Prime combat age combining experience and physical capability\n * Peak of martial arts mastery and physical conditioning\n * Balanced wisdom and reflexes\n */\n age: 32,\n\n /**\n * Total Height: 180 cm\n * Solid military build height\n * Above average for imposing presence\n * Good proportions for all-around combat\n */\n totalHeight: 180,\n\n /**\n * Torso Length: 59 cm\n * Strong core providing stable base\n * Optimal for breath control and Ki cultivation\n * Protected vital points\n */\n torsoLength: 59,\n\n /**\n * Head Size: 22 cm\n * Average head diameter\n * Standard vital point target area\n * Balanced consciousness vulnerability\n */\n headSize: 22,\n\n /**\n * Neck Length: 11 cm\n * Strong, trained neck\n * Moderate vulnerability to chokes\n * Conditioned for impact resistance\n */\n neckLength: 11,\n\n /**\n * Shoulder Width: 46 cm\n * Broad military shoulders\n * Strong defense coverage\n * Excellent grappling control points\n */\n shoulderWidth: 46,\n\n /**\n * Walk Speed: 6.0 m/s\n * Balanced tactical movement\n * Military conditioning for sustained mobility\n * Optimal for disciplined combat approach\n */\n walkSpeed: 6.0,\n\n /**\n * Run Speed: 9.5 m/s\n * Strong sprint capability\n * Combat-ready rapid repositioning\n * Efficient for tactical advances\n */\n runSpeed: 9.5,\n\n /**\n * Acceleration: 12.0 m/s²\n * Balanced explosiveness\n * Military conditioning for quick reactions\n * Optimal muscle-to-weight ratio for combat\n */\n acceleration: 12.0,\n};\n\n/**\n * 암살자 (Amsalja) - Shadow Assassin Physical Profile\n *\n * **Philosophy**: Efficiency through invisibility\n * **Training**: Covert operations and silent elimination specialist\n * **Build**: Lean, agile, optimized for stealth and precision\n *\n * Physical characteristics emphasize low body mass for stealth movement,\n * exceptional reach for vital point targeting, and minimal fat for maximum\n * agility. Every attribute optimized for silent, deadly efficiency.\n *\n * @korean 암살자신체\n */\nexport const AMSALJA_PHYSICAL: PhysicalAttributes = {\n /**\n * Weight: 75 kg\n * Lean athletic build like a kickboxer (Israel Adesanya type)\n * Optimized for speed, reach, and precision\n * Light enough for stealth, heavy enough for power\n */\n weight: 75,\n\n /**\n * Leg Length: 102 cm\n * Long legs for exceptional reach and stride\n * Enables precise high kicks to vital points\n * Excellent for maintaining distance\n */\n legLength: 102,\n\n /**\n * Arm Length: 82 cm\n * Extended reach for range advantage\n * Crucial for vital point precision strikes\n * Keeps opponents at safe distance\n */\n armLength: 82,\n\n /**\n * Muscle Mass: 30 kg (40% of body weight)\n * Lean, functional muscle for speed\n * Optimized for explosive movements\n * Sufficient for devastating precision strikes\n */\n muscleMass: 30,\n\n /**\n * Fat Mass: 10 kg (13% body fat)\n * Very low fat for maximum definition\n * Peak agility and flexibility\n * Athletic performance optimized\n */\n fatMass: 10,\n\n /**\n * Age: 28 years\n * Young and at peak physical agility\n * Optimal reflexes for split-second decisions\n * Experience balanced with peak conditioning\n */\n age: 28,\n\n /**\n * Total Height: 186 cm\n * Tall for exceptional reach advantage\n * Long limb ratios for vital point access\n * Intimidating presence while maintaining agility\n */\n totalHeight: 186,\n\n /**\n * Torso Length: 58 cm\n * Compact torso for lower center of gravity\n * Agile core for quick movement\n * Reduced vital point target area\n */\n torsoLength: 58,\n\n /**\n * Head Size: 22 cm\n * Normal head profile\n * Standard target area for head strikes\n * Balanced consciousness vulnerability\n */\n headSize: 22,\n\n /**\n * Neck Length: 11 cm\n * Longer neck for head movement evasion\n * Slightly increased choke vulnerability\n * Requires skilled guard positioning\n */\n neckLength: 11,\n\n /**\n * Shoulder Width: 44 cm\n * Lean but athletic shoulders\n * Good mobility with adequate coverage\n * Efficient for striking mechanics\n */\n shoulderWidth: 44,\n\n /**\n * Walk Speed: 6.5 m/s\n * FASTEST tactical movement\n * Optimized for silent, rapid repositioning\n * Assassin-level agility and speed\n */\n walkSpeed: 6.5,\n\n /**\n * Run Speed: 11.0 m/s\n * FASTEST sprint capability\n * Peak athletic conditioning for pursuit\n * Exceptional for closing distance quickly\n */\n runSpeed: 11.0,\n\n /**\n * Acceleration: 15.0 m/s²\n * HIGHEST explosiveness\n * Exceptional muscle-to-weight ratio\n * Lightning-fast direction changes\n */\n acceleration: 15.0,\n};\n\n/**\n * 해커 (Hacker) - Cyber Warrior Physical Profile\n *\n * **Philosophy**: Information as power through technology\n * **Training**: Digital native with supplemental physical training\n * **Build**: Average physique enhanced by technological augmentation\n *\n * Physical characteristics reflect a tech-focused lifestyle with functional\n * fitness rather than peak athletic conditioning. Attributes are average\n * but compensated by cybernetic enhancements and data-driven combat analysis.\n *\n * @korean 해커신체\n */\nexport const HACKER_PHYSICAL: PhysicalAttributes = {\n /**\n * Weight: 72 kg\n * Average weight for height\n * Functional fitness from regular training\n * Tech worker who maintains fitness\n */\n weight: 72,\n\n /**\n * Leg Length: 92 cm\n * Standard leg proportions\n * Adequate for tech-assisted movement\n * Compensated by augmented targeting systems\n */\n legLength: 92,\n\n /**\n * Arm Length: 73 cm\n * Average arm reach\n * Sufficient when aided by cybernetic enhancements\n * Precision compensated by data analysis\n */\n armLength: 73,\n\n /**\n * Muscle Mass: 28 kg (39% of body weight)\n * Moderate muscle mass for tech worker\n * Maintained through efficient training\n * Relies more on tech than raw strength\n */\n muscleMass: 28,\n\n /**\n * Fat Mass: 15 kg (21% body fat)\n * Average body fat from desk work\n * Still functional for combat\n * Less emphasis on peak conditioning\n */\n fatMass: 15,\n\n /**\n * Age: 26 years\n * Young digital native\n * High neuroplasticity for tech integration\n * Peak learning and adaptation capabilities\n */\n age: 26,\n\n /**\n * Total Height: 175 cm\n * Average Korean male height\n * Standard proportions for tech integration\n * Balanced body type for augmentation\n */\n totalHeight: 175,\n\n /**\n * Torso Length: 57 cm\n * Average torso length\n * Standard core for cyber implants\n * Balanced Ki flow for tech-bio integration\n */\n torsoLength: 57,\n\n /**\n * Head Size: 22 cm\n * Average head size\n * Standard neural interface compatibility\n * Balanced for augmented reality overlays\n */\n headSize: 22,\n\n /**\n * Neck Length: 10 cm\n * Average neck length\n * Standard vulnerability to chokes\n * Adequate for neural interface cables\n */\n neckLength: 10,\n\n /**\n * Shoulder Width: 43 cm\n * Average shoulder span\n * Standard defense coverage\n * Balanced for wearable tech integration\n */\n shoulderWidth: 43,\n\n /**\n * Walk Speed: 5.5 m/s\n * Average tactical movement\n * Tech-focused rather than athletic\n * Compensated by cybernetic enhancements\n */\n walkSpeed: 5.5,\n\n /**\n * Run Speed: 8.5 m/s\n * Moderate sprint capability\n * Supplemental physical training\n * Relies on tech for combat advantage\n */\n runSpeed: 8.5,\n\n /**\n * Acceleration: 10.0 m/s²\n * Moderate explosiveness\n * Average physical conditioning\n * Compensated by tech-enhanced reactions\n */\n acceleration: 10.0,\n};\n\n/**\n * 정보요원 (Jeongbo Yowon) - Intelligence Operative Physical Profile\n *\n * **Philosophy**: Knowledge through observation and strategy\n * **Training**: Government intelligence agency with specialized combat\n * **Build**: Athletic operative with strategic fitness\n *\n * Physical characteristics reflect intelligence agency fitness standards\n * with emphasis on versatility, endurance, and adaptability. Balanced\n * attributes suitable for varied operational requirements.\n *\n * @korean 정보요원신체\n */\nexport const JEONGBO_PHYSICAL: PhysicalAttributes = {\n /**\n * Weight: 78 kg\n * Fit intelligence operative build\n * Government agency fitness standard\n * Balance between capability and inconspicuousness\n */\n weight: 78,\n\n /**\n * Leg Length: 95 cm\n * Balanced leg length for varied terrain\n * Standard proportions for operational flexibility\n * Suitable for extended pursuit or evasion\n */\n legLength: 95,\n\n /**\n * Arm Length: 76 cm\n * Standard operative reach\n * Trained for weapon and hand-to-hand versatility\n * Balanced for multiple combat scenarios\n */\n armLength: 76,\n\n /**\n * Muscle Mass: 32 kg (41% of body weight)\n * Agency-required conditioning\n * Balanced strength for operational demands\n * Emphasis on functional fitness\n */\n muscleMass: 32,\n\n /**\n * Fat Mass: 12 kg (15% body fat)\n * Low but sustainable body fat\n * Maintains energy reserves for long operations\n * Within intelligence service standards\n */\n fatMass: 12,\n\n /**\n * Age: 34 years\n * Experienced operative\n * Peak of analytical and physical capability\n * Wisdom from field experience\n */\n age: 34,\n\n /**\n * Total Height: 179 cm\n * Standard government agency height\n * Balanced proportions for versatility\n * Neither imposing nor inconspicuous\n */\n totalHeight: 179,\n\n /**\n * Torso Length: 58 cm\n * Balanced torso for varied operations\n * Good breath control and stamina\n * Standard vital point distribution\n */\n torsoLength: 58,\n\n /**\n * Head Size: 22 cm\n * Average head size\n * Standard tactical gear compatibility\n * Balanced consciousness resilience\n */\n headSize: 22,\n\n /**\n * Neck Length: 10 cm\n * Average neck length\n * Trained resistance to chokes\n * Standard blood choke vulnerability\n */\n neckLength: 10,\n\n /**\n * Shoulder Width: 45 cm\n * Athletic shoulder width\n * Good defense coverage\n * Versatile grappling control\n */\n shoulderWidth: 45,\n\n /**\n * Walk Speed: 6.2 m/s\n * Fast tactical movement\n * Agency fitness standards\n * Excellent for varied operations\n */\n walkSpeed: 6.2,\n\n /**\n * Run Speed: 10.0 m/s\n * Strong sprint capability\n * Intelligence operative conditioning\n * Efficient pursuit and evasion\n */\n runSpeed: 10.0,\n\n /**\n * Acceleration: 14.0 m/s²\n * High explosiveness\n * Agency combat training\n * Quick response for tactical situations\n */\n acceleration: 14.0,\n};\n\n/**\n * 조직폭력배 (Jojik Pokryeokbae) - Organized Crime Physical Profile\n *\n * **Philosophy**: Survival through ruthlessness and brutality\n * **Training**: Street fighting and underground martial arts\n * **Build**: Heavy, powerful, intimidating presence\n *\n * Physical characteristics emphasize raw power and intimidation over\n * refined technique. Heavier build with high muscle mass for brutal\n * effectiveness and street-proven durability.\n *\n * @korean 조직폭력배신체\n */\nexport const JOJIK_PHYSICAL: PhysicalAttributes = {\n /**\n * Weight: 105 kg\n * MASSIVE build for power and intimidation\n * Like a heavyweight MMA fighter or large taekwondo practitioner\n * Dominant mass advantage in any confrontation\n */\n weight: 105,\n\n /**\n * Leg Length: 100 cm\n * Long, powerful legs despite heavy build\n * Devastating kicks with massive power\n * Surprising mobility for size\n */\n legLength: 100,\n\n /**\n * Arm Length: 84 cm\n * Long, thick arms for crushing power\n * Exceptional reach for grappling and strikes\n * Street-fighting dominance\n */\n armLength: 84,\n\n /**\n * Muscle Mass: 48 kg (46% of body weight)\n * Highest muscle mass of all archetypes\n * Built through intense street combat and heavy training\n * Raw, overwhelming power\n */\n muscleMass: 48,\n\n /**\n * Fat Mass: 20 kg (19% body fat)\n * Functional body fat for damage absorption\n * Provides padding against strikes\n * Still very fit despite bulk\n */\n fatMass: 20,\n\n /**\n * Age: 36 years\n * Veteran of street conflicts\n * Battle-scarred and experienced\n * Peak brutality and survival instincts\n */\n age: 36,\n\n /**\n * Total Height: 188 cm\n * Tall AND massive build\n * Physically imposing presence\n * Dominates any confrontation visually\n */\n totalHeight: 188,\n\n /**\n * Torso Length: 64 cm\n * Thick, powerful torso\n * Massive core strength\n * Enhanced durability and power generation\n */\n torsoLength: 64,\n\n /**\n * Head Size: 24 cm\n * Large, thick skull\n * Significant head strike resistance\n * High consciousness resilience\n */\n headSize: 24,\n\n /**\n * Neck Length: 11 cm\n * Thick, muscular neck\n * Very difficult to choke\n * Protected blood vessels\n */\n neckLength: 11,\n\n /**\n * Shoulder Width: 54 cm\n * WIDEST shoulders - intimidating presence\n * Maximum defense coverage\n * Overwhelming physical dominance\n */\n shoulderWidth: 54,\n\n /**\n * Walk Speed: 5.0 m/s\n * Slower tactical movement\n * Heavy build reduces mobility\n * Compensated by raw power and reach\n */\n walkSpeed: 5.0,\n\n /**\n * Run Speed: 8.0 m/s\n * Moderate sprint capability\n * Mass limits top speed\n * Still intimidating when charging\n */\n runSpeed: 8.0,\n\n /**\n * Acceleration: 9.0 m/s²\n * Lower explosiveness\n * Heavy mass requires more force to move\n * Compensated by devastating power on contact\n */\n acceleration: 9.0,\n};\n\n/**\n * Archetype physical attributes lookup map.\n *\n * **Korean**: 원형 신체 속성 맵 (Archetype Physical Attributes Map)\n *\n * Provides quick access to physical attribute profiles by archetype.\n * Used by combat system to retrieve realistic body dimensions and\n * composition for calculations.\n *\n * @example\n * ```typescript\n * const playerArchetype = PlayerArchetype.MUSA;\n * const physicalAttrs = ARCHETYPE_PHYSICAL_ATTRIBUTES[playerArchetype];\n * const kickRange = calculateKickRange(physicalAttrs.legLength);\n * ```\n *\n * @public\n * @korean 원형신체맵\n */\nexport const ARCHETYPE_PHYSICAL_ATTRIBUTES: Record<\n PlayerArchetype,\n PhysicalAttributes\n> = {\n [PlayerArchetype.MUSA]: MUSA_PHYSICAL,\n [PlayerArchetype.AMSALJA]: AMSALJA_PHYSICAL,\n [PlayerArchetype.HACKER]: HACKER_PHYSICAL,\n [PlayerArchetype.JEONGBO_YOWON]: JEONGBO_PHYSICAL,\n [PlayerArchetype.JOJIK_POKRYEOKBAE]: JOJIK_PHYSICAL,\n};\n\n/**\n * Get physical attributes for a specific archetype.\n *\n * **Korean**: 원형 신체 속성 가져오기 (Get Archetype Physical Attributes)\n *\n * Retrieves the physical attribute profile for the specified player archetype.\n * Returns a readonly copy to prevent accidental mutations.\n *\n * @param archetype - The player archetype to get attributes for\n * @returns Physical attributes for the specified archetype\n *\n * @example\n * ```typescript\n * const musaAttrs = getArchetypePhysicalAttributes(PlayerArchetype.MUSA);\n * console.log(`Musa weight: ${musaAttrs.weight}kg`);\n * console.log(`Musa arm reach: ${musaAttrs.armLength}cm`);\n * ```\n *\n * @public\n * @korean 원형신체가져오기\n */\nexport function getArchetypePhysicalAttributes(\n archetype: PlayerArchetype,\n): Readonly<PhysicalAttributes> {\n return ARCHETYPE_PHYSICAL_ATTRIBUTES[archetype];\n}\n\n/**\n * Calculate effective reach based on limb length and stance.\n *\n * **Korean**: 유효 거리 계산 (Calculate Effective Reach)\n *\n * Computes the effective combat reach considering limb length and\n * body positioning. Different techniques use different limbs and\n * leverage different amounts of body extension.\n *\n * @param limbLength - Length of the limb in centimeters\n * @param extension - Percentage of full extension (0.0 to 1.0)\n * @returns Effective reach in centimeters\n *\n * @example\n * ```typescript\n * // Full extension punch\n * const punchReach = calculateEffectiveReach(75, 1.0); // 75cm\n *\n * // 70% extension kick (stable stance)\n * const kickReach = calculateEffectiveReach(95, 0.7); // 66.5cm\n * ```\n *\n * @public\n * @korean 유효거리계산\n */\nexport function calculateEffectiveReach(\n limbLength: number,\n extension: number = 1.0,\n): number {\n return limbLength * Math.max(0, Math.min(1, extension));\n}\n\n/**\n * Calculate movement speed modifier based on weight and leg length.\n *\n * **Korean**: 이동 속도 계산 (Calculate Movement Speed)\n *\n * Computes movement speed modifier based on body weight (inversely)\n * and leg length (positively). Heavier fighters move slower, while\n * longer legs provide faster base movement.\n *\n * Formula: baseSpeed * (legLength / 95) * (75 / weight)\n * - Normalized around 95cm legs and 75kg weight\n *\n * @param physical - Physical attributes of the fighter\n * @param baseSpeed - Base movement speed (default: 100)\n * @returns Modified movement speed\n *\n * @example\n * ```typescript\n * const musaSpeed = calculateMovementSpeed(MUSA_PHYSICAL);\n * // Result: 100 * (95/95) * (75/75) = 100\n *\n * const jojikSpeed = calculateMovementSpeed(JOJIK_PHYSICAL);\n * // Result: 100 * (90/95) * (75/85) = ~88.2 (slower)\n * ```\n *\n * @public\n * @korean 이동속도계산\n */\nexport function calculateMovementSpeed(\n physical: PhysicalAttributes,\n baseSpeed: number = 100,\n): number {\n const legFactor = physical.legLength / 95; // Normalized to 95cm average\n const weightFactor = 75 / physical.weight; // Normalized to 75kg average\n return baseSpeed * legFactor * weightFactor;\n}\n\n/**\n * Calculate damage modifier based on muscle mass.\n *\n * **Korean**: 공격력 계산 (Calculate Damage Output)\n *\n * Computes damage output modifier based on muscle mass. More muscle\n * means more power in strikes, but with diminishing returns.\n *\n * Formula: 1.0 + ((muscleMass - 35) / 35) * 0.3\n * - Normalized around 35kg muscle mass\n * - Maximum 30% bonus from muscle\n *\n * @param physical - Physical attributes of the fighter\n * @returns Damage multiplier (typically 0.7 to 1.3)\n *\n * @example\n * ```typescript\n * const musaDamage = calculateDamageModifier(MUSA_PHYSICAL);\n * // Result: 1.0 + ((38-35)/35)*0.3 = ~1.026\n *\n * const jojikDamage = calculateDamageModifier(JOJIK_PHYSICAL);\n * // Result: 1.0 + ((42-35)/35)*0.3 = ~1.06 (stronger)\n * ```\n *\n * @public\n * @korean 공격력계산\n */\nexport function calculateDamageModifier(physical: PhysicalAttributes): number {\n const normalizedMuscle = (physical.muscleMass - 35) / 35;\n return 1.0 + normalizedMuscle * 0.3;\n}\n\n/**\n * Calculate defense modifier based on fat mass and muscle mass.\n *\n * **Korean**: 방어력 계산 (Calculate Defense)\n *\n * Computes defense modifier based on fat mass (padding) and muscle mass\n * (structural integrity). Fat absorbs blunt damage, muscle protects\n * against impact.\n *\n * Formula: 1.0 + (fatMass / 100) + (muscleMass / 200)\n *\n * @param physical - Physical attributes of the fighter\n * @returns Defense multiplier (typically 1.0 to 1.3)\n *\n * @example\n * ```typescript\n * const amsaljaDefense = calculateDefenseModifier(AMSALJA_PHYSICAL);\n * // Result: 1.0 + (9/100) + (32/200) = 1.25\n *\n * const jojikDefense = calculateDefenseModifier(JOJIK_PHYSICAL);\n * // Result: 1.0 + (18/100) + (42/200) = 1.39 (tankier)\n * ```\n *\n * @public\n * @korean 방어력계산\n */\nexport function calculateDefenseModifier(physical: PhysicalAttributes): number {\n const fatPadding = physical.fatMass / 100;\n const muscleStructure = physical.muscleMass / 200;\n return 1.0 + fatPadding + muscleStructure;\n}\n\n/**\n * Calculate stamina regeneration rate based on age and fat mass.\n *\n * **Korean**: 체력 회복 속도 (Stamina Recovery Rate)\n *\n * Computes stamina recovery speed based on age (optimal 25-35) and\n * fat mass (lower is better for recovery). Younger fighters and leaner\n * builds recover faster.\n *\n * Formula: baseRate * ageFactor * fatFactor\n * - Age factor peaks at 30 years (1.0), decreases before and after\n * - Fat factor = 1.0 - (fatMass - 10) / 50\n *\n * @param physical - Physical attributes of the fighter\n * @param baseRate - Base recovery rate (default: 10 per second)\n * @returns Modified stamina recovery rate\n *\n * @example\n * ```typescript\n * const amsaljaRecovery = calculateStaminaRecovery(AMSALJA_PHYSICAL);\n * // Age 28, fat 9kg: ~10.2 per second\n *\n * const jojikRecovery = calculateStaminaRecovery(JOJIK_PHYSICAL);\n * // Age 36, fat 18kg: ~8.4 per second (slower)\n * ```\n *\n * @public\n * @korean 체력회복계산\n */\nexport function calculateStaminaRecovery(\n physical: PhysicalAttributes,\n baseRate: number = 10,\n): number {\n // Age factor: peaks at 30, decreases before and after\n const ageOptimal = 30;\n const ageDiff = Math.abs(physical.age - ageOptimal);\n const ageFactor = Math.max(0.7, 1.0 - ageDiff / 30);\n\n // Fat factor: lower fat = faster recovery\n const fatFactor = Math.max(0.7, 1.0 - (physical.fatMass - 10) / 50);\n\n return baseRate * ageFactor * fatFactor;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,IAAa,gBAAoC;CAO/C,QAAQ;CAQR,WAAW;CAQX,WAAW;CAQX,YAAY;CAQZ,SAAS;CAQT,KAAK;CAQL,aAAa;CAQb,aAAa;CAQb,UAAU;CAQV,YAAY;CAQZ,eAAe;CAQf,WAAW;CAQX,UAAU;CAQV,cAAc;CACf;;;;;;;;;;;;;;AAeD,IAAa,mBAAuC;CAOlD,QAAQ;CAQR,WAAW;CAQX,WAAW;CAQX,YAAY;CAQZ,SAAS;CAQT,KAAK;CAQL,aAAa;CAQb,aAAa;CAQb,UAAU;CAQV,YAAY;CAQZ,eAAe;CAQf,WAAW;CAQX,UAAU;CAQV,cAAc;CACf;;;;;;;;;;;;;;AAeD,IAAa,kBAAsC;CAOjD,QAAQ;CAQR,WAAW;CAQX,WAAW;CAQX,YAAY;CAQZ,SAAS;CAQT,KAAK;CAQL,aAAa;CAQb,aAAa;CAQb,UAAU;CAQV,YAAY;CAQZ,eAAe;CAQf,WAAW;CAQX,UAAU;CAQV,cAAc;CACf;;;;;;;;;;;;;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;;;AAgC5B,SAAgB,yBACd,UACA,WAAmB,IACX;CAGR,MAAM,UAAU,KAAK,IAAI,SAAS,MADf,GACgC;CACnD,MAAM,YAAY,KAAK,IAAI,IAAK,IAAM,UAAU,GAAG;CAGnD,MAAM,YAAY,KAAK,IAAI,IAAK,KAAO,SAAS,UAAU,MAAM,GAAG;AAEnE,QAAO,WAAW,YAAY"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Game data and configuration for Black Trigram (흑괘)
|
|
3
|
+
*
|
|
4
|
+
* Contains archetype definitions, technique mappings, physical attributes,
|
|
5
|
+
* and Korean martial arts combat data.
|
|
6
|
+
*
|
|
7
|
+
* @module data
|
|
8
|
+
* @category Data
|
|
9
|
+
*/
|
|
10
|
+
export * from "./archetypeClothing";
|
|
11
|
+
export * from "./archetypePhysicalAttributes";
|
|
12
|
+
export * from "./techniqueMappings";
|
|
13
|
+
export * from "./techniques";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { AMSALJA_TECHNIQUES, HACKER_TECHNIQUES, JEONGBO_YOWON_TECHNIQUES, JOJIK_POKRYEOKBAE_TECHNIQUES, MUSA_TECHNIQUES, getTechniqueById, getTechniquesForArchetype, getTechniquesForStanceAndArchetype } from "./techniques.js";
|
|
3
|
+
import { AMSALJA_PHYSICAL, ARCHETYPE_PHYSICAL_ATTRIBUTES, HACKER_PHYSICAL, JEONGBO_PHYSICAL, JOJIK_PHYSICAL, MUSA_PHYSICAL, calculateDamageModifier, calculateDefenseModifier, calculateEffectiveReach, calculateMovementSpeed, calculateStaminaRecovery, getArchetypePhysicalAttributes } from "./archetypePhysicalAttributes.js";
|
|
4
|
+
import { ATTACK_ANIMATION_TO_MOVEMENT_TYPE, TECHNIQUE_TO_ANIMATION_TYPE, getAnimationTypeForTechnique, getAnimationTypeFromAttackAnimation } from "./techniqueMappings.js";
|
|
5
|
+
import { AMSALJA_CLOTHING, ARCHETYPE_CLOTHING, HACKER_CLOTHING, JEONGBO_CLOTHING, JOJIK_CLOTHING, MUSA_CLOTHING, getArchetypeClothing } from "./archetypeClothing.js";
|
|
6
|
+
//#region src/data/index.ts
|
|
7
|
+
var data_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
AMSALJA_CLOTHING: () => AMSALJA_CLOTHING,
|
|
9
|
+
AMSALJA_PHYSICAL: () => AMSALJA_PHYSICAL,
|
|
10
|
+
AMSALJA_TECHNIQUES: () => AMSALJA_TECHNIQUES,
|
|
11
|
+
ARCHETYPE_CLOTHING: () => ARCHETYPE_CLOTHING,
|
|
12
|
+
ARCHETYPE_PHYSICAL_ATTRIBUTES: () => ARCHETYPE_PHYSICAL_ATTRIBUTES,
|
|
13
|
+
ATTACK_ANIMATION_TO_MOVEMENT_TYPE: () => ATTACK_ANIMATION_TO_MOVEMENT_TYPE,
|
|
14
|
+
HACKER_CLOTHING: () => HACKER_CLOTHING,
|
|
15
|
+
HACKER_PHYSICAL: () => HACKER_PHYSICAL,
|
|
16
|
+
HACKER_TECHNIQUES: () => HACKER_TECHNIQUES,
|
|
17
|
+
JEONGBO_CLOTHING: () => JEONGBO_CLOTHING,
|
|
18
|
+
JEONGBO_PHYSICAL: () => JEONGBO_PHYSICAL,
|
|
19
|
+
JEONGBO_YOWON_TECHNIQUES: () => JEONGBO_YOWON_TECHNIQUES,
|
|
20
|
+
JOJIK_CLOTHING: () => JOJIK_CLOTHING,
|
|
21
|
+
JOJIK_PHYSICAL: () => JOJIK_PHYSICAL,
|
|
22
|
+
JOJIK_POKRYEOKBAE_TECHNIQUES: () => JOJIK_POKRYEOKBAE_TECHNIQUES,
|
|
23
|
+
MUSA_CLOTHING: () => MUSA_CLOTHING,
|
|
24
|
+
MUSA_PHYSICAL: () => MUSA_PHYSICAL,
|
|
25
|
+
MUSA_TECHNIQUES: () => MUSA_TECHNIQUES,
|
|
26
|
+
TECHNIQUE_TO_ANIMATION_TYPE: () => TECHNIQUE_TO_ANIMATION_TYPE,
|
|
27
|
+
calculateDamageModifier: () => calculateDamageModifier,
|
|
28
|
+
calculateDefenseModifier: () => calculateDefenseModifier,
|
|
29
|
+
calculateEffectiveReach: () => calculateEffectiveReach,
|
|
30
|
+
calculateMovementSpeed: () => calculateMovementSpeed,
|
|
31
|
+
calculateStaminaRecovery: () => calculateStaminaRecovery,
|
|
32
|
+
getAnimationTypeForTechnique: () => getAnimationTypeForTechnique,
|
|
33
|
+
getAnimationTypeFromAttackAnimation: () => getAnimationTypeFromAttackAnimation,
|
|
34
|
+
getArchetypeClothing: () => getArchetypeClothing,
|
|
35
|
+
getArchetypePhysicalAttributes: () => getArchetypePhysicalAttributes,
|
|
36
|
+
getTechniqueById: () => getTechniqueById,
|
|
37
|
+
getTechniquesForArchetype: () => getTechniquesForArchetype,
|
|
38
|
+
getTechniquesForStanceAndArchetype: () => getTechniquesForStanceAndArchetype
|
|
39
|
+
});
|
|
40
|
+
//#endregion
|
|
41
|
+
export { data_exports };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/data/index.ts"],"sourcesContent":["/**\n * Game data and configuration for Black Trigram (흑괘)\n *\n * Contains archetype definitions, technique mappings, physical attributes,\n * and Korean martial arts combat data.\n *\n * @module data\n * @category Data\n */\n\nexport * from \"./archetypeClothing\";\nexport * from \"./archetypePhysicalAttributes\";\nexport * from \"./techniqueMappings\";\nexport * from \"./techniques\";\n"],"mappings":""}
|
|
@@ -1,7 +1,42 @@
|
|
|
1
1
|
import { AttackAnimationType } from "../types/skeletal.js";
|
|
2
2
|
import { AnimationType } from "../systems/animation/builders/MartialArtsConstants.js";
|
|
3
3
|
import TechniqueId from "../types/techniqueId.js";
|
|
4
|
-
|
|
4
|
+
//#region src/data/techniqueMappings.ts
|
|
5
|
+
/**
|
|
6
|
+
* Technique to Animation Type mappings
|
|
7
|
+
*
|
|
8
|
+
* **Korean**: 기술-애니메이션 매핑
|
|
9
|
+
*
|
|
10
|
+
* Maps each technique to its corresponding AnimationType for attack movement physics.
|
|
11
|
+
* This provides a type-safe, comprehensive mapping that replaces string-based
|
|
12
|
+
* substring matching.
|
|
13
|
+
*
|
|
14
|
+
* @module data/techniqueMappings
|
|
15
|
+
* @category Combat System
|
|
16
|
+
* @korean 기술매핑
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Maps AttackAnimationType (from technique definitions) to AnimationType (for movement physics)
|
|
20
|
+
*
|
|
21
|
+
* AttackAnimationType is the skeletal animation type (PUNCH_HIGH, KICK_FRONT, etc.)
|
|
22
|
+
* AnimationType is the martial arts movement type for physics calculations
|
|
23
|
+
*
|
|
24
|
+
* @korean 공격애니메이션타입-애니메이션타입매핑
|
|
25
|
+
*/
|
|
26
|
+
var ATTACK_ANIMATION_TO_MOVEMENT_TYPE = {
|
|
27
|
+
[AttackAnimationType.PUNCH_HIGH]: AnimationType.CROSS,
|
|
28
|
+
[AttackAnimationType.PUNCH_MID]: AnimationType.JAB,
|
|
29
|
+
[AttackAnimationType.PUNCH_LOW]: AnimationType.JAB,
|
|
30
|
+
[AttackAnimationType.KICK_FRONT]: AnimationType.FRONT_KICK,
|
|
31
|
+
[AttackAnimationType.KICK_SIDE]: AnimationType.SIDE_KICK,
|
|
32
|
+
[AttackAnimationType.KICK_ROUNDHOUSE]: AnimationType.ROUNDHOUSE_KICK,
|
|
33
|
+
[AttackAnimationType.ELBOW_STRIKE]: AnimationType.ELBOW_STRIKE,
|
|
34
|
+
[AttackAnimationType.ELBOW_UPPERCUT]: AnimationType.ELBOW_UPPERCUT,
|
|
35
|
+
[AttackAnimationType.KNEE_STRIKE]: AnimationType.KNEE_STRIKE,
|
|
36
|
+
[AttackAnimationType.KNEE_CLINCH]: AnimationType.CLINCH_KNEE,
|
|
37
|
+
[AttackAnimationType.PRESSURE_POINT]: AnimationType.PRESSURE_POINT_STRIKE,
|
|
38
|
+
[AttackAnimationType.PRESSURE_POINT_RAPID]: AnimationType.RAPID_BARRAGE
|
|
39
|
+
};
|
|
5
40
|
/**
|
|
6
41
|
* Maps TechniqueId to AnimationType for movement physics
|
|
7
42
|
*
|
|
@@ -50,7 +85,17 @@ function getAnimationTypeForTechnique(techniqueId) {
|
|
|
50
85
|
if (!techniqueId) return;
|
|
51
86
|
return TECHNIQUE_TO_ANIMATION_TYPE[techniqueId];
|
|
52
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Get AnimationType from AttackAnimationType
|
|
90
|
+
*
|
|
91
|
+
* @param attackAnimationType - The attack animation type from technique definition
|
|
92
|
+
* @returns The AnimationType for movement physics
|
|
93
|
+
* @korean 공격애니메이션타입에서애니메이션타입가져오기
|
|
94
|
+
*/
|
|
95
|
+
function getAnimationTypeFromAttackAnimation(attackAnimationType) {
|
|
96
|
+
return ATTACK_ANIMATION_TO_MOVEMENT_TYPE[attackAnimationType];
|
|
97
|
+
}
|
|
53
98
|
//#endregion
|
|
54
|
-
export { getAnimationTypeForTechnique };
|
|
99
|
+
export { ATTACK_ANIMATION_TO_MOVEMENT_TYPE, TECHNIQUE_TO_ANIMATION_TYPE, getAnimationTypeForTechnique, getAnimationTypeFromAttackAnimation };
|
|
55
100
|
|
|
56
101
|
//# sourceMappingURL=techniqueMappings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"techniqueMappings.js","names":[],"sources":["../../src/data/techniqueMappings.ts"],"sourcesContent":["/**\n * Technique to Animation Type mappings\n *\n * **Korean**: 기술-애니메이션 매핑\n *\n * Maps each technique to its corresponding AnimationType for attack movement physics.\n * This provides a type-safe, comprehensive mapping that replaces string-based\n * substring matching.\n *\n * @module data/techniqueMappings\n * @category Combat System\n * @korean 기술매핑\n */\n\nimport { TechniqueId } from \"../types/techniqueId\";\nimport { AnimationType } from \"../systems/animation/builders/MartialArtsConstants\";\nimport { AttackAnimationType } from \"../types/skeletal\";\n\n/**\n * Maps AttackAnimationType (from technique definitions) to AnimationType (for movement physics)\n *\n * AttackAnimationType is the skeletal animation type (PUNCH_HIGH, KICK_FRONT, etc.)\n * AnimationType is the martial arts movement type for physics calculations\n *\n * @korean 공격애니메이션타입-애니메이션타입매핑\n */\nexport const ATTACK_ANIMATION_TO_MOVEMENT_TYPE: Record<\n AttackAnimationType,\n AnimationType\n> = {\n // Punches → Punch types\n [AttackAnimationType.PUNCH_HIGH]: AnimationType.CROSS,\n [AttackAnimationType.PUNCH_MID]: AnimationType.JAB,\n [AttackAnimationType.PUNCH_LOW]: AnimationType.JAB,\n\n // Kicks → Kick types\n [AttackAnimationType.KICK_FRONT]: AnimationType.FRONT_KICK,\n [AttackAnimationType.KICK_SIDE]: AnimationType.SIDE_KICK,\n [AttackAnimationType.KICK_ROUNDHOUSE]: AnimationType.ROUNDHOUSE_KICK,\n\n // Elbows → Elbow types\n [AttackAnimationType.ELBOW_STRIKE]: AnimationType.ELBOW_STRIKE,\n [AttackAnimationType.ELBOW_UPPERCUT]: AnimationType.ELBOW_UPPERCUT,\n\n // Knees → Knee types\n [AttackAnimationType.KNEE_STRIKE]: AnimationType.KNEE_STRIKE,\n [AttackAnimationType.KNEE_CLINCH]: AnimationType.CLINCH_KNEE,\n\n // Pressure points → Specialized strikes\n [AttackAnimationType.PRESSURE_POINT]: AnimationType.PRESSURE_POINT_STRIKE,\n [AttackAnimationType.PRESSURE_POINT_RAPID]: AnimationType.RAPID_BARRAGE,\n};\n\n/**\n * Maps TechniqueId to AnimationType for movement physics\n *\n * This is the primary lookup table used by CombatScreen3D to determine\n * the correct movement animation for each technique.\n *\n * Derived from technique definitions but cached here for performance.\n *\n * @korean 기술ID-애니메이션타입매핑\n */\nexport const TECHNIQUE_TO_ANIMATION_TYPE: Record<TechniqueId, AnimationType> = {\n // 무사 (Musa) - Traditional Warrior\n [TechniqueId.MUSA_THUNDER_STRIKE]: AnimationType.HEAVEN_STRIKE, // PUNCH_HIGH → powerful descending\n [TechniqueId.MUSA_IRON_DEFENSE]: AnimationType.JAB, // PUNCH_MID → defensive\n [TechniqueId.MUSA_DRAGON_FIST]: AnimationType.JAB, // PUNCH_MID → piercing\n [TechniqueId.MUSA_MOUNTAIN_BREAKER]: AnimationType.CROSS, // PUNCH_HIGH → crushing\n\n // 암살자 (Amsalja) - Shadow Assassin\n [TechniqueId.AMSALJA_SHADOW_STRIKE]: AnimationType.PRESSURE_POINT_STRIKE, // PRESSURE_POINT\n [TechniqueId.AMSALJA_NERVE_STRIKE]: AnimationType.NERVE_STRIKE, // PRESSURE_POINT → precise\n [TechniqueId.AMSALJA_DEADLY_PRECISION]: AnimationType.PRESSURE_POINT_STRIKE, // PRESSURE_POINT\n [TechniqueId.AMSALJA_SILENT_DEATH]: AnimationType.PRESSURE_POINT_STRIKE, // PRESSURE_POINT → lethal\n\n // 해커 (Hacker) - Cyber Warrior\n [TechniqueId.HACKER_ELECTRIC_SHOCK]: AnimationType.LIGHTNING_STRIKE, // PUNCH_MID → electric\n [TechniqueId.HACKER_DATA_STRIKE]: AnimationType.PRESSURE_POINT_STRIKE, // PRESSURE_POINT\n [TechniqueId.HACKER_CYBER_OVERDRIVE]: AnimationType.RAPID_BARRAGE, // PRESSURE_POINT_RAPID\n [TechniqueId.HACKER_SYSTEM_CRASH]: AnimationType.NERVE_STRIKE, // PRESSURE_POINT → system\n\n // 정보요원 (Jeongbo) - Intelligence Operative\n [TechniqueId.JEONGBO_TACTICAL_STRIKE]: AnimationType.PRESSURE_POINT_STRIKE, // PRESSURE_POINT\n [TechniqueId.JEONGBO_COUNTER_INTELLIGENCE]: AnimationType.JAB, // PUNCH_MID → counter\n [TechniqueId.JEONGBO_PSYCHOLOGICAL_WARFARE]: AnimationType.NERVE_STRIKE, // PRESSURE_POINT\n [TechniqueId.JEONGBO_PRECISION_TAKEDOWN]: AnimationType.PRESSURE_POINT_STRIKE, // PRESSURE_POINT\n [TechniqueId.JEONGBO_INTELLIGENCE_STRIKE]: AnimationType.PRESSURE_POINT_STRIKE, // PRESSURE_POINT\n\n // 조직폭력배 (Jojik) - Organized Crime\n [TechniqueId.JOJIK_STREET_BRAWL]: AnimationType.HOOK, // PUNCH_MID → brawling\n [TechniqueId.JOJIK_IMPROVISED_WEAPON]: AnimationType.HAMMER_FIST, // ELBOW_STRIKE variant\n [TechniqueId.JOJIK_RUTHLESS_ASSAULT]: AnimationType.CROSS, // PUNCH_HIGH → brutal\n [TechniqueId.JOJIK_BRUTAL_TAKEDOWN]: AnimationType.ELBOW_STRIKE, // ELBOW_STRIKE → takedown\n};\n\n/**\n * Get AnimationType for a given technique ID\n *\n * Looks up the AnimationType from the TECHNIQUE_TO_ANIMATION_TYPE mapping.\n * Currently only supports archetype techniques (TechniqueId enum).\n * Returns undefined for unknown techniques or trigram techniques.\n *\n * @param techniqueId - The technique ID\n * @returns The AnimationType for movement physics, or undefined if not found\n * @korean 기술ID로애니메이션타입가져오기\n */\nexport function getAnimationTypeForTechnique(\n techniqueId: string | undefined\n): AnimationType | undefined {\n if (!techniqueId) {\n return undefined;\n }\n \n // Check if techniqueId is in our mapping\n // Note: Only archetype techniques (TechniqueId enum) are currently mapped\n return TECHNIQUE_TO_ANIMATION_TYPE[techniqueId as TechniqueId];\n}\n\n/**\n * Get AnimationType from AttackAnimationType\n *\n * @param attackAnimationType - The attack animation type from technique definition\n * @returns The AnimationType for movement physics\n * @korean 공격애니메이션타입에서애니메이션타입가져오기\n */\nexport function getAnimationTypeFromAttackAnimation(\n attackAnimationType: AttackAnimationType\n): AnimationType {\n return ATTACK_ANIMATION_TO_MOVEMENT_TYPE[attackAnimationType];\n}\n\nexport default {\n TECHNIQUE_TO_ANIMATION_TYPE,\n ATTACK_ANIMATION_TO_MOVEMENT_TYPE,\n getAnimationTypeForTechnique,\n getAnimationTypeFromAttackAnimation,\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"techniqueMappings.js","names":[],"sources":["../../src/data/techniqueMappings.ts"],"sourcesContent":["/**\n * Technique to Animation Type mappings\n *\n * **Korean**: 기술-애니메이션 매핑\n *\n * Maps each technique to its corresponding AnimationType for attack movement physics.\n * This provides a type-safe, comprehensive mapping that replaces string-based\n * substring matching.\n *\n * @module data/techniqueMappings\n * @category Combat System\n * @korean 기술매핑\n */\n\nimport { TechniqueId } from \"../types/techniqueId\";\nimport { AnimationType } from \"../systems/animation/builders/MartialArtsConstants\";\nimport { AttackAnimationType } from \"../types/skeletal\";\n\n/**\n * Maps AttackAnimationType (from technique definitions) to AnimationType (for movement physics)\n *\n * AttackAnimationType is the skeletal animation type (PUNCH_HIGH, KICK_FRONT, etc.)\n * AnimationType is the martial arts movement type for physics calculations\n *\n * @korean 공격애니메이션타입-애니메이션타입매핑\n */\nexport const ATTACK_ANIMATION_TO_MOVEMENT_TYPE: Record<\n AttackAnimationType,\n AnimationType\n> = {\n // Punches → Punch types\n [AttackAnimationType.PUNCH_HIGH]: AnimationType.CROSS,\n [AttackAnimationType.PUNCH_MID]: AnimationType.JAB,\n [AttackAnimationType.PUNCH_LOW]: AnimationType.JAB,\n\n // Kicks → Kick types\n [AttackAnimationType.KICK_FRONT]: AnimationType.FRONT_KICK,\n [AttackAnimationType.KICK_SIDE]: AnimationType.SIDE_KICK,\n [AttackAnimationType.KICK_ROUNDHOUSE]: AnimationType.ROUNDHOUSE_KICK,\n\n // Elbows → Elbow types\n [AttackAnimationType.ELBOW_STRIKE]: AnimationType.ELBOW_STRIKE,\n [AttackAnimationType.ELBOW_UPPERCUT]: AnimationType.ELBOW_UPPERCUT,\n\n // Knees → Knee types\n [AttackAnimationType.KNEE_STRIKE]: AnimationType.KNEE_STRIKE,\n [AttackAnimationType.KNEE_CLINCH]: AnimationType.CLINCH_KNEE,\n\n // Pressure points → Specialized strikes\n [AttackAnimationType.PRESSURE_POINT]: AnimationType.PRESSURE_POINT_STRIKE,\n [AttackAnimationType.PRESSURE_POINT_RAPID]: AnimationType.RAPID_BARRAGE,\n};\n\n/**\n * Maps TechniqueId to AnimationType for movement physics\n *\n * This is the primary lookup table used by CombatScreen3D to determine\n * the correct movement animation for each technique.\n *\n * Derived from technique definitions but cached here for performance.\n *\n * @korean 기술ID-애니메이션타입매핑\n */\nexport const TECHNIQUE_TO_ANIMATION_TYPE: Record<TechniqueId, AnimationType> = {\n // 무사 (Musa) - Traditional Warrior\n [TechniqueId.MUSA_THUNDER_STRIKE]: AnimationType.HEAVEN_STRIKE, // PUNCH_HIGH → powerful descending\n [TechniqueId.MUSA_IRON_DEFENSE]: AnimationType.JAB, // PUNCH_MID → defensive\n [TechniqueId.MUSA_DRAGON_FIST]: AnimationType.JAB, // PUNCH_MID → piercing\n [TechniqueId.MUSA_MOUNTAIN_BREAKER]: AnimationType.CROSS, // PUNCH_HIGH → crushing\n\n // 암살자 (Amsalja) - Shadow Assassin\n [TechniqueId.AMSALJA_SHADOW_STRIKE]: AnimationType.PRESSURE_POINT_STRIKE, // PRESSURE_POINT\n [TechniqueId.AMSALJA_NERVE_STRIKE]: AnimationType.NERVE_STRIKE, // PRESSURE_POINT → precise\n [TechniqueId.AMSALJA_DEADLY_PRECISION]: AnimationType.PRESSURE_POINT_STRIKE, // PRESSURE_POINT\n [TechniqueId.AMSALJA_SILENT_DEATH]: AnimationType.PRESSURE_POINT_STRIKE, // PRESSURE_POINT → lethal\n\n // 해커 (Hacker) - Cyber Warrior\n [TechniqueId.HACKER_ELECTRIC_SHOCK]: AnimationType.LIGHTNING_STRIKE, // PUNCH_MID → electric\n [TechniqueId.HACKER_DATA_STRIKE]: AnimationType.PRESSURE_POINT_STRIKE, // PRESSURE_POINT\n [TechniqueId.HACKER_CYBER_OVERDRIVE]: AnimationType.RAPID_BARRAGE, // PRESSURE_POINT_RAPID\n [TechniqueId.HACKER_SYSTEM_CRASH]: AnimationType.NERVE_STRIKE, // PRESSURE_POINT → system\n\n // 정보요원 (Jeongbo) - Intelligence Operative\n [TechniqueId.JEONGBO_TACTICAL_STRIKE]: AnimationType.PRESSURE_POINT_STRIKE, // PRESSURE_POINT\n [TechniqueId.JEONGBO_COUNTER_INTELLIGENCE]: AnimationType.JAB, // PUNCH_MID → counter\n [TechniqueId.JEONGBO_PSYCHOLOGICAL_WARFARE]: AnimationType.NERVE_STRIKE, // PRESSURE_POINT\n [TechniqueId.JEONGBO_PRECISION_TAKEDOWN]: AnimationType.PRESSURE_POINT_STRIKE, // PRESSURE_POINT\n [TechniqueId.JEONGBO_INTELLIGENCE_STRIKE]: AnimationType.PRESSURE_POINT_STRIKE, // PRESSURE_POINT\n\n // 조직폭력배 (Jojik) - Organized Crime\n [TechniqueId.JOJIK_STREET_BRAWL]: AnimationType.HOOK, // PUNCH_MID → brawling\n [TechniqueId.JOJIK_IMPROVISED_WEAPON]: AnimationType.HAMMER_FIST, // ELBOW_STRIKE variant\n [TechniqueId.JOJIK_RUTHLESS_ASSAULT]: AnimationType.CROSS, // PUNCH_HIGH → brutal\n [TechniqueId.JOJIK_BRUTAL_TAKEDOWN]: AnimationType.ELBOW_STRIKE, // ELBOW_STRIKE → takedown\n};\n\n/**\n * Get AnimationType for a given technique ID\n *\n * Looks up the AnimationType from the TECHNIQUE_TO_ANIMATION_TYPE mapping.\n * Currently only supports archetype techniques (TechniqueId enum).\n * Returns undefined for unknown techniques or trigram techniques.\n *\n * @param techniqueId - The technique ID\n * @returns The AnimationType for movement physics, or undefined if not found\n * @korean 기술ID로애니메이션타입가져오기\n */\nexport function getAnimationTypeForTechnique(\n techniqueId: string | undefined\n): AnimationType | undefined {\n if (!techniqueId) {\n return undefined;\n }\n \n // Check if techniqueId is in our mapping\n // Note: Only archetype techniques (TechniqueId enum) are currently mapped\n return TECHNIQUE_TO_ANIMATION_TYPE[techniqueId as TechniqueId];\n}\n\n/**\n * Get AnimationType from AttackAnimationType\n *\n * @param attackAnimationType - The attack animation type from technique definition\n * @returns The AnimationType for movement physics\n * @korean 공격애니메이션타입에서애니메이션타입가져오기\n */\nexport function getAnimationTypeFromAttackAnimation(\n attackAnimationType: AttackAnimationType\n): AnimationType {\n return ATTACK_ANIMATION_TO_MOVEMENT_TYPE[attackAnimationType];\n}\n\nexport default {\n TECHNIQUE_TO_ANIMATION_TYPE,\n ATTACK_ANIMATION_TO_MOVEMENT_TYPE,\n getAnimationTypeForTechnique,\n getAnimationTypeFromAttackAnimation,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAa,oCAGT;EAED,oBAAoB,aAAa,cAAc;EAC/C,oBAAoB,YAAY,cAAc;EAC9C,oBAAoB,YAAY,cAAc;EAG9C,oBAAoB,aAAa,cAAc;EAC/C,oBAAoB,YAAY,cAAc;EAC9C,oBAAoB,kBAAkB,cAAc;EAGpD,oBAAoB,eAAe,cAAc;EACjD,oBAAoB,iBAAiB,cAAc;EAGnD,oBAAoB,cAAc,cAAc;EAChD,oBAAoB,cAAc,cAAc;EAGhD,oBAAoB,iBAAiB,cAAc;EACnD,oBAAoB,uBAAuB,cAAc;CAC3D;;;;;;;;;;;AAYD,IAAa,8BAAkE;EAE5E,YAAY,sBAAsB,cAAc;EAChD,YAAY,oBAAoB,cAAc;EAC9C,YAAY,mBAAmB,cAAc;EAC7C,YAAY,wBAAwB,cAAc;EAGlD,YAAY,wBAAwB,cAAc;EAClD,YAAY,uBAAuB,cAAc;EACjD,YAAY,2BAA2B,cAAc;EACrD,YAAY,uBAAuB,cAAc;EAGjD,YAAY,wBAAwB,cAAc;EAClD,YAAY,qBAAqB,cAAc;EAC/C,YAAY,yBAAyB,cAAc;EACnD,YAAY,sBAAsB,cAAc;EAGhD,YAAY,0BAA0B,cAAc;EACpD,YAAY,+BAA+B,cAAc;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