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

    Class MovementPenaltySystem

    Movement Penalty System class.

    Korean: 이동 패널티 시스템 클래스

    Calculates movement penalties from leg injuries, manages instant penalties from knee/ankle strikes, and integrates with balance system.

    const system = new MovementPenaltySystem();

    // Calculate current movement penalty
    const penalty = system.calculateMovementPenalty(
    bodyPartHealth,
    maxHealth,
    activeInstantPenalty
    );

    // Apply to movement speed
    const actualSpeed = baseSpeed * penalty.speedMultiplier;
    Index

    Constructors

    Methods

    • Calculate asymmetric movement penalty based on movement direction and injured leg.

      Korean: 비대칭 이동 패널티 계산

      Left leg damage affects left-side movements more, and vice versa. This creates realistic limping behavior where movement toward the injured side is more impaired.

      Parameters

      • health: BodyPartHealth

        Current body part health

      • maxHealth: BodyPartMaxHealth

        Maximum health values

      • movementDirection: { x: number; y: number }

        Direction of movement (positive = right, negative = left)

      Returns number

      Additional speed multiplier for asymmetric penalty

    • Calculate modified movement speed with all penalties applied.

      Korean: 수정된 이동 속도 계산

      Applies base movement penalty, asymmetric penalties, and instant penalties to calculate the final movement speed.

      Parameters

      • baseSpeed: number

        Base movement speed (pixels per frame)

      • health: BodyPartHealth

        Current body part health

      • maxHealth: BodyPartMaxHealth

        Maximum health values

      • movementDirection: { x: number; y: number }

        Direction vector of movement

      • OptionalinstantPenalty: InstantMovementPenalty

        Optional active instant penalty

      • currentTime: number = ...

        Current timestamp

      Returns number

      Final movement speed with all penalties applied

    • Private

      Get injury state and speed multiplier from leg health percentage.

      Korean: 부상 상태 및 속도 배율 조회

      Parameters

      • legHealthPercent: number

        Average leg health as percentage (0.0-1.0)

      Returns { injuryState: LegInjuryState; speedMultiplier: number }

      Injury state and corresponding speed multiplier

    • Check if player should enter VULNERABLE state from leg damage.

      Korean: 취약 상태 확인

      Low leg health increases chance of entering vulnerable state, making player more susceptible to follow-up attacks.

      Parameters

      Returns boolean

      True if player should enter vulnerable state