pub struct Damage {
pub source: DamageSource,
pub kind: DamageKind,
pub value: f32,
}Fields§
§source: DamageSource§kind: DamageKind§value: f32Implementations§
Source§impl Damage
impl Damage
Sourcepub fn compute_damage_reduction(
damage: Option<Self>,
inventory: Option<&Inventory>,
stats: Option<&Stats>,
msm: &MaterialStatManifest,
) -> f32
pub fn compute_damage_reduction( damage: Option<Self>, inventory: Option<&Inventory>, stats: Option<&Stats>, msm: &MaterialStatManifest, ) -> f32
Returns the total damage reduction provided by all equipped items
pub fn calculate_health_change( self, damage_reduction: f32, block_damage_decrement: f32, damage_contributor: Option<DamageContributor>, precision_mult: Option<f32>, precision_power: f32, damage_modifier: f32, time: Time, instance: u64, ) -> HealthChange
pub fn interpolate_damage(&mut self, frac: f32, min: f32)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Damage
impl<'de> Deserialize<'de> for Damage
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Damage
impl StructuralPartialEq for Damage
Auto Trait Implementations§
impl Freeze for Damage
impl RefUnwindSafe for Damage
impl Send for Damage
impl Sync for Damage
impl Unpin for Damage
impl UnwindSafe for Damage
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,
§impl<C, M> ConvertSaveload<M> for C
impl<C, M> ConvertSaveload<M> for C
§type Error = Infallible
type Error = Infallible
Error may occur during serialization or deserialization of component
§fn convert_into<F>(
&self,
_: F,
) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error>
fn convert_into<F>( &self, _: F, ) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error>
Convert this data type into serializable form (
Data) using
entity to marker mapping function§fn convert_from<F>(
data: <C as ConvertSaveload<M>>::Data,
_: F,
) -> Result<C, <C as ConvertSaveload<M>>::Error>
fn convert_from<F>( data: <C as ConvertSaveload<M>>::Data, _: F, ) -> Result<C, <C as ConvertSaveload<M>>::Error>
Convert this data from a deserializable form (
Data) using
entity to marker mapping function§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>
Converts
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>
Converts
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