Struct veloren_common::combat::Damage
source · pub struct Damage {
pub source: DamageSource,
pub kind: DamageKind,
pub value: f32,
}
Fields§
§source: DamageSource
§kind: DamageKind
§value: f32
Implementations§
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
source§impl PartialEq for Damage
impl PartialEq for Damage
impl Copy for Damage
impl StructuralPartialEq for Damage
Auto Trait Implementations§
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
§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