]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix the last weird hack for vaporizer using blaster for its secondary
authorSamual Lenks <samual@xonotic.org>
Sat, 11 Jan 2014 03:16:08 +0000 (22:16 -0500)
committerSamual Lenks <samual@xonotic.org>
Sat, 11 Jan 2014 03:16:08 +0000 (22:16 -0500)
qcsrc/common/weapons/w_blaster.qc
qcsrc/common/weapons/w_vaporizer.qc

index 89faebb3a1840e6789faa55e9442648b197385fc..eae3ff0d4e95471711e24905f0758a24fb902998 100644 (file)
@@ -80,6 +80,7 @@ void W_Blaster_Think(void)
 }
 
 void W_Blaster_Attack(
+       float atk_deathtype,
        float atk_shotangle,
        float atk_damage,
        float atk_edgedamage,
@@ -121,16 +122,16 @@ void W_Blaster_Attack(
                atk_spread,
                FALSE
        );
-       
+
        missile.angles = vectoangles(missile.velocity);
-       
+
        //missile.glow_color = 250; // 244, 250
        //missile.glow_size = 120;
 
        missile.touch = W_Blaster_Touch;
        missile.flags = FL_PROJECTILE;
        missile.missile_flags = MIF_SPLASH;
-       missile.projectiledeathtype = WEP_BLASTER
+       missile.projectiledeathtype = atk_deathtype
        missile.think = W_Blaster_Think;
        missile.nextthink = time + atk_delay;
 
@@ -171,6 +172,7 @@ float W_Blaster(float request)
                                if(weapon_prepareattack(0, WEP_CVAR_PRI(blaster, refire)))
                                {
                                        W_Blaster_Attack(
+                                               WEP_BLASTER,
                                                WEP_CVAR_PRI(blaster, shotangle),
                                                WEP_CVAR_PRI(blaster, damage),
                                                WEP_CVAR_PRI(blaster, edgedamage),
@@ -200,6 +202,7 @@ float W_Blaster(float request)
                                                if(weapon_prepareattack(1, WEP_CVAR_SEC(blaster, refire)))
                                                {
                                                        W_Blaster_Attack(
+                                                               WEP_BLASTER | HITTYPE_SECONDARY,
                                                                WEP_CVAR_SEC(blaster, shotangle),
                                                                WEP_CVAR_SEC(blaster, damage),
                                                                WEP_CVAR_SEC(blaster, edgedamage),
index 22fa6efcffff2ebbaf0fd8e9d0d737640617e894..7ad1e1dd8fe4544519cc763a38685b4af87a3fa9 100644 (file)
@@ -161,10 +161,8 @@ float W_Vaporizer(float req)
                                                W_DecreaseAmmo(WEP_CVAR_SEC(vaporizer, ammo));
 
                                        // ugly minstagib hack to reuse the fire mode of the laser
-                                       float w;
-                                       w = self.weapon;
-                                       self.weapon = WEP_BLASTER;
                                        W_Blaster_Attack(
+                                               WEP_VAPORIZER | HITTYPE_SECONDARY,
                                                WEP_CVAR_SEC(vaporizer, shotangle),
                                                WEP_CVAR_SEC(vaporizer, damage),
                                                WEP_CVAR_SEC(vaporizer, edgedamage),
@@ -175,7 +173,6 @@ float W_Vaporizer(float req)
                                                WEP_CVAR_SEC(vaporizer, delay),
                                                WEP_CVAR_SEC(vaporizer, lifetime)
                                        );
-                                       self.weapon = w;
                                        
                                        // now do normal refire
                                        weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(vaporizer, animtime), w_ready);
@@ -260,14 +257,21 @@ float W_Vaporizer(float req)
                {
                        vector org2;
                        org2 = w_org + w_backoff * 6;
-                       pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
-                       if(!w_issilent)
-                               sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
-                               
+                       if(w_deathtype & HITTYPE_SECONDARY)
+                       {
+                               pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1);
+                               if(!w_issilent) { sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM); }
+                       }
+                       else
+                       {
+                               pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
+                               if(!w_issilent) { sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM); }
+                       }
                        return TRUE;
                }
                case WR_INIT:
                {
+                       precache_sound("weapons/laserimpact.wav");
                        precache_sound("weapons/neximpact.wav");
                        if(autocvar_cl_reticle && autocvar_cl_reticle_weapon)
                        {