pub struct MirrorBossState {
pub mirror_buffer: Vec<RecordedAction>,
pub buffer_depth: usize,
pub copy_delay: u32,
pub copying_stats: bool,
pub simultaneous: bool,
pub copied_attack: f32,
pub copied_defense: f32,
}Expand description
State for the Mirror Boss. Copies player’s last 3 abilities with a 1-turn delay. Phase 2: also copies player stats. Phase 3: acts simultaneously with copied action.
Fields§
§mirror_buffer: Vec<RecordedAction>Buffer of player actions to copy (FIFO, max 3).
buffer_depth: usizeMaximum buffer depth.
copy_delay: u32Delay in turns before copied action is used.
copying_stats: boolWhether stats are also being copied (phase 2+).
simultaneous: boolWhether actions are simultaneous (phase 3).
copied_attack: f32Copied player stats (if copying_stats is true).
copied_defense: f32Implementations§
Source§impl MirrorBossState
impl MirrorBossState
pub fn new() -> Self
Sourcepub fn record_action(&mut self, action: RecordedAction)
pub fn record_action(&mut self, action: RecordedAction)
Record a player action into the mirror buffer.
Sourcepub fn get_mirrored_action(&self, current_turn: u32) -> Option<&RecordedAction>
pub fn get_mirrored_action(&self, current_turn: u32) -> Option<&RecordedAction>
Get the action to mirror this turn (with delay).
Sourcepub fn copy_stats(&mut self, player_stats: &CombatStats)
pub fn copy_stats(&mut self, player_stats: &CombatStats)
Copy player stats (for phase 2+).
Sourcepub fn enter_phase2(&mut self)
pub fn enter_phase2(&mut self)
Transition to phase 2: enable stat copying.
Sourcepub fn enter_phase3(&mut self)
pub fn enter_phase3(&mut self)
Transition to phase 3: enable simultaneous action.
Trait Implementations§
Source§impl Clone for MirrorBossState
impl Clone for MirrorBossState
Source§fn clone(&self) -> MirrorBossState
fn clone(&self) -> MirrorBossState
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 MirrorBossState
impl Debug for MirrorBossState
Auto Trait Implementations§
impl Freeze for MirrorBossState
impl RefUnwindSafe for MirrorBossState
impl Send for MirrorBossState
impl Sync for MirrorBossState
impl Unpin for MirrorBossState
impl UnsafeUnpin for MirrorBossState
impl UnwindSafe for MirrorBossState
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.