X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fclient%2Fprojectile.qc;h=fb07b21b8fd18473dfdb9168d5b56b4342b5873d;hb=e0c1470ac5fcae5caeea336e35909475880357df;hp=6160cb3f0219713d80c3df0aee6556b0894f596e;hpb=eae0f8d6df2195d6fa4cd4a4ed1671b946f3d75b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/projectile.qc b/qcsrc/client/projectile.qc index 6160cb3f0..fb07b21b8 100644 --- a/qcsrc/client/projectile.qc +++ b/qcsrc/client/projectile.qc @@ -22,6 +22,11 @@ void SUB_Stop() .float silent; .float traileffect; +void Projectile_ResetTrail(vector to) +{ + self.trail_oldorigin = to; + self.trail_oldtime = time; +} void Projectile_DrawTrail(vector to) { vector from; @@ -37,7 +42,10 @@ void Projectile_DrawTrail(vector to) from_z += 1; if (self.traileffect) - trailparticles(self, self.traileffect, from, to); + { + particles_alphamin = particles_alphamax = sqrt(self.alpha); + boxparticles(self.traileffect, self, from, to, self.velocity, self.velocity, sqrt(self.alpha), PARTICLES_USEALPHA); + } } void Projectile_Draw() @@ -54,9 +62,18 @@ void Projectile_Draw() if(self.count & 0x80) { //self.move_flags &~= FL_ONGROUND; - Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy); + if(self.move_movetype == MOVETYPE_NONE || self.move_movetype == MOVETYPE_FLY) + Movetype_Physics_NoMatchServer(); + // the trivial movetypes do not have to match the + // server's ticrate as they are ticrate independent + // NOTE: this assumption is only true if MOVETYPE_FLY + // projectiles detonate on impact. If they continue + // moving, we might still be ticrate dependent. + else + Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy); if(!(self.move_flags & FL_ONGROUND)) - self.angles = vectoangles(self.velocity); + if(self.velocity != '0 0 0') + self.angles = vectoangles(self.velocity); } else { @@ -102,8 +119,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) @@ -118,10 +137,9 @@ void Projectile_Draw() if(drawn) Projectile_DrawTrail(trailorigin); else - { - self.trail_oldorigin = trailorigin; - self.trail_oldtime = time; - } + Projectile_ResetTrail(trailorigin); + + self.drawmask = 0; if(!drawn) return; @@ -136,10 +154,7 @@ void Projectile_Draw() break; } - self.alpha = self.alphamod * a; - self.renderflags = 0; - - R_AddEntity(self); + self.drawmask = MASK_NORMAL; } void loopsound(entity e, float ch, string samp, float vol, float attn) @@ -266,6 +281,7 @@ void Ent_Projectile() case PROJECTILE_ELECTRO_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break; case PROJECTILE_GRENADE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_GRENADE"); break; case PROJECTILE_GRENADE_BOUNCING: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_GRENADE"); break; + case PROJECTILE_MINE: setmodel(self, "models/mine.md3");self.traileffect = particleeffectnum(""); break; case PROJECTILE_LASER: setmodel(self, "models/laser.mdl");self.traileffect = particleeffectnum(""); break; case PROJECTILE_HLAC: setmodel(self, "models/hlac_bullet.md3");self.traileffect = particleeffectnum(""); break; case PROJECTILE_PORTO_RED: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_WIZSPIKE"); self.scale = 4; break; @@ -295,8 +311,8 @@ void Ent_Projectile() case PROJECTILE_ELECTRO: // only new engines support sound moving with object loopsound(self, CHAN_PROJECTILE, "weapons/electro_fly.wav", VOL_BASE, ATTN_NORM); - self.mins = '0 0 -3'; - self.maxs = '0 0 -3'; + self.mins = '0 0 -4'; + self.maxs = '0 0 -4'; self.move_movetype = MOVETYPE_BOUNCE; self.move_touch = SUB_Null; break; @@ -306,17 +322,21 @@ void Ent_Projectile() self.maxs = '3 3 3'; break; case PROJECTILE_GRENADE: - self.mins = '0 0 -3'; - self.maxs = '0 0 -3'; + self.mins = '-3 -3 -3'; + self.maxs = '3 3 3'; break; case PROJECTILE_GRENADE_BOUNCING: - self.mins = '0 0 -3'; - self.maxs = '0 0 -3'; + self.mins = '-3 -3 -3'; + self.maxs = '3 3 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_MINE: + self.mins = '-4 -4 -4'; + self.maxs = '4 4 4'; + break; case PROJECTILE_PORTO_RED: self.colormod = '2 1 1'; self.alphamod = 0.5; @@ -394,6 +414,7 @@ void Projectile_Precache() precache_model("models/ebomb.mdl"); precache_model("models/elaser.mdl"); precache_model("models/grenademodel.md3"); + precache_model("models/mine.md3"); precache_model("models/hagarmissile.mdl"); precache_model("models/hlac_bullet.md3"); precache_model("models/laser.mdl");