Shadowsubmissive
Overview
The ShadowSubmissive component manages the behavioral and tag-based response of an entity to entities bearing shadow dominance. It listens for attack events, removes the shadowdominance tag from the attacker upon being attacked, schedules reapplication of the tag after a configurable delay (default 12 seconds), and provides utility methods to check dominance relationships.
Dependencies & Tags
- Tags added by this component:
shadowsubmissive(applied to the entity using this component) - Tags checked/modified by this component:
shadowdominance,inherentshadowdominance - Component dependency: Uses
attacker.components.inventoryif present (only duringOnReactivateorTargetHasDominancechecks)
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
forgetattackertime | number | 12 | Time (in seconds) to wait before reapplying the shadowdominance tag to an attacker after being attacked. |
inst | Entity | — | Reference to the entity instance this component is attached to. |
Main Functions
OnRemoveFromEntity()
- Description: Cleanup method called when the component is removed from its entity. Removes the
shadowsubmissivetag and unregisters the"attacked"event listener. - Parameters: None.
ShouldSubmitToTarget(target)
- Description: Determines whether the component's owner should submit to a given target based solely on the target possessing the
shadowdominancetag. - Parameters:
target(Entity or nil): The target entity to evaluate.
TargetHasDominance(target)
- Description: Checks whether a given target holds dominance by verifying presence of the
shadowdominancetag, either via equip (viainventory:EquipHasTag) or theinherentshadowdominancetag. - Parameters:
target(Entity or nil): The target entity to evaluate.
Events & Listeners
- Listens to:
"attacked"→ triggersOnAttackedcallback
- Triggers (via internal logic):
data.attacker:RemoveTag("shadowdominance")data.attacker:AddTag("shadowdominance")(scheduled viaDoTaskInTime)data.attacker._shadowdsubmissive_task:Cancel()(if task exists)