Waveyjoneshandbrain
Based on game build 714014 | Last updated: 2026-02-27
Overview
This brain component governs the decision-making logic for Wavey Jones' hand, a boss-level entity in Don't Starve Together. Its primary responsibility is to scan the current platform (boat) for active components (such as lowered sails, anchors, leaks, fires, fuel sources, and rotators), and prioritize appropriate repair or interference actions—such as unpatching leaks, raising anchors, lowering sails, extinguishing fires, or rotating the boat—while considering the sanity level of nearby players. It uses a behavior tree to sequence these decisions and falls back to idle wandering when no suitable actions are available.
The component interacts with multiple boat-related systems including boat rotation, sail deployment, anchor state, leak status, fire presence, and fuel levels. It also periodically coordinates with TheWorld to avoid conflicting assignments of targets.
Usage example
This brain is typically assigned to an entity (e.g., a boss hand) during entity construction and does not require further manual interaction:
inst:AddBrain("waveyjoneshandbrain")
inst.Transform:Set Rotation(0)
inst.arm = CreateEntity()
inst.arm.Transform:SetRotation(0)
Dependencies & tags
Components used:
anchor(state:anchor_lowered,anchor_transitioning)boatleak(state:boat_repaired_patch)boatrotator(state:sg.mem.direction == 0)fueled(requiresGetPercent() > 0andcanbespecialextinguished == true)hull(requiresGetRadius())mast(state:saillowered,sail_transitioning)sanity(requiresGetPercent())timer(checksTimerExists("reactiondelay"))
Tags checked:
sailloweredsail_transitioninganchor_loweredanchor_transitioningboat_repaired_patchfirestructure
Tags added: None.
Properties
No public instance properties are initialized directly in the constructor. The inst.waveyjonestarget field is assigned at runtime during action selection but is not part of the class definition.
Main functions
WaveyJonesHand:OnStart()
- Description: Initializes and assigns the behavior tree root node, which evaluates whether the hand is untrapped, attempts to perform a tinker action via
Dotinker, then falls back toStandStill. - Parameters: None.
- Returns: None.
- Error states: None.
Dotinker(inst)
- Description: Computes a suitable action for the hand to perform on the current boat platform by scanning nearby entities with tags
boat_repaired_patchandstructure, and evaluating component states (e.g., lowered anchor, fire, leak). Returns aBufferedActiontoward the selected target ornilif no valid target exists or the reaction delay timer is active. - Parameters:
inst(Entity): The hand entity calling this function.
- Returns:
BufferedActionornil. The action is chosen based on priority:UNPATCH,RAISE_ANCHOR,ROTATE_BOAT,RAISE_SAIL, orEXTINGUISH.
- Error states:
- Returns
nilifreactiondelaytimer exists. - Returns
nilif no valid targets are found or no action conditions match. - Uses
GetDistanceSqToInstfor closest target selection; ifinst.armis missing,getdirectionFnmay fail silently (no guard present).
- Returns
getboatsanity(boat)
- Description: Calculates the lowest sanity percentage among all players within the boat’s hull radius. Used to conditionally enable sanity-dependent actions like
UNPATCH(requiressanity <= 0.25) orEXTINGUISH(requiressanity <= 0.5). - Parameters:
boat(Entity): The boat platform entity.
- Returns:
number(0 to 1): Minimum sanity of nearby players.
- Error states: None.
mastcheck(ent), anchorcheck(ent), patchcheck(ent), firecheck(ent), fuelcheck(ent), rotatorcheck(ent)
- Description: Helper predicate functions that return
trueif the entityentmeets the respective component condition (e.g., mast is lowered and not transitioning). - Parameters:
ent(Entity): Target entity to inspect.
- Returns:
boolean. - Error states: None.
Events & listeners
This component does not register any inst:ListenForEvent listeners. It also does not fire any events via inst:PushEvent.