Black Trigram (흑괘) - Korean Martial Arts Combat Simulator API - v0.7.0
    Preparing search index...

    Function calculateLegInjuryFactor

    • Calculate leg injury factor for MovementPhysics from body part health.

      Korean: 다리 손상 요소 계산

      Converts detailed body part health into a simple 0-1 injury factor that MovementPhysics.MovementState expects. This allows gradual migration from the old simple system to the new detailed system.

      Uses the worst (minimum) leg health to match the main injury system's behavior, ensuring asymmetric injuries (e.g., one leg at 0%, other at 100%) are properly represented.

      Parameters

      Returns number

      Leg injury factor (0 = healthy, 1 = fully injured), clamped to 0-1 range

      const legInjuryFactor = calculateLegInjuryFactor(bodyPartHealth);
      movementState.legInjuryFactor = legInjuryFactor;

      다리손상요소계산