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

    Class PainResponseSystem

    Pain Response System managing cumulative pain effects.

    Pain accumulates from all damage sources and reduces combat effectiveness progressively. High pain can incapacitate even if health remains adequate. Pain dissipates slowly over time.

    const painSystem = new PainResponseSystem();

    // Apply pain from damage
    const newPlayer = painSystem.applyPain(player, 15, VitalPointSeverity.MAJOR);

    // Check pain level
    const level = painSystem.getPainLevel(newPlayer.pain);

    // Apply dissipation over time
    const recovered = painSystem.applyDissipation(newPlayer, 1000);

    고통반응시스템

    Index

    Constructors

    Methods

    • Applies pain dissipation over time (requirement: -5 pain/second).

      Pain naturally dissipates when not taking damage at a constant rate of -5 pain per second.

      Parameters

      • player: PlayerState

        Current player state

      • deltaTime: number

        Time elapsed in milliseconds

      Returns PlayerState

      Updated player state with reduced pain

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

      고통감소

    • Applies pain from combat damage with shock pain effects.

      Calculates pain increase based on damage amount, vital point severity, and vital point category. Also determines if shock pain effect should be triggered.

      Shock Pain: Instant 10-30% reduction for 2-3 seconds on significant hits (>=10 damage) Cumulative Trauma: Progressive pain accumulation that reduces performance Pain Overload: At >80 pain, chance of stun/unconsciousness

      Parameters

      • player: PlayerState

        Current player state

      • damage: number

        Base damage amount

      • Optionalseverity: VitalPointSeverity

        Optional vital point severity

      • Optionalcategory: VitalPointCategory

        Optional vital point category for more accurate pain calculation

      Returns { player: PlayerState; shockEffect?: ShockPainEffect }

      Updated player state with increased pain and optional shock effect

      // Normal hit
      const result = system.applyPain(player, 10);

      // Vital point neurological hit with shock pain
      const result = system.applyPain(
      player,
      20,
      VitalPointSeverity.MAJOR,
      VitalPointCategory.NEUROLOGICAL
      );
      if (result.shockEffect) {
      console.log(`Shock pain active for ${result.shockEffect.duration}ms`);
      }

      고통적용

    • Checks if pain overload should trigger stun.

      At pain >80, there's a chance per hit to trigger stun based on pain level. Pain Overload level has 30% chance to trigger stun.

      Parameters

      Returns boolean

      True if player should be stunned from pain

      고통기절확인

    Properties

    BASE_DISSIPATION_RATE: 5 = 5.0

    Base pain dissipation rate per second (requirement: -5 pain/second).

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

    Pain multipliers by vital point category.

    DAMAGE_SCALE_FACTOR: 100
    INTENSITY_RANGE: 0.2
    MAX_SHOCK_INTENSITY: 0.3

    Shock pain intensity constants.

    MIN_SHOCK_INTENSITY: 0.1
    PAIN_OVERLOAD_THRESHOLD: 80

    Pain overload threshold for stun chance (requirement: >80).

    PAIN_TO_DAMAGE_RATIO: 0.5

    Pain to damage ratio for cumulative trauma calculation.

    painEffects: Record<PainLevel, PainEffects> = ...

    Pain level effects and thresholds matching requirements.

    severityMultipliers: Record<VitalPointSeverity, number> = ...

    Pain multipliers by vital point severity.

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

    Shock pain duration range in milliseconds (requirement: 2-3 seconds).

    SHOCK_PAIN_THRESHOLD: 10

    Minimum damage to trigger shock pain.