# AI Boss Manager

<div align="left"><figure><img src="/files/Pxb9F1D6r6SRb7Q5t5rd" alt=""><figcaption></figcaption></figure></div>

The **AI Boss Manager (AC\_AI\_Boss)** component is designed for handling advanced boss behavior, allowing for dynamic phase transitions based on various conditions, such as health thresholds or custom triggers. It extends upon the standard [**AI Combat Manager**](/components-managers/ai-only-components/ai-combat-manager.md), overriding its **Ability system** to support **phase-based Ability sets**, cinematic transitions, and boss-specific mechanics. This ensures that boss encounters feel more engaging and responsive to the player's actions.

It is added to the **Soulslike Boss (B\_Soulslike\_Boss)** class by default.

### **How It Works**

* **Phase Management**
  * The component listens for **stat updates** and evaluates whether a phase transition should be triggered based on a predefined condition (e.g., health dropping below a threshold).
  * If a phase transition is required, it sets the new phase and updates the boss’s ability set accordingly.
  * It supports playing a **cinematic sequence, music, or an animation montage** before resuming combat.
* **Event Bindings & Damage Handling**
  * It binds to **OnStatUpdated** events to track changes in stats that may trigger a phase change.
  * Additionally, it listens for **OnDeath**, ensuring that once a boss is defeated, necessary actions such as **unlocking doors**, **playing a final death cinematic**, or **displaying a "Boss Defeated" message** are executed.
* **Ability Overrides**
  * Dynamically **overrides abilities** at each phase, replacing the boss's current ability set with a new one appropriate for the given phase.
  * This allows bosses to change their combat behavior as the fight progresses, introducing **new mechanics, attack patterns, or defensive maneuvers**.
* **Death Handling**
  * Upon death, it marks the fight as inactive and attempts to **play a death sequence**.
  * If applicable, nearby **boss doors** will be unlocked.
  * A **delayed screen message** (e.g, "Boss Defeated") can be displayed after a configurable delay.

### Example Usage

<figure><img src="/files/GeBGDZz8JYOJXKTSwVgl" alt=""><figcaption></figcaption></figure>

{% embed url="<https://youtu.be/X4sAa8LQ6KU>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://soulslike-framework.isik.vip/components-managers/ai-only-components/ai-boss-manager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
