]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Minor cleanup of polytrail cvars, add optional team coloring
authorMario <mario.mario@y7mail.com>
Mon, 23 Dec 2024 15:47:26 +0000 (01:47 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 23 Dec 2024 15:47:26 +0000 (01:47 +1000)
12 files changed:
polytrails.cfg
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/main.qc
qcsrc/client/main.qh
qcsrc/client/polytrails.qc
qcsrc/client/polytrails.qh
qcsrc/client/weapons/projectile.qc
qcsrc/client/weapons/projectile.qh
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/weapon.qh
qcsrc/common/weapons/weapon/crylink.qh
qcsrc/common/weapons/weapon/electro.qh

index 7dda27c6bc1921abe0af4c23e304287b9cd12e56..ac13cf33308c1f097824d9f0e8e66f031c800cac 100644 (file)
@@ -2,18 +2,19 @@
 // a polygon rendering system for trails
 
 seta cl_polytrails 1 "enable polygon-based trail effect drawing (looks better but may impact performance)"
+seta cl_polytrails_teamcolor 0 "apply team and player colors to part of the polytrails"
 
 // electro primary bolt
 seta cl_polytrails_electro_bolt 1
-seta cl_polytrails_electro_bolt_rgb0 "0.75 0.75 1"
-seta cl_polytrails_electro_bolt_rgb1 "0.45 0.45 1"
-seta cl_polytrails_electro_bolt_rgb2 "0.1 0.1 0.75"
-seta cl_polytrails_electro_bolt_alpha0 1
-seta cl_polytrails_electro_bolt_alpha1 0.5
-seta cl_polytrails_electro_bolt_alpha2 0
-seta cl_polytrails_electro_bolt_thickness0 5
-seta cl_polytrails_electro_bolt_thickness1 5
-seta cl_polytrails_electro_bolt_thickness2 0
+seta cl_polytrails_electro_bolt_head_alpha 1
+seta cl_polytrails_electro_bolt_head_color "0.75 0.75 1"
+seta cl_polytrails_electro_bolt_head_thickness 5
+seta cl_polytrails_electro_bolt_body_alpha 0.5
+seta cl_polytrails_electro_bolt_body_color "0.45 0.45 1"
+seta cl_polytrails_electro_bolt_body_thickness 5
+seta cl_polytrails_electro_bolt_tail_alpha 0
+seta cl_polytrails_electro_bolt_tail_color "0.1 0.1 0.75"
+seta cl_polytrails_electro_bolt_tail_thickness 0
 seta cl_polytrails_electro_bolt_lifetime 0.27
 seta cl_polytrails_electro_bolt_segmentsize 10
 seta cl_polytrails_electro_bolt_noise 5
@@ -21,15 +22,15 @@ seta cl_polytrails_electro_bolt_noisefunc "chaotic"
 
 // electro secondary orb
 seta cl_polytrails_electro_orb 1
-seta cl_polytrails_electro_orb_rgb0 "0.8 0.8 1"
-seta cl_polytrails_electro_orb_rgb1 "0.5 0.5 1"
-seta cl_polytrails_electro_orb_rgb2 "0.1 0.1 0.7"
-seta cl_polytrails_electro_orb_alpha0 1
-seta cl_polytrails_electro_orb_alpha1 0.5
-seta cl_polytrails_electro_orb_alpha2 0
-seta cl_polytrails_electro_orb_thickness0 15
-seta cl_polytrails_electro_orb_thickness1 7
-seta cl_polytrails_electro_orb_thickness2 0
+seta cl_polytrails_electro_orb_head_alpha 1
+seta cl_polytrails_electro_orb_head_color "0.8 0.8 1"
+seta cl_polytrails_electro_orb_head_thickness 15
+seta cl_polytrails_electro_orb_body_alpha 0.5
+seta cl_polytrails_electro_orb_body_color "0.5 0.5 1"
+seta cl_polytrails_electro_orb_body_thickness 7
+seta cl_polytrails_electro_orb_tail_alpha 0
+seta cl_polytrails_electro_orb_tail_color "0.1 0.1 0.7"
+seta cl_polytrails_electro_orb_tail_thickness 0
 seta cl_polytrails_electro_orb_lifetime 0.18
 seta cl_polytrails_electro_orb_segmentsize 10
 seta cl_polytrails_electro_orb_noise 10
@@ -37,15 +38,15 @@ seta cl_polytrails_electro_orb_noisefunc "chaotic"
 
 // crylink bouncing projectile
 seta cl_polytrails_crylink_bouncing 1
-seta cl_polytrails_crylink_bouncing_rgb0 "0.7 0 1"
-seta cl_polytrails_crylink_bouncing_rgb1 "0.5 0 1"
-seta cl_polytrails_crylink_bouncing_rgb2 "0.1 0 0.8"
-seta cl_polytrails_crylink_bouncing_alpha0 0.5
-seta cl_polytrails_crylink_bouncing_alpha1 0.2
-seta cl_polytrails_crylink_bouncing_alpha2 0
-seta cl_polytrails_crylink_bouncing_thickness0 5
-seta cl_polytrails_crylink_bouncing_thickness1 3
-seta cl_polytrails_crylink_bouncing_thickness2 3
+seta cl_polytrails_crylink_bouncing_head_alpha 0.5
+seta cl_polytrails_crylink_bouncing_head_color "0.7 0 1"
+seta cl_polytrails_crylink_bouncing_head_thickness 5
+seta cl_polytrails_crylink_bouncing_body_alpha 0.2
+seta cl_polytrails_crylink_bouncing_body_color "0.5 0 1"
+seta cl_polytrails_crylink_bouncing_body_thickness 3
+seta cl_polytrails_crylink_bouncing_tail_alpha 0
+seta cl_polytrails_crylink_bouncing_tail_color "0.1 0 0.8"
+seta cl_polytrails_crylink_bouncing_tail_thickness 13
 seta cl_polytrails_crylink_bouncing_lifetime 0.15
 seta cl_polytrails_crylink_bouncing_segmentsize 80
 seta cl_polytrails_crylink_bouncing_noise 0
@@ -53,15 +54,15 @@ seta cl_polytrails_crylink_bouncing_noisefunc "none"
 
 // crylink bolt projectiles
 seta cl_polytrails_crylink_bolt 1
-seta cl_polytrails_crylink_bolt_rgb0 "0.7 0 1"
-seta cl_polytrails_crylink_bolt_rgb1 "0.5 0 1"
-seta cl_polytrails_crylink_bolt_rgb2 "0.1 0 0.8"
-seta cl_polytrails_crylink_bolt_alpha0 0.75
-seta cl_polytrails_crylink_bolt_alpha1 0.2
-seta cl_polytrails_crylink_bolt_alpha2 0
-seta cl_polytrails_crylink_bolt_thickness0 5
-seta cl_polytrails_crylink_bolt_thickness1 3
-seta cl_polytrails_crylink_bolt_thickness2 3
+seta cl_polytrails_crylink_bolt_head_alpha 0.75
+seta cl_polytrails_crylink_bolt_head_color "0.7 0 1"
+seta cl_polytrails_crylink_bolt_head_thickness 5
+seta cl_polytrails_crylink_bolt_body_alpha 0.2
+seta cl_polytrails_crylink_bolt_body_color "0.5 0 1"
+seta cl_polytrails_crylink_bolt_body_thickness 3
+seta cl_polytrails_crylink_bolt_tail_alpha 0
+seta cl_polytrails_crylink_bolt_tail_color "0.1 0 0.8"
+seta cl_polytrails_crylink_bolt_tail_thickness 3
 seta cl_polytrails_crylink_bolt_lifetime 0.15
 seta cl_polytrails_crylink_bolt_segmentsize 80
 seta cl_polytrails_crylink_bolt_noise 0
index 99368d39370e37aa31eea427c12d944616d1c3b3..f1511bd757850685beb0388f66da928babb20009 100644 (file)
@@ -4,7 +4,6 @@
 #include <client/player_skeleton.qh>
 #include <client/weapons/projectile.qh>
 #include <common/animdecide.qh>
-#include <common/effects/all.inc>
 #include <common/effects/all.qh>
 #include <common/ent_cs.qh>
 #include <common/gamemodes/_mod.qh>
index b426840edb393a73517d82e13a72f849059aa721..4ecd99467bf59550659e3c3b8e448656576fe043 100644 (file)
@@ -15,7 +15,6 @@
 #include <client/weapons/projectile.qh>
 #include <common/checkextension.qh>
 #include <common/deathtypes/all.qh>
-#include <common/effects/all.inc>
 #include <common/effects/all.qh>
 #include <common/effects/effect.qh>
 #include <common/effects/qc/_mod.qh>
index 698c70b2d94495073bd89cd238ed560db54ae1f2..548b1649a87a267043f09ad77dc4a3273c212cd1 100644 (file)
@@ -1,7 +1,6 @@
 #pragma once
 
 #include <common/constants.qh>
-#include <common/weapons/_all.qh>
 
 bool autocvar_cl_db_saveasdump;
 bool autocvar_cl_spawn_event_particles;
index 0b2c138534e7636d647a55de6f4d600ae8285cde..32a34f3ce4638ed9be9ecc504a413af15b92cc84 100644 (file)
@@ -1,5 +1,6 @@
 #include "polytrails.qh"
 
+#include <client/main.qh>
 #include <lib/warpzone/common.qh>
 
 #define POLYTRAIL_SEEK(_p, _rel) ((POLYTRAIL_BUFSIZE + (_p).polytrail_bufidx + (_rel)) % POLYTRAIL_BUFSIZE)
@@ -50,9 +51,9 @@ void Trail_draw(entity this)
                }
                vector to = this.polytrail_bufpos[idx];
                to += lerpvratio('0 0 0', this.polytrail_bufnoise[idx], rtime);
