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

    Class DamageCalculator

    Index

    Constructors

    Methods

    • Calculate damage reduction from defense

      Parameters

      • incomingDamage: number
      • defenderDefense: number
      • isBlocking: boolean = false

      Returns number

    • Calculate earth's supportive healing from Gon technique.

      Korean: 대지 치유 계산 (Earth Healing Calculation)

      Implements Korean martial arts philosophy: "대지는 모든 것을 품고 키운다" (The earth embraces and nurtures all things)

      Gon techniques restore HP to the attacker after successful execution based on their connection with earth energy. Traditional techniques like Ssireum throws provide stronger healing due to cultural authenticity.

      Healing Formula:

      healingAmount = supportiveHealing × (1 + earthAffinityBonus)
      

      Supportive Healing Ranges:

      • 0-2: Minimal earth connection (aggressive techniques)
      • 3-4: Moderate earth connection (standard Ssireum)
      • 5-6: Strong earth connection (traditional, sacrifice throws)
      • 7-10: RESERVED for meditation/healing techniques

      Parameters

      • technique: KoreanTechnique

        Korean martial arts technique (checks for ExtendedGonTechnique)

      • earthAffinityBonus: number = 0

        Player's earth affinity stat modifier (0.0-1.0)

      Returns number

      HP healing amount (0 if not a Gon technique)

      const healing = DamageCalculator.calculateEarthHealing(
      ssireumThrowTechnique, // supportiveHealing: 5
      0.3 // 30% earth affinity bonus
      );
      // Result: 6.5 HP restored (5 × 1.3)

      대지치유계산

    • Calculate comprehensive vital point damage with all modifiers.

      Korean: 종합 급소 피해 계산 (Comprehensive Vital Point Damage Calculation)

      Integrates all damage modifiers including:

      • Base damage from attacker strength and technique power
      • Stance effectiveness (攻克关系)
      • Vital point severity multipliers (1.5x-3.0x)
      • Accuracy bonus (0.8x-1.2x)
      • Meridian flow bonus (1.0x-1.3x at peak hours)
      • Time-of-day bonus (+20% for Dark Ops techniques at night)
      • Archetype-specific bonuses
      • Hip rotation power modifier (1.0x-1.3x for strikes with full rotation)
      • Critical hit multiplier (2x when accuracy > 0.9)
      • Damage variance (±10% randomness)
      • Defense reduction
      finalDamage =
      baseDamage ×
      stanceEffectiveness ×
      vitalPointMultiplier ×
      accuracyBonus ×
      meridianBonus ×
      timeBonus ×
      archetypeBonus ×
      hipRotationModifier ×
      criticalMultiplier ×
      variance ×
      defenseReduction

      Parameters

      • attacker: PlayerState

        Attacking player state

      • defender: PlayerState

        Defending player state

      • technique: KoreanTechnique

        Korean martial arts technique being used

      • vitalPointHit: VitalPointHitResult

        Result of vital point hit detection

      • currentHour: number

        Current hour of day (0-23) for meridian flow

      • meridianStates: Record<string, number>

        Current meridian disruption states (0=blocked, 1=normal)

      • hipRotationAngle: number = 0

        Hip rotation angle in radians (optional, defaults to 0)

      • OptionalkickHipState: HipRotationState

        Hip rotation state for kicks (optional, for kick-specific power)

      Returns DamageResult

      Comprehensive damage result with all modifiers applied

      const result = DamageCalculator.calculateEnhancedVitalPointDamage(
      attackerState,
      defenderState,
      technique,
      vitalPointHitResult,
      2, // 2 AM - liver meridian peak
      { liver: 1.0, gallbladder: 0.8 }
      );
      console.log(`Final damage: ${result.damage}`);
      console.log(`Critical hit: ${result.isCritical}`);

      종합급소피해계산

    • Private

      Calculate meridian flow damage bonus based on time of day.

      Korean: 경락 유효성 피해 보너스 계산

      Calculates bonus damage when striking vital points during their peak meridian flow hours. Peak flow provides +30% damage bonus.

      Parameters

      • vitalPointId: string

        ID of the vital point being struck

      • currentHour: number

        Current hour of day (0-23)

      • meridianStates: Record<string, number>

        Current meridian disruption states

      Returns number

      Damage multiplier (1.0-1.3)

      경락유효성피해보너스계산

    • Calculate throw/takedown impact damage with ground multiplier.

      Korean: 던지기 충격 피해 계산 (Throw Impact Damage Calculation)

      Applies groundImpactMultiplier from Gon (Earth) techniques when opponent hits the ground after a throw or takedown. Integrates with base damage calculation to provide authentic Ssireum/Hapkido throw mechanics.

      Formula:

      impactDamage = baseDamage × groundImpactMultiplier × strengthModifier
      

      Ground Impact Multiplier Ranges:

      • 1.0-1.2: Low impact (controlled takedowns)
      • 1.3-1.5: Medium impact (standard throws)
      • 1.6-1.8: High impact (power throws)
      • 1.9-2.0: Maximum impact (slams like 대지강타)

      Parameters

      • technique: KoreanTechnique

        Korean martial arts technique (checks for ExtendedGonTechnique)

      • baseDamage: number

        Base damage before ground impact modifier

      • attackerStrength: number = 50

        Attacker's strength stat for scaling

      • options: { applyVariance?: boolean } = {}

        Optional configuration for damage calculation

        • OptionalapplyVariance?: boolean

          Whether to apply random ±5% variance (default: true)

      Returns DamageResult

      Enhanced damage result with ground impact applied

      const throwDamage = DamageCalculator.calculateThrowImpactDamage(
      ssireumThrowTechnique, // groundImpactMultiplier: 1.7
      50, // base damage
      80 // attacker strength
      );
      // Result: ~85 damage (50 × 1.7 × 1.0) with ±5% variance

      // For deterministic testing:
      const testDamage = DamageCalculator.calculateThrowImpactDamage(
      technique, 50, 80, { applyVariance: false }
      );

      던지기충격피해계산

    • Private

      Calculate time-of-day bonus for Dark Ops techniques.

      Korean: 시간대 보너스 계산

      Dark Ops techniques gain +20% damage at night (20:00-05:59) to reflect tactical advantage of darkness.

      Parameters

      • technique: KoreanTechnique

        Technique being used

      • currentHour: number

        Current hour of day (0-23)

      Returns number

      Time bonus multiplier (1.0 or 1.2)

      시간대보너스계산

    • Private

      Determine kick type from technique name for hip rotation power calculation

      Parameters

      • techniqueName: string

        Name of the technique

      Returns KickType

      Kick type for hip rotation calculation

      차기유형결정

    • Private

      Get archetype-specific damage bonus for technique and vital point.

      Korean: 원형 특화 피해 보너스

      Each archetype has specialized bonuses for different techniques and vital point categories:

      • 무사 (Musa): +20% with 건 (Geon) stance techniques
      • 암살자 (Amsalja): +30% on neurological vital points
      • 해커 (Hacker): +15% baseline precision bonus
      • 정보요원 (Jeongbo): +25% on vascular vital points
      • 조직폭력배 (Jojik): +20% on dirty/ruthless techniques

      Parameters

      Returns number

      Archetype damage multiplier (1.0-1.5)

      원형특화피해보너스

    Properties

    ACCURACY_MIN_MULTIPLIER: 0.8

    Accuracy bonus scaling constants Maps 0.0-1.0 accuracy to 0.8x-1.2x multiplier

    ACCURACY_RANGE: 0.4
    SEVERITY_MULTIPLIERS: Record<VitalPointSeverity, number> = ...

    Vital point severity damage multipliers