Module veloren_server::sys::agent::behavior_tree
source · Modules§
- interaction π
Structs§
- Struct containing essential data for running a behavior tree
listββtreeββ of behavior functions This struct will allow you to run through multiple behavior function until one finally handles an event
Enums§
- Enumeration of the timers used by the behavior tree.
Functions§
- attack_if_owner_hurt πAttack targetβs attacker (if there is one) Target is the owner in this case
- do_combat π
- If target is hostile and agent is aware of target, do the hostile tree and stop the current BehaviorTree
- do_idle_tree πRun the Idle BehaviorTree
- do_pet_tree_if_owned πif owned, do the pet tree and stop the current BehaviorTree
- do_pickup_loot πIf the target is an ItemDrop, go pick it up
- If the agent has a target, do the target tree, else do the idle tree
- follow_if_far_away π
- handle_rtsim_actions πHandle action requests from rtsim, such as talking to NPCs or attacking
- handle_timed_events πHandle timed events, like looking at the player we are talking to
- heal_self_if_hurt πTry to heal self if our damage went below a certain threshold
- hurt_utterance πHurt utterances at random upon receiving damage
- maintain_if_gliding πIf in gliding, properly maintain it If on ground, unwield glider
- react_if_on_fire πIf on fire and able, stop, drop, and roll
- If falling velocity is critical, throw everything and save yourself!
- remembers_fight_with π
- Set owner if no target
- target_if_attacked πTarget an entity thatβs attacking us if the attack was recent and we have a health component
- untarget_if_dead πIf target is dead, forget them
Type Aliases§
- BehaviorFn πBehavior function Determines if the current situation can be handled and act accordingly Returns true if an action has been taken, stopping the tree execution