From: LegendaryGuard Date: Thu, 16 Jun 2022 21:57:08 +0000 (+0200) Subject: Merge branch 'master' into LegendaryGuard/armorizing_and_dark_nades X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=022c4288a417e0d2fde14eb39630425d2bdab465;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into LegendaryGuard/armorizing_and_dark_nades --- 022c4288a417e0d2fde14eb39630425d2bdab465 diff --cc qcsrc/common/mutators/mutator/nades/nades.qc index cd31002e8b,5ea4cb49cf..79afff9aa2 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@@ -11,9 -11,9 +11,10 @@@ float autocvar_g_nades_spread = 0.04 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) { @@@ -2312,20 -1573,16 +2324,20 @@@ MUTATOR_HOOKFUNCTION(nades, SpectateCop 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 diff --cc qcsrc/common/mutators/mutator/nades/nades.qh index 18409ac52f,460c215716..53acefc2c8 --- a/qcsrc/common/mutators/mutator/nades/nades.qh +++ b/qcsrc/common/mutators/mutator/nades/nades.qh @@@ -155,6 -129,11 +155,12 @@@ Nade Nade_FromProjectile(int proj .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; @@@ -197,99 -169,6 +203,96 @@@ MUTATOR_HOOKABLE(Nade_Damage, EV_Nade_D #endif +REGISTER_NET_TEMP(TE_CSQC_DARKBLINKING); //LegendGuard registers dark blinking nade feature 09-02-2021 + +#ifdef CSQC +#include +#include + - 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 +//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 + +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