]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/View.qc
add a slow rot to 50% nex charge (even when not holding the gun), improve the current...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / View.qc
index 074a3be5eec6f8d63eb1e671e48e70ca44189980..211bb9e9864586ed08aa23d07621a82aa6331603 100644 (file)
@@ -350,6 +350,7 @@ vector freeze_pmove_org, freeze_input_angles;
 entity nightvision_noise, nightvision_noise2;
 
 float pickup_crosshair_time, pickup_crosshair_size;
+float nex_charge_movingavg, nex_charge_current_avg;
 
 void CSQC_UpdateView(float w, float h)
 {
@@ -869,6 +870,15 @@ void CSQC_UpdateView(float w, float h)
                        }
                        else if (activeweapon == WEP_NEX && nex_charge) // ring around crosshair representing velocity-dependent damage for the nex
                        {
+                               vector rgb;
+                               // indicate how much we're charging right now with an inner circle
+                               a = cvar("crosshair_nexvelocity_currentcharge_alpha");
+                               nex_charge_movingavg = (1 - cvar("crosshair_nexvelocity_currentcharge_movingavg_rate")) * nex_charge_movingavg + cvar("crosshair_nexvelocity_currentcharge_movingavg_rate") * nex_charge;
+
+                               rgb = eX * cvar("crosshair_nexvelocity_currentcharge_color_red") + eY * cvar("crosshair_nexvelocity_currentcharge_color_green") + eZ * cvar("crosshair_nexvelocity_currentcharge_color_blue");
+                               DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", bound(0, cvar("crosshair_nexvelocity_currentcharge_scale") * (nex_charge - nex_charge_movingavg), 1), rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+
+                               // draw the charge
                                a = cvar("crosshair_nexvelocity_alpha");
                                DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", nex_charge, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
                        }