-               vector rgb = lerpv3ratio(this.polytrail_rgb[0], this.polytrail_rgb[1], this.polytrail_rgb[2], rtime);
-               float a = lerp3ratio(this.polytrail_alpha[0], this.polytrail_alpha[1], this.polytrail_alpha[2], rtime);
-               int thickness = lerp3ratio(this.polytrail_thickness[0], this.polytrail_thickness[1], this.polytrail_thickness[2], rtime);
+               vector rgb = lerpv3ratio(this.polytrail_head_color, this.polytrail_body_color, this.polytrail_tail_color, rtime);
+               float a = lerp3ratio(this.polytrail_head_alpha, this.polytrail_body_alpha, this.polytrail_tail_alpha, rtime);
+               int thickness = lerp3ratio(this.polytrail_head_thickness, this.polytrail_body_thickness, this.polytrail_tail_thickness, rtime);
                vector thickdir = normalize(cross(normalize(to - from), view_origin - from)) * (thickness / 2);
                vector A = from + thickdir;
                vector B = from - thickdir;
@@ -71,17 +72,19 @@ void Trail_draw(entity this)
 
 void Trail_recreate(entity this)
 {
-       PolyTrail t = NEW(PolyTrail, this.polytrail_follow);
+       PolyTrail t = NEW(PolyTrail);
+       t.polytrail_follow = this.polytrail_follow;
+       IL_PUSH(g_drawables, t);
        t.polytrail_tex = this.polytrail_tex;
-       t.polytrail_rgb[0] = this.polytrail_rgb[0];
-       t.polytrail_rgb[1] = this.polytrail_rgb[1];
-       t.polytrail_rgb[2] = this.polytrail_rgb[2];
-       t.polytrail_alpha[0] = this.polytrail_alpha[0];
-       t.polytrail_alpha[1] = this.polytrail_alpha[1];
-       t.polytrail_alpha[2] = this.polytrail_alpha[2];
-       t.polytrail_thickness[0] = this.polytrail_thickness[0];
-       t.polytrail_thickness[1] = this.polytrail_thickness[1];
-       t.polytrail_thickness[2] = this.polytrail_thickness[2];
+       t.polytrail_head_alpha = this.polytrail_head_alpha;
+       t.polytrail_head_color = this.polytrail_head_color;
+       t.polytrail_head_thickness = this.polytrail_head_thickness;
+       t.polytrail_body_alpha = this.polytrail_body_alpha;
+       t.polytrail_body_color = this.polytrail_body_color;
+       t.polytrail_body_thickness = this.polytrail_body_thickness;
+       t.polytrail_tail_alpha = this.polytrail_tail_alpha;
+       t.polytrail_tail_color = this.polytrail_tail_color;
+       t.polytrail_tail_thickness = this.polytrail_tail_thickness;
        t.polytrail_lifetime = this.polytrail_lifetime;
        t.polytrail_segmentsize = this.polytrail_segmentsize;
        t.polytrail_noise = this.polytrail_noise;
@@ -89,3 +92,17 @@ void Trail_recreate(entity this)
 
        this.polytrail_follow = NULL;
 }
