Combat Manager

The Combat Manager (AC_CombatManager) component is the core combat handler for the player, responsible for managing all aspects of player combat, including unarmed attacks, weapon attacks, guarding, poise system, combo chains, and damage application. It is the counterpart to AC_AI_CombatManager, but tailored for a more interactive, player-driven combat system.

It is added to the Character class by default (B_Soulslike_Character).

How It Works

  1. Initialization & Event Bindings

    • When initialized , it binds to key events such as OnAnyDamage and OnStatUpdated.

    • It listens for stat changes to respond relatively

      • For example, death event when Health <= 0, poise break when Poise <= 0, etc.

  2. Damage Handling

    • Handles incoming damage from various sources (weapons, projectiles, unarmed).

    • Checks player invincibility and adjusts HP accordingly.

    • If the damage reduces HP to 0, it triggers the HandleDeath() function.

  3. Unarmed Combat & Hit Tracing

    • Supports tracing-based melee attacks for unarmed combat using hand sockets.

    • Tracks traced actors in FistTracedActors and processes hit reactions accordingly.

  4. Guarding & Perfect Guard System

    • Implements a guard system with tracking for active guard state, stamina drain, and perfect guard mechanics.

    • Perfect Guard window is based on PerfectGuardDuration and FacingDirectionAcceptance.

    • If a perfect guard is executed, an effect is played (PerfectGuardEffect) and the incoming damage is completely ignored.

  5. Combo System

    • Tracks combo sections through ComboSection and executes Montages dynamically.

  6. Poise System

    • Tracks the player's Poise stat.

    • If poise is broken, plays a Poise Break Montage which is used to punish the player.

  7. Hit Reactions

    • Upon taking damage, after relative stats have been adjusted, tries to play a directional hit reaction only if the player's Stance stat <= 0 (stagger resistance).

  8. Death & Respawning Logic

    • Clears lock-on and clears the guard state.

    • Determines the direction of death and plays appropriate ragdoll/death montage.

    • Drops currency at the death location.

    • Initiates respawning logic.

Example Usage

Last updated

Was this helpful?