From: MirceaKitsune Date: Sat, 9 Jul 2011 13:29:16 +0000 (+0300) Subject: Basic implementation of slow swallowing. You need to aim at the prey from up close... X-Git-Url: https://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=commitdiff_plain;h=5f0d7b82cb0cc8efcfdba49b3f55b662377f29a5 Basic implementation of slow swallowing. You need to aim at the prey from up close and hold fire (as until now), but for an amount of time, before the actual swallowing will occur. --- diff --git a/data/balanceVT.cfg b/data/balanceVT.cfg index 8cac88b2..15e91bd4 100644 --- a/data/balanceVT.cfg +++ b/data/balanceVT.cfg @@ -187,6 +187,7 @@ set g_balance_grabber_reload_time 2 // {{{ stomach set g_balance_vore_swallow_range 100 "distance below which you can swallow another player when facing them" set g_balance_vore_swallow_limit 3 "how many players can fit in the stomach at a time, may range between 1 and 9" +set g_balance_vore_swallow_speed 1 "how long it takes to swallow a player" 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" 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" set g_balance_vore_swallow_punchangle 12 "your view gets tilted by this amount when swallowing someone" diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index 5bc4e17e..e63d5130 100644 --- a/data/qcsrc/server/defs.qh +++ b/data/qcsrc/server/defs.qh @@ -68,6 +68,7 @@ float maxclients; .entity predator; .entity fakepredator; +.float swallow_progress_prey, swallow_progress_pred; .float digesting; .float stomach_load; .float weapon_delay; diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 18dddf8b..6c66cddd 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -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 } +void Vore_SwallowStep(entity e) +{ + if(!cvar("g_balance_vore_swallow_speed")) + { + Vore_Swallow(e); + return; + } + + // increase the progress value until it reaches 1, then swallow the player + if(e.swallow_progress_prey < 1) + e.swallow_progress_prey += cvar("g_balance_vore_swallow_speed") * frametime; + else + { + Vore_Swallow(e); + e.swallow_progress_prey = 0; + } + + // the predator's progress is how much the prey got swallowed + self.swallow_progress_pred = e.swallow_progress_prey; +} + void Vore_Regurgitate(entity e) { // this player is being regurgitated by their predator, apply the proper changes @@ -633,7 +654,7 @@ void Vore() self.stat_canswallow = 1; if(self.BUTTON_ATCK) - Vore_Swallow(prey); + Vore_SwallowStep(prey); } else if(prey != world) self.stat_canswallow = -1;