24{
25 int armor,
health, fuel, air_time;
27 {
29 return;
31 return;
32
35 {
39 return;
40 }
42
43
44
45
47 {
48
59 }
61 {
62
67 }
70 }
71 else
72 {
74 armor = 75;
75 fuel = 20;
76 air_time = 6;
77 }
78
80
82
85
88 else
92 {
95 }
96
97 float air_alpha;
98 if (!
STAT(AIR_FINISHED))
99 air_alpha = 0;
101 {
103 air_time = 10;
104 }
105 else
106 {
110 air_alpha =
bound(0, start_alpha + (1 - start_alpha) * (1 - f), 1);
111 }
112
113 float fuel_alpha;
114 if (!fuel)
115 fuel_alpha = 0;
116 else
117 {
119 float f = (100 - fuel) / 50;
120 fuel_alpha =
bound(0, start_alpha + (1 - start_alpha) * f, 1);
121 }
122
125
129 {
131 float hp =
floor(v.x + 1);
132
133 float maxtotal = maxhealth + maxarmor;
134 string biggercount;
135 if (v.z)
136 {
137 biggercount = "health";
142 }
143 else
144 {
145 biggercount = "armor";
150 }
152 DrawNumIcon(pos, mySize, hp, biggercount,
false,
false, iconalign,
HUD_Get_Num_Color(hp, maxtotal,
true), 1);
153
154 if (fuel)
156 if (air_time)
158 }
159 else
160 {
161 float panel_ar = mySize.x / mySize.y;
162 bool is_vertical = panel_ar < 1;
163 vector health_offset =
'0 0 0', armor_offset =
'0 0 0';
164 if (panel_ar >= 4 || (panel_ar >= 1/4 && panel_ar < 1))
165 {
166 mySize.x *= 0.5;
168 health_offset.x = mySize.x;
169 else
170 armor_offset.x = mySize.x;
171 }
172 else
173 {
174 mySize.y *= 0.5;
176 health_offset.y = mySize.y;
177 else
178 armor_offset.y = mySize.y;
179 }
180
181 bool health_baralign, armor_baralign, fuel_baralign, air_align;
182 bool health_iconalign, armor_iconalign;
184 {
187 air_align = fuel_baralign = health_baralign;
190 }
191 else
192 {
195 air_align = fuel_baralign = armor_baralign;
198 }
199
200
201 {
203 {
204 float p_health, pain_health_alpha;
206 pain_health_alpha = 1;
208 {
210 {
212 {
215 else
218 }
220 {
223 }
224 }
226 {
228 {
232 }
234 {
237 }
238 }
240
242 pain_health_alpha =
blink(0.85, 0.15, 9);
243 }
245 }
247 DrawNumIcon(pos + health_offset, mySize,
health,
"health", is_vertical,
false, health_iconalign,
HUD_Get_Num_Color(
health, maxhealth,
true), 1);
248 }
249
250
251 {
252 float p_armor = armor;
254 {
256 {
258 {
260 {
263 else
266 }
268 {
271 }
272 }
274 {
276 {
280 }
282 {
285 }
286 }
288 }
289 if (p_armor)
291 }
293 DrawNumIcon(pos + armor_offset, mySize, armor,
"armor", is_vertical,
false, armor_iconalign,
HUD_Get_Num_Color(armor, maxarmor,
true), 1);
294 }
295
296 vector cell_size = mySize;
297 if (fuel || air_time)
298 {
299 if (is_vertical)
300 mySize.x *= 0.2 / 2;
301 else
302 mySize.y *= 0.2;
303 if (panel_ar >= 4)
304 mySize.x *= 2;
305 else if (panel_ar < 1/4)
306 mySize.y *= 2;
307 if (fuel)
309 if (air_time)
310 {
311 if (panel_ar > 1 && panel_ar < 4)
312 pos.y += cell_size.y;
313 else if (panel_ar > 1/4 && panel_ar <= 1)
314 pos.x += cell_size.x;
315 if (is_vertical)
316 pos.x += cell_size.x - mySize.x;
317 else
318 pos.y += cell_size.y - mySize.y;
320 }
321 }
322 }
323
325}
#define drawpic_aspect_skin(pos, pic, sz, color, theAlpha, drawflag)
#define draw_beginBoldFont()
#define draw_endBoldFont()
int spectatee_status
the -1 disables HUD panels before CSQC receives necessary data
vector healtharmor_maxdamage(float h, float a, float armorblock, int deathtype)
ERASEABLE float blink_synced(float base, float range, float freq, float start_time, int start_pos)
ERASEABLE float blink(float base, float range, float freq)
const float DRAWFLAG_NORMAL
int autocvar_hud_panel_healtharmor_iconalign
float autocvar_hud_panel_healtharmor_progressbar_gfx_smooth
bool autocvar_hud_panel_healtharmor_hide_ondeath
bool autocvar_hud_panel_healtharmor
int autocvar_hud_panel_healtharmor_baralign
vector autocvar_hud_progressbar_oxygen_color
float autocvar_hud_panel_healtharmor_fuelbar_startalpha
bool autocvar_hud_panel_healtharmor_progressbar_gfx
vector autocvar_hud_progressbar_fuel_color
bool autocvar_hud_panel_healtharmor_dynamichud
float autocvar_hud_panel_healtharmor_progressbar_gfx_damage
bool autocvar_hud_panel_healtharmor_flip
bool autocvar_hud_panel_healtharmor_progressbar
string autocvar_hud_panel_healtharmor_progressbar_health
float autocvar_hud_panel_healtharmor_oxygenbar_startalpha
float autocvar_hud_panel_healtharmor_progressbar_gfx_lowhealth
int autocvar_hud_panel_healtharmor_text
vector autocvar_hud_progressbar_armor_color
int autocvar_hud_panel_healtharmor_maxhealth
vector autocvar_hud_progressbar_health_color
int autocvar_hud_panel_healtharmor_maxarmor
string autocvar_hud_panel_healtharmor_progressbar_armor
bool autocvar_hud_panel_healtharmor_combined
void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
void HUD_Panel_LoadCvars()
void DrawNumIcon(vector myPos, vector mySize, float theTime, string icon, bool vertical, bool isInfinite, int icon_right_align, vector color, float theAlpha)
vector HUD_Get_Num_Color(float hp, float maxvalue, bool blink)
float autocvar_hud_progressbar_alpha
#define HUD_Panel_DrawBg()
bool autocvar__hud_configure
float health
Legacy fields for the resources. To be removed.