REGISTER_WEAPON(
/* WEP_##id */ UZI,
/* function */ w_uzi,
-/* ammotype */ IT_NAILS,
+/* ammotype */ ammo_nails,
/* impulse */ 3,
-/* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
+/* flags */ WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
/* rating */ BOT_PICKUP_RATING_MID,
/* model */ "uzi",
/* netname */ "uzi",
/* fullname */ _("Machine Gun")
);
-#define UZI_SETTINGS(weapon) \
- WEP_ADD_CVAR(weapon, MO_NONE, speed) \
- WEP_ADD_CVAR(weapon, MO_NONE, spread_min) \
- WEP_ADD_CVAR(weapon, MO_NONE, spread_max) \
- WEP_ADD_CVAR(weapon, MO_NONE, spread_add) \
- WEP_ADD_CVAR(weapon, MO_NONE, mode) \
- WEP_ADD_CVAR(weapon, MO_NONE, bulletconstant) \
- WEP_ADD_CVAR(weapon, MO_NONE, first) \
- WEP_ADD_CVAR(weapon, MO_NONE, first_damage) \
- WEP_ADD_CVAR(weapon, MO_NONE, first_force) \
- WEP_ADD_CVAR(weapon, MO_NONE, first_refire) \
- WEP_ADD_CVAR(weapon, MO_NONE, first_spread) \
- WEP_ADD_CVAR(weapon, MO_NONE, first_ammo) \
- WEP_ADD_CVAR(weapon, MO_NONE, sustained_damage) \
- WEP_ADD_CVAR(weapon, MO_NONE, sustained_force) \
- WEP_ADD_CVAR(weapon, MO_NONE, sustained_refire) \
- WEP_ADD_CVAR(weapon, MO_NONE, sustained_spread) \
- WEP_ADD_CVAR(weapon, MO_NONE, sustained_ammo) \
- WEP_ADD_CVAR(weapon, MO_NONE, burst) \
- WEP_ADD_CVAR(weapon, MO_NONE, burst_refire) \
- WEP_ADD_CVAR(weapon, MO_NONE, burst_refire2) \
- WEP_ADD_CVAR(weapon, MO_NONE, burst_animtime) \
- WEP_ADD_CVAR(weapon, MO_NONE, burst_speed) \
- WEP_ADD_CVAR(weapon, MO_NONE, burst_ammo) \
- 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)
+#define UZI_SETTINGS(w_cvar,w_prop) UZI_SETTINGS_LIST(w_cvar, w_prop, UZI, uzi)
+#define UZI_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
+ w_cvar(id, sn, NONE, speed) \
+ w_cvar(id, sn, NONE, spread_min) \
+ w_cvar(id, sn, NONE, spread_max) \
+ w_cvar(id, sn, NONE, spread_add) \
+ w_cvar(id, sn, NONE, mode) \
+ w_cvar(id, sn, NONE, bulletconstant) \
+ w_cvar(id, sn, NONE, first) \
+ w_cvar(id, sn, NONE, first_damage) \
+ w_cvar(id, sn, NONE, first_force) \
+ w_cvar(id, sn, NONE, first_refire) \
+ w_cvar(id, sn, NONE, first_spread) \
+ w_cvar(id, sn, NONE, first_ammo) \
+ w_cvar(id, sn, NONE, sustained_damage) \
+ w_cvar(id, sn, NONE, sustained_force) \
+ w_cvar(id, sn, NONE, sustained_refire) \
+ w_cvar(id, sn, NONE, sustained_spread) \
+ w_cvar(id, sn, NONE, sustained_ammo) \
+ w_cvar(id, sn, NONE, burst) \
+ w_cvar(id, sn, NONE, burst_refire) \
+ w_cvar(id, sn, NONE, burst_refire2) \
+ w_cvar(id, sn, NONE, burst_animtime) \
+ w_cvar(id, sn, NONE, burst_speed) \
+ w_cvar(id, sn, NONE, burst_ammo) \
+ w_prop(id, sn, float, reloading_ammo, reload_ammo) \
+ w_prop(id, sn, float, reloading_time, reload_time) \
+ w_prop(id, sn, float, switchdelay_raise, switchdelay_raise) \
+ w_prop(id, sn, float, switchdelay_drop, switchdelay_drop) \
+ w_prop(id, sn, string, weaponreplace, weaponreplace) \
+ w_prop(id, sn, float, weaponstart, weaponstart) \
+ w_prop(id, sn, float, weaponstartoverride, weaponstartoverride)
#ifdef SVQC
-UZI_SETTINGS(uzi)
+UZI_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
#endif
#else
#ifdef SVQC
void W_UZI_Attack (float deathtype)
{
- W_SetupShot (self, autocvar_g_antilag_bullets && WEP_CVAR(uzi, speed) >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? WEP_CVAR(uzi, first_damage) : WEP_CVAR(uzi, sustained_damage)));
+ W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? WEP_CVAR(uzi, first_damage) : WEP_CVAR(uzi, sustained_damage)));
if (!autocvar_g_norecoil)
{
self.punchangle_x = random () - 0.5;
ATTACK_FINISHED(self) = time + WEP_CVAR(uzi, first_refire) * W_WeaponRateFactor();
if (self.misc_bulletcounter == 1)
- fireBallisticBullet(w_shotorg, w_shotdir, WEP_CVAR(uzi, first_spread), WEP_CVAR(uzi, speed), 5, WEP_CVAR(uzi, first_damage), WEP_CVAR(uzi, first_force), deathtype, 0, 1, WEP_CVAR(uzi, bulletconstant));
+ fireBallisticBullet(w_shotorg, w_shotdir, WEP_CVAR(uzi, first_spread), WEP_CVAR(uzi, speed), 5, WEP_CVAR(uzi, first_damage), WEP_CVAR(uzi, first_force), deathtype, 0, WEP_CVAR(uzi, bulletconstant));
else
- fireBallisticBullet(w_shotorg, w_shotdir, WEP_CVAR(uzi, sustained_spread), WEP_CVAR(uzi, speed), 5, WEP_CVAR(uzi, sustained_damage), WEP_CVAR(uzi, sustained_force), deathtype, 0, 1, WEP_CVAR(uzi, bulletconstant));
+ fireBallisticBullet(w_shotorg, w_shotdir, WEP_CVAR(uzi, sustained_spread), WEP_CVAR(uzi, speed), 5, WEP_CVAR(uzi, sustained_damage), WEP_CVAR(uzi, sustained_force), deathtype, 0, WEP_CVAR(uzi, bulletconstant));
endFireBallisticBullet();
pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
if (self.misc_bulletcounter == 1)
- W_DecreaseAmmo(ammo_nails, WEP_CVAR(uzi, first_ammo), autocvar_g_balance_uzi_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR(uzi, first_ammo));
else
- W_DecreaseAmmo(ammo_nails, WEP_CVAR(uzi, sustained_ammo), autocvar_g_balance_uzi_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR(uzi, sustained_ammo));
}
// weapon frames
if (self.BUTTON_ATCK)
{
if (!WEP_ACTION(self.weapon, WR_CHECKAMMO2))
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
w_ready();
}
if (!WEP_ACTION(self.weapon, WR_CHECKAMMO1))
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
w_ready();
return;
}
- W_DecreaseAmmo(ammo_nails, WEP_CVAR(uzi, sustained_ammo), autocvar_g_balance_uzi_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR(uzi, sustained_ammo));
- W_SetupShot (self, autocvar_g_antilag_bullets && WEP_CVAR(uzi, speed) >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(uzi, sustained_damage));
+ W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(uzi, sustained_damage));
if (!autocvar_g_norecoil)
{
self.punchangle_x = random () - 0.5;
}
uzi_spread = bound(WEP_CVAR(uzi, spread_min), WEP_CVAR(uzi, spread_min) + (WEP_CVAR(uzi, spread_add) * self.misc_bulletcounter), WEP_CVAR(uzi, spread_max));
- fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, WEP_CVAR(uzi, speed), 5, WEP_CVAR(uzi, sustained_damage), WEP_CVAR(uzi, sustained_force), WEP_UZI, 0, 1, WEP_CVAR(uzi, bulletconstant));
+ fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, WEP_CVAR(uzi, speed), 5, WEP_CVAR(uzi, sustained_damage), WEP_CVAR(uzi, sustained_force), WEP_UZI, 0, WEP_CVAR(uzi, bulletconstant));
endFireBallisticBullet();
self.misc_bulletcounter = self.misc_bulletcounter + 1;
void uzi_mode1_fire_burst()
{
- W_SetupShot (self, autocvar_g_antilag_bullets && WEP_CVAR(uzi, speed) >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(uzi, sustained_damage));
+ W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(uzi, sustained_damage));
if (!autocvar_g_norecoil)
{
self.punchangle_x = random () - 0.5;
self.punchangle_y = random () - 0.5;
}
- fireBallisticBullet(w_shotorg, w_shotdir, WEP_CVAR(uzi, burst_speed), WEP_CVAR(uzi, speed), 5, WEP_CVAR(uzi, sustained_damage), WEP_CVAR(uzi, sustained_force), WEP_UZI, 0, 1, WEP_CVAR(uzi, bulletconstant));
+ fireBallisticBullet(w_shotorg, w_shotdir, WEP_CVAR(uzi, burst_speed), WEP_CVAR(uzi, speed), 5, WEP_CVAR(uzi, sustained_damage), WEP_CVAR(uzi, sustained_force), WEP_UZI, 0, WEP_CVAR(uzi, bulletconstant));
endFireBallisticBullet();
if(weapon_prepareattack(1, 0))
{
if (!WEP_ACTION(self.weapon, WR_CHECKAMMO2))
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
w_ready();
return FALSE;
}
- W_DecreaseAmmo(ammo_nails, WEP_CVAR(uzi, burst_ammo), autocvar_g_balance_uzi_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR(uzi, burst_ammo));
self.misc_bulletcounter = WEP_CVAR(uzi, burst) * -1;
uzi_mode1_fire_burst();
precache_model ("models/weapons/v_uzi.md3");
precache_model ("models/weapons/h_uzi.iqm");
precache_sound ("weapons/uzi_fire.wav");
- WEP_SET_PROPS(UZI_SETTINGS(uzi), WEP_UZI)
+ UZI_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
return TRUE;
}
case WR_SETUP:
}
case WR_CONFIG:
{
- WEP_CONFIG_SETTINGS(UZI_SETTINGS(uzi))
+ UZI_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
return TRUE;
}
case WR_RELOAD: