From: MirceaKitsune Date: Sun, 31 Jul 2011 21:24:47 +0000 (+0300) Subject: Gib size now depends on player size X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c040cb1cf71cd84452f0efe421322ea64c048762;p=voretournament%2Fvoretournament.git Gib size now depends on player size --- diff --git a/data/qcsrc/client/gibs.qc b/data/qcsrc/client/gibs.qc index 0a8b7de5..12a07753 100644 --- a/data/qcsrc/client/gibs.qc +++ b/data/qcsrc/client/gibs.qc @@ -38,7 +38,6 @@ void Gib_setmodel(entity gib, string mdlname, float specnum) gib.skin = 1; gib.colormod = '2 2 2'; } - gib.scale = 1; break; } default: @@ -102,7 +101,7 @@ void Gib_Draw() R_AddEntity(self); } -void TossGib (string mdlname, vector org, vector vconst, vector vrand, float specnum, float destroyontouch, float issilent) +void TossGib (string mdlname, vector org, vector vconst, vector vrand, float specnum, float sz, float destroyontouch, float issilent) { entity gib; @@ -116,6 +115,7 @@ void TossGib (string mdlname, vector org, vector vconst, vector vrand, float spe Gib_setmodel(gib, mdlname, specnum); setsize (gib, '-8 -8 -8', '8 8 8'); + gib.scale = sz; gib.draw = Gib_Draw; if(destroyontouch) @@ -136,7 +136,7 @@ void TossGib (string mdlname, vector org, vector vconst, vector vrand, float spe void Ent_GibSplash(float isNew) { - float amount, type, specnum; + float amount, type, specnum, sz; vector org, vel; string specstr; float issilent; @@ -150,6 +150,7 @@ void Ent_GibSplash(float isNew) org_y = ReadShort() * 4 + 2; org_z = ReadShort() * 4 + 2; vel = decompressShortVector(ReadShort()); + sz = ReadCoord(); if(cvar("cl_gentle")) type |= 0x80; // set gentle bit @@ -190,37 +191,37 @@ void Ent_GibSplash(float isNew) sound (self, CHAN_PAIN, "misc/gib.wav", VOL_BASE, ATTN_NORM); if(prandom() < amount) - TossGib ("models/gibs/eye.md3", org, vel, prandomvec() * 150, specnum, 0, issilent); + TossGib ("models/gibs/eye.md3", org, vel, prandomvec() * 150, specnum, sz, 0, issilent); new_te_bloodshower(particleeffectnum(strcat(specstr, "bloodshower")), org, 1200, amount); if(prandom() < amount) - TossGib ("models/gibs/bloodyskull.md3", org + 16 * prandomvec(), vel, prandomvec() * 100, specnum, 0, issilent); + TossGib ("models/gibs/bloodyskull.md3", org + 16 * prandomvec(), vel, prandomvec() * 100, specnum, sz, 0, issilent); for(c = 0; c < amount; ++c) { randomvalue = amount - c; if(prandom() < randomvalue) - TossGib ("models/gibs/arm.md3", org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,0, issilent); + TossGib ("models/gibs/arm.md3", org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,sz,0, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/arm.md3", org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,0, issilent); + TossGib ("models/gibs/arm.md3", org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,sz,0, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/chest.md3", org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,0, issilent); + TossGib ("models/gibs/chest.md3", org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,sz,0, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/smallchest.md3", org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,0, issilent); + TossGib ("models/gibs/smallchest.md3", org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,sz,0, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/leg1.md3", org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,0, issilent); + TossGib ("models/gibs/leg1.md3", org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,sz,0, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/leg2.md3", org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,0, issilent); + TossGib ("models/gibs/leg2.md3", org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,sz,0, issilent); // these splat on impact if(prandom() < randomvalue) - TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent); + TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,sz,1, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent); + TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,sz,1, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent); + TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,sz,1, issilent); if(prandom() < randomvalue) - TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent); + TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,sz,1, issilent); } break; case 0x02: @@ -228,7 +229,7 @@ void Ent_GibSplash(float isNew) break; case 0x03: if(prandom() < amount) - TossGib ("models/gibs/chunk.mdl", org, vel, prandomvec() * (prandom() * 30 + 20), specnum, 1, issilent); // TODO maybe adjust to more randomization? + TossGib ("models/gibs/chunk.mdl", org, vel, prandomvec() * (prandom() * 30 + 20), specnum, sz, 1, issilent); // TODO maybe adjust to more randomization? break; case 0x81: pointparticles(particleeffectnum(strcat(gentle_prefix, "damage_dissolve")), org, vel, amount); diff --git a/data/qcsrc/server/g_violence.qc b/data/qcsrc/server/g_violence.qc index 5665ff43..0fce11ea 100644 --- a/data/qcsrc/server/g_violence.qc +++ b/data/qcsrc/server/g_violence.qc @@ -6,7 +6,8 @@ float Violence_GibSplash_SendEntity(entity to, float sf) WriteShort(MSG_ENTITY, floor(self.origin_x / 4)); // not using a coord here, as gibs don't need this accuracy WriteShort(MSG_ENTITY, floor(self.origin_y / 4)); // not using a coord here, as gibs don't need this accuracy WriteShort(MSG_ENTITY, floor(self.origin_z / 4)); // not using a coord here, as gibs don't need this accuracy - WriteShort(MSG_ENTITY, self.oldorigin_x); // acrually compressed velocity + WriteShort(MSG_ENTITY, self.oldorigin_x); // actually compressed velocity + WriteCoord(MSG_ENTITY, self.scale); // size of the gibs return TRUE; } @@ -29,6 +30,7 @@ void Violence_GibSplash_At(vector org, vector dir, float type, float amount, ent e.state |= 8 * self.species; // gib type, ranges from 0 to 15 setorigin(e, org); e.velocity = dir; + e.scale = gibowner.scale; e.oldorigin_x = compressShortVector(e.velocity);