]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/vore.qc
Revert everything. Neither the old method nor the new one fix the issue...
[voretournament/voretournament.git] / data / qcsrc / server / vore.qc
index 506d227ec4d8cf3ceb32408d4a3691625475ff3e..76dca4064a07d087c4cfabf0e15adef00bde6cdd 100644 (file)
@@ -21,7 +21,10 @@ entity Swallow_player_check()
        vore_w_shotorg = self.origin;\r
        vore_w_shotdir = v_forward;\r
 \r
-       WarpZone_traceline_antilag(self, vore_w_shotorg, vore_w_shotorg + vore_w_shotdir * swallow_range, FALSE, self, ANTILAG_LATENCY(self));\r
+       if(self.antilag_debug)\r
+               WarpZone_traceline_antilag(self, vore_w_shotorg, vore_w_shotorg + vore_w_shotdir * swallow_range, FALSE, self, self.antilag_debug);\r
+       else\r
+               WarpZone_traceline_antilag(self, vore_w_shotorg, vore_w_shotorg + vore_w_shotdir * swallow_range, FALSE, self, ANTILAG_LATENCY(self));\r
        if(trace_fraction < 1)\r
        if(trace_ent.classname == "player")\r
                return trace_ent;\r
@@ -36,7 +39,7 @@ float Swallow_condition_check(entity prey)
        if(prey.classname == "player" && !prey.stat_eaten && prey.deadflag == DEAD_NO) // we can't swallow someone who's already in someone else's stomach\r
        if(self.classname == "player" && !self.stat_eaten && self.deadflag == DEAD_NO) // we can't swallow players while inside someone's stomach ourselves\r
        if(!self.BUTTON_REGURGITATE && time > self.action_delay)\r
-       if not(vlen(self.velocity) > cvar("g_balance_vore_regurgitate_speedcap"))\r
+       if not(vlen(self.velocity) > cvar("g_balance_vore_regurgitate_speedcap") / (1 + self.stomach_load))\r
        {\r
                string swallow_complain;\r
                if(teams_matter && prey.team == self.team && !cvar("g_vore_teamvore"))\r
@@ -539,7 +542,7 @@ void Vore_StomachKick()
        {\r
                float damage, vol;\r
                vector force;\r
-               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 = cvar("g_balance_vore_kick_damage");\r
                force = v_forward * cvar("g_balance_vore_kick_force");\r
                vol = VOL_BASE;\r
 \r
@@ -659,6 +662,7 @@ void Vore_SetSbarRings()
        }\r
 }\r
 \r
+.entity prey;\r
 void Vore()\r
 {\r
        // main vore code, this is where it all happens\r
@@ -761,23 +765,22 @@ void Vore()
 // Code that addresses predators:\r
 // --------------------------------\r
 \r
-       entity prey;\r
-       prey = Swallow_player_check();\r
+       self.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
        self.stat_canswallow = 0;\r
-       if(Swallow_condition_check(prey))\r
+       if(Swallow_condition_check(self.prey))\r
        {\r
                // canswallow stat, used by the HUD\r
-               if(teams_matter && prey.team == self.team)\r
+               if(teams_matter && self.prey.team == self.team)\r
                        self.stat_canswallow = 2;\r
                else\r
                        self.stat_canswallow = 1;\r
 \r
                if(self.BUTTON_ATCK)\r
-                       Vore_SwallowStep(prey);\r
+                       Vore_SwallowStep(self.prey);\r
        }\r
-       else if(prey != world)\r
+       else if(self.prey != world)\r
                self.stat_canswallow = -1;\r
 \r
        // toggle digestion, if the player has someone in their stomach\r
@@ -810,6 +813,7 @@ void Vore()
                        {\r
                                self.regurgitate_prepare = time + cvar("g_balance_vore_regurgitate_delay");\r
                                PlayerSound(self, playersound_regurgitate_prepare, CHAN_VOICE, VOICETYPE_PLAYERSOUND);\r
+                               setanim(self, self.anim_pain2, FALSE, TRUE, TRUE); // looks good for preparing regurgitation\r
                                self.regurgitate_button_delay_time = time + button_delay_time;\r
                        }\r
                }\r
@@ -846,7 +850,7 @@ void Vore()
 \r
        if(self.predator.deadflag != DEAD_NO)\r
                Vore_Regurgitate(self);\r
-       else if(vlen(self.predator.velocity) > cvar("g_balance_vore_regurgitate_speedcap"))\r
+       else if(vlen(self.predator.velocity) > cvar("g_balance_vore_regurgitate_speedcap") / (1 + self.predator.stomach_load))\r
                Vore_Regurgitate(self);\r
 \r
        // apply delayed regurgitating if it was scheduled\r