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

    Class AIDecisionTree

    AI Decision Tree System

    Korean Combat Philosophy (한국 무술 철학): This system embodies traditional Korean martial arts principles:

    • 팔괘 응용 (Trigram Application): Uses Eight Trigram system for stance transitions
    • 급소 타격 (Vital Point Strikes): Targets anatomical weak points with precision
    • 상황 판단 (Situational Awareness): Adapts tactics based on combat context
    • 기술 조합 (Technique Combinations): Chains attacks into flowing combos
    • 방어 우선 (Defense First): Prioritizes survival and tactical retreat when needed
    Index

    Constructors

    Methods

    • Clamp position to arena boundaries with proper margins Centralizes boundary validation logic for all movement calculations

      Parameters

      • position: Position
      • arenaBounds: { height: number; width: number; x: number; y: number }

      Returns Position

    • Evaluate stance change using TrigramSystem

      Korean Philosophy (자세 전환): Uses I Ching-based trigram system to find optimal stance transitions. Considers resource costs, counter-stance effectiveness, and archetype preferences. Each archetype has favored stances that they switch to more frequently.

      Parameters

      Returns AIDecision

    • Get archetype-specific movement bias multipliers

      Applies movement pattern modifiers based on archetype behavior profiles:

      • Aggressive: High forward pressure (2.0x)
      • Evasive: Moderate mobility (1.5x)
      • Analytical: Conservative approach (0.8x-1.0x)
      • Unpredictable: Variable movement (1.3x)

      Parameters

      Returns number

      원형별 이동 성향

    • Get optimal combat range based on AI personality archetype

      Uses archetype behavior profiles to determine preferred combat distance. Range is converted from cell units to pixels (1 cell = ~40px).

      Parameters

      Returns number

      최적 전투 거리 - 원형별 선호 거리

    • Select vital point to target based on difficulty and stance

      Korean Philosophy (급소 선택):

      • Beginner AI: Random targeting or no specific target
      • Intermediate AI: Favors easier vital points
      • Advanced AI: Targets appropriate points for current stance
      • Master AI: Targets critical points with high precision

      Parameters

      Returns string | undefined

    • Set AI difficulty level for vital point targeting accuracy

      Parameters

      • level: number

        0.0 (beginner) to 1.0 (master)

      Returns void

    • Set difficulty parameters for AI behavior Affects reaction time, accuracy, decision quality, etc.

      Calculates a randomized reaction delay (within parameter range) once when parameters change. This provides varied AI timing while maintaining consistent behavior throughout the current parameter set.

      Parameters

      Returns void

      난이도 매개변수 설정

    Properties

    consecutiveAttacks: number = 0
    currentReactionDelay: number = 50
    decisionCooldown: number = 50
    difficultyLevel: number = 0.5
    difficultyParams?: DifficultyParameters
    lastDecisionTime: number = 0
    lastStanceChange: number = 0
    stanceChangeCooldown: 3000
    trigramSystem: TrigramSystem
    ARENA_MARGIN_X: 60

    Arena boundary margins - exported for test validation These values represent the player character size/collision margins

    ARENA_MARGIN_Y: 180
    MIN_DISTANCE_THRESHOLD: 5
    MOVE_STEP_SIZE: 50