]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use effects system for vehicle muzzle flashes
authorMario <zacjardine@y7mail.com>
Wed, 4 Mar 2015 07:58:37 +0000 (18:58 +1100)
committerMario <zacjardine@y7mail.com>
Wed, 4 Mar 2015 07:58:37 +0000 (18:58 +1100)
qcsrc/common/effects.qh
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/unit/bumblebee.qc
qcsrc/common/vehicles/unit/racer.qc
qcsrc/common/vehicles/unit/raptor.qc
qcsrc/common/vehicles/unit/spiderbot.qc

index 1378e5e1a50b4cc705217fc514f2dae4b7ac4b26..36a568ddbfb6fd32e59c621bb14dca08f4eb270c 100644 (file)
     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") \
index f60d25b30f6efd4506d3fc9d61ea3e405d6b0716..792b2127d2cc382eb020d637a72309b642bbccfc 100644 (file)
@@ -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);
 
index b65a5f8521964226a8e73ba0de78d29247db3379..b2cb1ea03ed8a69936705dac156bed0d0b5d4112 100644 (file)
@@ -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);
index fa9b6c60a3feb30941d690dae578f6fbc9bb6454..860555646aa0694b96346af1880ecdf632636753 100644 (file)
@@ -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);
index 360892665b5e1e43835c2e4b4e6e5ee5a69add54..def794aa6423713e39b56919ab431f65b766193b 100644 (file)
@@ -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);
index d66d979e1217feb9e613ea3633bcbc1619639d57..b8ab1f905b58b3bdb290eddb780cf82b24bea421 100644 (file)
@@ -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);