/* netname */ "hlac",
/* fullname */ _("Heavy Laser Assault Cannon")
);
-#else
+
+#define HLAC_SETTINGS(weapon) \
+ WEP_ADD_CVAR(weapon, MO_BOTH, ammo) \
+ WEP_ADD_CVAR(weapon, MO_BOTH, animtime) \
+ WEP_ADD_CVAR(weapon, MO_BOTH, damage) \
+ WEP_ADD_CVAR(weapon, MO_BOTH, edgedamage) \
+ WEP_ADD_CVAR(weapon, MO_BOTH, force) \
+ WEP_ADD_CVAR(weapon, MO_BOTH, lifetime) \
+ WEP_ADD_CVAR(weapon, MO_BOTH, radius) \
+ WEP_ADD_CVAR(weapon, MO_BOTH, refire) \
+ WEP_ADD_CVAR(weapon, MO_BOTH, speed) \
+ WEP_ADD_CVAR(weapon, MO_BOTH, spread_crouchmod) \
+ WEP_ADD_CVAR(weapon, MO_PRI, spread_add) \
+ WEP_ADD_CVAR(weapon, MO_PRI, spread_max) \
+ WEP_ADD_CVAR(weapon, MO_PRI, spread_min) \
+ WEP_ADD_CVAR(weapon, MO_NONE, secondary) \
+ WEP_ADD_CVAR(weapon, MO_SEC, shots) \
+ WEP_ADD_CVAR(weapon, MO_SEC, spread) \
+ WEP_ADD_PROP(weapon, reloading_ammo, reload_ammo) \
+ WEP_ADD_PROP(weapon, reloading_time, reload_time) \
+ WEP_ADD_PROP(weapon, switchdelay_raise, switchdelay_raise) \
+ WEP_ADD_PROP(weapon, switchdelay_drop, switchdelay_drop)
+
#ifdef SVQC
+HLAC_SETTINGS(hlac)
void spawnfunc_weapon_hlac() { weapon_defaultspawnfunc(WEP_HLAC); }
+#endif
+#else
+#ifdef SVQC
void W_HLAC_Touch (void)
{
+ float isprimary;
+
PROJECTILE_TOUCH;
self.event_damage = func_null;
- if(self.projectiledeathtype & HITTYPE_SECONDARY)
- RadiusDamage (self, self.realowner, autocvar_g_balance_hlac_secondary_damage, autocvar_g_balance_hlac_secondary_edgedamage, autocvar_g_balance_hlac_secondary_radius, world, world, autocvar_g_balance_hlac_secondary_force, self.projectiledeathtype, other);
- else
- RadiusDamage (self, self.realowner, autocvar_g_balance_hlac_primary_damage, autocvar_g_balance_hlac_primary_edgedamage, autocvar_g_balance_hlac_primary_radius, world, world, autocvar_g_balance_hlac_primary_force, self.projectiledeathtype, other);
+ isprimary = !(self.projectiledeathtype & HITTYPE_SECONDARY);
+
+ RadiusDamage(self, self.realowner, WEP_CVAR_BOTH(hlac, isprimary, damage), WEP_CVAR_BOTH(hlac, isprimary, edgedamage), WEP_CVAR_BOTH(hlac, isprimary, radius), world, world, WEP_CVAR_BOTH(hlac, isprimary, force), self.projectiledeathtype, other);
remove (self);
}
entity missile;
float spread;
- W_DecreaseAmmo(ammo_cells, autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_reload_ammo);
+ W_DecreaseAmmo(ammo_cells, WEP_CVAR_PRI(hlac, ammo), autocvar_g_balance_hlac_reload_ammo);
- spread = autocvar_g_balance_hlac_primary_spread_min + (autocvar_g_balance_hlac_primary_spread_add * self.misc_bulletcounter);
- spread = min(spread,autocvar_g_balance_hlac_primary_spread_max);
+ spread = WEP_CVAR_PRI(hlac, spread_min) + (WEP_CVAR_PRI(hlac, spread_add) * self.misc_bulletcounter);
+ spread = min(spread,WEP_CVAR_PRI(hlac, spread_max));
if(self.crouch)
- spread = spread * autocvar_g_balance_hlac_primary_spread_crouchmod;
+ spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod);
- W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, autocvar_g_balance_hlac_primary_damage);
+ W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage));
pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
if (!g_norecoil)
{
missile.classname = "hlacbolt";
missile.bot_dodge = TRUE;
- missile.bot_dodgerating = autocvar_g_balance_hlac_primary_damage;
+ missile.bot_dodgerating = WEP_CVAR_PRI(hlac, damage);
missile.movetype = MOVETYPE_FLY;
PROJECTILE_MAKETRIGGER(missile);
setorigin (missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
- W_SetupProjectileVelocity(missile, autocvar_g_balance_hlac_primary_speed, spread);
+ W_SetupProjectileVelocity(missile, WEP_CVAR_PRI(hlac, speed), spread);
//missile.angles = vectoangles (missile.velocity); // csqc
missile.touch = W_HLAC_Touch;
missile.think = SUB_Remove;
- missile.nextthink = time + autocvar_g_balance_hlac_primary_lifetime;
+ missile.nextthink = time + WEP_CVAR_PRI(hlac, lifetime);
missile.flags = FL_PROJECTILE;
missile.projectiledeathtype = WEP_HLAC;
entity missile;
float spread;
- spread = autocvar_g_balance_hlac_secondary_spread;
+ spread = WEP_CVAR_SEC(hlac, spread);
if(self.crouch)
- spread = spread * autocvar_g_balance_hlac_secondary_spread_crouchmod;
+ spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod);
- W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, autocvar_g_balance_hlac_secondary_damage);
+ W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage));
pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = spawn ();
missile.classname = "hlacbolt";
missile.bot_dodge = TRUE;
- missile.bot_dodgerating = autocvar_g_balance_hlac_secondary_damage;
+ missile.bot_dodgerating = WEP_CVAR_SEC(hlac, damage);
missile.movetype = MOVETYPE_FLY;
PROJECTILE_MAKETRIGGER(missile);
setorigin (missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
- W_SetupProjectileVelocity(missile, autocvar_g_balance_hlac_secondary_speed, spread);
+ W_SetupProjectileVelocity(missile, WEP_CVAR_SEC(hlac, speed), spread);
//missile.angles = vectoangles (missile.velocity); // csqc
missile.touch = W_HLAC_Touch;
missile.think = SUB_Remove;
- missile.nextthink = time + autocvar_g_balance_hlac_secondary_lifetime;
+ missile.nextthink = time + WEP_CVAR_SEC(hlac, lifetime);
missile.flags = FL_PROJECTILE;
missile.missile_flags = MIF_SPLASH;
{
float i;
- W_DecreaseAmmo(ammo_cells, autocvar_g_balance_hlac_secondary_ammo, autocvar_g_balance_hlac_reload_ammo);
+ W_DecreaseAmmo(ammo_cells, WEP_CVAR_SEC(hlac, ammo), autocvar_g_balance_hlac_reload_ammo);
- for(i=autocvar_g_balance_hlac_secondary_shots;i>0;--i)
+ for(i=WEP_CVAR_SEC(hlac, shots);i>0;--i)
W_HLAC_Attack2f();
if (!g_norecoil)
return;
}
- ATTACK_FINISHED(self) = time + autocvar_g_balance_hlac_primary_refire * W_WeaponRateFactor();
+ ATTACK_FINISHED(self) = time + WEP_CVAR_PRI(hlac, refire) * W_WeaponRateFactor();
W_HLAC_Attack();
self.misc_bulletcounter = self.misc_bulletcounter + 1;
- weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_refire, HLAC_fire1_02);
+ weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(hlac, refire), HLAC_fire1_02);
}
else
{
- weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_animtime, w_ready);
+ weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(hlac, animtime), w_ready);
}
}
{
case WR_AIM:
{
- self.BUTTON_ATCK = bot_aim(autocvar_g_balance_hlac_primary_speed, 0, autocvar_g_balance_hlac_primary_lifetime, FALSE);
+ self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), FALSE);
return TRUE;
}
case WR_THINK:
{
- if(autocvar_g_balance_hlac_reload_ammo && self.clip_load < min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo)) // forced reload
+ if(autocvar_g_balance_hlac_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo))) // forced reload
WEP_ACTION(self.weapon, WR_RELOAD);
else if (self.BUTTON_ATCK)
{
- if (weapon_prepareattack(0, autocvar_g_balance_hlac_primary_refire))
+ if (weapon_prepareattack(0, WEP_CVAR_PRI(hlac, refire)))
{
self.misc_bulletcounter = 0;
W_HLAC_Attack();
- weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_refire, HLAC_fire1_02);
+ weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(hlac, refire), HLAC_fire1_02);
}
}
- else if (self.BUTTON_ATCK2 && autocvar_g_balance_hlac_secondary)
+ else if (self.BUTTON_ATCK2 && WEP_CVAR(hlac, secondary))
{
- if (weapon_prepareattack(1, autocvar_g_balance_hlac_secondary_refire))
+ if (weapon_prepareattack(1, WEP_CVAR_SEC(hlac, refire)))
{
W_HLAC_Attack2();
- weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hlac_secondary_animtime, w_ready);
+ weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hlac, animtime), w_ready);
}
}
precache_model ("models/weapons/v_hlac.md3");
precache_model ("models/weapons/h_hlac.iqm");
precache_sound ("weapons/lasergun_fire.wav");
+ WEP_SET_PROPS(HLAC_SETTINGS(hlac), WEP_HLAC)
return TRUE;
}
case WR_SETUP:
}
case WR_CHECKAMMO1:
{
- ammo_amount = self.ammo_cells >= autocvar_g_balance_hlac_primary_ammo;
- ammo_amount += self.(weapon_load[WEP_HLAC]) >= autocvar_g_balance_hlac_primary_ammo;
+ ammo_amount = self.ammo_cells >= WEP_CVAR_PRI(hlac, ammo);
+ ammo_amount += self.(weapon_load[WEP_HLAC]) >= WEP_CVAR_PRI(hlac, ammo);
return ammo_amount;
}
case WR_CHECKAMMO2:
{
- ammo_amount = self.ammo_cells >= autocvar_g_balance_hlac_secondary_ammo;
- ammo_amount += self.(weapon_load[WEP_HLAC]) >= autocvar_g_balance_hlac_secondary_ammo;
+ ammo_amount = self.ammo_cells >= WEP_CVAR_SEC(hlac, ammo);
+ ammo_amount += self.(weapon_load[WEP_HLAC]) >= WEP_CVAR_SEC(hlac, ammo);
return ammo_amount;
}
+ case WR_CONFIG:
+ {
+ WEP_CONFIG_SETTINGS(HLAC_SETTINGS(hlac))
+ return TRUE;
+ }
case WR_RELOAD:
{
- W_Reload(min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo), autocvar_g_balance_hlac_reload_ammo, autocvar_g_balance_hlac_reload_time, "weapons/reload.wav");
+ W_Reload(min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo)), autocvar_g_balance_hlac_reload_ammo, autocvar_g_balance_hlac_reload_time, "weapons/reload.wav");
return TRUE;
}
case WR_SUICIDEMESSAGE: