pub struct DamageSystem;Expand description
System that processes damage events on metaball entities.
Implementations§
Source§impl DamageSystem
impl DamageSystem
Sourcepub fn apply_damage(
entity: &mut MetaballEntity,
event: &DamageEvent,
) -> DamageResponse
pub fn apply_damage( entity: &mut MetaballEntity, event: &DamageEvent, ) -> DamageResponse
Process a damage event on a metaball entity.
Sourcepub fn death_sequence(entity: &mut MetaballEntity, progress: f32)
pub fn death_sequence(entity: &mut MetaballEntity, progress: f32)
Process the death sequence: all sources decay to zero over duration seconds.
Call each frame during the death animation. progress is 0.0 (just died) to 1.0 (fully gone).
Sourcepub fn low_hp_effects(entity: &mut MetaballEntity)
pub fn low_hp_effects(entity: &mut MetaballEntity)
Low HP visual update: make the entity look skeletal and fragile.
Called during normal update when HP is below 30%.
Sourcepub fn apply_aoe_damage(
entity: &mut MetaballEntity,
center: Vec3,
radius: f32,
damage: f32,
max_hp: f32,
time: f32,
) -> Vec<DamageResponse>
pub fn apply_aoe_damage( entity: &mut MetaballEntity, center: Vec3, radius: f32, damage: f32, max_hp: f32, time: f32, ) -> Vec<DamageResponse>
Apply area-of-effect damage to all sources within radius.
Auto Trait Implementations§
impl Freeze for DamageSystem
impl RefUnwindSafe for DamageSystem
impl Send for DamageSystem
impl Sync for DamageSystem
impl Unpin for DamageSystem
impl UnsafeUnpin for DamageSystem
impl UnwindSafe for DamageSystem
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.