]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/tturrets.qc
prepare support for engine side pitch shifting in the tuba
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / tturrets.qc
index fed48da9b7cec5b794c29f367c7711cd4259a229..1332d60ca106f35fd90f1658be69f978b20a22f4 100644 (file)
@@ -34,7 +34,7 @@ void turret_precache(float _tid)
     turret_tid2info(_tid);
     if(turret_is_precache[_tid])
     {
-        dprint("turret_precache: ", tid2info_name, "allready precache, skipping.\n");
+        dprint("turret_precache: ", tid2info_name, " allready precachd, skipping.\n");
         return;
     }
     else
@@ -209,11 +209,24 @@ void turret_draw()
     self.tur_head.angles += dt * self.tur_head.move_avelocity;
 
     if (self.health < 127)
-    if(random() < 0.25)
-        te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);    
+    {
+        dt = random();
+        
+        if(dt < 0.25)
+            te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);    
+        
+    }
+    
+    if(self.health < 85)    
+    if(dt < 0.1)
+        pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1);        
+    
+    if(self.health < 32)
+    if(dt < 0.1)
+        pointparticles(particleeffectnum("smoke_large"), (self.origin + (randomvec() * 80)), '0 0 0', 1);        
+    
 }
 
-
 void turret_walker_draw()
 {        
     float dt;
@@ -310,8 +323,7 @@ void turret_construct()
                 break;
             case TID_WALKER:
                 self.draw               = turret_walker_draw;
-        }
-        
+        }        
     }
 }
 
@@ -343,7 +355,7 @@ void turret_gibboom()
 {
     float i;
     
-    sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+    sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
     pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
 
     for (i = 1; i < 5; i = i + 1)
@@ -387,7 +399,7 @@ void turret_die()
     
     setmodel(self, "");
     setmodel(self.tur_head, "");
-    sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+    sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
     pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
     turret_tid2info(self.turret_type);
     dprint("Turret ", tid2info_name, " dies.\n");
@@ -486,8 +498,9 @@ void ent_turret()
             self.team = _team;
             turret_changeteam();        
         }
+        
+        if(self.health == 0)
+            turret_die();
     } 
     
-    if(self.health == 0)
-        turret_die();
 }