]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Basic implementation of slow swallowing. You need to aim at the prey from up close...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 9 Jul 2011 13:29:16 +0000 (16:29 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 9 Jul 2011 13:29:16 +0000 (16:29 +0300)
data/balanceVT.cfg
data/qcsrc/server/defs.qh
data/qcsrc/server/vore.qc

index 8cac88b256831b20eac39d95f9cc84bcc828305f..15e91bd48fcf89d75bced6a0c78eb8b3496f128e 100644 (file)
@@ -187,6 +187,7 @@ set g_balance_grabber_reload_time 2
 // {{{ stomach\r
 set g_balance_vore_swallow_range 100 "distance below which you can swallow another player when facing them"\r
 set g_balance_vore_swallow_limit 3 "how many players can fit in the stomach at a time, may range between 1 and 9"\r
+set g_balance_vore_swallow_speed 1 "how long it takes to swallow a player"\r
 set g_balance_vore_swallow_stealprey 0.7 "probability of stealing someone's prey when eating them (when true their prey joins your stomach rather than popping out). 0 = never, 1 = always"\r
 set g_balance_vore_swallow_dropweapon 0.6 "probability of dropping your weapon when swallowed. 0 = never and 1 = always, does not apply to team mates"\r
 set g_balance_vore_swallow_punchangle 12 "your view gets tilted by this amount when swallowing someone"\r
index 5bc4e17e98e5c2a695318a087508740b4957c984..e63d51308bc99bea7b7557a08a547d16f1ee144f 100644 (file)
@@ -68,6 +68,7 @@ float maxclients;
 \r
 .entity predator;\r
 .entity fakepredator;\r
+.float swallow_progress_prey, swallow_progress_pred;\r
 .float digesting;\r
 .float stomach_load;\r
 .float weapon_delay;\r
index 18dddf8b70a208ae5ad7df3a1011d17b582ce8db..6c66cdddea0e1fb0318c5528588c2d825431c500 100644 (file)
@@ -247,6 +247,27 @@ void Vore_Swallow(entity e)
        e.stomachkick_delay = time + cvar("g_balance_vore_kick_delay"); // don't kick immediately after being swallowed\r
 }\r
 \r
+void Vore_SwallowStep(entity e)\r
+{\r
+       if(!cvar("g_balance_vore_swallow_speed"))\r
+       {\r
+               Vore_Swallow(e);\r
+               return;\r
+       }\r
+\r
+       // increase the progress value until it reaches 1, then swallow the player\r
+       if(e.swallow_progress_prey < 1)\r
+               e.swallow_progress_prey += cvar("g_balance_vore_swallow_speed") * frametime;\r
+       else\r
+       {\r
+               Vore_Swallow(e);\r
+               e.swallow_progress_prey = 0;\r
+       }\r
+\r
+       // the predator's progress is how much the prey got swallowed\r
+       self.swallow_progress_pred = e.swallow_progress_prey;\r
+}\r
+\r
 void Vore_Regurgitate(entity e)\r
 {\r
        // this player is being regurgitated by their predator, apply the proper changes\r
@@ -633,7 +654,7 @@ void Vore()
                        self.stat_canswallow = 1;\r
 \r
                if(self.BUTTON_ATCK)\r
-                       Vore_Swallow(prey);\r
+                       Vore_SwallowStep(prey);\r
        }\r
        else if(prey != world)\r
                self.stat_canswallow = -1;\r