]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_nex.qc
gradually fade out the "charge" on the nex so if you go fast but hit a wall, you...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_nex.qc
index 3a85e113adc6a9ccbe7bd33469122e155664078f..87d0c88ab53fae69c7e3a9151c9ed31c2eccbccf 100644 (file)
@@ -18,7 +18,7 @@ void SendCSQCNexBeamParticle() {
 
 void W_Nex_Attack (float issecondary)
 {
-       float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo;
+       float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, f;
        if(issecondary)
        {
                mydmg = cvar("g_balance_nex_secondary_damage");
@@ -43,6 +43,12 @@ void W_Nex_Attack (float issecondary)
        float flying;
        flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
 
+       f = ExponentialFalloff(cvar("g_balance_nex_velocitydependent_minspeed"), cvar("g_balance_nex_velocitydependent_maxspeed"), cvar("g_balance_nex_velocitydependent_halflife"), self.nexspeed);
+
+       // TODO: make it more obvious (through effects, indicator on weapon) that damage increases when speed increases
+       mydmg *= f;
+       myforce *= f;
+
        W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", mydmg);
 
        yoda = 0;
@@ -64,7 +70,6 @@ void W_Nex_Attack (float issecondary)
 
 void spawnfunc_weapon_nex (void); // defined in t_items.qc
 
-.float sent_nex_scope;
 float w_nex(float req)
 {
        if (req == WR_AIM)
@@ -92,17 +97,6 @@ float w_nex(float req)
                                        weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_secondary_animtime"), w_ready);
                                }
                        }
-                       else
-                       {
-                               if(clienttype(self) == CLIENTTYPE_REAL)
-                               if(!self.sent_nex_scope)
-                               {
-                                       msg_entity = self;
-                                       WriteByte(MSG_ONE, SVC_TEMPENTITY);
-                                       WriteByte(MSG_ONE, TE_CSQC_NEX_SCOPE);
-                                       self.sent_nex_scope = 1;
-                               }       
-                       }
                }
        }
        else if (req == WR_PRECACHE)