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

      회복가능확인

    • Determines fall direction based on last impact and stance.

      When consciousness is lost, fall direction is determined by:

      • Last attack angle (if available)
      • Current stance bias (if no attack data)
      • Default to backward fall (natural collapse)

      Korean falling from consciousness loss:

      • 후방의식상실 (Hubang Uisik Sangsil): Backward consciousness loss fall
      • 전방기절 (Jeonbang Gijeol): Forward knockout

      Parameters

      • _player: PlayerState
      • OptionallastImpactAngle: number

        Angle of last hit (optional)

      Returns FallType

      Fall type to use for animation

      // Player loses consciousness from frontal head strike
      const fallType = consciousnessSystem.determineFallType(
      player,
      0 // Front angle
      );
      // Returns: 'backward' (knocked back by frontal strike)

      // Player loses consciousness without specific impact
      const fallType = consciousnessSystem.determineFallType(player);
      // Returns: Stance-based fall or 'backward' default

      의식상실낙법결정

    • Determines fall type based on stance when consciousness is lost.

      Uses stance bias to determine fall direction when consciousness is lost without specific impact data.

      Korean terminology:

      • 자세의식상실 (Jase Uisik Sangsil): Stance-based consciousness loss

      Parameters

      Returns FallType

      Fall type based on stance characteristics

      // Player in Mountain stance (defensive back)
      const fallType = consciousnessSystem.determineFallTypeFromStance(
      TrigramStance.GAN
      );
      // Returns: 'backward' (Mountain has defensive backward bias)

      자세의식상실낙법

    • 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`);
      }

      무력화한계확인

    • Checks if consciousness is low enough to trigger fall animation.

      Falls occur when consciousness drops below 10% (UNCONSCIOUS threshold). This represents complete loss of ability to maintain standing position.

      Korean terminology:

      • 의식상실낙법 (Uisik Sangsil Nakbeop): Consciousness loss fall
      • 기절낙하 (Gijeol Nakha): Knockout collapse

      Parameters

      Returns boolean

      True if fall animation should trigger

      if (consciousnessSystem.shouldTriggerFall(player)) {
      const fallType = consciousnessSystem.determineFallType(
      player,
      lastImpactAngle
      );
      animationMachine.transitionTo(FALL_TYPE_TO_ANIMATION[fallType]);
      }

      의식상실낙법확인

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