bool ring_is_closing(entity this);
-float autocvar_g_br_ring_fadedistance = 2000;
-
#define RING_MODEL_PATH "models/sphere/sphere.md3"
#define RING_MODEL_RADIUS 64 // radius of model at 1.0 scale
void ring_draw(entity this)
}
this.scale = current_radius / RING_MODEL_RADIUS;
- this.alpha = max((1 - min(max(current_radius - vlen((csqcplayer.origin + csqcplayer.view_ofs) - this.origin), 0) / max(autocvar_g_br_ring_fadedistance, 1), 1)) * this.br_ring_alpha, 0.01);
+ this.alpha = max((1 - min(max(current_radius - vlen((csqcplayer.origin + csqcplayer.view_ofs) - this.origin), 0) / this.br_ring_fadedistance, 1)) * this.br_ring_alpha, 0.01);
if(vlen((csqcplayer.origin + csqcplayer.view_ofs) - this.origin) > current_radius)
this.alpha = max(this.alpha / 4, 0.01); // let's weaken the ring visuals a bit, everything is already ring colored
}
this.br_ring_alpha = bound(0.01, ReadCoord(), 1);
+ this.br_ring_fadedistance = max(ReadCoord(), 1);
+
this.br_ring_stage_count = max(ReadByte(), 1);
this.br_ring_stage_waittime = max(ReadCoord(), 0);
for(int i = 0; i < (this.br_ring_stage_count + 1); ++i)
void ring_alignPosition(entity this);
float autocvar_g_br_ring_duration = 150;
-vector autocvar_g_br_ring_color = '1 0 0';
-float autocvar_g_br_ring_alpha = 0.5;
+vector autocvar_g_br_ring_color = '1 0 0'; // FIXME: put visual-only cvar client side?
+float autocvar_g_br_ring_alpha = 0.5; // FIXME: put visual-only cvar client side?
+float autocvar_g_br_ring_fadedistance = 2000; // FIXME: put visual-only cvar client side?
float autocvar_g_br_ring_radius = -1; // useful for per map settings
string autocvar_g_br_ring_timing = "0.6 0.8 0.9";
string autocvar_g_br_ring_strength = "2.5 5 10 20 50";
this.br_ring_stage = -1;
this.colormod = autocvar_g_br_ring_color; // TODO: color changing ring
this.alpha = this.br_ring_alpha = bound(0.01, autocvar_g_br_ring_alpha, 1);
+ this.br_ring_fadedistance = max(autocvar_g_br_ring_fadedistance, 1);
this.br_ring_stage_waittime = max(autocvar_g_br_ring_wait, 0);
bool has_invalid_timings = ring_parseTiming(this);
WriteCoord(MSG_ENTITY, this.radius);
WriteVector(MSG_ENTITY, this.colormod);
WriteCoord(MSG_ENTITY, this.br_ring_alpha);
+ WriteCoord(MSG_ENTITY, this.br_ring_fadedistance);
WriteByte(MSG_ENTITY, this.br_ring_stage_count);
WriteCoord(MSG_ENTITY, this.br_ring_stage_waittime);