]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Further cleanup of laser, plus remove useless mode declarations
authorSamual Lenks <samual@xonotic.org>
Sat, 7 Dec 2013 22:41:02 +0000 (17:41 -0500)
committerSamual Lenks <samual@xonotic.org>
Sat, 7 Dec 2013 22:41:02 +0000 (17:41 -0500)
qcsrc/common/weapons/w_blaster.qc
qcsrc/common/weapons/w_minstanex.qc
qcsrc/common/weapons/weapons.qh
qcsrc/server/autocvars.qh

index b1e6b279d2cfd90f1b0e47f1734751b237289d7e..cac732c8bbe12234e03d97bc78ca30a4e074982a 100644 (file)
@@ -13,25 +13,6 @@ REGISTER_WEAPON(
 #else
 #ifdef SVQC
 void spawnfunc_weapon_laser() { weapon_defaultspawnfunc(WEP_LASER); }
-void(float imp) W_SwitchWeapon;
-void() W_LastWeapon;
-
-void SendCSQCShockwaveParticle(vector endpos) 
-{
-       //endpos = WarpZone_UnTransformOrigin(transform, endpos);
-       
-       WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
-       WriteByte(MSG_BROADCAST, TE_CSQC_SHOCKWAVEPARTICLE);
-       WriteCoord(MSG_BROADCAST, w_shotorg_x);
-       WriteCoord(MSG_BROADCAST, w_shotorg_y);
-       WriteCoord(MSG_BROADCAST, w_shotorg_z);
-       WriteCoord(MSG_BROADCAST, endpos_x);
-       WriteCoord(MSG_BROADCAST, endpos_y);
-       WriteCoord(MSG_BROADCAST, endpos_z);
-       WriteByte(MSG_BROADCAST, bound(0, autocvar_g_balance_laser_shockwave_spread_max, 255));
-       WriteByte(MSG_BROADCAST, bound(0, autocvar_g_balance_laser_shockwave_spread_min, 255));
-       WriteByte(MSG_BROADCAST, num_for_edict(self));
-}
 
 void W_Laser_Touch()
 {
@@ -113,18 +94,22 @@ void W_Laser_Attack(float issecondary)
                self = oldself;
        }
 }
-void W_Laser_Shockwave(void);
-void W_Laser_Melee(void);
 float W_Laser(float request)
 {
        switch(request)
        {
                case WR_AIM:
                {
-                       if((autocvar_g_balance_laser_secondary == 2) && (vlen(self.origin-self.enemy.origin) <= autocvar_g_balance_laser_melee_range))
-                               self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE);
+                       if(autocvar_g_balance_laser_secondary)
+                       {
+                               if((random() * (autocvar_g_balance_laser_primary_damage + autocvar_g_balance_laser_secondary_damage)) > autocvar_g_balance_laser_primary_damage)
+                                       { self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_laser_secondary_speed, 0, autocvar_g_balance_laser_secondary_lifetime, FALSE); }
+                               else
+                                       { self.BUTTON_ATCK = bot_aim(autocvar_g_balance_laser_primary_speed, 0, autocvar_g_balance_laser_primary_lifetime, FALSE); }
+                       }
                        else
-                               self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
+                               { self.BUTTON_ATCK = bot_aim(autocvar_g_balance_laser_primary_speed, 0, autocvar_g_balance_laser_primary_lifetime, FALSE); }
+
                        return TRUE;
                }
                
@@ -136,13 +121,8 @@ float W_Laser(float request)
                        {
                                if(weapon_prepareattack(0, autocvar_g_balance_laser_primary_refire))
                                {
-                                       W_DecreaseAmmo(ammo_none, 1, TRUE);
-
-                                       if not(autocvar_g_balance_laser_primary)
-                                               W_Laser_Shockwave();
-                                       else
-                                               W_Laser_Attack(FALSE);
-
+                                       W_DecreaseAmmo(ammo_none, 1, TRUE); // WEAPONTODO is this necessary?
+                                       W_Laser_Attack(FALSE);
                                        weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_laser_primary_animtime, w_ready);
                                }
                        }
@@ -154,7 +134,6 @@ float W_Laser(float request)
                                        {
                                                if(self.switchweapon == WEP_LASER) // don't do this if already switching
                                                        W_LastWeapon();
-
                                                break;
                                        }
 
@@ -169,17 +148,6 @@ float W_Laser(float request)
 
                                                break;
                                        }
-
-                                       case 2: // melee attack secondary
-                                       {
-                                               if(!self.crouch) // we are not currently crouching; this fixes an exploit where your melee anim is not visible, and besides wouldn't make much sense
-                                               if(weapon_prepareattack(1, autocvar_g_balance_laser_melee_refire))
-                                               {
-                                                       // attempt forcing playback of the anim by switching to another anim (that we never play) here...
-                                                       W_Laser_Melee();
-                                                       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_laser_melee_animtime, w_ready);
-                                               }
-                                       }
                                }
                        }
                        return TRUE;
