]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/vore.qc
Re-arrange some code in the meantime
[voretournament/voretournament.git] / data / qcsrc / server / vore.qc
index b1b13558a9bd5fb1c077e22d58a67b7f84aa96f8..0c45de6a96991c8dca127a3e9dc117b45aa10ed0 100644 (file)
@@ -97,6 +97,8 @@ void Vore_Weight_apply(entity e)
        e.vore_oldstomachload = e.stomach_load;\r
 }\r
 \r
+.entity pusher;\r
+.float pushltime;\r
 void Vore_Swallow(entity e)\r
 {\r
        // this player is beening swallowed by another player, apply the proper changes\r
@@ -112,13 +114,13 @@ void Vore_Swallow(entity e)
        e.alpha = -1; // best way of hiding / showing the eaten player\r
        e.aiment = e.eater; // follow the predator. Is automatically unset\r
 \r
-       Vore_CameraEffect_Set(e);\r
-\r
        // drop keys (KH) and flags (CTF) when we get swallowed\r
        kh_Key_DropAll(e, FALSE);\r
        if(e.flagcarried)\r
                DropFlag(e.flagcarried, world, e.eater);\r
 \r
+       Vore_CameraEffect_Set(e);\r
+\r
        if(stov(cvar_string("g_vore_regurgitatecolor_released")))\r
                e.colormod = stov(cvar_string("g_vore_regurgitatecolor_released"));\r
 \r
@@ -158,6 +160,9 @@ void Vore_Regurgitate(entity e)
        v_right = oldright;\r
        v_up = oldup;\r
 \r
+       e.pusher = e.eater; // so we can frag players by regurgitating them in deadly pits\r
+       e.pushltime = time + cvar("g_maxpushtime");\r
+\r
        PlayerSound(e.eater, playersound_regurgitate, CHAN_PAIN, VOICETYPE_PLAYERSOUND);\r
        setanim(e.eater, e.eater.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating\r
        pointparticles(particleeffectnum("regurgitate"), e.eater.origin, '0 0 0', 1);\r
@@ -332,7 +337,7 @@ void Vore()
                        if(time > self.regurgitate_button_delay)\r
                        {\r
                                self.regurgitate_prepare = time + cvar("g_balance_vore_regurgitate_delay");\r
-                               PlayerSound(self, playersound_regurgitate_prepare, CHAN_PAIN, VOICETYPE_PLAYERSOUND);\r
+                               PlayerSound(self, playersound_regurgitate_prepare, CHAN_VOICE, VOICETYPE_PLAYERSOUND);\r
                                self.regurgitate_button_delay = time + button_delay;\r
                        }\r
                }\r
@@ -362,7 +367,7 @@ void Vore()
                targeteater = self.eater.eater;\r
 \r
                Vore_Regurgitate(self);\r
-               if(1 == 1) //cvar!!!!!!!!!!!!!!!!\r
+               if(random() < cvar("g_vore_stealprey"))\r
                if(Swallow_condition_check(self))\r
                {\r
                        oldself = self;\r