Black Trigram (흑괘) - Korean Martial Arts Combat Simulator API - v0.7.0
    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

    Constructors

    Methods

    • 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)

    • 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

    Properties