From a9639f01d55a902f36eb21a84db8ab2cc79a0d39 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 4 Mar 2015 18:58:37 +1100 Subject: [PATCH] Use effects system for vehicle muzzle flashes --- qcsrc/common/effects.qh | 5 +++++ qcsrc/common/vehicles/sv_vehicles.qc | 5 ++--- qcsrc/common/vehicles/unit/bumblebee.qc | 2 +- qcsrc/common/vehicles/unit/racer.qc | 4 ++-- qcsrc/common/vehicles/unit/raptor.qc | 2 +- qcsrc/common/vehicles/unit/spiderbot.qc | 6 +++--- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/qcsrc/common/effects.qh b/qcsrc/common/effects.qh index 1378e5e1a..36a568ddb 100644 --- a/qcsrc/common/effects.qh +++ b/qcsrc/common/effects.qh @@ -26,6 +26,11 @@ EFFECT(0, EFFECT_LASER_MUZZLEFLASH, "laser_muzzleflash") \ EFFECT(0, EFFECT_MACHINEGUN_MUZZLEFLASH, "uzi_muzzleflash") \ EFFECT(0, EFFECT_RIFLE_MUZZLEFLASH, "rifle_muzzleflash") \ + EFFECT(0, EFFECT_RAPTOR_MUZZLEFLASH, "raptor_cannon_muzzleflash") \ + EFFECT(0, EFFECT_RACER_MUZZLEFLASH, "wakizashi_gun_muzzleflash") \ + EFFECT(0, EFFECT_RACER_ROCKETLAUNCH, "wakizashi_rocket_launch") \ + EFFECT(0, EFFECT_SPIDERBOT_ROCKETLAUNCH, "spiderbot_rocket_launch") \ + EFFECT(0, EFFECT_BIGPLASMA_MUZZLEFLASH, "bigplasma_muzzleflash") \ EFFECT(1, EFFECT_RIFLE, "tr_rifle") \ EFFECT(1, EFFECT_RIFLE_WEAK, "tr_rifle_weak") \ EFFECT(0, EFFECT_SEEKER_MUZZLEFLASH, "seeker_muzzleflash") \ diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index f60d25b30..792b2127d 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -214,7 +214,7 @@ void vehicles_projectile_explode() remove (self); } -entity vehicles_projectile(string _mzlfx, string _mzlsound, +entity vehicles_projectile(int _mzlfx, string _mzlsound, vector _org, vector _vel, float _dmg, float _radi, float _force, float _size, float _deahtype, float _projtype, float _health, @@ -257,8 +257,7 @@ entity vehicles_projectile(string _mzlfx, string _mzlsound, sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM); if(_mzlfx) - pointparticles(particleeffectnum(_mzlfx), proj.origin, proj.velocity, 1); - + Send_Effect(_mzlfx, proj.origin, proj.velocity, 1); setsize (proj, '-1 -1 -1' * _size, '1 1 1' * _size); diff --git a/qcsrc/common/vehicles/unit/bumblebee.qc b/qcsrc/common/vehicles/unit/bumblebee.qc index b65a5f852..b2cb1ea03 100644 --- a/qcsrc/common/vehicles/unit/bumblebee.qc +++ b/qcsrc/common/vehicles/unit/bumblebee.qc @@ -95,7 +95,7 @@ float bumble_raygun_send(entity to, int sf); void bumblebee_fire_cannon(entity _gun, string _tagname, entity _owner) { vector v = gettaginfo(_gun, gettagindex(_gun, _tagname)); - vehicles_projectile("bigplasma_muzzleflash", W_Sound("flacexp3"), + vehicles_projectile(EFFECT_BIGPLASMA_MUZZLEFLASH, W_Sound("flacexp3"), v, normalize(v_forward + randomvec() * autocvar_g_vehicle_bumblebee_cannon_spread) * autocvar_g_vehicle_bumblebee_cannon_speed, autocvar_g_vehicle_bumblebee_cannon_damage, autocvar_g_vehicle_bumblebee_cannon_radius, autocvar_g_vehicle_bumblebee_cannon_force, 0, DEATH_VH_BUMB_GUN, PROJECTILE_BUMBLE_GUN, 0, true, true, _owner); diff --git a/qcsrc/common/vehicles/unit/racer.qc b/qcsrc/common/vehicles/unit/racer.qc index fa9b6c60a..860555646 100644 --- a/qcsrc/common/vehicles/unit/racer.qc +++ b/qcsrc/common/vehicles/unit/racer.qc @@ -163,7 +163,7 @@ void racer_fire_cannon(string tagname) entity bolt; v = gettaginfo(self, gettagindex(self, tagname)); - bolt = vehicles_projectile("wakizashi_gun_muzzleflash", W_Sound("lasergun_fire"), + bolt = vehicles_projectile(EFFECT_RACER_MUZZLEFLASH, W_Sound("lasergun_fire"), v, normalize(v_forward + randomvec() * autocvar_g_vehicle_racer_cannon_spread) * autocvar_g_vehicle_racer_cannon_speed, autocvar_g_vehicle_racer_cannon_damage, autocvar_g_vehicle_racer_cannon_radius, autocvar_g_vehicle_racer_cannon_force, 0, DEATH_VH_WAKI_GUN, PROJECTILE_WAKICANNON, 0, true, true, self.owner); @@ -281,7 +281,7 @@ void racer_rocket_tracker() void racer_fire_rocket(string tagname, entity trg) { vector v = gettaginfo(self, gettagindex(self, tagname)); - entity rocket = vehicles_projectile("wakizashi_rocket_launch", W_Sound("rocket_fire"), + entity rocket = vehicles_projectile(EFFECT_RACER_ROCKETLAUNCH, W_Sound("rocket_fire"), v, v_forward * autocvar_g_vehicle_racer_rocket_speed, autocvar_g_vehicle_racer_rocket_damage, autocvar_g_vehicle_racer_rocket_radius, autocvar_g_vehicle_racer_rocket_force, 3, DEATH_VH_WAKI_ROCKET, PROJECTILE_WAKIROCKET, 20, false, false, self.owner); diff --git a/qcsrc/common/vehicles/unit/raptor.qc b/qcsrc/common/vehicles/unit/raptor.qc index 360892665..def794aa6 100644 --- a/qcsrc/common/vehicles/unit/raptor.qc +++ b/qcsrc/common/vehicles/unit/raptor.qc @@ -191,7 +191,7 @@ void raptor_bombdrop() void raptor_fire_cannon(entity gun, string tagname) { - vehicles_projectile("raptor_cannon_muzzleflash", W_Sound("lasergun_fire"), + vehicles_projectile(EFFECT_RAPTOR_MUZZLEFLASH, W_Sound("lasergun_fire"), gettaginfo(gun, gettagindex(gun, tagname)), normalize(v_forward + randomvec() * autocvar_g_vehicle_raptor_cannon_spread) * autocvar_g_vehicle_raptor_cannon_speed, autocvar_g_vehicle_raptor_cannon_damage, autocvar_g_vehicle_raptor_cannon_radius, autocvar_g_vehicle_raptor_cannon_force, 0, DEATH_VH_RAPT_CANNON, PROJECTILE_RAPTORCANNON, 0, true, true, self.owner); diff --git a/qcsrc/common/vehicles/unit/spiderbot.qc b/qcsrc/common/vehicles/unit/spiderbot.qc index d66d979e1..b8ab1f905 100644 --- a/qcsrc/common/vehicles/unit/spiderbot.qc +++ b/qcsrc/common/vehicles/unit/spiderbot.qc @@ -261,7 +261,7 @@ void spiderbot_rocket_do() switch(self.vehicle_weapon2mode) { case SBRM_VOLLY: - rocket = vehicles_projectile("spiderbot_rocket_launch", W_Sound("rocket_fire"), + rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH, W_Sound("rocket_fire"), v, normalize(randomvec() * autocvar_g_vehicle_spiderbot_rocket_spread + v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed, autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1, DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner); @@ -275,7 +275,7 @@ void spiderbot_rocket_do() self.wait = -10; break; case SBRM_GUIDE: - rocket = vehicles_projectile("spiderbot_rocket_launch", W_Sound("rocket_fire"), + rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH, W_Sound("rocket_fire"), v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed, autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1, DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, false, self.owner); @@ -287,7 +287,7 @@ void spiderbot_rocket_do() break; case SBRM_ARTILLERY: - rocket = vehicles_projectile("spiderbot_rocket_launch", W_Sound("rocket_fire"), + rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH, W_Sound("rocket_fire"), v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed, autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1, DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner); -- 2.39.2