+
+void PolyTrail_Spawn(entity this, entity _follow)
+{
+       this.polytrail_follow = _follow;
+       IL_PUSH(g_drawables, this);
+
+       if(autocvar_cl_polytrails_teamcolor && _follow.colormap > 0)
+       {
+               vector teamcolor = colormapPaletteColor(_follow.colormap & 0x0F, true);
+               // keep original head color so it matches projectile
+               this.polytrail_body_color = teamcolor;
+               this.polytrail_tail_color = teamcolor;
+       }
+}
index c8ec3b23438d9a7fc54c63b614971b72c47a50f3..62fce0a52ccec95a3afa604f02547c916e6ff3a5 100644 (file)
@@ -1,8 +1,7 @@
 #pragma once
 
-#include <client/main.qh>
-
 bool autocvar_cl_polytrails = true;
+bool autocvar_cl_polytrails_teamcolor = false;
 
 CLASS(PolyTrail, Object)
        ATTRIB(PolyTrail, polytrail_follow, entity, NULL);
@@ -12,9 +11,15 @@ CLASS(PolyTrail, Object)
        ATTRIB(PolyTrail, polytrail_noise, float, 0);
        ATTRIB(PolyTrail, polytrail_segmentsize, float, 10);
        ATTRIB(PolyTrail, polytrail_noisefunc, string, "chaotic");
