Shadowdominance
Overview
This component enforces the presence or absence of the shadowdominance tag on an entity based on its equipped items. It integrates with the equippable and inventoryitem components to dynamically add the tag when the item is equipped (and the owner lacks a shadow submissiveness override) and remove it when unequipped or removed—while also checking for other equipped shadowdominance items before removal.
Dependencies & Tags
Depends on components:
equippableinventoryitem
Tag management:
- Adds
shadowdominancetag on initialization (via constructor). - Adds/removes
shadowdominancetag from the owner entity during equip/unequip/remove lifecycle events.
Interacts with:
- Owner's
_shadowdsubmissive_task(internal reference to shadow submissiveness state). - Owner's
inventory.equipslotsto detect other shadowdominance-equipped items.
Properties
No public instance properties are defined. The only stored reference is self.inst, which holds the entity instance the component is attached to.
Main Functions
ShadowDominance:OnRemoveFromEntity()
- Description: Cleans up the component when removed from its entity. Ensures the
shadowdominancetag is removed frominst, all event listeners are deregistered, and a final cleanup step is performed to check and potentially remove the tag from the owner if still equipped at removal time. - Parameters: None (instance method).
Events & Listeners
- Listens for:
"equipped"→ triggersOnEquipped"unequipped"→ triggersOnUnequipped"onremove"→ triggersOnRemove
- Pushes/Triggers events:
- None (does not push events itself).