]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
nex secondary = negative push (very experimental!)
authorFruitieX <rasse@rasse-lappy.localdomain>
Wed, 28 Jul 2010 21:03:28 +0000 (00:03 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Wed, 28 Jul 2010 21:03:28 +0000 (00:03 +0300)
balance25.cfg
balanceNexSVN.cfg
balanceSamual.cfg
balanceXPM.cfg
balanceXonotic.cfg
qcsrc/client/Defs.qc
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/common/constants.qh
qcsrc/server/w_nex.qc

index c3a3a6205ed2001480d4ca7ad6448160cb9b8e72..0250978c3b56b38e8e261be84dcfbfea2884e627 100644 (file)
@@ -383,15 +383,26 @@ set g_balance_crylink_secondary_line_lifetime 2 // range: 35000 full, fades to 7
 set g_balance_crylink_secondary_line_fadetime 2
 // }}}
 // {{{ nex
-set g_balance_nex_damage 100
-set g_balance_nex_force 600
-set g_balance_nex_refire 1.5
-set g_balance_nex_animtime 0.3
-set g_balance_nex_ammo 5
-set g_balance_nex_damagefalloff_mindist 0
-set g_balance_nex_damagefalloff_maxdist 0
-set g_balance_nex_damagefalloff_halflife 0
-set g_balance_nex_damagefalloff_forcehalflife 0
+set g_balance_nex_primary_damage 100
+set g_balance_nex_primary_force 600
+set g_balance_nex_primary_refire 1.5
+set g_balance_nex_primary_animtime 0.3
+set g_balance_nex_primary_ammo 5
+set g_balance_nex_primary_damagefalloff_mindist 0
+set g_balance_nex_primary_damagefalloff_maxdist 0
+set g_balance_nex_primary_damagefalloff_halflife 0
+set g_balance_nex_primary_damagefalloff_forcehalflife 0
+
+set g_balance_nex_secondary 0
+set g_balance_nex_secondary_damage 100
+set g_balance_nex_secondary_force 600
+set g_balance_nex_secondary_refire 1.5
+set g_balance_nex_secondary_animtime 0.3
+set g_balance_nex_secondary_ammo 5
+set g_balance_nex_secondary_damagefalloff_mindist 0
+set g_balance_nex_secondary_damagefalloff_maxdist 0
+set g_balance_nex_secondary_damagefalloff_halflife 0
+set g_balance_nex_secondary_damagefalloff_forcehalflife 0
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
index d1596a1d7354450e0a42f9bc7df00a55011878d2..0f8a8dc35c4dcdaa02d949335b42bb237fe2bd19 100644 (file)
@@ -383,15 +383,26 @@ set g_balance_crylink_secondary_line_lifetime 2 // range: 35000 full, fades to 7
 set g_balance_crylink_secondary_line_fadetime 2
 // }}}
 // {{{ nex
-set g_balance_nex_damage 90
-set g_balance_nex_force 200
-set g_balance_nex_refire 1.5
-set g_balance_nex_animtime 0.3
-set g_balance_nex_ammo 5
-set g_balance_nex_damagefalloff_mindist 1000
-set g_balance_nex_damagefalloff_maxdist 3000
-set g_balance_nex_damagefalloff_halflife 1500
-set g_balance_nex_damagefalloff_forcehalflife 1500
+set g_balance_nex_primary_damage 90
+set g_balance_nex_primary_force 200
+set g_balance_nex_primary_refire 1.5
+set g_balance_nex_primary_animtime 0.3
+set g_balance_nex_primary_ammo 5
+set g_balance_nex_primary_damagefalloff_mindist 1000
+set g_balance_nex_primary_damagefalloff_maxdist 3000
+set g_balance_nex_primary_damagefalloff_halflife 1500
+set g_balance_nex_primary_damagefalloff_forcehalflife 1500
+
+set g_balance_nex_secondary 0
+set g_balance_nex_secondary_damage 90
+set g_balance_nex_secondary_force 200
+set g_balance_nex_secondary_refire 1.5
+set g_balance_nex_secondary_animtime 0.3
+set g_balance_nex_secondary_ammo 5
+set g_balance_nex_secondary_damagefalloff_mindist 1000
+set g_balance_nex_secondary_damagefalloff_maxdist 3000
+set g_balance_nex_secondary_damagefalloff_halflife 1500
+set g_balance_nex_secondary_damagefalloff_forcehalflife 1500
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
index 292bb210568be03dd1f3fa5c161e2a1ea5d8bd88..e70157872ed1a52ab980be125b4184ca42a812f8 100644 (file)
@@ -383,15 +383,26 @@ set g_balance_crylink_secondary_line_lifetime 2 // range: 35000 full, fades to 7
 set g_balance_crylink_secondary_line_fadetime 2
 // }}}
 // {{{ nex
-set g_balance_nex_damage 90
-set g_balance_nex_force 300
-set g_balance_nex_refire 1.5
-set g_balance_nex_animtime 0.3
-set g_balance_nex_ammo 5
-set g_balance_nex_damagefalloff_mindist 1000
-set g_balance_nex_damagefalloff_maxdist 3000
-set g_balance_nex_damagefalloff_halflife 1500
-set g_balance_nex_damagefalloff_forcehalflife 1500
+set g_balance_nex_primary_damage 90
+set g_balance_nex_primary_force 300
+set g_balance_nex_primary_refire 1.5
+set g_balance_nex_primary_animtime 0.3
+set g_balance_nex_primary_ammo 5
+set g_balance_nex_primary_damagefalloff_mindist 1000
+set g_balance_nex_primary_damagefalloff_maxdist 3000
+set g_balance_nex_primary_damagefalloff_halflife 1500
+set g_balance_nex_primary_damagefalloff_forcehalflife 1500
+
+set g_balance_nex_secondary 0
+set g_balance_nex_secondary_damage 90
+set g_balance_nex_secondary_force 300
+set g_balance_nex_secondary_refire 1.5
+set g_balance_nex_secondary_animtime 0.3
+set g_balance_nex_secondary_ammo 5
+set g_balance_nex_secondary_damagefalloff_mindist 1000
+set g_balance_nex_secondary_damagefalloff_maxdist 3000
+set g_balance_nex_secondary_damagefalloff_halflife 1500
+set g_balance_nex_secondary_damagefalloff_forcehalflife 1500
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
index 91072e83529a35ff4945e697ce3fc6b7e7373653..55b6a5486d530450ab58d93bae38eb9a4a6e1685 100644 (file)
@@ -383,15 +383,26 @@ set g_balance_crylink_secondary_line_lifetime 2 // range: 4000 full, fades to 80
 set g_balance_crylink_secondary_line_fadetime 2
 // }}}
 // {{{ nex
-set g_balance_nex_damage 100
-set g_balance_nex_force 200
-set g_balance_nex_refire 1.25
-set g_balance_nex_animtime 1
-set g_balance_nex_ammo 5
-set g_balance_nex_damagefalloff_mindist 1000
-set g_balance_nex_damagefalloff_maxdist 3000
-set g_balance_nex_damagefalloff_halflife 2000
-set g_balance_nex_damagefalloff_forcehalflife 2000
+set g_balance_nex_primary_damage 100
+set g_balance_nex_primary_force 200
+set g_balance_nex_primary_refire 1.25
+set g_balance_nex_primary_animtime 1
+set g_balance_nex_primary_ammo 5
+set g_balance_nex_primary_damagefalloff_mindist 1000
+set g_balance_nex_primary_damagefalloff_maxdist 3000
+set g_balance_nex_primary_damagefalloff_halflife 2000
+set g_balance_nex_primary_damagefalloff_forcehalflife 2000
+
+set g_balance_nex_secondary 0
+set g_balance_nex_secondary_damage 100
+set g_balance_nex_secondary_force 200
+set g_balance_nex_secondary_refire 1.25
+set g_balance_nex_secondary_animtime 1
+set g_balance_nex_secondary_ammo 5
+set g_balance_nex_secondary_damagefalloff_mindist 1000
+set g_balance_nex_secondary_damagefalloff_maxdist 3000
+set g_balance_nex_secondary_damagefalloff_halflife 2000
+set g_balance_nex_secondary_damagefalloff_forcehalflife 2000
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1.25
index 12da28e70d0e9b30c827a8702b9b62923269294d..87b35fd38ebc7ca5aee14f6b78d8f7bab0db4af4 100644 (file)
@@ -383,15 +383,26 @@ set g_balance_crylink_secondary_line_lifetime 2 // range: 4000 full, fades to 80
 set g_balance_crylink_secondary_line_fadetime 2
 // }}}
 // {{{ nex
-set g_balance_nex_damage 80
-set g_balance_nex_force -300
-set g_balance_nex_refire 1.25
-set g_balance_nex_animtime 0.75
-set g_balance_nex_ammo 5
-set g_balance_nex_damagefalloff_mindist 1000
-set g_balance_nex_damagefalloff_maxdist 3000
-set g_balance_nex_damagefalloff_halflife 4000
-set g_balance_nex_damagefalloff_forcehalflife 4000
+set g_balance_nex_primary_damage 80
+set g_balance_nex_primary_force 200
+set g_balance_nex_primary_refire 1.25
+set g_balance_nex_primary_animtime 0.75
+set g_balance_nex_primary_ammo 5
+set g_balance_nex_primary_damagefalloff_mindist 1000
+set g_balance_nex_primary_damagefalloff_maxdist 3000
+set g_balance_nex_primary_damagefalloff_halflife 4000
+set g_balance_nex_primary_damagefalloff_forcehalflife 4000
+
+set g_balance_nex_secondary 1
+set g_balance_nex_secondary_damage 80
+set g_balance_nex_secondary_force -200
+set g_balance_nex_secondary_refire 1.25
+set g_balance_nex_secondary_animtime 0.75
+set g_balance_nex_secondary_ammo 5
+set g_balance_nex_secondary_damagefalloff_mindist 1000
+set g_balance_nex_secondary_damagefalloff_maxdist 3000
+set g_balance_nex_secondary_damagefalloff_halflife 4000
+set g_balance_nex_secondary_damagefalloff_forcehalflife 4000
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1.25
index 1b019d5be89d63aa3caa0b0831fc5005a2b77d8a..fbed63fc40b671ffb09f0d43d11eb5a9eecf5bad 100644 (file)
@@ -259,3 +259,4 @@ string w_deathtypestring;
 vector w_org, w_backoff;
 
 float campingrifle_scope;
+float nex_scope;
index dc1f5bb518d757046dbc355d00182c290f0766fa..78b45fae37864270e14a40aa830643c6cf105a27 100644 (file)
@@ -1281,6 +1281,10 @@ void Net_CampingrifleScope() {
        campingrifle_scope = TRUE;
 }
 
+void Net_NexScope() {
+       nex_scope = TRUE;
+}
+
 // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer.
 // You must ALWAYS first acquire the temporary ID, which is sent as a byte.
 // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event.
@@ -1355,6 +1359,10 @@ float CSQC_Parse_TempEntity()
                        Net_CampingrifleScope();
                        bHandled = true;
                        break;
+               case TE_CSQC_NEX_SCOPE:
+                       Net_NexScope();
+                       bHandled = true;
+                       break;
                default:
                        // No special logic for this temporary entity; return 0 so the engine can handle it
                        bHandled = false;
index bbd337d0fdeef4313bacfbee5595ece88c76c403..05f1fe97e247209bb4be8d83d07966b825c66d1a 100644 (file)
@@ -137,7 +137,7 @@ vector GetCurrentFov(float fov)
                        zoomspeed = 3.5;
 
        zoomdir = button_zoom;
-       if(getstati(STAT_ACTIVEWEAPON) == WEP_NEX || (getstati(STAT_ACTIVEWEAPON) == WEP_CAMPINGRIFLE && campingrifle_scope)) // do NOT use switchweapon here
+       if((getstati(STAT_ACTIVEWEAPON) == WEP_NEX && nex_scope) || (getstati(STAT_ACTIVEWEAPON) == WEP_CAMPINGRIFLE && campingrifle_scope)) // do NOT use switchweapon here
                zoomdir += button_attack2;
        if(spectatee_status > 0 || isdemo())
        {
index 7a5cf3447b1a29d502953812c276d533bb8fbb78..53f37bcdd2c48d5bb9b12a0157d926687a41f3d3 100644 (file)
@@ -60,6 +60,7 @@ const float TE_CSQC_TARGET_MUSIC = 111;
 const float TE_CSQC_NOTIFY = 112;
 const float TE_CSQC_WEAPONCOMPLAIN = 113;
 const float TE_CSQC_CAMPINGRIFLE_SCOPE = 115;
+const float TE_CSQC_NEX_SCOPE = 116;
 
 const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
 const float RACE_NET_CHECKPOINT_CLEAR = 1;
index aee2a80a28e1aad32baa97fb357db263ae8cdb26..389341f2382185e73b5d5c9a32b9735aa919e15c 100644 (file)
@@ -16,15 +16,40 @@ void SendCSQCNexBeamParticle() {
        WriteCoord(MSG_BROADCAST, v_z);
 }
 
-void W_Nex_Attack (void)
+void W_Nex_Attack (float issecondary)
 {
+       float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo;
+       if(issecondary)
+       {
+               mydmg = cvar("g_balance_nex_secondary_damage");
+               myforce = cvar("g_balance_nex_secondary_force");
+               mymindist = cvar("g_balance_nex_secondary_damagefalloff_mindist");
+               mymaxdist = cvar("g_balance_nex_secondary_damagefalloff_maxdist");
+               myhalflife = cvar("g_balance_nex_secondary_damagefalloff_halflife");
+               myforcehalflife = cvar("g_balance_nex_secondary_damagefalloff_forcehalflife");
+               myammo = cvar("g_balance_nex_secondary_ammo");
+       }
+       else
+       {
+               mydmg = cvar("g_balance_nex_primary_damage");
+               myforce = cvar("g_balance_nex_primary_force");
+               mymindist = cvar("g_balance_nex_primary_damagefalloff_mindist");
+               mymaxdist = cvar("g_balance_nex_primary_damagefalloff_maxdist");
+               myhalflife = cvar("g_balance_nex_primary_damagefalloff_halflife");
+               myforcehalflife = cvar("g_balance_nex_primary_damagefalloff_forcehalflife");
+               myammo = cvar("g_balance_nex_primary_ammo");
+       }
+
        float flying;
        flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
 
-       W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", cvar("g_balance_nex_damage"));
+       W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", mydmg);
 
        yoda = 0;
-       FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, cvar("g_balance_nex_damage"), cvar("g_balance_nex_force"), cvar("g_balance_nex_damagefalloff_mindist"), cvar("g_balance_nex_damagefalloff_maxdist"), cvar("g_balance_nex_damagefalloff_halflife"), cvar("g_balance_nex_damagefalloff_forcehalflife"), WEP_NEX);
+       if(issecondary) // reverse effects
+               FireRailgunBullet (w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, w_shotorg, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_NEX);
+       else
+               FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_NEX);
 
        if(yoda && flying)
                AnnounceTo(self, "yoda");
@@ -34,26 +59,52 @@ void W_Nex_Attack (void)
        
        // flash and burn the wall
        if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
-               Damage_DamageInfo(trace_endpos, cvar("g_balance_nex_damage"), 0, 0, cvar("g_balance_nex_force") * w_shotdir, WEP_NEX, self);
+               Damage_DamageInfo(trace_endpos, mydmg, 0, 0, myforce * w_shotdir, WEP_NEX, self);
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_cells = self.ammo_cells - cvar("g_balance_nex_ammo");
+               self.ammo_cells = self.ammo_cells - myammo;
 }
 
 void spawnfunc_weapon_nex (void); // defined in t_items.qc
 
