# Equipment Manager

<div align="left"><figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FOXndO6hKeLj0uEuE8Vaf%2FActorComponent_64x.png?alt=media&#x26;token=b00844b2-cbc3-4f89-9f4b-d2c8e193007c" alt=""><figcaption></figcaption></figure></div>

The **Equipment Manager (AC\_EquipmentManager)** is one of the most sophisticated components in Soulslike Framework, responsible for dynamically managing equipment slots and their associated functionality. It provides a fully modular and customizable equipment system, allowing users to define and configure slots at runtime.

It is added to the **PlayerController** class by default **(PC\_SoulslikeFramework).**

### **How It Works**

* **Slot Initialization**:
  * At runtime, equipment slots are generated using the provided Slot Tabl&#x65;**.**
  * Each slot is assigned a unique identifier and type (e.g., `Right Hand Weapon 1`, `Tool Slot 3`), allowing the system to handle them flexibly.
* **Equipping Items**:
  * The `EquipItem` method validates whether the item meets slot requirements:
    * **Stat Requirements**: Checks if the player has the required stats for the item.
    * **Slot Compatibility**: Ensures the item can be equipped to the intended slot type.
  * Upon successful validation, the item is equipped, triggering:
    * **Stat Changes**: Applies any bonuses provided by the item (e.g., Strength +5).
    * **Visual Updates:** Weapons/mesh updates reflecting the equipped item.
    * **UI Updates**: Refreshes the equipment screen to reflect the new item.
* **Unequipping Items**:
  * The `UnequipItem` method removes the item from the slot, reversing any applied stat changes, visual changes and updating the UI.
* **Two-Hand Stancing**:
  * Toggles between one-handed and two-handed modes for weapons that support it (e.g., switching a sword from single-hand to two-hand grip).
  * Adjusts animations and gameplay logic accordingly.
* **Helper Methods**:
  * Includes various utility functions to streamline equipment management:
    * `IsSlotOccupied`: Checks if a slot currently has an item.
    * `GetActiveWeaponSlot`: Retrieves the currently active weapon for combat.
    * `CanBlock`: Determines if the equipped item allows blocking functionality.

### Example Usages

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FcAWuuDqmEVrfXMAuLfus%2Fimage.png?alt=media&#x26;token=90345d1d-b6aa-4d9b-aa8c-1d9c5c296444" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FJPXe4B9N5YJPrBFQ1KzD%2Fimage%20(11).png?alt=media&#x26;token=920fd109-49e2-485c-b0a1-173fb6ab4e24" alt=""><figcaption></figcaption></figure>

Most functionality of the Equipment Component is utilized by the **Equipment Widget.**
