DayZ 1.24
Loading...
Searching...
No Matches
BleedingDrop.c
Go to the documentation of this file.
1
3{
5 protected int m_Severity;
6 protected float m_TimeTotal;
7 protected float m_ProgressBreakpointTime;
8 protected float m_ProgressFadingDuration; //remaining duration AFTER breakpoint
9 protected float m_ProgressBreakpoint;
10 protected float m_Duration;
11 protected float m_SpeedCoef;
12 protected int m_ScatterPx;
13 protected float m_SlideDistance;
14
15 protected float m_ColorAlphaStart;
16 protected float m_ColorAlphaEnd;
17 protected float m_ColorAlphaCurrent;
18
19 protected float m_ImageBaseSizeX;
20 protected float m_ImageBaseSizeY;
21 protected float m_ImageStartingSizeX; //adjusted by percentage
22 protected float m_ImageStartingSizeY; //adjusted by percentage
23 protected float m_ImageEndSizeX; //adjusted by percentage
24 protected float m_ImageEndSizeY; //adjusted by percentage
25 protected float m_ImageMaxSizeX;
26 protected float m_ImageMaxSizeY;
27 protected float m_ImageBaseRotation;
28 protected bool m_IsRunning;
30 protected int m_ScreenSizeX;
31 protected int m_ScreenSizeY;
32 protected float m_PosX, m_PosY;
33 protected float m_StartSizeCoef;
34 protected float m_EndSizeCoef;
35 protected float m_RandomSizeMin;
36 protected float m_RandomSizeMax;
37
38 //Written with relative positioning in mind
40 {
43 m_TimeTotal = 0;
44 m_IsRunning = false;
45
46#ifdef DIAG_DEVELOPER
48 {
58 }
59 else
60#endif
61 {
62 switch (m_Severity)
63 {
65 {
73 break;
74 }
76 {
84 break;
85 }
87 {
95 break;
96 }
97 }
98
101 }
103
104 m_SpeedCoef = 1.0; //TODO ??
105#ifdef DIAG_DEVELOPER
107 {
110 }
111 else
112#endif
113 {
116 }
120 }
121
123 {
124 }
125
136
138 {
139#ifdef DIAG_DEVELOPER
142#endif
145 m_PosX = pos[0];
147
148 m_PosY = pos[1];
150 }
151
153 {
154 m_TimeTotal = 0;
155
157 m_Widget.SetPos(m_PosX, m_PosY);
158#ifdef DIAG_DEVELOPER
160 m_Widget.SetRotation(0, 0, 0);
161 else
162#endif
163 {
164 m_Widget.SetRotation(0, 0, Math.RandomFloatInclusive(0.0, 360.0));
165 }
166
167 m_Widget.Show(true);
168 m_IsRunning = true;
169 }
170
171 void StopDrop()
172 {
173 m_IsRunning = false;
174 m_Widget.SetSize(m_ImageBaseSizeX, m_ImageBaseSizeY); //resets image size
175 m_Widget.Show(false);
176 }
177
179 {
180 m_BasePosition = pos;
183 }
184
186 {
187 return m_IsRunning;
188 }
189
191 {
192 return m_Widget;
193 }
194
196 {
197 //color adjustment
202#ifdef DIAG_DEVELOPER
204 {
209 }
210#endif
211
212 //saturation adjustment
213#ifdef DIAG_DEVELOPER
215 {
216#endif
218 float saturationProgress = Param1<float>.Cast(par).param1;
221 float lowest_channel = Math.Min(Math.Min(r, g), b);
225#ifdef DIAG_DEVELOPER
226 }
227#endif
228
229 int color = ARGB(0x00, r, g, b);
230 m_Widget.SetColor(color);
231 }
232
242
245 {
249 m_Widget.SetSize(sizeX, sizeY);
250
252 {
253 //do stuff before breakpoint
254 }
255 else
256 {
257 //do stuff after breakpoint
259 m_Widget.SetPos(m_PosX, posYTemp);
260 }
261 }
262
263 void Update(float timeSlice)
264 {
265 if (m_IsRunning)
266 {
267 float progress, progressFade;
270
271 //alpha
273 //transform + scaling
275
277
278 if (m_TimeTotal >= m_Duration)
279 {
280 //deletes this;
281 StopDrop();
282 }
283 }
284 }
285}
void BleedingIndicatorDropData(ImageWidget image, int severity)
void Update(float timeSlice)
void SetBasePosition(vector pos)
void UpdateAlpha(float progress, float progressFade)
void ScatterPosition(vector pos)
void UpdateTransform(float progress, float progressFade)
scaling and transformation
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Definition Easing.c:3
static float EaseOutSine(float t)
Definition Easing.c:9
Definition EnMath.c:7
Glow - PostProcessEffectType.Glow.
Definition PPEGlow.c:8
static const int PARAM_SATURATION
Definition PPEGlow.c:31
Static component of PPE manager, used to hold the instance.
Definition PPEManager.c:3
static PPEManager GetPPEManager()
Returns the manager instance singleton.
Definition PPEManager.c:27
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
PostProcessEffectType
Post-process effect type.
Definition EnWorld.c:72
static const float PI2
Definition EnMath.c:13
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106
static proto float Min(float x, float y)
Returns smaller of two given values.
static proto float Cos(float angle)
Returns cosinus of angle in radians.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float Sin(float angle)
Returns sinus of angle in radians.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
proto void GetScreenSize(out int x, out int y)
int ARGB(int a, int r, int g, int b)
Definition proto.c:322