From: Mario Date: Mon, 23 Dec 2024 15:47:26 +0000 (+1000) Subject: Minor cleanup of polytrail cvars, add optional team coloring X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6b732bbf9fb6620f6e2b068f05f68d8b017a4299;p=xonotic%2Fxonotic-data.pk3dir.git Minor cleanup of polytrail cvars, add optional team coloring --- diff --git a/polytrails.cfg b/polytrails.cfg index 7dda27c6b..ac13cf333 100644 --- a/polytrails.cfg +++ b/polytrails.cfg @@ -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 diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index 99368d393..f1511bd75 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index b426840ed..4ecd99467 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 698c70b2d..548b1649a 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -1,7 +1,6 @@ #pragma once #include -#include bool autocvar_cl_db_saveasdump; bool autocvar_cl_spawn_event_particles; diff --git a/qcsrc/client/polytrails.qc b/qcsrc/client/polytrails.qc index 0b2c13853..32a34f3ce 100644 --- a/qcsrc/client/polytrails.qc +++ b/qcsrc/client/polytrails.qc @@ -1,5 +1,6 @@ #include "polytrails.qh" +#include #include #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; + } +} diff --git a/qcsrc/client/polytrails.qh b/qcsrc/client/polytrails.qh index c8ec3b234..62fce0a52 100644 --- a/qcsrc/client/polytrails.qh +++ b/qcsrc/client/polytrails.qh @@ -1,8 +1,7 @@ #pragma once -#include - 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) diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index be041ffc0..ef3d89943 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -5,9 +5,12 @@ #include #include #include +#include +#include #include #include #include +#include #include #include @@ -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; /* diff --git a/qcsrc/client/weapons/projectile.qh b/qcsrc/client/weapons/projectile.qh index 9c7fa6c6e..b3cfd3e9b 100644 --- a/qcsrc/client/weapons/projectile.qh +++ b/qcsrc/client/weapons/projectile.qh @@ -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"; diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index 8ac7a20c8..f0f2be472 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -23,6 +23,10 @@ WepSet ReadWepSet(); #include #endif +#ifdef CSQC +#include +#endif + #include REGISTRY(Weapons, 72) // Increase as needed. Can be up to 72. diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index 19a81029c..2c74ecddb 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -8,6 +8,10 @@ #include #endif +#ifdef CSQC +#include +#endif + USING(WepSet, vector); const int MAX_WEAPONSLOTS = 2; diff --git a/qcsrc/common/weapons/weapon/crylink.qh b/qcsrc/common/weapons/weapon/crylink.qh index 15b46ba72..91173fec8 100644 --- a/qcsrc/common/weapons/weapon/crylink.qh +++ b/qcsrc/common/weapons/weapon/crylink.qh @@ -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 diff --git a/qcsrc/common/weapons/weapon/electro.qh b/qcsrc/common/weapons/weapon/electro.qh index fe9199b8f..a4e774c6c 100644 --- a/qcsrc/common/weapons/weapon/electro.qh +++ b/qcsrc/common/weapons/weapon/electro.qh @@ -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