]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/projectile.qc
Merge branch 'mand1nga/rebrand' of ssh://git.xonotic.org/xonotic-data.pk3dir into...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / projectile.qc
index 4c057929d54a94db936f2b95cc181e6e1c02be43..b67cc76aadc206c591f8f1f3f249ecc394f9af6b 100644 (file)
@@ -31,8 +31,28 @@ void Projectile_DrawTrail(vector to)
        self.trail_oldorigin = to;
        self.trail_oldtime = time;
 
+       // force the effect even for stationary firemine
+       if(self.cnt == PROJECTILE_FIREMINE)
+               if(from == to)
+                       from_z += 1;
+
        if (self.traileffect)
-               trailparticles(self, self.traileffect, from, to);
+       {
+               if(checkextension("DP_CSQC_BOXPARTICLES"))
+               {
+                       /* looks good, but we can do better with particle count
+                       particles_alphamin = particles_alphamax = self.alpha;
+                       boxparticles(self.traileffect, self, from, to, self.velocity, self.velocity, 1, PARTICLES_USEALPHA);
+                       */
+                       /* looks bad
+                       boxparticles(self.traileffect, self, from, to, self.velocity, self.velocity, self.alpha, 0);
+                       */
+                       particles_alphamin = particles_alphamax = sqrt(self.alpha);
+                       boxparticles(self.traileffect, self, from, to, self.velocity, self.velocity, sqrt(self.alpha), PARTICLES_USEALPHA);
+               }
+               else
+                       trailparticles(self, self.traileffect, from, to);
+       }
 }
 
 void Projectile_Draw()
@@ -97,8 +117,10 @@ void Projectile_Draw()
        makevectors(ang);
 
        a = 1 - (time - self.fade_time) * self.fade_rate;
-       if(a <= 0)
+       self.alpha = bound(0, self.alphamod * a, 1);
+       if(self.alpha <= 0)
                drawn = 0;
+       self.renderflags = 0;
 
        trailorigin = self.origin;
        switch(self.cnt)
@@ -131,9 +153,6 @@ void Projectile_Draw()
                        break;
        }
 
-       self.alpha = self.alphamod * a;
-       self.renderflags = 0;
-
        R_AddEntity(self);
 }
 
@@ -213,13 +232,15 @@ void Ent_Projectile()
                        self.velocity_x = ReadCoord();
                        self.velocity_y = ReadCoord();
                        self.velocity_z = ReadCoord();
-                       self.gravity = ReadCoord();
-
+                       if(f & 0x10)
+                               self.gravity = ReadCoord();
+                       else
+                               self.gravity = 0; // none
                        self.move_origin = self.origin;
                        self.move_velocity = self.velocity;
                }
 
-               if(time == self.spawntime || (self.count & 0x80) || (f & 0x10))
+               if(time == self.spawntime || (self.count & 0x80) || (f & 0x08))
                {
                        self.trail_oldorigin = self.origin;
                        if(!(self.count & 0x80))
@@ -269,7 +290,7 @@ void Ent_Projectile()
                        case PROJECTILE_FIREBALL: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum("fireball"); break; // particle effect is good enough
                        case PROJECTILE_FIREMINE: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum("firemine"); break; // particle effect is good enough
                        case PROJECTILE_TAG: setmodel(self, "models/laser.mdl"); self.traileffect = particleeffectnum("TR_ROCKET"); break;
-                       case PROJECTILE_FLAC: setmodel(self, "models/hagarmissile.md3"); self.scale = 0.4; self.traileffect = particleeffectnum("TR_ROCKET"); break;
+                       case PROJECTILE_FLAC: setmodel(self, "models/hagarmissile.mdl"); self.scale = 0.4; self.traileffect = particleeffectnum("TR_ROCKET"); break;
                        case PROJECTILE_SEEKER: setmodel(self, "models/tagrocket.md3"); self.scale = 2; self.traileffect = particleeffectnum("TR_ROCKET"); break;
                        default:
                                error("Received invalid CSQC projectile, can't work with this!");
@@ -307,6 +328,8 @@ void Ent_Projectile()
                                self.maxs = '0 0 -3';
                                self.move_movetype = MOVETYPE_BOUNCE;
                                self.move_touch = SUB_Null;
+                               self.move_bounce_factor = g_balance_grenadelauncher_secondary_bouncefactor;
+                               self.move_bounce_stopspeed = g_balance_grenadelauncher_secondary_bouncestop;
                                break;
                        case PROJECTILE_PORTO_RED:
                                self.colormod = '2 1 1';