]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/cl_player.qc
More animations and animation tweaks
[voretournament/voretournament.git] / data / qcsrc / server / cl_player.qc
index 148170f7f0f898b80df894ef9fbf1194f3a1a748..829a6501b777bf234d15110d7ad8a240b123fef3 100644 (file)
@@ -114,6 +114,7 @@ void CopyBody(float keepvelocity)
        self.lip = oldself.lip;\r
        self.colormap = oldself.colormap;\r
        self.colormod = oldself.colormod;\r
+       self.glowmod = oldself.glowmod;\r
        self.iscreature = oldself.iscreature;\r
        self.angles = oldself.angles;\r
        self.avelocity = oldself.avelocity;\r
@@ -309,7 +310,11 @@ void player_anim (void)
 \r
        if (!self.animstate_override)\r
        {\r
-               if(self.stat_eaten)\r
+               if(self.swallow_progress_pred)\r
+                       setanim(self, self.anim_duckjump, TRUE, FALSE, FALSE); // looks good for predators who are swallowing\r
+               else if(self.swallow_progress_prey)\r
+                       setanim(self, self.anim_die2, FALSE, FALSE, FALSE); // looks good for prey who's getting swallowed\r
+               else if(self.stat_eaten)\r
                {\r
                        if(self.BUTTON_ATCK || self.predator.digesting)\r
                                setanim(self, self.anim_pain2, FALSE, TRUE, FALSE); // looks good for prey attacking the stomach or being digested\r
@@ -358,7 +363,16 @@ void player_anim (void)
 \r
        if (self.weaponentity)\r
        if (!self.weaponentity.animstate_override)\r
-               setanim(self.weaponentity, self.weaponentity.anim_idle, TRUE, FALSE, FALSE);\r
+       {\r
+               if(self.swallow_progress_pred)\r
+                       setanim(self.weaponentity, self.weaponentity.anim_fire2, TRUE, FALSE, FALSE); // looks good for predators who are swallowing\r
+               else if(self.swallow_progress_prey)\r
+                       setanim(self.weaponentity, self.weaponentity.anim_reload, TRUE, FALSE, FALSE); // looks good for prey who's getting swallowed\r
+               else if(self.stat_eaten && self.BUTTON_ATCK)\r
+                       setanim(self.weaponentity, self.weaponentity.anim_fire1, TRUE, FALSE, FALSE); // looks good for prey attacking the stomach\r
+               else\r
+                       setanim(self.weaponentity, self.weaponentity.anim_idle, TRUE, FALSE, FALSE);\r
+       }\r
 }\r
 \r
 void SpawnThrownWeapon (vector org, float w, float doreduce)\r
@@ -1218,6 +1232,7 @@ void GlobalSound(string sample, float chan, float voicetype)
 {\r
        float n;\r
        float tauntrand;\r
+       float vol;\r
 \r
        if(sample == "")\r
                return;\r
@@ -1229,6 +1244,14 @@ void GlobalSound(string sample, float chan, float voicetype)
        else\r
                sample = strcat(argv(0), ".wav"); // randomization\r
 \r
+       // modified volume, used for attenuated (non-radio) voices\r
+       vol = VOL_BASEVOICE;\r
+       if(self.stat_eaten && cvar("g_vore_soundocclusion")) // reduce sound volume for prey, to simulate stomach culling\r
+               vol *= cvar("g_vore_soundocclusion");\r
+       if(cvar("g_healthsize") && cvar("g_healthsize_soundfactor")) // amplify or reduce sound volume based on the size of the player\r
+               vol *= pow(self.scale, cvar("g_healthsize_soundfactor"));\r
+       vol = bound(0, vol, 1);\r
+\r
        switch(voicetype)\r
        {\r
                case VOICETYPE_LASTATTACKER_ONLY:\r
@@ -1239,12 +1262,7 @@ void GlobalSound(string sample, float chan, float voicetype)
                                        if(clienttype(msg_entity) == CLIENTTYPE_REAL)\r
                                        {\r
                                                if(msg_entity.cvar_cl_voice_directional == 1)\r
-                                               {\r
-                                                       if(self.stat_eaten)\r
-                                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_MIN);\r
-                                                       else\r
-                                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);\r
-                                               }\r
+                                                       soundto(MSG_ONE, self, chan, sample, vol, ATTN_MIN);\r
                                                else\r
                                                        soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
                                        }\r
@@ -1258,12 +1276,7 @@ void GlobalSound(string sample, float chan, float voicetype)
                                        if(clienttype(msg_entity) == CLIENTTYPE_REAL)\r
                                        {\r
                                                if(msg_entity.cvar_cl_voice_directional == 1)\r
-                                               {\r
-                                                       if(self.stat_eaten)\r
-                                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_MIN);\r
-                                                       else\r
-                                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);\r
-                                               }\r
+                                                       soundto(MSG_ONE, self, chan, sample, vol, ATTN_MIN);\r
                                                else\r
                                                        soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
                                        }\r
@@ -1277,12 +1290,7 @@ void GlobalSound(string sample, float chan, float voicetype)
                                if(!teams_matter || msg_entity.team == self.team)\r
                                {\r
                                        if(msg_entity.cvar_cl_voice_directional == 1)\r
-                                       {\r
-                                               if(self.stat_eaten)\r
-                                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_MIN);\r
-                                               else\r
-                                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);\r
-                                       }\r
+                                               soundto(MSG_ONE, self, chan, sample, vol, ATTN_MIN);\r
                                        else\r
                                                soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
                                }\r
@@ -1297,15 +1305,12 @@ void GlobalSound(string sample, float chan, float voicetype)
                        tauntrand = random();\r
                        FOR_EACH_REALCLIENT(msg_entity)\r
                                if (tauntrand < msg_entity.cvar_cl_autotaunt)\r
-                               if (msg_entity.cvar_cl_voice_directional >= 1)\r
                                {\r
-                                       if(self.stat_eaten)\r
-                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
+                                       if (msg_entity.cvar_cl_voice_directional >= 1)\r
+                                               soundto(MSG_ONE, self, chan, sample, vol, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
                                        else\r
-                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
+                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
                                }\r
-                               else\r
-                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
                        break;\r
                case VOICETYPE_TAUNT:\r
                        if(self.classname == "player")\r
@@ -1318,24 +1323,16 @@ void GlobalSound(string sample, float chan, float voicetype)
                        FOR_EACH_REALCLIENT(msg_entity)\r
                        {\r
                                if (msg_entity.cvar_cl_voice_directional >= 1)\r
-                               {\r
-                                       if(self.stat_eaten)\r
-                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
-                                       else\r
-                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
-                               }\r
+                                       soundto(MSG_ONE, self, chan, sample, vol, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
                                else\r
                                        soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
                        }\r
                case VOICETYPE_PLAYERSOUND:\r
-                       if(self.stat_eaten)\r
-                               sound(self, chan, sample, VOL_BASE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_NORM);\r
-                       else\r
-                               sound(self, chan, sample, VOL_BASE, ATTN_NORM);\r
+                               sound(self, chan, sample, vol, ATTN_NORM);\r
                        break;\r
                case VOICETYPE_GURGLE:\r
                        if(self.stomach_load)\r
-                               sound(self, chan, sample, VOL_BASE * self.stomach_load / cvar("g_balance_vore_swallow_limit"), ATTN_NORM);\r
+                               sound(self, chan, sample, vol * self.stomach_load / g_balance_vore_swallow_limit, ATTN_NORM);\r
                        else\r
                                stopsound(self, chan);\r
                        break;\r