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

    Class BodyPartHealthSystem

    Body Part Health System class.

    Korean: 신체부위 체력 시스템 클래스

    Provides methods for managing body part health, calculating effects, and distributing damage based on hit locations.

    const system = new BodyPartHealthSystem();

    // Create initial body part health
    const health = system.createDefaultBodyPartHealth();

    // Apply damage to head
    const damaged = system.applyDamageToBodyPart(
    health,
    BodyPart.HEAD,
    25
    );

    // Calculate combat effects
    const effects = system.calculateBodyPartEffects(damaged);
    Index
    • Calculate aggregate health from body parts.

      Korean: 종합 체력 계산

      Computes overall health as average of all body part health values. This maintains backwards compatibility with single health bar systems.

      Parameters

      Returns number

      Aggregate health value (0-100)

    • Calculate combat capability effects from body part damage.

      Korean: 전투 능력 효과 계산

      Analyzes body part health and returns multipliers for various combat capabilities. Implements acceptance criteria:

      • Head <50%: Consciousness penalties
      • Torso <50%: Stamina regen -50%
      • Arms <50%: Attack damage -30%
      • Legs <50%: Movement speed -40%

      Parameters

      Returns BodyPartEffects

      Combat capability effect multipliers

    • Create default body part health with all parts at maximum.

      Korean: 기본 신체부위 체력 생성

      Parameters

      • maxHealth: number = 100

        Optional custom max health per part (default: 100)

      Returns BodyPartHealth

      Body part health structure with all parts at max HP

    • Check if player is incapacitated based on body part health.

      Korean: 무력화 상태 확인

      Player is incapacitated if:

      • Head is at 0 HP (unconscious)
      • Both legs are at 0 HP (cannot move)
      • Aggregate health below 10%

      Parameters

      Returns boolean

      Whether player is incapacitated