]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_nex.qc
change the glow on the nex depending on how charged it is (warning: looks pretty...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_nex.qc
index 61f4dc2929feacf92f54270c8c185171aac8e666..5b1943b5da68fceecf92850e0a614ccd04ea70de 100644 (file)
@@ -48,6 +48,7 @@ void W_Nex_Attack (float issecondary)
                charge = cvar("g_balance_nex_charge_mindmg") / mydmg + (1 - cvar("g_balance_nex_charge_mindmg") / mydmg) * self.nex_charge;
                self.nex_charge *= cvar("g_balance_nex_charge_shot_multiplier"); // do this AFTER setting mydmg/myforce
                                                                                 // O RLY? -- divVerent
+                                                                         // YA RLY -- FruitieX
        }
        else
                charge = 1;
@@ -55,6 +56,10 @@ void W_Nex_Attack (float issecondary)
        myforce *= charge;
 
        W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", CHAN_WEAPON, mydmg);
+    if(charge > cvar("g_balance_nex_charge_limit") && cvar("g_balance_nex_charge_limit")) // if the Nex is overcharged, we play an extra sound
+    {
+        sound (self, CHAN_WEAPON2, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * cvar("g_balance_nex_charge_limit")) / (1 - 0.5 * cvar("g_balance_nex_charge_limit")), ATTN_NORM);
+    }
 
        yoda = 0;
        FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_NEX);
@@ -89,6 +94,17 @@ float w_nex(float req)
                if(cvar("g_balance_nex_charge") && self.nex_charge < cvar("g_balance_nex_charge_limit"))
                        self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_rate") * frametime / W_TICSPERFRAME);
 
+        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;
+            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"));
+            }
+        }
+
                if(cvar("g_balance_nex_secondary_charge_pool"))
                if(self.nex_charge_pool_ammo < 1)
                {