-       ATTRIBARRAY(PolyTrail, polytrail_rgb, vector, 3);
-       ATTRIBARRAY(PolyTrail, polytrail_alpha, float, 3);
-       ATTRIBARRAY(PolyTrail, polytrail_thickness, float, 3);
+       ATTRIB(PolyTrail, polytrail_head_alpha, float, 1);
+       ATTRIB(PolyTrail, polytrail_head_color, vector, '1 0 0');
+       ATTRIB(PolyTrail, polytrail_head_thickness, float, 10);
+       ATTRIB(PolyTrail, polytrail_body_alpha, float, 0.5);
+       ATTRIB(PolyTrail, polytrail_body_color, vector, '0 1 0');
+       ATTRIB(PolyTrail, polytrail_body_thickness, float, 5);
+       ATTRIB(PolyTrail, polytrail_tail_alpha, float, 0);
+       ATTRIB(PolyTrail, polytrail_tail_color, vector, '0 0 1');
+       ATTRIB(PolyTrail, polytrail_tail_thickness, float, 0);
 
        /**
         * Increase as necessary if the buffer is overflowing
@@ -35,10 +40,6 @@ CLASS(PolyTrail, Object)
 
        void Trail_draw(entity this);
        void Trail_recreate(entity this);
+       void PolyTrail_Spawn(entity this, entity _follow);
        ATTRIB(PolyTrail, draw, void(entity this), Trail_draw);
-       CONSTRUCTOR(PolyTrail, entity _follow) {
-               CONSTRUCT(PolyTrail);
-               this.polytrail_follow = _follow;
-               IL_PUSH(g_drawables, this);
-       }
 ENDCLASS(PolyTrail)
index be041ffc0fa49293b75c68934d1768937340930b..ef3d8994392fbd6e863db929ed92d047f92f4fba 100644 (file)
@@ -5,9 +5,12 @@
 #include <common/constants.qh>
 #include <common/effects/all.qh>
 #include <common/effects/effect.qh>
+#include <common/models/all.qh>
+#include <common/sounds/all.qh>
 #include <common/mutators/mutator/nades/nades.qh>
 #include <common/net_linked.qh>
 #include <common/physics/movetypes/movetypes.qh>
+#include <common/weapons/all.qh>
 #include <lib/csqcmodel/interpolate.qh>
 #include <lib/warpzone/anglestransform.qh>
 
@@ -364,21 +367,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
                                if(autocvar_cl_polytrails && autocvar_cl_polytrails_electro_orb)
                                {
                                        this.traileffect = EFFECT_Null.m_id;
-                                       PolyTrail t = NEW(PolyTrail, this);
-                                       t.polytrail_tex = "particles/lgbeam.tga";
-                                       t.polytrail_rgb[0] = autocvar_cl_polytrails_electro_orb_rgb0;
-                                       t.polytrail_rgb[1] = autocvar_cl_polytrails_electro_orb_rgb1;
-                                       t.polytrail_rgb[2] = autocvar_cl_polytrails_electro_orb_rgb2;
-                                       t.polytrail_alpha[0] = autocvar_cl_polytrails_electro_orb_alpha0;
-                                       t.polytrail_alpha[1] = autocvar_cl_polytrails_electro_orb_alpha1;
-                                       t.polytrail_alpha[2] = autocvar_cl_polytrails_electro_orb_alpha2;
-                                       t.polytrail_thickness[0] = autocvar_cl_polytrails_electro_orb_thickness0;
-                                       t.polytrail_thickness[1] = autocvar_cl_polytrails_electro_orb_thickness1;
-                                       t.polytrail_thickness[2] = autocvar_cl_polytrails_electro_orb_thickness2;
-                                       t.polytrail_lifetime = autocvar_cl_polytrails_electro_orb_lifetime;
-                                       t.polytrail_segmentsize = autocvar_cl_polytrails_electro_orb_segmentsize;
-                                       t.polytrail_noise = autocvar_cl_polytrails_electro_orb_noise;
-                                       t.polytrail_noisefunc = autocvar_cl_polytrails_electro_orb_noisefunc;
+                                       PolyTrail_Spawn(NEW(ElectroOrbTrail), this);
                                }
                                break;
                        case PROJECTILE_RPC:
@@ -431,21 +420,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
                                if(autocvar_cl_polytrails && autocvar_cl_polytrails_crylink_bouncing)
                                {
                                        this.traileffect = EFFECT_Null.m_id;
-                                       PolyTrail t = NEW(PolyTrail, this);
-                                       t.polytrail_tex = "gfx/crosshair_ring.tga"; // TODO: dedicated texture
-                                       t.polytrail_rgb[0] = autocvar_cl_polytrails_crylink_bouncing_rgb0;
-                                       t.polytrail_rgb[1] = autocvar_cl_polytrails_crylink_bouncing_rgb1;
-                                       t.polytrail_rgb[2] = autocvar_cl_polytrails_crylink_bouncing_rgb2;
-                                       t.polytrail_alpha[0] = autocvar_cl_polytrails_crylink_bouncing_alpha0;
-                                       t.polytrail_alpha[1] = autocvar_cl_polytrails_crylink_bouncing_alpha1;
-                                       t.polytrail_alpha[2] = autocvar_cl_polytrails_crylink_bouncing_alpha2;
-                                       t.polytrail_thickness[0] = autocvar_cl_polytrails_crylink_bouncing_thickness0;
-                                       t.polytrail_thickness[1] = autocvar_cl_polytrails_crylink_bouncing_thickness1;
-                                       t.polytrail_thickness[2] = autocvar_cl_polytrails_crylink_bouncing_thickness2;
-                                       t.polytrail_lifetime = autocvar_cl_polytrails_crylink_bouncing_lifetime;
-                                       t.polytrail_segmentsize = autocvar_cl_polytrails_crylink_bouncing_segmentsize;
-                                       t.polytrail_noise = autocvar_cl_polytrails_crylink_bouncing_noise;
-                                       t.polytrail_noisefunc = autocvar_cl_polytrails_crylink_bouncing_noisefunc;
+                                       PolyTrail_Spawn(NEW(CrylinkBouncingTrail), this);
                                }
                                break;
                        case PROJECTILE_FIREBALL:
@@ -495,42 +470,14 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
                                if(autocvar_cl_polytrails && autocvar_cl_polytrails_electro_bolt)
                                {
                                        this.traileffect = EFFECT_Null.m_id;
-                                       PolyTrail t = NEW(PolyTrail, this);
-                                       t.polytrail_tex = "particles/lgbeam.tga";
-                                       t.polytrail_rgb[0] = autocvar_cl_polytrails_electro_bolt_rgb0;
-                                       t.polytrail_rgb[1] = autocvar_cl_polytrails_electro_bolt_rgb1;
-                                       t.polytrail_rgb[2] = autocvar_cl_polytrails_electro_bolt_rgb2;
-                                       t.polytrail_alpha[0] = autocvar_cl_polytrails_electro_bolt_alpha0;
-                                       t.polytrail_alpha[1] = autocvar_cl_polytrails_electro_bolt_alpha1;
-                                       t.polytrail_alpha[2] = autocvar_cl_polytrails_electro_bolt_alpha2;
-                                       t.polytrail_thickness[0] = autocvar_cl_polytrails_electro_bolt_thickness0;
-                                       t.polytrail_thickness[1] = autocvar_cl_polytrails_electro_bolt_thickness1;
-                                       t.polytrail_thickness[2] = autocvar_cl_polytrails_electro_bolt_thickness2;
-                                       t.polytrail_lifetime = autocvar_cl_polytrails_electro_bolt_lifetime;
-                                       t.polytrail_segmentsize = autocvar_cl_polytrails_electro_bolt_segmentsize;
-                                       t.polytrail_noise = autocvar_cl_polytrails_electro_bolt_noise;
-                                       t.polytrail_noisefunc = autocvar_cl_polytrails_electro_bolt_noisefunc;
+                                       PolyTrail_Spawn(NEW(ElectroBoltTrail), this);
                                }
                                break;
                        case PROJECTILE_CRYLINK:
                                if(autocvar_cl_polytrails && autocvar_cl_polytrails_crylink_bolt)
                                {
                                        this.traileffect = EFFECT_Null.m_id;
-                                       PolyTrail t = NEW(PolyTrail, this);
-                                       t.polytrail_tex = "gfx/crosshair_ring.tga"; // TODO: dedicated texture
-                                       t.polytrail_rgb[0] = autocvar_cl_polytrails_crylink_bolt_rgb0;
-                                       t.polytrail_rgb[1] = autocvar_cl_polytrails_crylink_bolt_rgb1;
-                                       t.polytrail_rgb[2] = autocvar_cl_polytrails_crylink_bolt_rgb2;
-                                       t.polytrail_alpha[0] = autocvar_cl_polytrails_crylink_bolt_alpha0;
-                                       t.polytrail_alpha[1] = autocvar_cl_polytrails_crylink_bolt_alpha1;
-                                       t.polytrail_alpha[2] = autocvar_cl_polytrails_crylink_bolt_alpha2;
-                                       t.polytrail_thickness[0] = autocvar_cl_polytrails_crylink_bolt_thickness0;
-                                       t.polytrail_thickness[1] = autocvar_cl_polytrails_crylink_bolt_thickness1;
-                                       t.polytrail_thickness[2] = autocvar_cl_polytrails_crylink_bolt_thickness2;
-                                       t.polytrail_lifetime = autocvar_cl_polytrails_crylink_bolt_lifetime;
-                                       t.polytrail_segmentsize = autocvar_cl_polytrails_crylink_bolt_segmentsize;
-                                       t.polytrail_noise = autocvar_cl_polytrails_crylink_bolt_noise;
-                                       t.polytrail_noisefunc = autocvar_cl_polytrails_crylink_bolt_noisefunc;
+                                       PolyTrail_Spawn(NEW(CrylinkBoltTrail), this);
                                }
                                break;
                        /*
index 9c7fa6c6e3b8fd20ba48be9ccad4ffb844a14cb3..b3cfd3e9b1455711c05749b8f39085548ef7149a 100644 (file)
@@ -31,64 +31,3 @@ void Projectile_Draw(entity this);
 void loopsound(entity e, int ch, Sound samp, float vol, float attn);
 
 void Ent_RemoveProjectile(entity this);
-
-// projectile polytrails
-bool autocvar_cl_polytrails_crylink_bouncing = true;
-vector autocvar_cl_polytrails_crylink_bouncing_rgb0 = '0.7 0 1';
-vector autocvar_cl_polytrails_crylink_bouncing_rgb1 = '0.5 0 1';
-vector autocvar_cl_polytrails_crylink_bouncing_rgb2 = '0.1 0 0.8';
-float autocvar_cl_polytrails_crylink_bouncing_alpha0 = 0.5;
-float autocvar_cl_polytrails_crylink_bouncing_alpha1 = 0.2;
-float autocvar_cl_polytrails_crylink_bouncing_alpha2 = 0;
-float autocvar_cl_polytrails_crylink_bouncing_thickness0 = 5;
-float autocvar_cl_polytrails_crylink_bouncing_thickness1 = 3;
-float autocvar_cl_polytrails_crylink_bouncing_thickness2 = 3;
-float autocvar_cl_polytrails_crylink_bouncing_lifetime = 0.15;
-float autocvar_cl_polytrails_crylink_bouncing_segmentsize = 80;
-float autocvar_cl_polytrails_crylink_bouncing_noise = 0;
-string autocvar_cl_polytrails_crylink_bouncing_noisefunc = "none";
-
-bool autocvar_cl_polytrails_crylink_bolt = true;
-vector autocvar_cl_polytrails_crylink_bolt_rgb0 = '0.7 0 1';
-vector autocvar_cl_polytrails_crylink_bolt_rgb1 = '0.5 0 1';
-vector autocvar_cl_polytrails_crylink_bolt_rgb2 = '0.1 0 0.8';
-float autocvar_cl_polytrails_crylink_bolt_alpha0 = 0.75;
-float autocvar_cl_polytrails_crylink_bolt_alpha1 = 0.2;
-float autocvar_cl_polytrails_crylink_bolt_alpha2 = 0;
-float autocvar_cl_polytrails_crylink_bolt_thickness0 = 5;
-float autocvar_cl_polytrails_crylink_bolt_thickness1 = 3;
-float autocvar_cl_polytrails_crylink_bolt_thickness2 = 3;
-float autocvar_cl_polytrails_crylink_bolt_lifetime = 0.15;
-float autocvar_cl_polytrails_crylink_bolt_segmentsize = 80;
-float autocvar_cl_polytrails_crylink_bolt_noise = 0;
-string autocvar_cl_polytrails_crylink_bolt_noisefunc = "none";
-
-bool autocvar_cl_polytrails_electro_bolt = true;
-vector autocvar_cl_polytrails_electro_bolt_rgb0 = '0.75 0.75 1';
-vector autocvar_cl_polytrails_electro_bolt_rgb1 = '0.45 0.45 1';
-vector autocvar_cl_polytrails_electro_bolt_rgb2 = '0.1 0.1 0.75';
-float autocvar_cl_polytrails_electro_bolt_alpha0 = 1;
-float autocvar_cl_polytrails_electro_bolt_alpha1 = 0.5;
-float autocvar_cl_polytrails_electro_bolt_alpha2 = 0;
-float autocvar_cl_polytrails_electro_bolt_thickness0 = 5;
-float autocvar_cl_polytrails_electro_bolt_thickness1 = 5;
-float autocvar_cl_polytrails_electro_bolt_thickness2 = 0;
-float autocvar_cl_polytrails_electro_bolt_lifetime = 0.27;
-float autocvar_cl_polytrails_electro_bolt_segmentsize = 10;
-float autocvar_cl_polytrails_electro_bolt_noise = 5;
-string autocvar_cl_polytrails_electro_bolt_noisefunc = "chaotic";
-
-bool autocvar_cl_polytrails_electro_orb = true;
-vector autocvar_cl_polytrails_electro_orb_rgb0 = '0.8 0.8 1';
-vector autocvar_cl_polytrails_electro_orb_rgb1 = '0.5 0.5 1';
-vector autocvar_cl_polytrails_electro_orb_rgb2 = '0.1 0.1 0.7';
-float autocvar_cl_polytrails_electro_orb_alpha0 = 1;
-float autocvar_cl_polytrails_electro_orb_alpha1 = 0.5;
-float autocvar_cl_polytrails_electro_orb_alpha2 = 0;
-float autocvar_cl_polytrails_electro_orb_thickness0 = 15;
-float autocvar_cl_polytrails_electro_orb_thickness1 = 7;
-float autocvar_cl_polytrails_electro_orb_thickness2 = 0;
-float autocvar_cl_polytrails_electro_orb_lifetime = 0.18;
-float autocvar_cl_polytrails_electro_orb_segmentsize = 10;
-float autocvar_cl_polytrails_electro_orb_noise = 10;
-string autocvar_cl_polytrails_electro_orb_noisefunc = "chaotic";
index 8ac7a20c8ec9b6e421ade25240fae2fc0e9aa2a1..f0f2be472b606d4ccde46e3b08f625ec89c6f85b 100644 (file)
@@ -23,6 +23,10 @@ WepSet ReadWepSet();
 #include <common/effects/all.qh>
 #endif
 
+#ifdef CSQC
+#include <client/polytrails.qh>
+#endif
+
 #include <common/util.qh>
 
 REGISTRY(Weapons, 72) // Increase as needed. Can be up to 72.
index 19a81029c3a77cced7ac87c95d2097aa12873374..2c74ecddbb7e167597b9b51968260768948a2a01 100644 (file)
@@ -8,6 +8,10 @@
 #include <common/effects/qc/_mod.qh>
 #endif
 
+#ifdef CSQC
+#include <client/polytrails.qh>
+#endif
+
 USING(WepSet, vector);
 
 const int MAX_WEAPONSLOTS = 2;
index 15b46ba721e06d4547bacfce65d688f9c20ab786..91173fec8d50a5230c997397715200aeacdf0510 100644 (file)
@@ -76,3 +76,67 @@ SPAWNFUNC_WEAPON(weapon_crylink, WEP_CRYLINK)
 
 void W_Crylink_Dequeue(entity e);
 #endif
+
+#ifdef CSQC
+bool autocvar_cl_polytrails_crylink_bouncing = true;
+float autocvar_cl_polytrails_crylink_bouncing_head_alpha = 0.5;
+vector autocvar_cl_polytrails_crylink_bouncing_head_color = '0.7 0 1';
+float autocvar_cl_polytrails_crylink_bouncing_head_thickness = 5;
+float autocvar_cl_polytrails_crylink_bouncing_body_alpha = 0.2;
+vector autocvar_cl_polytrails_crylink_bouncing_body_color = '0.5 0 1';
+float autocvar_cl_polytrails_crylink_bouncing_body_thickness = 3;
+float autocvar_cl_polytrails_crylink_bouncing_tail_alpha = 0;
+vector autocvar_cl_polytrails_crylink_bouncing_tail_color = '0.1 0 0.8';
+float autocvar_cl_polytrails_crylink_bouncing_tail_thickness = 13;
+float autocvar_cl_polytrails_crylink_bouncing_lifetime = 0.15;
+float autocvar_cl_polytrails_crylink_bouncing_segmentsize = 80;
+float autocvar_cl_polytrails_crylink_bouncing_noise = 0;
+string autocvar_cl_polytrails_crylink_bouncing_noisefunc = "none";
+CLASS(CrylinkBouncingTrail, PolyTrail)
+       ATTRIB(CrylinkBouncingTrail, polytrail_tex, string, "gfx/crosshair_ring.tga"); // TODO: dedicated texture
+       ATTRIB(CrylinkBouncingTrail, polytrail_lifetime, float, autocvar_cl_polytrails_crylink_bouncing_lifetime);
+       ATTRIB(CrylinkBouncingTrail, polytrail_noise, float, autocvar_cl_polytrails_crylink_bouncing_noise);
+       ATTRIB(CrylinkBouncingTrail, polytrail_segmentsize, float, autocvar_cl_polytrails_crylink_bouncing_segmentsize);
+       ATTRIB(CrylinkBouncingTrail, polytrail_noisefunc, string, autocvar_cl_polytrails_crylink_bouncing_noisefunc);
+       ATTRIB(CrylinkBouncingTrail, polytrail_head_alpha, float, autocvar_cl_polytrails_crylink_bouncing_head_alpha);
+       ATTRIB(CrylinkBouncingTrail, polytrail_head_color, vector, autocvar_cl_polytrails_crylink_bouncing_head_color);
+       ATTRIB(CrylinkBouncingTrail, polytrail_head_thickness, float, autocvar_cl_polytrails_crylink_bouncing_head_thickness);
+       ATTRIB(CrylinkBouncingTrail, polytrail_body_alpha, float, autocvar_cl_polytrails_crylink_bouncing_body_alpha);
+       ATTRIB(CrylinkBouncingTrail, polytrail_body_color, vector, autocvar_cl_polytrails_crylink_bouncing_body_color);
+       ATTRIB(CrylinkBouncingTrail, polytrail_body_thickness, float, autocvar_cl_polytrails_crylink_bouncing_body_thickness);
+       ATTRIB(CrylinkBouncingTrail, polytrail_tail_alpha, float, autocvar_cl_polytrails_crylink_bouncing_tail_alpha);
+       ATTRIB(CrylinkBouncingTrail, polytrail_tail_color, vector, autocvar_cl_polytrails_crylink_bouncing_tail_color);
+       ATTRIB(CrylinkBouncingTrail, polytrail_tail_thickness, float, autocvar_cl_polytrails_crylink_bouncing_tail_thickness);
+ENDCLASS(CrylinkBouncingTrail)
+
+bool autocvar_cl_polytrails_crylink_bolt = true;
+float autocvar_cl_polytrails_crylink_bolt_head_alpha = 0.75;
+vector autocvar_cl_polytrails_crylink_bolt_head_color = '0.7 0 1';
+float autocvar_cl_polytrails_crylink_bolt_head_thickness = 5;
+float autocvar_cl_polytrails_crylink_bolt_body_alpha = 0.2;
+vector autocvar_cl_polytrails_crylink_bolt_body_color = '0.5 0 1';
+float autocvar_cl_polytrails_crylink_bolt_body_thickness = 3;
+float autocvar_cl_polytrails_crylink_bolt_tail_alpha = 0;
+vector autocvar_cl_polytrails_crylink_bolt_tail_color = '0.1 0 0.8';
+float autocvar_cl_polytrails_crylink_bolt_tail_thickness = 3;
+float autocvar_cl_polytrails_crylink_bolt_lifetime = 0.15;
+float autocvar_cl_polytrails_crylink_bolt_segmentsize = 80;
+float autocvar_cl_polytrails_crylink_bolt_noise = 0;
+string autocvar_cl_polytrails_crylink_bolt_noisefunc = "none";
+CLASS(CrylinkBoltTrail, PolyTrail)
+       ATTRIB(CrylinkBoltTrail, polytrail_tex, string, "gfx/crosshair_ring.tga"); // TODO: dedicated texture
+       ATTRIB(CrylinkBoltTrail, polytrail_lifetime, float, autocvar_cl_polytrails_crylink_bolt_lifetime);
+       ATTRIB(CrylinkBoltTrail, polytrail_noise, float, autocvar_cl_polytrails_crylink_bolt_noise);
+       ATTRIB(CrylinkBoltTrail, polytrail_segmentsize, float, autocvar_cl_polytrails_crylink_bolt_segmentsize);
+       ATTRIB(CrylinkBoltTrail, polytrail_noisefunc, string, autocvar_cl_polytrails_crylink_bolt_noisefunc);
+       ATTRIB(CrylinkBoltTrail, polytrail_head_alpha, float, autocvar_cl_polytrails_crylink_bolt_head_alpha);
+       ATTRIB(CrylinkBoltTrail, polytrail_head_color, vector, autocvar_cl_polytrails_crylink_bolt_head_color);
+       ATTRIB(CrylinkBoltTrail, polytrail_head_thickness, float, autocvar_cl_polytrails_crylink_bolt_head_thickness);
+       ATTRIB(CrylinkBoltTrail, polytrail_body_alpha, float, autocvar_cl_polytrails_crylink_bolt_body_alpha);
+       ATTRIB(CrylinkBoltTrail, polytrail_body_color, vector, autocvar_cl_polytrails_crylink_bolt_body_color);
+       ATTRIB(CrylinkBoltTrail, polytrail_body_thickness, float, autocvar_cl_polytrails_crylink_bolt_body_thickness);
+       ATTRIB(CrylinkBoltTrail, polytrail_tail_alpha, float, autocvar_cl_polytrails_crylink_bolt_tail_alpha);
+       ATTRIB(CrylinkBoltTrail, polytrail_tail_color, vector, autocvar_cl_polytrails_crylink_bolt_tail_color);
+       ATTRIB(CrylinkBoltTrail, polytrail_tail_thickness, float, autocvar_cl_polytrails_crylink_bolt_tail_thickness);
+ENDCLASS(CrylinkBoltTrail)
+#endif
index fe9199b8f9665fe0bb4c5b96e0491f57fa793b2e..a4e774c6c2ac37846a82d0ced5c488a584a5efa5 100644 (file)
@@ -83,3 +83,67 @@ IntrusiveList LimitedElectroBallRubbleList;
 .float electro_secondarytime;
 void W_Electro_ExplodeCombo(entity this);
 #endif
+
+#ifdef CSQC
+bool autocvar_cl_polytrails_electro_bolt = true;
+float autocvar_cl_polytrails_electro_bolt_head_alpha = 1;
+vector autocvar_cl_polytrails_electro_bolt_head_color = '0.75 0.75 1';
+float autocvar_cl_polytrails_electro_bolt_head_thickness = 5;
+float autocvar_cl_polytrails_electro_bolt_body_alpha = 0.5;
+vector autocvar_cl_polytrails_electro_bolt_body_color = '0.45 0.45 1';
+float autocvar_cl_polytrails_electro_bolt_body_thickness = 5;
+float autocvar_cl_polytrails_electro_bolt_tail_alpha = 0;
+vector autocvar_cl_polytrails_electro_bolt_tail_color = '0.1 0.1 0.75';
+float autocvar_cl_polytrails_electro_bolt_tail_thickness = 0;
+float autocvar_cl_polytrails_electro_bolt_lifetime = 0.27;
+float autocvar_cl_polytrails_electro_bolt_segmentsize = 10;
+float autocvar_cl_polytrails_electro_bolt_noise = 5;
+string autocvar_cl_polytrails_electro_bolt_noisefunc = "chaotic";
+CLASS(ElectroBoltTrail, PolyTrail)
+       ATTRIB(ElectroBoltTrail, polytrail_tex, string, "particles/lgbeam.tga");
+       ATTRIB(ElectroBoltTrail, polytrail_lifetime, float, autocvar_cl_polytrails_electro_bolt_lifetime);
+       ATTRIB(ElectroBoltTrail, polytrail_noise, float, autocvar_cl_polytrails_electro_bolt_noise);
+       ATTRIB(ElectroBoltTrail, polytrail_segmentsize, float, autocvar_cl_polytrails_electro_bolt_segmentsize);
+       ATTRIB(ElectroBoltTrail, polytrail_noisefunc, string, autocvar_cl_polytrails_electro_bolt_noisefunc);
+       ATTRIB(ElectroBoltTrail, polytrail_head_alpha, float, autocvar_cl_polytrails_electro_bolt_head_alpha);
+       ATTRIB(ElectroBoltTrail, polytrail_head_color, vector, autocvar_cl_polytrails_electro_bolt_head_color);
+       ATTRIB(ElectroBoltTrail, polytrail_head_thickness, float, autocvar_cl_polytrails_electro_bolt_head_thickness);
+       ATTRIB(ElectroBoltTrail, polytrail_body_alpha, float, autocvar_cl_polytrails_electro_bolt_body_alpha);
+       ATTRIB(ElectroBoltTrail, polytrail_body_color, vector, autocvar_cl_polytrails_electro_bolt_body_color);
+       ATTRIB(ElectroBoltTrail, polytrail_body_thickness, float, autocvar_cl_polytrails_electro_bolt_body_thickness);
+       ATTRIB(ElectroBoltTrail, polytrail_tail_alpha, float, autocvar_cl_polytrails_electro_bolt_tail_alpha);
+       ATTRIB(ElectroBoltTrail, polytrail_tail_color, vector, autocvar_cl_polytrails_electro_bolt_tail_color);
+       ATTRIB(ElectroBoltTrail, polytrail_tail_thickness, float, autocvar_cl_polytrails_electro_bolt_tail_thickness);
+ENDCLASS(ElectroBoltTrail)
+
+bool autocvar_cl_polytrails_electro_orb = true;
+float autocvar_cl_polytrails_electro_orb_head_alpha = 1;
+vector autocvar_cl_polytrails_electro_orb_head_color = '0.8 0.8 1';
+float autocvar_cl_polytrails_electro_orb_head_thickness = 15;
+float autocvar_cl_polytrails_electro_orb_body_alpha = 0.5;
+vector autocvar_cl_polytrails_electro_orb_body_color = '0.5 0.5 1';
+float autocvar_cl_polytrails_electro_orb_body_thickness = 7;
+float autocvar_cl_polytrails_electro_orb_tail_alpha = 0;
+vector autocvar_cl_polytrails_electro_orb_tail_color = '0.1 0.1 0.7';
+float autocvar_cl_polytrails_electro_orb_tail_thickness = 0;
+float autocvar_cl_polytrails_electro_orb_lifetime = 0.18;
+float autocvar_cl_polytrails_electro_orb_segmentsize = 10;
+float autocvar_cl_polytrails_electro_orb_noise = 10;
+string autocvar_cl_polytrails_electro_orb_noisefunc = "chaotic";
+CLASS(ElectroOrbTrail, PolyTrail)
+       ATTRIB(ElectroOrbTrail, polytrail_tex, string, "particles/lgbeam.tga");
+       ATTRIB(ElectroOrbTrail, polytrail_lifetime, float, autocvar_cl_polytrails_electro_orb_lifetime);
+       ATTRIB(ElectroOrbTrail, polytrail_noise, float, autocvar_cl_polytrails_electro_orb_noise);
+       ATTRIB(ElectroOrbTrail, polytrail_segmentsize, float, autocvar_cl_polytrails_electro_orb_segmentsize);
+       ATTRIB(ElectroOrbTrail, polytrail_noisefunc, string, autocvar_cl_polytrails_electro_orb_noisefunc);
+       ATTRIB(ElectroOrbTrail, polytrail_head_alpha, float, autocvar_cl_polytrails_electro_orb_head_alpha);
+       ATTRIB(ElectroOrbTrail, polytrail_head_color, vector, autocvar_cl_polytrails_electro_orb_head_color);
+       ATTRIB(ElectroOrbTrail, polytrail_head_thickness, float, autocvar_cl_polytrails_electro_orb_head_thickness);
+       ATTRIB(ElectroOrbTrail, polytrail_body_alpha, float, autocvar_cl_polytrails_electro_orb_body_alpha);
+       ATTRIB(ElectroOrbTrail, polytrail_body_color, vector, autocvar_cl_polytrails_electro_orb_body_color);
+       ATTRIB(ElectroOrbTrail, polytrail_body_thickness, float, autocvar_cl_polytrails_electro_orb_body_thickness);
+       ATTRIB(ElectroOrbTrail, polytrail_tail_alpha, float, autocvar_cl_polytrails_electro_orb_tail_alpha);
+       ATTRIB(ElectroOrbTrail, polytrail_tail_color, vector, autocvar_cl_polytrails_electro_orb_tail_color);
+       ATTRIB(ElectroOrbTrail, polytrail_tail_thickness, float, autocvar_cl_polytrails_electro_orb_tail_thickness);
+ENDCLASS(ElectroOrbTrail)
+#endif