From b1dd36a05bd64d582353def5142bbe98ec7dc2a5 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Tue, 11 Jun 2013 16:35:45 +0300 Subject: [PATCH] Give prey the same view orientation as predators when being swallowed --- data/balanceVT.cfg | 4 +++- data/defaultVT.cfg | 4 ++-- data/qcsrc/server/cl_physics.qc | 16 ++++++++++++++-- data/qcsrc/server/sys.qh | 3 +++ data/qcsrc/server/vore.qc | 15 +++++++++++++++ docs/Release notes.txt | 2 ++ 6 files changed, 39 insertions(+), 5 deletions(-) diff --git a/data/balanceVT.cfg b/data/balanceVT.cfg index 45722fc0..a608a42f 100644 --- a/data/balanceVT.cfg +++ b/data/balanceVT.cfg @@ -196,7 +196,7 @@ set g_balance_grabber_reload_ammo 45 set g_balance_grabber_reload_time 2 // }}} -// {{{ stomach +// {{{ vore set g_balance_vore_action_delay 1 "how many seconds must pass before you can swallow or regurgitate again, after swallowing or regurgitating another player" set g_balance_vore_load_pred_capacity 100 "capacity percent a player's stomach has, influenced by player size" set g_balance_vore_load_pred_weight 1 "you get this heavier the more you eat, at 1 a full belly makes you two times heavier" @@ -216,6 +216,8 @@ set g_balance_vore_swallow_dropweapon 0.6 "probability of dropping your weapon w set g_balance_vore_swallow_predator_punchangle 10 "your view gets tilted by this amount when swallowing someone" set g_balance_vore_swallow_predator_punchangle_item 8 "your view gets tilted by this amount when swallowing an item" set g_balance_vore_swallow_prey_punchvector 25 "your view gets lifted by this amount when getting swallowed" +set g_balance_vore_swallow_prey_orient 1 "prey has the same view origin as the the predator while being swallowed" +set g_balance_vore_swallow_prey_orient_speed 10 "speed at which the view returns to normal once as are no longer eaten by your predayor" set g_balance_vore_regurgitate_damage 10 "predators take this amount of damage whenever regurgitating someone (influenced by player scale difference)" set g_balance_vore_regurgitate_swallowprogress 0.5 "regurgitated prey is given this amount of swallow progress, to simulate being more vulnerable (if slow swallowing is enabled)" set g_balance_vore_regurgitate_force 600 "regurgitated players rocket out at this speed, in the direction the predator is facing (influenced by player scale difference)" diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index 10c01db4..3049efdb 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -328,8 +328,8 @@ set g_respawn_ghosts_maxtime 6 "maximum amount of time a respawn ghost can last, set sv_gibhealth -150 "Amount of health a dead body must have in order to get gibbed, influenced by player size" -set sv_punchangle_speed 16 "speed at which punchangle returns to normal" -set sv_punchvector_speed 32 "speed at which punchvector returns to normal" +set sv_punchangle_speed 16 "default speed at which punchangle returns to normal" +set sv_punchvector_speed 32 "default speed at which punchvector returns to normal" // fragmessage: This allows extra information to be displayed with the frag centerprints. set sv_fragmessage_information_ping 0 "Enable ping display information, 0 = Never display; 1 = Always display (If the player is a bot, it will say bot instead of the ping.)" diff --git a/data/qcsrc/server/cl_physics.qc b/data/qcsrc/server/cl_physics.qc index 40ab462f..8fdd51a6 100644 --- a/data/qcsrc/server/cl_physics.qc +++ b/data/qcsrc/server/cl_physics.qc @@ -813,21 +813,33 @@ void SV_PlayerPhysics() if (self.punchangle != '0 0 0') { - f = vlen(self.punchangle) - cvar("sv_punchangle_speed") * frametime; + float speed = cvar("sv_punchangle_speed"); + if (self.punchangle_speed) + speed *= self.punchangle_speed + 1; + + f = vlen(self.punchangle) - speed * frametime; if (f > 0) self.punchangle = normalize(self.punchangle) * f; else self.punchangle = '0 0 0'; } + else + self.punchangle_speed = 0; if (self.punchvector != '0 0 0') { - f = vlen(self.punchvector) - cvar("sv_punchvector_speed") * frametime; + float speed = cvar("sv_punchvector_speed"); + if (self.punchvector_speed) + speed *= self.punchvector_speed + 1; + + f = vlen(self.punchvector) - speed * frametime; if (f > 0) self.punchvector = normalize(self.punchvector) * f; else self.punchvector = '0 0 0'; } + else + self.punchvector_speed = 0; if (clienttype(self) == CLIENTTYPE_BOT) { diff --git a/data/qcsrc/server/sys.qh b/data/qcsrc/server/sys.qh index 0d9cda6b..659cc1d9 100644 --- a/data/qcsrc/server/sys.qh +++ b/data/qcsrc/server/sys.qh @@ -141,6 +141,9 @@ void end_sys_globals; .float sounds; .string noise, noise1, noise2, noise3; +.float punchangle_speed; +.float punchvector_speed; + ///////////////////////////////////////////////////////// void end_sys_fields; ///////////////////////////////////////////////////////// diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 146a763a..195b5ce1 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -299,6 +299,7 @@ void Vore_Swallow(entity e) e.predator = self; setorigin(e, e.predator.origin); e.velocity = '0 0 0'; + e.punchangle = '0 0 0'; e.movetype = MOVETYPE_FOLLOW; e.solid = SOLID_NOT; e.aiment = e.predator; // follow the predator, automatically unset when regurgitated @@ -351,6 +352,13 @@ void Vore_SwallowStep(entity e) if(!self.swallow_progress_pred) PlayerSound(self, playersound_grab, CHAN_PAIN, VOICETYPE_PLAYERSOUND); + // apply prey orientation + if(cvar("g_balance_vore_swallow_prey_orient")) + { + e.punchangle = self.angles - e.angles; + e.punchangle_speed = cvar("g_balance_vore_swallow_prey_orient_speed") * (1 - e.swallow_progress_prey); + } + Vore_GulletModel_Update(e, self); // increase the progress value until it reaches 1, then swallow the player @@ -415,6 +423,13 @@ void Vore_Regurgitate(entity e) e.pusher = e.predator; // allows us to frag players by regurgitating them in deadly pits e.pushltime = time + cvar("g_maxpushtime"); + // apply prey orientation + if(cvar("g_balance_vore_swallow_prey_orient")) + { + e.punchangle = e.predator.angles - e.angles; + e.punchangle_speed = cvar("g_balance_vore_swallow_prey_orient_speed") * (1 - e.swallow_progress_prey); + } + // if the dead body of the prey is below gibbing health, gib it e.stat_eaten = 0; // necessary for gibs to show PlayerGib(e, e.predator); diff --git a/docs/Release notes.txt b/docs/Release notes.txt index de5bd1e6..c339d24e 100644 --- a/docs/Release notes.txt +++ b/docs/Release notes.txt @@ -358,4 +358,6 @@ Features: - Fully customizable HUD. Each component can be positioned and scaled independently using cvars in the HUD config file, allowing the player to create their own HUD setup. Note that not all HUD components were adapted to the new system yet. +- Prey is oriented same as the predator while being eaten (1st person view), to simulate being swallowed feet-first. + Known bugs: -- 2.39.2