pub struct StatusTracker {
pub effects: Vec<StatusEffect>,
}Expand description
Manages all status effects on a single entity.
Handles stacking, expiry, and per-tick resolution.
Fields§
§effects: Vec<StatusEffect>Implementations§
Source§impl StatusTracker
impl StatusTracker
pub fn new() -> Self
Sourcepub fn apply(&mut self, effect: StatusEffect)
pub fn apply(&mut self, effect: StatusEffect)
Apply a status effect. If the same kind already exists, attempts to stack.
Sourcepub fn tick(&mut self, dt: f32) -> f32
pub fn tick(&mut self, dt: f32) -> f32
Advance all effects by dt. Returns total damage dealt this tick (DoT).
Sourcepub fn remove(&mut self, kind: StatusKind)
pub fn remove(&mut self, kind: StatusKind)
Remove all effects of a given kind.
pub fn has(&self, kind: StatusKind) -> bool
pub fn is_stunned(&self) -> bool
pub fn is_frozen(&self) -> bool
pub fn is_silenced(&self) -> bool
Sourcepub fn movement_factor(&self) -> f32
pub fn movement_factor(&self) -> f32
Combined movement slow from all active effects.
Sourcepub fn attack_speed_factor(&self) -> f32
pub fn attack_speed_factor(&self) -> f32
Combined attack speed factor from all active effects.
Sourcepub fn entropy_amp(&self) -> f32
pub fn entropy_amp(&self) -> f32
Current entropy amplification from Entropied stacks.
Sourcepub fn vulnerable_mult(&self) -> f32
pub fn vulnerable_mult(&self) -> f32
Damage multiplier from Vulnerable status.
Sourcepub fn thorns_reflection(&self) -> f32
pub fn thorns_reflection(&self) -> f32
Thorns damage: fraction of incoming damage reflected.
Trait Implementations§
Source§impl Clone for StatusTracker
impl Clone for StatusTracker
Source§fn clone(&self) -> StatusTracker
fn clone(&self) -> StatusTracker
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StatusTracker
impl Debug for StatusTracker
Source§impl Default for StatusTracker
impl Default for StatusTracker
Source§fn default() -> StatusTracker
fn default() -> StatusTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StatusTracker
impl RefUnwindSafe for StatusTracker
impl Send for StatusTracker
impl Sync for StatusTracker
impl Unpin for StatusTracker
impl UnsafeUnpin for StatusTracker
impl UnwindSafe for StatusTracker
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.