import { type ProximityPrompt } from "../interaction/proximityPrompt.js"; import type { PathProgress, Waypoint } from "../nav/pathFollow.js"; import type { Blackboard, DecisionGraph } from "../ai/decisionGraph.js"; import type { CooldownMode } from "../ai/pursuit.js"; import type { ThreatTableConfig } from "../ai/threat.js"; /** Scheduled chase/attack behavior; the default declares hostility toward player-role entities. * GameDefinition.pursuit.eligible can further restrict every target source using the live world. * Explicit targets and optional threat override nearest-player acquisition, not eligibility. */ export interface PursueBehavior { kind: "pursue"; aggroRadius: number; reach: number; leashRange: number; speed: number; attack: { effect: string; amount: number; intervalSec: number; }; /** Seconds between acquisition/movement/attack ticks; default .1. Zero advances every frame. */ thinkInterval?: number; cooldownMode?: CooldownMode; /** Opt into a per-instance table available through `behaviorControl(ctx).threat(id)`. */ threat?: ThreatTableConfig; } export interface WanderBehavior { kind: "wander"; radius: number; } export interface PatrolBehavior { kind: "patrol"; waypoints: readonly Waypoint[]; speed: number; loop: boolean; /** * Optional initial progress the follower is seeded at instead of waypoint zero — lets a fleet of * route followers start at distributed phases. Round-trips through the behavior lifecycle seek/serialize. */ startProgress?: PathProgress; /** * Sample world ground height for the pose Y each tick, so a route authored in the XZ plane rides * uneven terrain. Default false (waypoint Y is used verbatim). */ groundClamp?: boolean; } export interface PromptableBehavior { kind: "promptable"; prompt: ProximityPrompt; } export interface PlayerBehavior { kind: "player"; } /** Decision graph behavior descriptor using a named registered action set. */ export interface DecisionGraphBehavior { kind: "decisionGraph"; graph: DecisionGraph; actions: string; /** Initial facts for this entity's persistent blackboard; systems write more through `behaviorControl(ctx).blackboard(id)`. */ blackboard?: Blackboard; /** Seconds between graph ticks (`0` = every frame). Siblings are staggered; actions receive the elapsed time. */ thinkInterval?: number; } export type BehaviorDescriptor = WanderBehavior | PatrolBehavior | PromptableBehavior | PlayerBehavior | PursueBehavior | DecisionGraphBehavior; /** @internal Compare declarative behavior data at replacement boundaries, independent of object key order. */ export declare function behaviorDataEqual(a: unknown, b: unknown): boolean; /** Attach aggro, collision-aware chase, cooldown attack and latched return-to-spawn as data. * @capability pursue-behavior scheduled pursuit with bounded target acquisition and saved cooldown/leash state */ export declare function pursue(options: Omit): PursueBehavior; export declare function wander({ radius }: { radius: number; }): WanderBehavior; export declare function patrol({ waypoints, speed, loop, startProgress, groundClamp, }: { waypoints: readonly Waypoint[]; speed: number; loop?: boolean; startProgress?: PathProgress; groundClamp?: boolean; }): PatrolBehavior; export declare function promptable(prompt: ProximityPrompt): PromptableBehavior; export declare function talkable(dialogueId: string): PromptableBehavior; export declare function player(): PlayerBehavior;