pub struct NecroSoulChain {
pub rope: RopeChain,
pub drain_progress: f32,
pub drain_rate: f32,
pub max_distance: f32,
pub broken: bool,
pub particle_positions: Vec<f32>,
pub particle_speed: f32,
}Expand description
A rope connecting a necromancer to a recently killed enemy. Dark energy particles flow along the chain. The chain breaks when the enemy is too far or the soul is consumed.
Fields§
§rope: RopeChain§drain_progress: f32Progress of the soul drain (0.0 = start, 1.0 = fully consumed).
drain_rate: f32Speed of the drain per second.
max_distance: f32Maximum allowed distance before chain snaps.
broken: boolIf true, the chain has broken.
particle_positions: Vec<f32>Particle positions along the chain (normalized 0..1 along rope length).
particle_speed: f32Particle speed along the chain.
Implementations§
Source§impl NecroSoulChain
impl NecroSoulChain
pub fn new( necro_pos: Vec3, enemy_pos: Vec3, segments: usize, max_distance: f32, drain_rate: f32, ) -> Self
Sourcepub fn update(&mut self, necro_pos: Vec3, enemy_pos: Vec3, dt: f32)
pub fn update(&mut self, necro_pos: Vec3, enemy_pos: Vec3, dt: f32)
Update chain: move endpoints, step physics, advance drain, check break.
Sourcepub fn get_particle_world_positions(&self) -> Vec<Vec3>
pub fn get_particle_world_positions(&self) -> Vec<Vec3>
Get world-space positions of the dark energy particles.
pub fn is_active(&self) -> bool
pub fn get_points(&self) -> Vec<Vec3>
Trait Implementations§
Source§impl Clone for NecroSoulChain
impl Clone for NecroSoulChain
Auto Trait Implementations§
impl Freeze for NecroSoulChain
impl RefUnwindSafe for NecroSoulChain
impl Send for NecroSoulChain
impl Sync for NecroSoulChain
impl Unpin for NecroSoulChain
impl UnsafeUnpin for NecroSoulChain
impl UnwindSafe for NecroSoulChain
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.