#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()
{
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;
}
{
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);
}
}
{
if(self.switchweapon == WEP_LASER) // don't do this if already switching
W_LastWeapon();
-
break;
}
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;
float w;
w = self.weapon;
self.weapon = WEP_LASER;
- W_Laser_Shockwave();
+ W_Laser_Attack(FALSE);
self.weapon = w;
// now do normal refire
// 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;
#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 */
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;
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;
//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;