Struct DamageContainer
pub struct DamageContainer(/* private fields */);Expand description
A plain snapshot of one hit. Sequencing and normalization remain owned by the game.
Implementations§
§impl DamageContainer
impl DamageContainer
pub fn add_reduction_modifier(
&mut self,
reduction: Reduction,
change: ReductionChange,
)
pub fn add_reduction_modifier( &mut self, reduction: Reduction, change: ReductionChange, )
Append a per-hit modifier, applied by the engine in registration order.
pub fn reduction_modifiers(
&self,
) -> impl Iterator<Item = (Reduction, ReductionChange)>
pub fn reduction_modifiers( &self, ) -> impl Iterator<Item = (Reduction, ReductionChange)>
Iterate the modifiers registered for this hit in order.
pub fn new(original: f32) -> DamageContainer
pub fn new(original: f32) -> DamageContainer
Begin a snapshot with the incoming damage and vanilla’s default cooldown.
pub fn new_damage(&self) -> f32
pub fn new_damage(&self) -> f32
Read the hit snapshot’s new_damage.
pub fn shield_damage(&self) -> f32
pub fn shield_damage(&self) -> f32
Read the hit snapshot’s shield_damage.
pub fn post_attack_invulnerability_ticks(&self) -> i32
pub fn post_attack_invulnerability_ticks(&self) -> i32
Read the hit snapshot’s post_attack_invulnerability_ticks.
pub fn should_cause_side_effects(&self) -> bool
pub fn should_cause_side_effects(&self) -> bool
Read the hit snapshot’s should_cause_side_effects.
pub fn health_damage(&self) -> f32
pub fn health_damage(&self) -> f32
Read the hit snapshot’s health_damage.
pub fn set_new_damage(&mut self, value: f32)
pub fn set_new_damage(&mut self, value: f32)
Change new_damage; the engine applies normalization at its original application point.
pub fn set_post_attack_invulnerability_ticks(&mut self, value: i32)
pub fn set_post_attack_invulnerability_ticks(&mut self, value: i32)
Change post_attack_invulnerability_ticks; the engine applies normalization at its original application point.
Trait Implementations§
§impl Clone for DamageContainer
impl Clone for DamageContainer
§fn clone(&self) -> DamageContainer
fn clone(&self) -> DamageContainer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for DamageContainer
impl Debug for DamageContainer
§impl From<&DamageContainer> for DamageValues
impl From<&DamageContainer> for DamageValues
§fn from(value: &DamageContainer) -> DamageValues
fn from(value: &DamageContainer) -> DamageValues
Converts to this type from the input type.
§impl From<DamageValues> for DamageContainer
impl From<DamageValues> for DamageContainer
§fn from(values: DamageValues) -> DamageContainer
fn from(values: DamageValues) -> DamageContainer
Converts to this type from the input type.
§impl PartialEq for DamageContainer
impl PartialEq for DamageContainer
impl StructuralPartialEq for DamageContainer
Auto Trait Implementations§
impl Freeze for DamageContainer
impl RefUnwindSafe for DamageContainer
impl Send for DamageContainer
impl Sync for DamageContainer
impl Unpin for DamageContainer
impl UnsafeUnpin for DamageContainer
impl UnwindSafe for DamageContainer
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