1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
use crate::health::Health;
impl Health {
/// Is character alive
///
/// # Examples
/// ```
/// let value = person.health.is_alive();
/// ```
pub fn is_alive(&self) -> bool { self.is_alive.get() }
/// Is player tired (`fatigue_level` more than 70%)
///
/// # Examples
/// ```
/// let value = person.health.is_tired();
/// ```
pub fn is_tired(&self) -> bool { self.fatigue_level.get() >= 70. }
/// Is player tired (`fatigue_level` more than 90%)
///
/// # Examples
/// ```
/// let value = person.health.is_exhausted();
/// ```
pub fn is_exhausted(&self) -> bool { self.fatigue_level.get() >= 90. }
/// Player has low stamina (`stamina_level` 5% and less)
///
/// # Examples
/// ```
/// let value = person.health.is_no_strength();
/// ```
pub fn is_no_strength(&self) -> bool { self.stamina_level.get() <= 5. }
/// Player has low oxygen level (`oxygen_level` 5% and less)
///
/// # Examples
/// ```
/// let value = person.health.is_low_oxygen();
/// ```
pub fn is_low_oxygen(&self) -> bool { self.oxygen_level.get() <= 5. }
/// Player has low food level (`food_level` 5% and less)
///
/// # Examples
/// ```
/// let value = person.health.is_low_food();
/// ```
pub fn is_low_food(&self) -> bool { self.food_level.get() <= 5. }
/// Player has low water level (`water_level` 5% and less)
///
/// # Examples
/// ```
/// let value = person.health.is_low_water();
/// ```
pub fn is_low_water(&self) -> bool { self.water_level.get() <= 5. }
/// Player has low blood level (`blood_level` 5% and less)
///
/// # Examples
/// ```
/// let value = person.health.is_low_blood();
/// ```
pub fn is_low_blood(&self) -> bool { self.blood_level.get() <= 5. }
/// Player has active non-zero blood loss from some injury
///
/// # Examples
/// ```
/// let value = person.health.is_blood_loss();
/// ```
pub fn is_blood_loss(&self) -> bool { self.has_blood_loss.get() }
/// Current body temperature (degrees C)
///
/// # Examples
/// ```
/// let value = person.health.body_temperature();
/// ```
pub fn body_temperature(&self) -> f32 { self.body_temperature.get() }
/// Current heart rate (bpm)
///
/// # Examples
/// ```
/// let value = person.health.heart_rate();
/// ```
pub fn heart_rate(&self) -> f32 { self.heart_rate.get() }
/// Current top blood pressure (mmHg)
///
/// # Examples
/// ```
/// let value = person.health.top_pressure();
/// ```
pub fn top_pressure(&self) -> f32 { self.top_pressure.get() }
/// Current bottom blood pressure (mmHg)
///
/// # Examples
/// ```
/// let value = person.health.bottom_pressure();
/// ```
pub fn bottom_pressure(&self) -> f32 { self.bottom_pressure.get() }
/// Current blood level (0..100 percents)
///
/// # Examples
/// ```
/// let value = person.health.blood_level();
/// ```
pub fn blood_level(&self) -> f32 { self.blood_level.get() }
/// Current food level (0..100 percents)
///
/// # Examples
/// ```
/// let value = person.health.food_level();
/// ```
pub fn food_level(&self) -> f32 { self.food_level.get() }
/// Current water level (0..100 percents)
///
/// # Examples
/// ```
/// let value = person.health.water_level();
/// ```
pub fn water_level(&self) -> f32 { self.water_level.get() }
/// Current stamina level (0..100 percents)
///
/// # Examples
/// ```
/// let value = person.health.stamina_level();
/// ```
pub fn stamina_level(&self) -> f32 { self.stamina_level.get() }
/// Current fatigue level (0..100 percents)
///
/// # Examples
/// ```
/// let value = person.health.fatigue_level();
/// ```
pub fn fatigue_level(&self) -> f32 { self.fatigue_level.get() }
/// Current oxygen level (0..100 percents)
///
/// # Examples
/// ```
/// let value = person.health.oxygen_level();
/// ```
pub fn oxygen_level(&self) -> f32 { self.oxygen_level.get() }
}