]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/unit/plasma_dual.qc
Merge branch 'master' into Mario/turrets
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / unit / plasma_dual.qc
index 58424781076c62c779058df43d9a6617f8d3ffff..110ae1dea7d26075ef64665e8ae69af027b7d13a 100644 (file)
@@ -9,17 +9,9 @@ REGISTER_TURRET(
 /* netname       */ "plasma_dual",
 /* fullname   */ _("Dual Plasma Cannon")
 );
-
-#define PLASMA_DUAL_SETTINGS(turret) 
-
-
-#ifdef SVQC
-PLASMA_DUAL_SETTINGS(plasma_dual)
-#endif // SVQC
 #else
 #ifdef SVQC
-
-void spawnfunc_turret_plasma_dual() { if not(turret_initialize(TUR_PLASMA_DUAL)) remove(self); }
+void spawnfunc_turret_plasma_dual() { if(!turret_initialize(TUR_PLASMA_DUAL)) remove(self); }
 
 float t_plasma_dual(float req)
 {
@@ -27,7 +19,7 @@ float t_plasma_dual(float req)
        {
                case TR_ATTACK:
                {
-                       if(g_minstagib)
+                       if(g_instagib)
                        {
                                float flying;
                                flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
@@ -40,27 +32,11 @@ float t_plasma_dual(float req)
 
                                // teamcolor / hit beam effect
                                vector v;
+                               string s;
                                v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
-                               if(teamplay)
-                               {
-                                       switch(self.team)
-                                       {
-                                               case NUM_TEAM_1:   // Red
-                                                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED"), self.tur_shotorg, v);
-                                                       break;
-                                               case NUM_TEAM_2:   // Blue
-                                                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE"), self.tur_shotorg, v);
-                                                       break;
-                                               case NUM_TEAM_3:   // Yellow
-                                                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW"), self.tur_shotorg, v);
-                                                       break;
-                                               case NUM_TEAM_4:   // Pink
-                                                               WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3PINK"), self.tur_shotorg, v);
-                                                       break;
-                                       }
-                               }
-                               else
-                                       WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3"), self.tur_shotorg, v);
+                               s = strcat("TE_TEI_G3", ((self.team) ? Static_Team_ColorName_Upper(self.team) : ""));
+                               
+                               WarpZone_TrailParticles(world, particleeffectnum(s), self.tur_shotorg, v);
                                        
                                self.tur_head.frame += 1;
                        }
@@ -72,7 +48,7 @@ float t_plasma_dual(float req)
                                self.tur_head.frame += 1;
                        }
 
-                       return TRUE;
+                       return true;
                }
                case TR_THINK:
                {
@@ -82,11 +58,11 @@ float t_plasma_dual(float req)
                        if (self.tur_head.frame > 6)
                                self.tur_head.frame = 0;
 
-                       return TRUE;
+                       return true;
                }
                case TR_DEATH:
                {
-                       return TRUE;
+                       return true;
                }
                case TR_SETUP:
                {
@@ -97,22 +73,17 @@ float t_plasma_dual(float req)
                        
                        turret_do_updates(self);
 
-                       return TRUE;
+                       return true;
                }
                case TR_PRECACHE:
                {
                        precache_model ("models/turrets/base.md3");
                        precache_model ("models/turrets/plasmad.md3");
-                       return TRUE;
-               }
-               case TR_CONFIG:
-               {
-                       TUR_CONFIG_SETTINGS(PLASMA_DUAL_SETTINGS(plasma_dual))
-                       return TRUE;
+                       return true;
                }
        }
 
-       return TRUE;
+       return true;
 }
 
 #endif // SVQC
@@ -123,17 +94,15 @@ float t_plasma_dual(float req)
        {
                case TR_SETUP:
                {
-                       return TRUE;
+                       return true;
                }
                case TR_PRECACHE:
                {
-                       precache_model ("models/turrets/base.md3");
-                       precache_model ("models/turrets/plasmad.md3");
-                       return TRUE;
+                       return true;
                }
        }
 
-       return TRUE;
+       return true;
 }
 
 #endif // CSQC