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

    Class ConsciousnessSystem

    Consciousness System managing awareness and cognitive function.

    Tracks consciousness damage from:

    • Head trauma (strikes to head region)
    • Neurological vital point hits
    • Blood flow restriction (vascular hits)
    • Respiratory disruption

    Consciousness naturally recovers over time when not taking damage.

    const consciousnessSystem = new ConsciousnessSystem();

    // Apply damage from head strike
    const newPlayer = consciousnessSystem.applyDamage(
    player,
    15,
    VitalPointCategory.NEUROLOGICAL
    );

    // Check consciousness level
    const level = consciousnessSystem.getLevel(newPlayer.consciousness);
    console.log(`Consciousness: ${level}`);

    // Apply recovery over time
    const recovered = consciousnessSystem.applyRecovery(newPlayer, 1000);

    의식시스템

    Index

    Constructors

    Methods

    • Applies consciousness damage from combat.

      Calculates consciousness reduction based on damage amount and vital point category. Neurological and vascular damage have the highest impact on consciousness.

      Parameters

      Returns PlayerState

      Updated player state with reduced consciousness

      // Head strike causes significant consciousness damage
      const newPlayer = system.applyDamage(
      player,
      20,
      VitalPointCategory.NEUROLOGICAL
      );
      console.log(`Consciousness: ${newPlayer.consciousness}`);

      의식피해적용

    • Applies consciousness recovery over time.

      Consciousness naturally recovers when not taking damage. Recovery rate depends on current level - severely stunned players recover more slowly.

      Note: Full recovery only occurs after 5 seconds without head trauma.

      Parameters

      • player: PlayerState

        Current player state

      • deltaTime: number

        Time elapsed in milliseconds

      • OptionallastHeadTraumaTime: number

        Timestamp of last head trauma (optional)

      Returns PlayerState

      Updated player state with recovered consciousness

      // In game loop (60fps, ~16ms per frame)
      player = system.applyRecovery(player, 16, player.lastActionTime);

      의식회복

    • Checks if enough time has passed for consciousness recovery.

      Consciousness only recovers after 5 seconds without head trauma.

      Parameters

      • lastHeadTraumaTime: number

        Timestamp of last head trauma

      Returns boolean

      True if recovery is allowed

      회복가능확인

    • Gets random helpless duration when consciousness drops below threshold.

      Returns a random duration between 3-5 seconds (3000-5000ms).

      Returns number

      Helpless duration in milliseconds

      무력화지속시간

    • Determines consciousness level from consciousness value.

      Updated thresholds:

      • 90-100: Combat Alert
      • 50-89: Disoriented
      • 20-49: Stunned
      • 0-19: Unconscious (incapacitation threshold <20%)

      Parameters

      • consciousness: number

        Consciousness value (0-100)

      Returns ConsciousnessLevel

      Current consciousness level

      const level = system.getLevel(75);
      console.log(level); // DISORIENTED

      const level2 = system.getLevel(15);
      console.log(level2); // UNCONSCIOUS (below incapacitation threshold)

      의식수준확인

    • Checks if player is at incapacitation threshold.

      Korean: 무력화한계 (Incapacitation Threshold)

      When consciousness drops below 20%, player becomes helpless for 3-5 seconds.

      Parameters

      Returns boolean

      True if consciousness is below incapacitation threshold (<20%)

      if (system.isAtIncapacitationThreshold(player)) {
      // Player is helpless, trigger helpless state
      const helplessDuration = system.getHelplessDuration();
      console.log(`Player helpless for ${helplessDuration}ms`);
      }

      무력화한계확인

    Properties

    baseRecoveryRate: 5 = 5.0

    Base recovery rate per second.

    categoryMultipliers: Record<string, number> = ...

    Damage multipliers by vital point category affecting consciousness.

    helplessDuration: { max: number; min: number } = ...

    Duration of helplessness when consciousness drops below threshold (3-5 seconds).

    incapacitationThreshold: 20

    Incapacitation threshold - consciousness <20% renders player helpless.

    Korean: 무력화한계 (Incapacitation Threshold)

    levelEffects: Record<ConsciousnessLevel, ConsciousnessEffects> = ...

    Consciousness level effects and thresholds.

    noTraumaRecoveryTime: 5000

    Time without head trauma required for consciousness recovery (5 seconds).