pub struct AttackTable {
pub miss_chance: f64,
pub dodge_chance: f64,
pub parry_chance: f64,
pub glance_chance: f64,
pub block_chance: f64,
pub critical_block_chance: f64,
pub glance_multiplier: f64,
pub block_multiplier: f64,
pub critical_block_multiplier: f64,
}Expand description
Ordered one-roll attack-table probabilities and landed-hit reductions.
Fields§
§miss_chance: f64§dodge_chance: f64§parry_chance: f64§glance_chance: f64§block_chance: f64§critical_block_chance: f64§glance_multiplier: f64§block_multiplier: f64§critical_block_multiplier: f64Implementations§
Source§impl AttackTable
impl AttackTable
const DEFAULT_BLOCK_MULTIPLIER: f64 = 0.7
const DEFAULT_CRITICAL_BLOCK_MULTIPLIER: f64 = 0.4
const DEFAULT_GLANCE_MULTIPLIER: f64 = 0.75
fn resolve( self, crit_chance: f64, rng: &mut (impl FnMut() -> f64 + ?Sized), ) -> HitResult
const fn multiplier(self, result: HitResult, crit_multiplier: f64) -> f64
Trait Implementations§
Source§impl Clone for AttackTable
impl Clone for AttackTable
Source§fn clone(&self) -> AttackTable
fn clone(&self) -> AttackTable
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 AttackTable
impl Debug for AttackTable
Source§impl Default for AttackTable
impl Default for AttackTable
impl Copy for AttackTable
Auto Trait Implementations§
impl Freeze for AttackTable
impl RefUnwindSafe for AttackTable
impl Send for AttackTable
impl Sync for AttackTable
impl Unpin for AttackTable
impl UnsafeUnpin for AttackTable
impl UnwindSafe for AttackTable
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more