pub struct PrimeFactorialState {
pub factorial_index: u32,
pub factorial_cache: Vec<f32>,
pub puzzle_active: bool,
pub puzzle_target_factors: Vec<u32>,
pub puzzles_solved: u32,
pub rng_state: u64,
}Expand description
State for the Prime Factorial Boss. HP is a large prime. Deals damage in factorial sequences. Can only be damaged by prime-numbered damage values. Phase 2: arithmetic puzzle mechanic.
Fields§
§factorial_index: u32Current position in the factorial damage sequence.
factorial_cache: Vec<f32>Cached factorial values.
puzzle_active: boolWhether the arithmetic puzzle mode is active (phase 2).
puzzle_target_factors: Vec<u32>Current puzzle target factors.
puzzles_solved: u32How many puzzles solved.
rng_state: u64RNG for puzzle generation.
Implementations§
Source§impl PrimeFactorialState
impl PrimeFactorialState
pub fn new() -> Self
Sourcepub fn next_factorial_damage(&mut self) -> f32
pub fn next_factorial_damage(&mut self) -> f32
Get the next damage value in the factorial sequence.
Sourcepub fn filter_damage(&self, raw_damage: f32) -> f32
pub fn filter_damage(&self, raw_damage: f32) -> f32
Filter incoming damage: only prime values deal damage.
Sourcepub fn generate_puzzle(&mut self) -> Vec<u32>
pub fn generate_puzzle(&mut self) -> Vec<u32>
Generate an arithmetic puzzle (phase 2). Player must deal damage that factors to these specific numbers.
Sourcepub fn check_puzzle_solution(&mut self, damage: u32) -> bool
pub fn check_puzzle_solution(&mut self, damage: u32) -> bool
Check if player’s damage solves the current puzzle.
Trait Implementations§
Source§impl Clone for PrimeFactorialState
impl Clone for PrimeFactorialState
Source§fn clone(&self) -> PrimeFactorialState
fn clone(&self) -> PrimeFactorialState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrimeFactorialState
impl Debug for PrimeFactorialState
Auto Trait Implementations§
impl Freeze for PrimeFactorialState
impl RefUnwindSafe for PrimeFactorialState
impl Send for PrimeFactorialState
impl Sync for PrimeFactorialState
impl Unpin for PrimeFactorialState
impl UnsafeUnpin for PrimeFactorialState
impl UnwindSafe for PrimeFactorialState
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,
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.