pub struct DamageFormula {
pub element: DamageElement,
pub base_min: f32,
pub base_max: f32,
pub scaling: Vec<ScalingCoeff>,
pub crit_chance_base: f32,
pub crit_multiplier_base: f32,
pub crit_chance_scaling: Vec<ScalingCoeff>,
pub crit_multiplier_scaling: Vec<ScalingCoeff>,
pub penetration: f32,
pub penetration_percent: f32,
pub versus_status_bonus: Vec<(StatusEffectType, f32)>,
pub variance: f32,
}Fields§
§element: DamageElement§base_min: f32§base_max: f32§scaling: Vec<ScalingCoeff>§crit_chance_base: f32§crit_multiplier_base: f32§crit_chance_scaling: Vec<ScalingCoeff>§crit_multiplier_scaling: Vec<ScalingCoeff>§penetration: f32§penetration_percent: f32§versus_status_bonus: Vec<(StatusEffectType, f32)>§variance: f32Implementations§
Source§impl DamageFormula
impl DamageFormula
pub fn new(element: DamageElement, min: f32, max: f32) -> Self
pub fn compute_raw(&self, stats: &HashMap<String, f32>, roll_t: f32) -> f32
pub fn compute_crit_chance(&self, stats: &HashMap<String, f32>) -> f32
pub fn compute_crit_multiplier(&self, stats: &HashMap<String, f32>) -> f32
pub fn compute_final_damage( &self, stats: &HashMap<String, f32>, target_resist: f32, active_effects: &[StatusEffectType], roll_t: f32, crit_roll: f32, ) -> DamageResult
pub fn average_dps_preview( &self, stats: &HashMap<String, f32>, target_resist: f32, ) -> f32
Trait Implementations§
Source§impl Clone for DamageFormula
impl Clone for DamageFormula
Auto Trait Implementations§
impl Freeze for DamageFormula
impl RefUnwindSafe for DamageFormula
impl Send for DamageFormula
impl Sync for DamageFormula
impl Unpin for DamageFormula
impl UnsafeUnpin for DamageFormula
impl UnwindSafe for DamageFormula
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.