]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/csqcmodel_hooks.qc
Merge branch 'master' into Juhu/battle-royale
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / csqcmodel_hooks.qc
index 0565c9d86630484edfb9f5a084e3798dab5f6e08..4ce5c74a392ea94a0e4053b3156680fcf73c0765 100644 (file)
@@ -207,6 +207,8 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
 
        if(teamplay)
                isfriend = (cm == 1024 + 17 * myteam);
+       else if(ISGAMETYPE(BR))
+           isfriend = br_isSameSquad(this.entnum);
        else
                isfriend = islocalplayer;
 
@@ -252,6 +254,11 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
                if ((team_count == 2) && (myteam != NUM_SPECTATOR) && (fpc == 2 || fpc == 4 || fpc == 5))
                        forceplayercolors_enabled = true;
        }
+       else if (ISGAMETYPE(BR))
+       {
+               if (br_inSquad() && (fpc == 2 || fpc == 5))
+                       forceplayercolors_enabled = true;
+       }
        else
        {
                if (fpc == 1 || fpc == 2)
@@ -259,7 +266,7 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
        }
 
        // forceplayercolors too
-       if(teamplay)
+       if(teamplay || ISGAMETYPE(BR))
        {
                // own team's color is never forced
                int forcecolor_friend = 0, forcecolor_enemy = 0;
@@ -271,7 +278,7 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
                if(forceplayercolors_enabled)
                        forcecolor_enemy = 1024 + autocvar__cl_color;
 
-               if(forcecolor_enemy && !forcecolor_friend)
+               if(!ISGAMETYPE(BR) && forcecolor_enemy && !forcecolor_friend)
                {
                        // only enemy color is forced?
                        // verify it is not equal to the friend color
@@ -279,7 +286,7 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
                                forcecolor_enemy = 0;
                }
 
-               if(forcecolor_friend && !forcecolor_enemy)
+               if(!ISGAMETYPE(BR) && forcecolor_friend && !forcecolor_enemy)
                {
                        // only friend color is forced?
                        // verify it is not equal to the enemy color
@@ -292,7 +299,7 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
                                        forcecolor_friend = 0;
                }
 
-               if(cm == 1024 + 17 * myteam)
+               if((!ISGAMETYPE(BR) && (cm == 1024 + 17 * myteam)) || (ISGAMETYPE(BR) && br_isSameSquad(this.entnum)))
                {
                        if(forcecolor_friend)
                                this.colormap = forcecolor_friend;
@@ -571,6 +578,11 @@ void CSQCModel_Effects_Apply(entity this)
                boxparticles(particleeffectnum(EFFECT_EF_FLAME), this, this.absmin, this.absmax, this.velocity, this.velocity, bound(0, frametime, 0.1), 0);
                //pointparticles(EFFECT_EF_FLAME, this.origin, '0 0 0', bound(0, frametime, 0.1));
        }
+       if(eff & EF_SHOCK)
+       {
+               boxparticles(particleeffectnum(EFFECT_ARC_LIGHTNING), this, this.absmin, this.absmax, '0 0 0', '0 0 0', bound(0, frametime, 0.1), 0);
+               //pointparticles(EFFECT_ARC_LIGHTNING, this.origin, '0 0 0', bound(0, frametime, 0.1));
+       }
        if(eff & EF_STARDUST)
        {
                boxparticles(particleeffectnum(EFFECT_EF_STARDUST), this, this.absmin, this.absmax, this.velocity, this.velocity, bound(0, frametime, 0.1), 0);