Struct veloren_common_net::synced_components::inner::agent::Psyche
pub struct Psyche {
pub flee_health: f32,
pub sight_dist: f32,
pub listen_dist: f32,
pub aggro_dist: Option<f32>,
pub idle_wander_factor: f32,
pub aggro_range_multiplier: f32,
pub should_stop_pursuing: bool,
}
Fields§
§flee_health: f32
The proportion of health below which entities will start fleeing. 0.0 = never flees, 1.0 = always flees, 0.5 = flee at 50% health.
sight_dist: f32
The distance below which the agent will see enemies if it has line of sight.
listen_dist: f32
The distance below which the agent can hear enemies without seeing them.
aggro_dist: Option<f32>
The distance below which the agent will attack enemies. Should be lower
than sight_dist
. None
implied that the agent is always aggro
towards enemies that it is aware of.
idle_wander_factor: f32
A factor that controls how much further an agent will wander when in the
idle state. 1.0
is normal.
aggro_range_multiplier: f32
Aggro range is multiplied by this factor. 1.0
is normal.
This includes scaling the effective sight_dist
and listen_dist
when finding new targets to attack, adjusting the strength of
wandering behavior in the idle state, and scaling aggro_dist
in
certain situations.
should_stop_pursuing: bool
Whether this entity should intelligently decide to loose aggro based on distance from agent home and health, this is not suitable for world bosses and roaming entities
Implementations§
§impl Psyche
impl Psyche
pub fn search_dist(&self) -> f32
pub fn search_dist(&self) -> f32
The maximum distance that targets to attack might be detected by this agent.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Psyche
impl RefUnwindSafe for Psyche
impl Send for Psyche
impl Sync for Psyche
impl Unpin for Psyche
impl UnwindSafe for Psyche
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<Context> SubContext<Context> for Context
impl<Context> SubContext<Context> for Context
fn sub_context(self) -> Context
§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere
T: Default,
§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
§fn unwrap_default() -> Self
fn unwrap_default() -> Self
try_default
and panics on an error case.