Shadow Bishopbrain
Based on game build 714014 | Last updated: 2026-02-27
Overview
The Shadow_BishopBrain component implements the behavior tree for the Shadow Bishop boss entity in DST. It manages high-level actions including chasing and attacking when appropriate, maintaining orientation toward a target (player), periodically taunting, and automatically triggering a despawn event after a fixed duration. The component depends on the combat and health components to determine target validity, cooldown state, and combat readiness.
Usage example
inst:AddBrain("Shadow_BishopBrain")
inst.components.combat:SetUpTargetLogic(nil, true)
inst:AddTag("shadowboss")
Dependencies & tags
Components used: combat, health
Tags: shadowboss (implied from context; no explicit tag management in this file)
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
_shouldchase | boolean | false | Internal cache of the chase decision state, updated by ShouldChase to prevent oscillation. |
Main functions
Shadow_BishopBrain:OnStart()
- Description: Initializes and assigns the behavior tree (BT) root node. Sets up priority-based task execution including chase/attack, face-target with taunt loop, and a timed despawn sequence paired with wandering.
- Parameters: None.
- Returns:
nil. - Error states: None documented; assumes all required components and tags are present on
self.inst.
ShouldChase(self)
- Description: Determines whether the Shadow Bishop should enter the chase state based on the combat status and target distance. Evaluates if there is no current target, if the attack cooldown has expired, or if the target has moved too far beyond the attack range.
- Parameters:
self— TheShadow_BishopBraininstance.
- Returns:
boolean—trueif the entity should chase;falseotherwise. - Error states: May return inconsistent values if called concurrently with rapid state changes (uses cached
_shouldchasevalue to mitigate flickering).
GetFaceTargetFn(inst)
- Description: Helper function to identify the current face target. Prefers the entity's assigned combat target; otherwise searches for the nearest player within a specified distance.
- Parameters:
inst— The entity instance.
- Returns:
entity?— A valid target entity ornilif none found or target is invalid (notarget,playerghost, or missing). - Error states: Returns
nilifFindClosestPlayerToInstreturnsnil, or if the target entity lacks ahealthcomponent or is taggednotarget.
KeepFaceTargetFn(inst, target)
- Description: Validates whether the current face target remains valid for face alignment. Ensures the target is alive, has a
healthcomponent, is not a ghost, not taggednotarget, and is within the keep-face distance. - Parameters:
inst— The entity instance.target— The candidate target entity.
- Returns:
boolean—trueif target remains valid;falseotherwise. - Error states: Returns
falseiftarget.components.healthis missing ortarget:HasTag("playerghost")is true.
Events & listeners
- Listens to: None.
- Pushes:
"despawn"— Fired when the timed despawn sequence completes (TUNING.SHADOW_CHESSPIECE_DESPAWN_TIMEseconds after behavior tree starts).