pub struct ResistanceProfile {
pub resistances: HashMap<Element, f32>,
}Expand description
Per-element resistance multipliers for a combatant.
1.0 = normal damage, 0.5 = 50% resistance, 2.0 = 200% (weakness),
0.0 = immune, -0.5 = healed by that element.
Fields§
§resistances: HashMap<Element, f32>Implementations§
Source§impl ResistanceProfile
impl ResistanceProfile
pub fn neutral() -> Self
pub fn get(&self, el: Element) -> f32
pub fn set(&mut self, el: Element, value: f32)
Sourcepub fn fire_elemental() -> Self
pub fn fire_elemental() -> Self
Common preset: fire elemental — immune to fire, weak to ice.
Sourcepub fn void_entity() -> Self
pub fn void_entity() -> Self
Common preset: void entity — immune to void, weak to radiant.
Sourcepub fn chaos_rift() -> Self
pub fn chaos_rift() -> Self
Common preset: chaos rift — amplified by entropy, normal otherwise.
Sourcepub fn boss_resist() -> Self
pub fn boss_resist() -> Self
Boss resist profile: everything at half, but entropy at 1.5x.
Trait Implementations§
Source§impl Clone for ResistanceProfile
impl Clone for ResistanceProfile
Source§fn clone(&self) -> ResistanceProfile
fn clone(&self) -> ResistanceProfile
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 moreAuto Trait Implementations§
impl Freeze for ResistanceProfile
impl RefUnwindSafe for ResistanceProfile
impl Send for ResistanceProfile
impl Sync for ResistanceProfile
impl Unpin for ResistanceProfile
impl UnsafeUnpin for ResistanceProfile
impl UnwindSafe for ResistanceProfile
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.