index b7adc5207a7b8ecd0c75aec1a1a15e925a089e9b..15c33942f33a6447d3883a43a5afb6695c7e7cdb 100644 (file)
@@ -132,7 +132,7 @@ float w_minstanex(float req)
                                        float w;
                                        w = self.weapon;
                                        self.weapon = WEP_LASER;
-                                       W_Laser_Shockwave();
+                                       W_Laser_Attack(FALSE);
                                        self.weapon = w;
                                        
                                        // now do normal refire
index ebb327235777aa298df311464ce00182658bf7fc..800a49dee52663df324f57d7ce65451abf1ebf57 100644 (file)
@@ -147,11 +147,6 @@ float W_AmmoItemCode(float wpn);
 //  Weapon Registration
 // =====================
 
-#define MO_NONE 0
-#define MO_PRI 1
-#define MO_SEC 2
-#define MO_BOTH 3
-
 // create cvars for weapon settings
 #define WEP_ADD_CVAR_MO_PRI(wepname,name) final float autocvar_g_balance_##wepname##_primary_##name;
 #define WEP_ADD_CVAR_MO_SEC(wepname,name) final float autocvar_g_balance_##wepname##_secondary_##name;
@@ -170,7 +165,7 @@ float W_AmmoItemCode(float wpn);
 #define WEP_CVAR(wepname,name) autocvar_g_balance_##wepname##_##name
 #define WEP_CVAR_PRI(wepname,name) WEP_CVAR(wepname, primary_##name)
 #define WEP_CVAR_SEC(wepname,name) WEP_CVAR(wepname, secondary_##name)
-#define WEP_CVAR_BOTH(wepname,mode,name) ((mode == MO_PRI) ? WEP_CVAR_PRI(wepname, name) : WEP_CVAR_SEC(wepname, name))
+#define WEP_CVAR_BOTH(wepname,isprimary,name) ((isprimary) ? WEP_CVAR_PRI(wepname, name) : WEP_CVAR_SEC(wepname, name))
 
 // set initialization values for weapon settings
 #define WEP_SKIPCVAR(unuseda,unusedb,unusedc,unusedd) /* skip cvars */
index 22ba25b2c230b4f12ce7feb77b0471fd0c398d72..40d54ff45e9ae2e9dde058cc555e3cd956b9e4a2 100644 (file)
@@ -180,20 +180,20 @@ float autocvar_g_balance_keyhunt_score_push;
 float autocvar_g_balance_keyhunt_throwvelocity;
 float autocvar_g_balance_kill_delay;
 float autocvar_g_balance_kill_antispam;
-float autocvar_g_balance_laser_melee_animtime;
+//float autocvar_g_balance_laser_melee_animtime;
 //float autocvar_g_balance_laser_melee_damage; // WEAPONTODO
 //float autocvar_g_balance_laser_melee_delay;
 //float autocvar_g_balance_laser_melee_force;
 //float autocvar_g_balance_laser_melee_multihit;
 //float autocvar_g_balance_laser_melee_no_doubleslap;
 //float autocvar_g_balance_laser_melee_nonplayerdamage;
-float autocvar_g_balance_laser_melee_range;
-float autocvar_g_balance_laser_melee_refire;
+//float autocvar_g_balance_laser_melee_range;
+//float autocvar_g_balance_laser_melee_refire;
 //float autocvar_g_balance_laser_melee_swing_side;
 //float autocvar_g_balance_laser_melee_swing_up;
 //float autocvar_g_balance_laser_melee_time;
 //float autocvar_g_balance_laser_melee_traces;
-float autocvar_g_balance_laser_primary;
+//float autocvar_g_balance_laser_primary;
 float autocvar_g_balance_laser_primary_animtime;
 float autocvar_g_balance_laser_primary_damage;
 float autocvar_g_balance_laser_primary_delay;
@@ -220,7 +220,7 @@ float autocvar_g_balance_laser_secondary_force;
 float autocvar_g_balance_laser_secondary_lifetime;
 float autocvar_g_balance_laser_secondary_radius;
 float autocvar_g_balance_laser_secondary_refire;
-//float autocvar_g_balance_laser_secondary_speed;
+float autocvar_g_balance_laser_secondary_speed;
 //float autocvar_g_balance_laser_shockwave_damage;
 //float autocvar_g_balance_laser_shockwave_distance;
 //float autocvar_g_balance_laser_shockwave_edgedamage;
@@ -247,8 +247,8 @@ float autocvar_g_balance_laser_secondary_refire;
 //float autocvar_g_balance_laser_shockwave_splash_multiplier_distance;
 //float autocvar_g_balance_laser_shockwave_splash_multiplier_min;
 //float autocvar_g_balance_laser_shockwave_splash_radius;
-float autocvar_g_balance_laser_shockwave_spread_max;
-float autocvar_g_balance_laser_shockwave_spread_min;
+//float autocvar_g_balance_laser_shockwave_spread_max;
+//float autocvar_g_balance_laser_shockwave_spread_min;
 //float autocvar_g_balance_minelayer_reload_ammo;
 float autocvar_g_balance_minstanex_ammo;
 float autocvar_g_balance_minstanex_laser_ammo;