pub struct Modifier {
pub source: ModifierSource,
pub effects: Vec<ModifierEffect>,
pub duration: ModifierDuration,
pub created_at_tick: u64,
}Expand description
A single buff or debuff attached to a fingerer. Composable: a fingerer may carry an unbounded number of these. See module docs for the stacking rules and aggregate-cache contract.
Fields§
§source: ModifierSource§effects: Vec<ModifierEffect>Zero or more contributions. An empty Vec is valid (a sourced marker with no numeric effect — e.g. a flag-style modifier read by future UI without changing FPS).
duration: ModifierDuration§created_at_tick: u64total_play_ticks value at the time this modifier was attached.
Drives “X ago” labels and tie-breaking. Recorded against the
monotonic play counter (not wall-clock) so it survives quit/restart
without becoming wrong.
Implementations§
Source§impl Modifier
impl Modifier
Sourcepub fn strength(&self) -> f32
pub fn strength(&self) -> f32
Plateau-at-1.0 until the last FADE_TICKS of the duration, then
smoothstep-decay to 0. Mirrors Buff::strength so border / HUD
pulse code can blend timed modifiers into the same activity sum
without a special case. Permanent modifiers always read 1.0
(they don’t fade).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Modifier
impl<'de> Deserialize<'de> for Modifier
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<ModifierV2> for Modifier
impl From<ModifierV2> for Modifier
Source§fn from(m: ModifierV2) -> Self
fn from(m: ModifierV2) -> Self
Auto Trait Implementations§
impl Freeze for Modifier
impl RefUnwindSafe for Modifier
impl Send for Modifier
impl Sync for Modifier
impl Unpin for Modifier
impl UnsafeUnpin for Modifier
impl UnwindSafe for Modifier
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§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