]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Gib size now depends on player size
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 31 Jul 2011 21:24:47 +0000 (00:24 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 31 Jul 2011 21:24:47 +0000 (00:24 +0300)
data/qcsrc/client/gibs.qc
data/qcsrc/server/g_violence.qc

index 0a8b7de57a9ba11fd0fc0bcf2a9ef408ca7fd218..12a077530fe376b333703a422ae07d474a580913 100644 (file)
@@ -38,7 +38,6 @@ void Gib_setmodel(entity gib, string mdlname, float specnum)
                                        gib.skin = 1;\r
                                        gib.colormod = '2 2 2';\r
                                }\r
-                               gib.scale = 1;\r
                                break;\r
                        }\r
                default:\r
@@ -102,7 +101,7 @@ void Gib_Draw()
                R_AddEntity(self);\r
 }\r
 \r
-void TossGib (string mdlname, vector org, vector vconst, vector vrand, float specnum, float destroyontouch, float issilent)\r
+void TossGib (string mdlname, vector org, vector vconst, vector vrand, float specnum, float sz, float destroyontouch, float issilent)\r
 {\r
        entity gib;\r
 \r
@@ -116,6 +115,7 @@ void TossGib (string mdlname, vector org, vector vconst, vector vrand, float spe
        Gib_setmodel(gib, mdlname, specnum);\r
 \r
        setsize (gib, '-8 -8 -8', '8 8 8');\r
+       gib.scale = sz;\r
 \r
        gib.draw = Gib_Draw;\r
        if(destroyontouch)\r
@@ -136,7 +136,7 @@ void TossGib (string mdlname, vector org, vector vconst, vector vrand, float spe
 \r
 void Ent_GibSplash(float isNew)\r
 {\r
-       float amount, type, specnum;\r
+       float amount, type, specnum, sz;\r
        vector org, vel;\r
        string specstr;\r
        float issilent;\r
@@ -150,6 +150,7 @@ void Ent_GibSplash(float isNew)
        org_y = ReadShort() * 4 + 2;\r
        org_z = ReadShort() * 4 + 2;\r
        vel = decompressShortVector(ReadShort());\r
+       sz = ReadCoord();\r
 \r
        if(cvar("cl_gentle"))\r
                type |= 0x80; // set gentle bit\r
@@ -190,37 +191,37 @@ void Ent_GibSplash(float isNew)
                                sound (self, CHAN_PAIN, "misc/gib.wav", VOL_BASE, ATTN_NORM);\r
 \r
                        if(prandom() < amount)\r
-                               TossGib ("models/gibs/eye.md3", org, vel, prandomvec() * 150, specnum, 0, issilent);\r
+                               TossGib ("models/gibs/eye.md3", org, vel, prandomvec() * 150, specnum, sz, 0, issilent);\r
                        new_te_bloodshower(particleeffectnum(strcat(specstr, "bloodshower")), org, 1200, amount);\r
                        if(prandom() < amount)\r
-                               TossGib ("models/gibs/bloodyskull.md3", org + 16 * prandomvec(), vel, prandomvec() * 100, specnum, 0, issilent);\r
+                               TossGib ("models/gibs/bloodyskull.md3", org + 16 * prandomvec(), vel, prandomvec() * 100, specnum, sz, 0, issilent);\r
 \r
                        for(c = 0; c < amount; ++c)\r
                        {\r
                                randomvalue = amount - c;\r
 \r
                                if(prandom() < randomvalue)\r
-                                       TossGib ("models/gibs/arm.md3", org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,0, issilent);\r
+                                       TossGib ("models/gibs/arm.md3", org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,sz,0, issilent);\r
                                if(prandom() < randomvalue)\r
-                                       TossGib ("models/gibs/arm.md3", org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,0, issilent);\r
+                                       TossGib ("models/gibs/arm.md3", org + 16 * prandomvec() + '0 0 8', vel, prandomvec() * (prandom() * 120 + 90), specnum,sz,0, issilent);\r
                                if(prandom() < randomvalue)\r
-                                       TossGib ("models/gibs/chest.md3", org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,0, issilent);\r
+                                       TossGib ("models/gibs/chest.md3", org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,sz,0, issilent);\r
                                if(prandom() < randomvalue)\r
-                                       TossGib ("models/gibs/smallchest.md3", org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,0, issilent);\r
+                                       TossGib ("models/gibs/smallchest.md3", org + 16 * prandomvec(), vel, prandomvec() * (prandom() * 120 + 80), specnum,sz,0, issilent);\r
                                if(prandom() < randomvalue)\r
-                                       TossGib ("models/gibs/leg1.md3", org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,0, issilent);\r
+                                       TossGib ("models/gibs/leg1.md3", org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,sz,0, issilent);\r
                                if(prandom() < randomvalue)\r
-                                       TossGib ("models/gibs/leg2.md3", org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,0, issilent);\r
+                                       TossGib ("models/gibs/leg2.md3", org + 16 * prandomvec() + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,sz,0, issilent);\r
 \r
                                // these splat on impact\r
                                if(prandom() < randomvalue)\r
-                                       TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent);\r
+                                       TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,sz,1, issilent);\r
                                if(prandom() < randomvalue)\r
-                                       TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent);\r
+                                       TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,sz,1, issilent);\r
                                if(prandom() < randomvalue)\r
-                                       TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent);\r
+                                       TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,sz,1, issilent);\r
                                if(prandom() < randomvalue)\r
-                                       TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,1, issilent);\r
+                                       TossGib ("models/gibs/chunk.mdl", org + 16 * prandomvec(), vel, prandomvec() * 450, specnum,sz,1, issilent);\r
                        }\r
                        break;\r
                case 0x02:\r
@@ -228,7 +229,7 @@ void Ent_GibSplash(float isNew)
                        break;\r
                case 0x03:\r
                        if(prandom() < amount)\r
-                               TossGib ("models/gibs/chunk.mdl", org, vel, prandomvec() * (prandom() * 30 + 20), specnum, 1, issilent); // TODO maybe adjust to more randomization?\r
+                               TossGib ("models/gibs/chunk.mdl", org, vel, prandomvec() * (prandom() * 30 + 20), specnum, sz, 1, issilent); // TODO maybe adjust to more randomization?\r
                        break;\r
                case 0x81:\r
                        pointparticles(particleeffectnum(strcat(gentle_prefix, "damage_dissolve")), org, vel, amount);\r
index 5665ff4365a374dee3a31774076e7d2739e6cee5..0fce11eab2c9f140ca49b062004613c736c2814f 100644 (file)
@@ -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\r
        WriteShort(MSG_ENTITY, floor(self.origin_y / 4)); // not using a coord here, as gibs don't need this accuracy\r
        WriteShort(MSG_ENTITY, floor(self.origin_z / 4)); // not using a coord here, as gibs don't need this accuracy\r
-       WriteShort(MSG_ENTITY, self.oldorigin_x); // acrually compressed velocity\r
+       WriteShort(MSG_ENTITY, self.oldorigin_x); // actually compressed velocity\r
+       WriteCoord(MSG_ENTITY, self.scale); // size of the gibs\r
        return TRUE;\r
 }\r
 \r
@@ -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\r
        setorigin(e, org);\r
        e.velocity = dir;\r
+       e.scale = gibowner.scale;\r
 \r
        e.oldorigin_x = compressShortVector(e.velocity);\r
 \r