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

    Class BreathingDisruptionSystem

    Breathing Disruption System implementation.

    Korean: 호흡곤란 시스템

    Manages breathing disruption effects from torso targeting. Integrates with vital point system and stamina regeneration.

    Index

    Constructors

    Methods

    • Apply gradual recovery to breathing disruption effect.

      Korean: 호흡곤란 점진적 회복 적용

      When torso health > 50% and no new hits, breathing gradually improves. This provides tactical gameplay: fighters with damaged torsos must fight defensively.

      Parameters

      • effect: BreathingDisruptionEffect

        Current breathing disruption effect

      • deltaTime: number

        Time since last update (milliseconds)

      • timestamp: number

        Current game time

      Returns BreathingDisruptionEffect | undefined

      Updated effect with recovery applied, or undefined if fully recovered

      // Each frame with torso health > 50%
      const updated = BreathingDisruptionSystem.applyGradualRecovery(
      effect, 16.67, timestamp
      );
      // Effect duration decreases faster than normal expiration
    • Calculate breathing disruption level from damage amount.

      Korean: 피해량으로 호흡곤란 수준 계산

      Determines appropriate disruption severity based on torso strike damage. Used when vital point ID is not specified but torso region was hit.

      Parameters

      • damage: number

        Base damage of the torso strike

      • isSolarPlexus: boolean

        Whether strike hit solar plexus vital point

      Returns BreathingDisruptionLevel

      Appropriate breathing disruption level

      // Moderate torso strike (15 damage) causes winded effect
      const level = BreathingDisruptionSystem.calculateLevelFromDamage(15, false);
      // level === BreathingDisruptionLevel.WINDED

      // Solar plexus vital strike (20+ damage) causes severe effect
      const severeLevel = BreathingDisruptionSystem.calculateLevelFromDamage(25, true);
      // severeLevel === BreathingDisruptionLevel.SEVERELY_WINDED
    • Calculate stamina regeneration multiplier with breathing disruption.

      Korean: 호흡곤란 포함 스태미나 재생 계산

      Applies breathing disruption penalty to base stamina regeneration rate. Used by stamina regeneration system each frame.

      Parameters

      • player: PlayerState

        Current player state

      • baseRegenRate: number

        Base stamina regeneration per second

      Returns number

      Modified regeneration rate with breathing penalty applied

      const baseRegen = 10; // 10 stamina/second normally

      // With Gasping effect (50% penalty)
      const modifiedRegen = BreathingDisruptionSystem.calculateStaminaRegen(
      player, baseRegen
      );
      // modifiedRegen === 5 (50% of base rate)
    • Check if player can recover from breathing disruption.

      Korean: 호흡곤란 회복 가능 여부 확인

      Recovery is possible when torso health > 50%. Player must avoid additional torso damage to allow breathing to normalize.

      Parameters

      Returns boolean

      True if torso health supports recovery

    • Create a breathing disruption effect at specified severity level.

      Korean: 호흡곤란 효과 생성

      Parameters

      • level: WINDED | GASPING | SEVERELY_WINDED

        Severity level of breathing disruption

      • source: string

        Source of the disruption (technique name, vital point, etc.)

      • timestamp: number

        When the effect was applied (game time)

      Returns BreathingDisruptionEffect

      BreathingDisruptionEffect ready to apply to PlayerState

      // Solar plexus strike causes severe disruption
      const effect = BreathingDisruptionSystem.createEffect(
      BreathingDisruptionLevel.SEVERELY_WINDED,
      "명치타격 (Solar Plexus Strike)",
      Date.now()
      );
    • Stack multiple breathing disruption effects.

      Korean: 호흡곤란 효과 누적

      Cumulative torso hits increase disruption duration and potentially severity. Multiple hits stack duration, and severe hits can escalate the level.

      Parameters

      Returns BreathingDisruptionEffect

      Updated BreathingDisruptionEffect with stacked duration/severity

      // First hit: Winded for 5 seconds
      let effect = BreathingDisruptionSystem.createEffect(
      BreathingDisruptionLevel.WINDED, "Rib Strike", 1000
      );

      // Second hit: Stacks to Gasping with extended duration
      effect = BreathingDisruptionSystem.stackEffect(
      effect, BreathingDisruptionLevel.WINDED, "Rib Strike", 3000
      );
      // Now Gasping level with 10+ seconds remaining