X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fgibs.qc;h=22825bc4f38d4912b70c51922098c20213308581;hb=b749d1e1536714f77ddaf011f2921ecddcc9f290;hp=eebad4c736374c437a7ab18768e14536d6cd1127;hpb=fe8fa62ddd3321825b7628645e3d4b809f07929d;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/gibs.qc b/qcsrc/client/gibs.qc index eebad4c73..22825bc4f 100644 --- a/qcsrc/client/gibs.qc +++ b/qcsrc/client/gibs.qc @@ -52,8 +52,8 @@ void new_te_bloodshower (float ef, vector org, float explosionspeed, float howma { float i, pmod; pmod = autocvar_cl_particles_quality; - for (i = 0; i < 250 * pmod; ++i) - pointparticles(ef, org, randomvec() * explosionspeed, howmany / 250); + for (i = 0; i < 50 * pmod; ++i) + pointparticles(ef, org, randomvec() * explosionspeed, howmany / 50); } void SUB_RemoveOnNoImpact() @@ -89,11 +89,17 @@ void Gib_Draw() return; if(self.touch == Gib_Touch) // don't do this for the "chunk" thingie... + // TODO somehow make it spray in a direction dependent on self.angles trailparticles(self, particleeffectnum(strcat(species_prefix(self.cnt), "TR_SLIGHTBLOOD")), oldorg, self.origin); else trailparticles(self, particleeffectnum(strcat(species_prefix(self.cnt), "TR_BLOOD")), oldorg, self.origin); self.renderflags = 0; + + // make gibs die faster at low view quality + // if view_quality is 0.5, we want to have them die twice as fast + self.nextthink -= frametime * (1 / bound(0.01, view_quality, 1.00) - 1); + self.alpha = bound(0, self.nextthink - time, 1); if(self.alpha < ALPHA_MIN_VISIBLE) @@ -103,7 +109,7 @@ void Gib_Draw() } } -void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector vrand, float specnum, float destroyontouch, float issilent, float gibownernum) +void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector vrand, float specnum, float destroyontouch, float issilent) { entity gib; @@ -115,7 +121,6 @@ void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector gib.solid = SOLID_CORPSE; gib.cnt = specnum; gib.silent = issilent; - gib.team = gibownernum; Gib_setmodel(gib, mdlname, specnum); setsize (gib, '-8 -8 -8', '8 8 8'); @@ -135,7 +140,7 @@ void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector gib.move_origin = gib.origin = org; gib.move_velocity = vconst * autocvar_cl_gibs_velocity_scale + vrand * autocvar_cl_gibs_velocity_random + '0 0 1' * autocvar_cl_gibs_velocity_up; - gib.move_avelocity = prandomvec() * vlen(gib.move_velocity); + gib.move_avelocity = prandomvec() * vlen(gib.move_velocity) * autocvar_cl_gibs_avelocity_scale; gib.move_time = time; gib.damageforcescale = autocvar_cl_gibs_damageforcescale; @@ -147,7 +152,7 @@ void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector void Ent_GibSplash(float isNew) { - float amount, type, specnum, entnumber; + float amount, type, specnum; vector org, vel; string specstr; float issilent; @@ -157,7 +162,6 @@ void Ent_GibSplash(float isNew) type = ReadByte(); // gibbage type amount = ReadByte() / 16.0; // gibbage amount - entnumber = ReadByte(); // player num org_x = ReadShort() * 4 + 2; org_y = ReadShort() * 4 + 2; org_z = ReadShort() * 4 + 2; @@ -205,37 +209,37 @@ void Ent_GibSplash(float isNew) sound (self, CH_PAIN, "misc/gib.wav", VOL_BASE, ATTN_NORM); if(prandom() < amount) - TossGib ("models/gibs/eye.md3", org, org, vel, prandomvec() * 150, specnum, 0, issilent, entnumber); + TossGib ("models/gibs/eye.md3", org, org, vel, prandomvec() * 150, specnum, 0, issilent); new_te_bloodshower(particleeffectnum(strcat(specstr, "bloodshower")), org, 1200, amount); if(prandom() < amount) - TossGib ("models/gibs/bloodyskull.md3", org, org + 16 * prandomvec(), vel, prandomvec() * 100, specnum, 0, issilent, entnumber); + TossGib ("models/gibs/bloodyskull.md3", org, org + 16 * prandomvec(), vel, prandomvec() * 100, specnum, 0, issilent); for(c = 0; c < amount; ++c) { randomvalue = amount - c; if(prandom() < randomvalue) - TossGib ("models/gibs/arm.md3", org, org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,0, issilent, entnumber); + TossGib ("models/gibs/arm.md3", org, org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,0, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/arm.md3", org, org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,0, issilent, entnumber); + TossGib ("models/gibs/arm.md3", org, org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,0, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/chest.md3", org, org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,0, issilent, entnumber); + TossGib ("models/gibs/chest.md3", org, org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,0, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/smallchest.md3", org, org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,0, issilent, entnumber); + TossGib ("models/gibs/smallchest.md3", org, org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,0, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/leg1.md3", org, org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,0, issilent, entnumber); + TossGib ("models/gibs/leg1.md3", org, org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,0, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/leg2.md3", org, org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,0, issilent, entnumber); + TossGib ("models/gibs/leg2.md3", org, org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,0, issilent); // these splat on impact if(prandom() < randomvalue) - TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent, entnumber); + TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent, entnumber); + TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent, entnumber); + TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent, entnumber); + TossGib ("models/gibs/chunk.mdl", org, org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent); } break; case 0x02: @@ -243,7 +247,7 @@ void Ent_GibSplash(float isNew) break; case 0x03: if(prandom() < amount) - TossGib ("models/gibs/chunk.mdl", org, org, vel, prandomvec() * (prandom() * 30 + 20), specnum, 1, issilent, entnumber); // TODO maybe adjust to more randomization? + TossGib ("models/gibs/chunk.mdl", org, org, vel, prandomvec() * (prandom() * 30 + 20), specnum, 1, issilent); // TODO maybe adjust to more randomization? break; case 0x81: pointparticles(particleeffectnum(strcat(gentle_prefix, "damage_dissolve")), org, vel, amount);