set g_mh_weapons_damage 0 "0: no damage, 1: only self-damage for runners, 2: only damage opposing team, 3: only allow hunters to damage runners, 4: self-damage and opposing team damage"
set g_mh_weapons_force 1 "0: no force, 1: only self-force, 2: self-force and opposing team force"
set g_mh_limited_ammunition 0 "do players consume ammunition when firing"
+set g_mh_hunterblind 1 "when this is set, hunters can't see anything until the round starts"
\ No newline at end of file
on-screen indication for your role
-gamemode icon
+gamemode icon (WIP)
more dynamicity for the code :)
add more TODO: notes
-
+it might need to improve something in Hunter black screen in mh.qh, sv_mh.qc uses HunterEyesStart function to execute black screen
+g_mh_hunterblind 1 // to activate hunter black screen
fix waypoint visibility, currently they are always visible to everyone. Fix them to not be visible for spectators of that player.
\ No newline at end of file
const int MH_STATUS_HUNTER = 1;
const int MH_STATUS_RUNNER = 2;
#endif
+
+// Hunters can't look anything until round starts
+REGISTER_NET_TEMP(TE_CSQC_HUNTEREYES);
+
+#ifdef CSQC
+#include <client/draw.qh>
+#include <client/hud/hud.qh>
+
+float huntereyes_appeartime;
+float huntereyes_fadetime;
+
+void HUD_HunterEyes()
+{
+ vector bottomright = vec2(vid_conwidth, vid_conheight);
+ // drawfill function parameters (qcsrc/dpdefs/menudefs.qc):
+ // float drawfill(vector position, vector size, vector rgb, float alpha, float flag)
+ drawfill('0 0 0', bottomright, '0 0 0', 1, DRAWFLAG_NORMAL);
+}
+
+#elif defined(SVQC)
+#include <server/command/common.qh>
+
+void HunterEyesStart(entity e)
+{
+ if(e == NULL)
+ return;
+
+ int accepted = VerifyClientEntity(e, true, false);
+
+ if(accepted > 0)
+ {
+ msg_entity = e;
+ WriteHeader(MSG_ONE, TE_CSQC_HUNTEREYES);
+ }
+}
+#endif
+
+#ifdef CSQC
+
+bool eyesblinded;
+
+REGISTER_MUTATOR(cl_hunteryes, true);
+
+MUTATOR_HOOKFUNCTION(cl_hunteryes, DrawScoreboard)
+{
+ return eyesblinded;
+}
+
+MUTATOR_HOOKFUNCTION(cl_hunteryes, HUD_Draw_overlay)
+{
+ if(!eyesblinded)
+ return false;
+
+ if(time <= huntereyes_fadetime)
+ {
+ HUD_HunterEyes();
+ return false;
+ }
+ else
+ eyesblinded = false;
+
+ return false;
+}
+
+NET_HANDLE(TE_CSQC_HUNTEREYES, bool isNew)
+{
+ return = true;
+
+ if(eyesblinded)
+ return;
+
+ eyesblinded = true;
+ huntereyes_appeartime = time;
+ float time_mh_roundstart = (time * 2 + cvar("g_mh_warmup")) / 1.655;
+ if(time <= cvar("g_mh_warmup")) // if it's the first time round starts
+ {
+ huntereyes_fadetime = time_mh_roundstart;
+ // LOG_INFOF("if ENTERED time: %f", time);
+ }
+ else
+ {
+ huntereyes_fadetime = time + cvar("g_mh_warmup");
+ // LOG_INFOF("else ENTERED time: %f", time);
+ }
+
+ // just another test
+ // if(huntereyes_fadetime > time)
+ // huntereyes_fadetime = time; LOG_INFOF("time: %f", time);
+
+ // LOG_INFOF("huntereyes_fadetime: %f", huntereyes_fadetime);
+}
+#endif
\ No newline at end of file
return true;
}
-// when players want to spec, clear team HUD
+// when players want to spec, clear HUD
MUTATOR_HOOKFUNCTION(mh, MakePlayerObserver)
{
entity player = M_ARGV(0, entity);
entity player = M_ARGV(0, entity);
player.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_PLAYERCLIP;
MH_count_players();
+
+ if(autocvar_g_mh_hunterblind)
+ {
+ if(player.team == Team_IndexToTeam(1))
+ HunterEyesStart(player); // Hunters can't see anything until round starts
+ }
+
if(player.team == Team_IndexToTeam(2) && !allowed_to_spawn_untagged && Team_GetNumberOfAlivePlayers(Team_GetTeamFromIndex(2)) > 1 && round_handler_IsActive() && round_handler_IsRoundStarted()){
player.mh_status = MH_STATUS_RUNNER;
player.deadflag = 1; // avoid a crash when a spectator joins runners mid-round and gets sent to hunters
if(autocvar_g_mh_player_waypoints == 2){
if(player.team == Team_IndexToTeam(1))
{
- player.mh_status = MH_STATUS_HUNTER;
WaypointSprite_AttachCarrier(WP_Null, player, RADARICON_FLAGCARRIER);
//player.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = mh_waypointsprite_visible_for_player;
WaypointSprite_UpdateRule(player.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
CS(it).killcount = 0;
MH_FakeTimeLimit(it, -1);
if(it.team == Team_IndexToTeam(1))
+ {
+ if(autocvar_g_mh_hunterblind)
+ HunterEyesStart(it); // Hunters can't see anything until round starts
it.mh_status = MH_STATUS_HUNTER;
+ }
else if(it.team == Team_IndexToTeam(2))
it.mh_status = MH_STATUS_RUNNER;
PutClientInServer(it);
int autocvar_g_mh_weapons_damage;
int autocvar_g_mh_weapons_force;
bool autocvar_g_mh_limited_ammunition;
+bool autocvar_g_mh_hunterblind;
int mh_teams;
bool allowed_to_spawn_untagged = 1;