]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/cl_player.qc
Fix and improve prey animations
[voretournament/voretournament.git] / data / qcsrc / server / cl_player.qc
index c3bde6ce9c7357358bad2f0a4690c97c56a6ec43..148170f7f0f898b80df894ef9fbf1194f3a1a748 100644 (file)
@@ -309,7 +309,14 @@ void player_anim (void)
 \r
        if (!self.animstate_override)\r
        {\r
-               if (!(self.flags & FL_ONGROUND))\r
+               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
+                       else\r
+                               setanim(self, self.anim_jump, FALSE, TRUE, FALSE); // looks good for prey idling inside the stomach\r
+               }\r
+               else if (!(self.flags & FL_ONGROUND))\r
                {\r
                        if (self.crouch)\r
                                setanim(self, self.anim_duckjump, FALSE, TRUE, self.restart_jump);\r
@@ -749,7 +756,7 @@ void UpdateSelectedPlayer()
        selected = world;\r
        selected_score = 0.95; // 18 degrees\r
 \r
-       if(self.predator.classname == "player")\r
+       if(self.stat_eaten)\r
        {\r
                if(!self.dropweapon_check)\r
                if(self.predator.team != self.team) // don't disarm team mates when swallowing them\r
@@ -1233,7 +1240,7 @@ void GlobalSound(string sample, float chan, float voicetype)
                                        {\r
                                                if(msg_entity.cvar_cl_voice_directional == 1)\r
                                                {\r
-                                                       if(self.predator.classname == "player")\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
@@ -1252,7 +1259,7 @@ void GlobalSound(string sample, float chan, float voicetype)
                                        {\r
                                                if(msg_entity.cvar_cl_voice_directional == 1)\r
                                                {\r
-                                                       if(self.predator.classname == "player")\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
@@ -1271,7 +1278,7 @@ void GlobalSound(string sample, float chan, float voicetype)
                                {\r
                                        if(msg_entity.cvar_cl_voice_directional == 1)\r
                                        {\r
-                                               if(self.predator.classname == "player")\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
@@ -1292,7 +1299,7 @@ void GlobalSound(string sample, float chan, float voicetype)
                                if (tauntrand < msg_entity.cvar_cl_autotaunt)\r
                                if (msg_entity.cvar_cl_voice_directional >= 1)\r
                                {\r
-                                       if(self.predator.classname == "player")\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
@@ -1312,7 +1319,7 @@ void GlobalSound(string sample, float chan, float voicetype)
                        {\r
                                if (msg_entity.cvar_cl_voice_directional >= 1)\r
                                {\r
-                                       if(self.predator.classname == "player")\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
@@ -1321,7 +1328,7 @@ void GlobalSound(string sample, float chan, float voicetype)
                                        soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
                        }\r
                case VOICETYPE_PLAYERSOUND:\r
-                       if(self.predator.classname == "player")\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