stamina limitation TODO@RR - change it to separate recovery/depletion modifier ID
79 {
80 #ifdef DEVELOPER
81 if(!player.GetCanBeDestroyed())
82 return;
83 #endif
84
85 float agentsCount = player.GetSingleAgentCount(
eAgents.SILICOSIS);
87
89 {
92
93 if (heavyBreathIntensity > 0.0)
95 else
97
99 {
101
102 Math.Randomize(Math.RandomInt(1, 1000));
103 float rand = Math.RandomFloat01();
104 if (rand <= heavyBreathIntensity)
105 player.RequestSoundEventEx(
EPlayerSoundEventID.HEAVY_BREATHING,
true, EPlayerSoundEventParam.HIGHEST_PRIORITY);
106 }
107 }
108
111 {
113 {
117 }
119 {
123 }
124 }
125
126 Param2<int, ref SymptomSyncData> params = new Param2<int, ref SymptomSyncData>(0, null);
127 SymptomSyncData faintData = new SymptomSyncData();
128 if (!player.IsUnconscious())
129 {
131
134 {
136 player.AddHealth(-healthLoss);
137 }
138
140 float vignette = Math.Remap(
UNCON_THRESHOLD, 1000, 0.0, 2.0, agentsCount);
141 float fadeOut = Math.Remap(
UNCON_THRESHOLD, 1000, 0.0, 5.0, agentsCount);
142 float interval = Math.Remap(1000,
UNCON_THRESHOLD, 0.0, 10.0, agentsCount) + fadeOut;
143
145 {
146 params.param1 = SymptomIDs.SYMPTOM_FAINT;
151 params.param2 = faintData;
152
154
159 }
161 {
162 params.param1 = SymptomIDs.SYMPTOM_FAINT;
167 params.param2 = faintData;
168
170
174 }
175 }
176 else
177 {
179 {
181
182 params.param1 = SymptomIDs.SYMPTOM_FAINT;
187 params.param2 = faintData;
188
190 }
191 }
192
194 {
196 {
199 }
200
202 if ((agentsCount >
UNCON_THRESHOLD && canTriggerUnconsciousness) || player.IsUnconscious())
203 {
206 {
207 player.RequestUnconsciousness(true);
208 player.SetHealth("", "Shock", 25.0);
212 }
214 {
215 player.RequestUnconsciousness(false);
218 }
219 }
220 }
221
223 }
const int STAMINA_LIMIT_TRESHOLD
float m_UnconciousnessInactiveTimer
const float HEAVY_BREATH_INTERVAL_MIN
min #num of agents
static const float UNCONSCIOUSNESS_EVENT_INTERVAL_MAX
static const float UNCONSCIOUSNESS_LENGTH_MAX
ref SymptomBase m_FaintSymptom
const float HEAVY_BREATH_INTERVAL_MAX
seconds
float m_NextUnconsciousnessEvent
const int UNCON_THRESHOLD
static const float UNCONSCIOUSNESS_LENGTH_MIN
Unconsciousness.
const int HEAVY_BREATH_TRESHOLD_MIN
bool m_CanFaintEffectFadeOut
static const float UNCONSCIOUSNESS_EVENT_INTERVAL_MIN
float m_AgentsCountPrevious
float m_UnconciousnessActiveTimer
const int HEALTH_THRESHOLD
bool m_CanFaintEffectFadeIn
seconds
ref TFloatArray m_FloatArray