1 #include "cl_survival.qh"
3 #include <client/hud/panel/modicons.qh>
5 void HUD_Mod_Survival(vector pos, vector mySize)
7 mod_active = 1; // survival should always show the mod HUD
9 int mystatus = entcs_receiver(player_localnum).survival_status;
10 string player_text = "";
11 vector player_color = '1 1 1';
12 //string player_icon = "";
13 if(mystatus == SV_STATUS_HUNTER)
15 player_text = _("Hunter");
16 player_color = '1 0 0';
17 //player_icon = "player_red";
19 else if(mystatus == SV_STATUS_PREY)
21 player_text = _("Survivor");
22 player_color = '0 1 0';
23 //player_icon = "player_neutral";
27 // if the player has no valid status, don't draw anything
31 string time_text = string_null;
32 vector timer_color = '1 1 1';
33 if(!STAT(GAME_STOPPED) && !warmup_stage && STAT(SURVIVAL_ROUNDTIMER) > 0)
35 float timeleft = max(0, STAT(SURVIVAL_ROUNDTIMER) - time);
36 timeleft = ceil(timeleft);
37 float minutesLeft = floor(timeleft / 60);
38 time_text = seconds_tostring(timeleft);
39 if(intermission_time || minutesLeft >= 5 || warmup_stage || STAT(SURVIVAL_ROUNDTIMER) == 0)
40 timer_color = '1 1 1'; //white
41 else if(minutesLeft >= 1)
42 timer_color = '1 1 0'; //yellow
44 timer_color = '1 0 0'; //red
47 //drawpic_aspect_skin(pos, player_icon, vec2(0.5 * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
49 drawstring_aspect(pos, player_text, vec2(mySize.x, mySize.y), player_color, panel_fg_alpha, DRAWFLAG_NORMAL);
52 drawstring_aspect(pos, player_text, vec2(0.5 * mySize.x, mySize.y), player_color, panel_fg_alpha, DRAWFLAG_NORMAL);
53 drawstring_aspect(pos + eX * (0.5 * mySize.x), time_text, vec2(0.5 * mySize.x, mySize.y), timer_color, panel_fg_alpha, DRAWFLAG_NORMAL);
57 REGISTER_MUTATOR(cl_sv, true);
59 MUTATOR_HOOKFUNCTION(cl_sv, ForcePlayercolors_Skip, CBC_ORDER_LAST)
61 if(!ISGAMETYPE(SURVIVAL))
64 entity player = M_ARGV(0, entity);
65 entity e = entcs_receiver(player.entnum - 1);
66 int surv_status = ((e) ? e.survival_status : 0);
67 int mystatus = entcs_receiver(player_localnum).survival_status;
69 int plcolor = SV_COLOR_PREY; // default to survivor
70 if((mystatus == SV_STATUS_HUNTER || intermission || STAT(GAME_STOPPED)) && surv_status == SV_STATUS_HUNTER)
71 plcolor = SV_COLOR_HUNTER;
73 player.colormap = 1024 + plcolor;