+.float sent_nex_scope;
 float w_nex(float req)
 {
        if (req == WR_AIM)
+       {
                self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
+               self.BUTTON_ATCK2 = bot_aim(1000000, 0, 1, FALSE);
+       }
        else if (req == WR_THINK)
        {
                if (self.BUTTON_ATCK)
                {
-                       if (weapon_prepareattack(0, cvar("g_balance_nex_refire")))
+                       if (weapon_prepareattack(0, cvar("g_balance_nex_primary_refire")))
+                       {
+                               W_Nex_Attack(0);
+                               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_primary_animtime"), w_ready);
+                       }
+               }
+               if (self.BUTTON_ATCK2)
+               {
+                       if(cvar("g_balance_nex_secondary"))
+                       {
+                               if (weapon_prepareattack(0, cvar("g_balance_nex_secondary_refire")))
+                               {
+                                       W_Nex_Attack(1);
+                                       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_secondary_animtime"), w_ready);
+                               }
+                       }
+                       else
                        {
-                               W_Nex_Attack();
-                               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_animtime"), w_ready);
+                               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;
+                               }       
                        }
                }
        }
@@ -71,9 +122,9 @@ float w_nex(float req)
        else if (req == WR_SETUP)
                weapon_setup(WEP_NEX);
        else if (req == WR_CHECKAMMO1)
-               return self.ammo_cells >= cvar("g_balance_nex_ammo");
+               return self.ammo_cells >= cvar("g_balance_nex_primary_ammo");
        else if (req == WR_CHECKAMMO2)
-               return FALSE;
+               return self.ammo_cells >= cvar("g_balance_nex_secondary_ammo");
        return TRUE;
 };
 #endif