tweak the glow
authorFruitieX <fruitiex@gmail.com>
Thu, 2 Dec 2010 19:49:20 +0000 (21:49 +0200)
committerFruitieX <fruitiex@gmail.com>
Thu, 2 Dec 2010 19:49:20 +0000 (21:49 +0200)
qcsrc/server/w_nex.qc
textures/nexgun.tga
textures/nexgun_glow.tga

index 5b1943b..4401abf 100644 (file)
@@ -96,13 +96,18 @@ float w_nex(float req)
 
         if(cvar("g_balance_nex_charge"))
         {
-            self.weaponentity.weaponentity.glowmod = '1 1 1' * self.nex_charge;
-            self.exteriorweaponentity.glowmod = '1 1 1' * self.nex_charge;
+            self.weaponentity.weaponentity.glowmod = '0 0 0'; // reset
+
+            self.weaponentity.weaponentity.glowmod_y = 0.5 * bound(0, self.weaponentity.weaponentity.glowmod_y + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1);
+            self.weaponentity.weaponentity.glowmod_z = bound(0, self.weaponentity.weaponentity.glowmod_z + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1);
+
             if(self.nex_charge > cvar("g_balance_nex_charge_limit"))
             {
-                self.weaponentity.weaponentity.glowmod_y -= 0.5 * (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit"));
-                self.weaponentity.weaponentity.glowmod_z -= 0.5 * (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit"));
+                self.weaponentity.weaponentity.glowmod_x = self.weaponentity.weaponentity.glowmod_x + (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit"));
+                self.weaponentity.weaponentity.glowmod_y = self.weaponentity.weaponentity.glowmod_y - 0.5 * (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit"));
+                self.weaponentity.weaponentity.glowmod_z = self.weaponentity.weaponentity.glowmod_z - (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit"));
             }
+            self.exteriorweaponentity.glowmod = self.weaponentity.weaponentity.glowmod;
         }
 
                if(cvar("g_balance_nex_secondary_charge_pool"))
index 240695f..09fb1b2 100644 (file)
Binary files a/textures/nexgun.tga and b/textures/nexgun.tga differ
index c58c009..e3befff 100644 (file)
Binary files a/textures/nexgun_glow.tga and b/textures/nexgun_glow.tga differ