]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_nex.qc
Rewrite of vote code.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_nex.qc
index 482e216dfc5e2702377be8eeb8c4060ec5b25589..f9367059555cca67c033a8311e593e9bfc152a81 100644 (file)
@@ -56,10 +56,10 @@ void W_Nex_Attack (float issecondary)
        mydmg *= charge;
        myforce *= charge;
 
-       W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", CHAN_WEAPON, mydmg);
+       W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", CH_WEAPON_A, mydmg);
        if(charge > autocvar_g_balance_nex_charge_animlimit && autocvar_g_balance_nex_charge_animlimit) // if the Nex is overcharged, we play an extra sound
        {
-               sound (self, CHAN_WEAPON2, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_animlimit) / (1 - 0.5 * autocvar_g_balance_nex_charge_animlimit), ATTN_NORM);
+               sound (self, CH_WEAPON_B, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_animlimit) / (1 - 0.5 * autocvar_g_balance_nex_charge_animlimit), ATTN_NORM);
        }
 
        yoda = 0;
@@ -87,8 +87,13 @@ float w_nex(float req)
        float ammo_amount;
        if (req == WR_AIM)
        {
-               self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
-               self.BUTTON_ATCK2 = bot_aim(1000000, 0, 1, FALSE);
+               if(bot_aim(1000000, 0, 1, FALSE))
+                       self.BUTTON_ATCK = TRUE;
+               else
+               {
+                       if(autocvar_g_balance_nex_charge)
+                               self.BUTTON_ATCK2 = TRUE;
+               }
        }
        else if (req == WR_THINK)
        {
@@ -115,7 +120,7 @@ float w_nex(float req)
                                        weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nex_primary_animtime, w_ready);
                                }
                        }
-                       if ((autocvar_g_balance_nex_secondary_charge && !autocvar_g_balance_nex_secondary) ? self.BUTTON_ZOOM : self.BUTTON_ATCK2)
+                       if ((autocvar_g_balance_nex_secondary_charge && !autocvar_g_balance_nex_secondary) ? (self.BUTTON_ZOOM | self.BUTTON_ZOOMSCRIPT) : self.BUTTON_ATCK2)
                        {
                                if(autocvar_g_balance_nex_secondary_charge)
                                {
@@ -189,20 +194,6 @@ float w_nex(float req)
                                }
                        }
                }
-
-               if(autocvar_g_balance_nex_charge)
-               {
-                       self.weaponentity_glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit);
-                       self.weaponentity_glowmod_y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit);
-                       self.weaponentity_glowmod_z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit);
-
-                       if(self.nex_charge > autocvar_g_balance_nex_charge_animlimit)
-                       {
-                               self.weaponentity_glowmod_x = self.weaponentity_glowmod_x + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (self.nex_charge - autocvar_g_balance_nex_charge_animlimit) / (1 - autocvar_g_balance_nex_charge_animlimit);
-                               self.weaponentity_glowmod_y = self.weaponentity_glowmod_y + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (self.nex_charge - autocvar_g_balance_nex_charge_animlimit) / (1 - autocvar_g_balance_nex_charge_animlimit);
-                               self.weaponentity_glowmod_z = self.weaponentity_glowmod_z + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (self.nex_charge - autocvar_g_balance_nex_charge_animlimit) / (1 - autocvar_g_balance_nex_charge_animlimit);
-                       }
-               }
        }
        else if (req == WR_PRECACHE)
        {
@@ -215,7 +206,7 @@ float w_nex(float req)
                precache_sound ("weapons/nexwhoosh1.wav");
                precache_sound ("weapons/nexwhoosh2.wav");
                precache_sound ("weapons/nexwhoosh3.wav");
-               precache_sound ("weapons/reload.wav");
+               //precache_sound ("weapons/reload.wav"); // until weapons have individual reload sounds, precache the reload sound somewhere else
        }
        else if (req == WR_SETUP)
        {
@@ -252,14 +243,14 @@ float w_nex(float req)
                org2 = w_org + w_backoff * 6;
                pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
                if(!w_issilent)
-                       sound(self, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
+                       sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
        }
        else if(req == WR_PRECACHE)
        {
                precache_sound("weapons/neximpact.wav");
        }
        else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s did the impossible");
+               w_deathtypestring = _("%s is now thinking with portals");
        else if (req == WR_KILLMESSAGE)
                w_deathtypestring = _("%s has been vaporized by %s");
        return TRUE;