]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/vore.qc
Play beep sound when a team mate was healed to the maximum amount, to both the prey...
[voretournament/voretournament.git] / data / qcsrc / server / vore.qc
index c806b2fd85dff9e726f5f249ebd35a7559d6d394..2c83a711ef7ef71df258eb91646832cde296d55d 100644 (file)
@@ -35,9 +35,9 @@ float Swallow_condition_check(entity prey)
        {\r
                if(teams_matter && prey.team == self.team && !cvar("g_vore_teamvore"))\r
                {\r
-                       if(time > self.complain_vore)\r
+                       if(time > self.complain_vore && self.BUTTON_ATCK)\r
                        {\r
-                               play2(self, "misc/unavailable.wav");\r
+                               play2(self, "misc/forbidden.wav");\r
                                sprint(self, "You cannot swallow your team mates\n");\r
                                self.complain_vore = time + complain_delay_time;\r
                        }\r
@@ -46,9 +46,9 @@ float Swallow_condition_check(entity prey)
 \r
                if(self.stomach_load >= cvar("g_balance_vore_swallow_limit"))\r
                {\r
-                       if(time > self.complain_vore)\r
+                       if(time > self.complain_vore && self.BUTTON_ATCK)\r
                        {\r
-                               play2(self, "misc/unavailable.wav");\r
+                               play2(self, "misc/forbidden.wav");\r
                                sprint(self, strcat("You cannot swallow more than ^2", cvar_string("g_balance_vore_swallow_limit"), "^7 players at a time\n"));\r
                                self.complain_vore = time + complain_delay_time;\r
                        }\r
@@ -58,9 +58,9 @@ float Swallow_condition_check(entity prey)
                if(cvar("g_vore_biggergut"))\r
                if(prey.stomach_load > self.stomach_load)\r
                {\r
-                       if(time > self.complain_vore)\r
+                       if(time > self.complain_vore && self.BUTTON_ATCK)\r
                        {\r
-                               play2(self, "misc/unavailable.wav");\r
+                               play2(self, "misc/forbidden.wav");\r
                                sprint(self, "You cannot swallow someone with a bigger stomach than yours\n");\r
                                self.complain_vore = time + complain_delay_time;\r
                        }\r
@@ -201,8 +201,10 @@ void Vore_Swallow(entity e)
 \r
        if(teams_matter && e.team == e.predator.team)\r
        {\r
-               centerprint(e, "^3You have been swallowed by a team mate, don't kick!");\r
-               centerprint(e.predator, "^3You have swallowed a team mate, use caution!");\r
+               if(cvar("g_vore_kick"))\r
+                       centerprint(e, "^3You have been swallowed by a team mate, don't kick!");\r
+               if(cvar("g_vore_digestion"))\r
+                       centerprint(e.predator, "^3You have swallowed a team mate, don't digest!");\r
        }\r
 \r
        PlayerSound(e.predator, playersound_swallow, CHAN_PAIN, VOICETYPE_PLAYERSOUND);\r
@@ -374,6 +376,13 @@ void Vore_Teamheal()
        {\r
                self.health += cvar("g_balance_vore_teamheal");\r
                self.teamheal_step = time + steptime;\r
+\r
+               // play beep sound when a team mate was healed to the maximum amount, to both the prey and the predator\r
+               if(self.health >= cvar("g_balance_vore_teamheal_stable"))\r
+               {\r
+                       play2(self, "misc/beep.ogg");\r
+                       play2(self.predator, "misc/beep.ogg");\r
+               }\r
        }\r
 }\r
 \r
@@ -388,6 +397,7 @@ void Vore_StomachKick()
                damage = ceil(random() * (cvar("g_balance_vore_kick_damage_max") - cvar("g_balance_vore_kick_damage_min")) + cvar("g_balance_vore_kick_damage_min"));\r
                Damage(self.predator, self, self, damage, DEATH_STOMACHKICK, self.predator.origin, v_forward * cvar("g_balance_vore_kick_force"));\r
                sound(self.predator, CHAN_PROJECTILE, "weapons/stomachkick.ogg", VOL_BASE, ATTN_NORM);\r
+               self.predator.punchangle_x -= self.predator.cvar_cl_vore_kick_punchangle;\r
 \r
                if(random() < cvar("g_balance_vore_kick_escapeprobability"))\r
                        Vore_Regurgitate(self);\r
@@ -404,7 +414,7 @@ void Vore_StomachLeave()
                Vore_Regurgitate(self);\r
        else if(time > self.complain_vore)\r
        {\r
-               play2(self, "misc/unavailable.wav");\r
+               play2(self, "misc/forbidden.wav");\r
                sprint(self, strcat("You cannot get out of ", self.predator.netname, "\n"));\r
                self.complain_vore = time + complain_delay_time;\r
        }\r
@@ -419,7 +429,7 @@ void Vore_AutoTaunt()
        // predator taunts\r
        if(self.stomach_load && !Stomach_TeamMates_check(self))\r
        {\r
-               if(!self.taunt_soundtime)\r
+               if(!self.taunt_soundtime) // taunt_soundtime becomes 0 once the taunt has played\r
                {\r
                        taunt_time = random() * (cvar("sv_vore_autotaunt_repeat_max") - cvar("sv_vore_autotaunt_repeat_min")) + cvar("sv_vore_autotaunt_repeat_min");\r
                        SetAutoTaunt(self, time + taunt_time, TAUNTTYPE_VOREPRED);\r
@@ -434,7 +444,7 @@ void Vore_AutoTaunt()
        // prey taunts\r
        if(self.predator.classname == "player" && !(teams_matter && self.team == self.predator.team))\r
        {\r
-               if(!self.taunt_soundtime)\r
+               if(!self.taunt_soundtime) // taunt_soundtime becomes 0 once the taunt has played\r
                {\r
                        taunt_time = random() * (cvar("sv_vore_autotaunt_repeat_max") - cvar("sv_vore_autotaunt_repeat_min")) + cvar("sv_vore_autotaunt_repeat_min");\r
                        SetAutoTaunt(self, time + taunt_time, TAUNTTYPE_VOREPREY);\r
@@ -534,9 +544,20 @@ void Vore()
        prey = Swallow_player_check();\r
 \r
        // attempt to swallow our new prey if we pressed the attack button, and there's any in range\r
-       if(self.BUTTON_ATCK)\r
+       self.stat_canswallow = 0;\r
        if(Swallow_condition_check(prey))\r
-               Vore_Swallow(prey);\r
+       {\r
+               // canswallow stat, used by the HUD\r
+               if(teams_matter && prey.team == self.team)\r
+                       self.stat_canswallow = 2;\r
+               else\r
+                       self.stat_canswallow = 1;\r
+\r
+               if(self.BUTTON_ATCK)\r
+                       Vore_Swallow(prey);\r
+       }\r
+       else if(prey != world)\r
+               self.stat_canswallow = -1;\r
 \r
        // toggle digestion, if the player has someone in their stomach\r
        if(self.BUTTON_DIGEST && cvar("g_vore_digestion"))\r
@@ -551,7 +572,7 @@ void Vore()
                }\r
                else if(time > self.complain_vore)\r
                {\r
-                       play2(self, "misc/unavailable.wav");\r
+                       play2(self, "misc/forbidden.wav");\r
                        sprint(self, "There is nothing to digest\n");\r
                        self.complain_vore = time + complain_delay_time;\r
                }\r
@@ -573,7 +594,7 @@ void Vore()
                }\r
                else if(time > self.complain_vore)\r
                {\r
-                       play2(self, "misc/unavailable.wav");\r
+                       play2(self, "misc/forbidden.wav");\r
                        sprint(self, "There is nothing to regurgitate\n");\r
                        self.complain_vore = time + complain_delay_time;\r
                }\r