]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/vore.qc
Nah, why else?
[voretournament/voretournament.git] / data / qcsrc / server / vore.qc
index 0c45de6a96991c8dca127a3e9dc117b45aa10ed0..48cfd3f6539ad09fddf76812ecd7ed6d23885fc6 100644 (file)
@@ -56,6 +56,13 @@ float Swallow_condition_check(entity prey)
        return FALSE;\r
 }\r
 \r
+float Vore_PreyCanLeave()\r
+{\r
+       if(teams_matter && self.team == self.eater.team)\r
+               return TRUE;\r
+       return FALSE;\r
+}\r
+\r
 // make the camera smoothly lower itself when we get swallowed\r
 // the target we are going for is from normal view offset to half of the view offset (because half is the best positioning of the view for the stomach model)\r
 .float cameraeffect_current, cameraeffect_target;\r
@@ -124,8 +131,11 @@ void Vore_Swallow(entity e)
        if(stov(cvar_string("g_vore_regurgitatecolor_released")))\r
                e.colormod = stov(cvar_string("g_vore_regurgitatecolor_released"));\r
 \r
-       if(e.eater.team == e.team && teamplay)\r
-               centerprint(e.eater, "^4You have swallowed a team mate, use caution!");\r
+       if(e.team == e.eater.team && teamplay)\r
+       {\r
+               centerprint(e, "^3You have been swallowed by a team mate, don't kick!");\r
+               centerprint(e.eater, "^3You have swallowed a team mate, use caution!");\r
+       }\r
 \r
        PlayerSound(e.eater, playersound_swallow, CHAN_PAIN, VOICETYPE_PLAYERSOUND);\r
        setanim(e.eater, e.eater.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating\r
@@ -171,6 +181,8 @@ void Vore_Regurgitate(entity e)
        e.eater.swallow_delay = time + cvar("g_balance_vore_swallow_delay");\r
        Vore_Weight_apply(e.eater);\r
 \r
+       // block firing for a small amount of time when getting regurgitated, or we'll be firing the next frame\r
+       e.weapon_delay = time + button_delay;\r
        e.system_delay = e.eater.system_delay = time + system_delay_time;\r
        e.eater = world;\r
 }\r
@@ -257,6 +269,20 @@ void Vore_StomachKick()
        }\r
 }\r
 \r
+void Vore_StomachLeave()\r
+{\r
+       // allows players to get out of their predator at will in some circumstances, such as team mates\r
+\r
+       if(Vore_PreyCanLeave())\r
+               Vore_Regurgitate(self);\r
+       else if(time > self.complain_swallow)\r
+       {\r
+               play2(self, "weapons/unavailable.wav");\r
+               sprint(self, strcat("You cannot get out of ", self.eater.netname, "\n"));\r
+               self.complain_swallow = time + complain_delay;\r
+       }\r
+}\r
+\r
 .float gurglesound_finished, gurglesound_oldstomachload;\r
 void Vore_Gurglesound()\r
 {\r
@@ -394,6 +420,10 @@ void Vore()
 \r
        if(self.BUTTON_ATCK)\r
                Vore_StomachKick();\r
+       if(self.BUTTON_JUMP)\r
+               Vore_StomachLeave();\r
+\r
+       self.stat_canleave = Vore_PreyCanLeave();\r
 \r
        Vore_CameraEffect_Apply();\r
 }
\ No newline at end of file