REGISTER_STAT(NADES_SMALL, int, autocvar_g_nades_nade_small)
#ifdef GAMEQC
+
REPLICATE(cvar_cl_nade_type, int, "cl_nade_type");
REPLICATE(cvar_cl_pokenade_type, string, "cl_pokenade_type");
+REPLICATE(cvar_cl_tandemnade_type, int, "cl_tandemnade_type");
entity Nade_TrailEffect(int proj, int nade_team)
{
STAT(ENTRAP_ORB_ALPHA, client) = STAT(ENTRAP_ORB_ALPHA, spectatee);
STAT(VEIL_ORB, client) = STAT(VEIL_ORB, spectatee);
STAT(VEIL_ORB_ALPHA, client) = STAT(VEIL_ORB_ALPHA, spectatee);
+ STAT(AMMUNITIONING_ORB, client) = STAT(AMMUNITIONING_ORB, spectatee); //LegendGuard adds nade STAT client 13-02-2021
+ STAT(AMMUNITIONING_ORB_ALPHA, client) = STAT(AMMUNITIONING_ORB_ALPHA, spectatee);
+ STAT(DARK_ORB, client) = STAT(DARK_ORB, spectatee); //LegendGuard adds nade STAT client 08-02-2021
+ STAT(DARK_ORB_ALPHA, client) = STAT(DARK_ORB_ALPHA, spectatee);
}
- MUTATOR_HOOKFUNCTION(nades, BuildMutatorsString)
+ MUTATOR_HOOKFUNCTION(nades, BuildMutatorsPrettyString)
{
- M_ARGV(0, string) = strcat(M_ARGV(0, string), ":Nades");
+ M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Nades");
}
- MUTATOR_HOOKFUNCTION(nades, BuildGameplayTipsString)
+ MUTATOR_HOOKFUNCTION(nades, BuildMutatorsString)
{
- M_ARGV(0, string) = strcat(M_ARGV(0, string), "\n\n^3nades^8 are enabled, press 'g' (dropweapon) to use them\n");
+ M_ARGV(0, string) = strcat(M_ARGV(0, string), ":Nades");
}
#endif
.float orb_lifetime;
.float orb_radius;
+ #ifdef GAMEQC
+ REPLICATE_INIT(int, cvar_cl_nade_type);
+ REPLICATE_INIT(string, cvar_cl_pokenade_type);
++REPLICATE_INIT(int, cvar_cl_tandemnade_type); //LegendGuard adds new cl variable for emerald nade 01-07-2021
+ #endif
+
#ifdef SVQC
.entity nade;
#endif
- float cvar_cl_nade_type;
- string cvar_cl_pokenade_type;
- float cvar_cl_tandemnade_type; //LegendGuard adds new cl variable for emerald nade 01-07-2021
+REGISTER_NET_TEMP(TE_CSQC_DARKBLINKING); //LegendGuard registers dark blinking nade feature 09-02-2021
+
+#ifdef CSQC
+#include <client/draw.qh>
+#include <client/hud/hud.qh>
+
+//LegendGuard sets variables for dark nade 09-02-2021
+float dark_appeartime;
+float dark_fadetime;
+/***************************************************************/
+void HUD_DarkBlinking()
+{
+ // vectors for top right, bottom right, bottom and bottom left corners
+ //vector topright = vec2(vid_conwidth, 0);
+ //vector bottom = vec2(vid_conwidth / 2, vid_conheight);
+ vector bottomright = vec2(vid_conwidth, vid_conheight);
+ //vector bottomleft = vec2(0, 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.23 0 0.23', 0.98, DRAWFLAG_NORMAL);
+}
+
+#elif defined(SVQC)
+#include <server/command/common.qh>
+
+void DarkBlinking(entity e)
+{
+ if(e == NULL)
+ return;
+
+ int accepted = VerifyClientEntity(e, true, false);
+
+ if(accepted > 0)
+ {
+ msg_entity = e;
+ WriteHeader(MSG_ONE, TE_CSQC_DARKBLINKING);
+ }
+}
+#endif
+
+#ifdef CSQC
+
+bool darkblink;
+
+REGISTER_MUTATOR(cl_darkblink, true);
+
+MUTATOR_HOOKFUNCTION(cl_darkblink, DrawScoreboard)
+{
+ return darkblink;
+}
+
+MUTATOR_HOOKFUNCTION(cl_darkblink, HUD_Draw_overlay)
+{
+ if(!darkblink)
+ return false;
+
+ if (g_stat_HEALTH < 0)
+ darkblink = false;
+
+ if(STAT(GAME_STOPPED))
+ darkblink = false;
+
+ if(time <= dark_fadetime)
+ {
+ HUD_DarkBlinking();
+ return false;
+ }
+ else
+ darkblink = false;
+
+ return false;
+}
+
+NET_HANDLE(TE_CSQC_DARKBLINKING, bool isNew)
+{
+ return = true;
+
+ if(darkblink)
+ return;
+
+ localcmd("play2 sound/misc/blind\n");
+ darkblink = true;
+ dark_appeartime = time;
+ dark_fadetime = time + 7;
+}
+#endif
+/***************************************************************/
#ifdef CSQC
bool Projectile_isnade(int proj); // TODO: remove