pub struct StatSheet {
pub stats: HashMap<StatKind, StatValue>,
}Fields§
§stats: HashMap<StatKind, StatValue>Implementations§
Source§impl StatSheet
impl StatSheet
pub fn new() -> Self
pub fn with_base(self, kind: StatKind, base: f32) -> Self
pub fn get(&self, kind: StatKind) -> f32
pub fn get_mut(&mut self, kind: StatKind) -> &mut StatValue
pub fn set_base(&mut self, kind: StatKind, base: f32)
pub fn add_base(&mut self, kind: StatKind, delta: f32)
Sourcepub fn apply_modifiers(&mut self, registry: &ModifierRegistry)
pub fn apply_modifiers(&mut self, registry: &ModifierRegistry)
Reapply all modifiers from the registry.
Sourcepub fn max_stamina(&self, level: u32) -> f32
pub fn max_stamina(&self, level: u32) -> f32
Compute derived stat: MaxStamina
Sourcepub fn physical_attack(&self, weapon_damage: f32) -> f32
pub fn physical_attack(&self, weapon_damage: f32) -> f32
Physical Attack (weapon_damage is passed in from equipment)
Sourcepub fn magical_attack(&self, spell_power: f32) -> f32
pub fn magical_attack(&self, spell_power: f32) -> f32
Magical Attack (spell_power from equipment/skills)
Sourcepub fn magic_resist(&self, magic_armor: f32) -> f32
pub fn magic_resist(&self, magic_armor: f32) -> f32
Magic Resist
Sourcepub fn crit_chance(&self) -> f32
pub fn crit_chance(&self) -> f32
Crit chance (capped at 75%)
Sourcepub fn crit_multiplier(&self) -> f32
pub fn crit_multiplier(&self) -> f32
Crit multiplier
Sourcepub fn block_chance(&self) -> f32
pub fn block_chance(&self) -> f32
Block chance (capped at 50%)
Sourcepub fn move_speed(&self) -> f32
pub fn move_speed(&self) -> f32
Move speed (base 100 units/s)
Sourcepub fn attack_speed(&self) -> f32
pub fn attack_speed(&self) -> f32
Attack speed (1.0 = base, higher is faster)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StatSheet
impl RefUnwindSafe for StatSheet
impl Send for StatSheet
impl Sync for StatSheet
impl Unpin for StatSheet
impl UnsafeUnpin for StatSheet
impl UnwindSafe for StatSheet
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.