From: Samual Lenks Date: Sat, 7 Dec 2013 22:41:02 +0000 (-0500) Subject: Further cleanup of laser, plus remove useless mode declarations X-Git-Tag: xonotic-v0.8.0~152^2~313 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3db71d686c46fd1c341ff4fcbc9c62656ae3d27a;p=xonotic%2Fxonotic-data.pk3dir.git Further cleanup of laser, plus remove useless mode declarations --- diff --git a/qcsrc/common/weapons/w_blaster.qc b/qcsrc/common/weapons/w_blaster.qc index b1e6b279d..cac732c8b 100644 --- a/qcsrc/common/weapons/w_blaster.qc +++ b/qcsrc/common/weapons/w_blaster.qc @@ -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; diff --git a/qcsrc/common/weapons/w_minstanex.qc b/qcsrc/common/weapons/w_minstanex.qc index b7adc5207..15c33942f 100644 --- a/qcsrc/common/weapons/w_minstanex.qc +++ b/qcsrc/common/weapons/w_minstanex.qc @@ -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 diff --git a/qcsrc/common/weapons/weapons.qh b/qcsrc/common/weapons/weapons.qh index ebb327235..800a49dee 100644 --- a/qcsrc/common/weapons/weapons.qh +++ b/qcsrc/common/weapons/weapons.qh @@ -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 */ diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 22ba25b2c..40d54ff45 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -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;