pub struct PlayerVitals {}Expand description
Player health / resources (players only; omitted on other entities).
Fields§
§health: f32§health_max: f32§mana: f32§mana_max: f32§stamina: f32§stamina_max: f32§hunger: f32§hunger_max: f32§thirst: f32§thirst_max: f32§coins: u32§deaths: u32§life_state: LifeStateImplementations§
Source§impl PlayerVitals
impl PlayerVitals
Sourcepub fn from_attributes(attrs: PrimaryAttributes) -> Self
pub fn from_attributes(attrs: PrimaryAttributes) -> Self
Build pool maximums from primary attributes (current pools filled to max).
Uses display stats (internal ÷ 10) so pools scale intuitively with progression, gear, and future enchant modifiers on attributes.
Default attrs (all 500 → display 50): ~150 HP, ~100 stamina, ~145 mana.
Sourcepub fn legacy_maxima(attrs: PrimaryAttributes) -> (f32, f32, f32)
pub fn legacy_maxima(attrs: PrimaryAttributes) -> (f32, f32, f32)
Legacy pool maxima (pre-2026-07 pool rebalance) for migration scaling.
Trait Implementations§
Source§impl Clone for PlayerVitals
impl Clone for PlayerVitals
Source§fn clone(&self) -> PlayerVitals
fn clone(&self) -> PlayerVitals
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PlayerVitals
Source§impl Debug for PlayerVitals
impl Debug for PlayerVitals
Source§impl Default for PlayerVitals
impl Default for PlayerVitals
Source§impl<'de> Deserialize<'de> for PlayerVitals
impl<'de> Deserialize<'de> for PlayerVitals
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PlayerVitals
impl PartialEq for PlayerVitals
Source§impl Serialize for PlayerVitals
impl Serialize for PlayerVitals
impl StructuralPartialEq for PlayerVitals
Auto Trait Implementations§
impl Freeze for PlayerVitals
impl RefUnwindSafe for PlayerVitals
impl Send for PlayerVitals
impl Sync for PlayerVitals
impl Unpin for PlayerVitals
impl UnsafeUnpin for PlayerVitals
impl UnwindSafe for PlayerVitals
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