]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/unit/plasma.qc
Merge branch 'master' into Mario/turrets
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / unit / plasma.qc
index 670efd29219507140e2034d9fe43e3b9df10477c..095aa9d02d749485d7b30d5e97c94bf059123432 100644 (file)
@@ -9,17 +9,9 @@ REGISTER_TURRET(
 /* netname       */ "plasma",
 /* fullname   */ _("Plasma Cannon")
 );
-
-#define PLASMA_SETTINGS(turret) 
-
-
-#ifdef SVQC
-PLASMA_SETTINGS(plasma)
-#endif // SVQC
 #else
 #ifdef SVQC
-
-void spawnfunc_turret_plasma() { if not(turret_initialize(TUR_PLASMA)) remove(self); }
+void spawnfunc_turret_plasma() { if(!turret_initialize(TUR_PLASMA)) remove(self); }
 
 float t_plasma(float req)
 {
@@ -27,7 +19,7 @@ float t_plasma(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
@@ -35,32 +27,16 @@ float t_plasma(float req)
                                FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000,
                                                                   800, 0, 0, 0, 0, DEATH_TURRET_PLASMA);
 
-
                                pointparticles(particleeffectnum("nex_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
 
                                // 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);
+                               
                                if (self.tur_head.frame == 0)
                                        self.tur_head.frame = 1;
                        }
@@ -74,7 +50,7 @@ float t_plasma(float req)
                                        self.tur_head.frame = 1;
                        }
 
-                       return TRUE;
+                       return true;
                }
                case TR_THINK:
                {
@@ -84,11 +60,11 @@ float t_plasma(float req)
                        if (self.tur_head.frame > 5)
                                self.tur_head.frame = 0;
 
-                       return TRUE;
+                       return true;
                }
                case TR_DEATH:
                {
-                       return TRUE;
+                       return true;
                }
                case TR_SETUP:
                {
@@ -99,22 +75,17 @@ float t_plasma(float req)
                        
                        turret_do_updates(self);
 
-                       return TRUE;
+                       return true;
                }
                case TR_PRECACHE:
                {
                        precache_model ("models/turrets/base.md3");
                        precache_model ("models/turrets/plasma.md3");
-                       return TRUE;
-               }
-               case TR_CONFIG:
-               {
-                       TUR_CONFIG_SETTINGS(PLASMA_SETTINGS(plasma))
-                       return TRUE;
+                       return true;
                }
        }
 
-       return TRUE;
+       return true;
 }
 
 #endif // SVQC
@@ -125,17 +96,15 @@ float t_plasma(float req)
        {
                case TR_SETUP:
                {
-                       return TRUE;
+                       return true;
                }
                case TR_PRECACHE:
                {
-                       precache_model ("models/turrets/base.md3");
-                       precache_model ("models/turrets/plasma.md3");
-                       return TRUE;
+                       return true;
                }
        }
 
-       return TRUE;
+       return true;
 }
 
 #endif // CSQC