Alterguardian Phase4 Lunarriftbrain
Based on game build 714014 | Last updated: 2026-02-27
Overview
This component implements the behavior tree for the Alterguardian boss during Phase 4 of the Lunar Rift encounter. It defines how the entity pursues and attacks targets while also roaming within a specific arena area (WagPunkArena). The behavior prioritizes combat over wandering, and integrates with the Combat component to handle ranged attacks and target engagement. It inherits from Brain and constructs its behavior tree inside the OnStart() method using custom nodes and shared behavior utilities.
Dependencies & Tags
- Components used:
Combat(self.inst.components.combat): Used to check for targets, cooldown status, and trigger attacks. Setsignorehitrange = trueduring attack attempts.Wander(frombehaviours/wander.lua): Used to define roaming behavior within a home area.
- Tags: None explicitly added or removed by this component.
- Behaviors used:
ChaseAndAttack: Shared behavior for pursuing and attacking targets.Wander: Enables the entity to wander near its arena center when no target is present or during combat cooldowns.
Properties
No public properties are initialized directly in the constructor. The only state set is self.bt, which stores the constructed BT (BehaviorTree) instance in OnStart().
Main Functions
Alterguardian_Phase4_LunarRiftBrain:OnStart()
- Description: Constructs and assigns the primary behavior tree for the entity. It defines a priority-based root node that runs indefinitely unless the entity enters a jumping or dead state. The behavior tree prioritizes combat (ranged attacks with chase/attack fallback) over wandering in a defined arena area.
- Parameters: None.
- Returns: None.
GetHome(inst)
- Description: A helper function that computes the home position for wandering. It checks if the entity is inside the
WagPunkArena, and if so, returns the arena's center coordinates as aVector3(with Y=0). If outside the arena, it returnsnil. - Parameters:
inst: The entity instance.
- Returns:
Vector3 | nil— the arena center ornilif the entity is outside the arena.
Events & Listeners
This component does not define or register any event listeners. It operates entirely through the BehaviorTree framework and immediate component calls (e.g., Combat methods).