From 84264c5993d3d0379a530690eafa6fe9b0d79c93 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Thu, 15 Mar 2012 21:56:17 +0200 Subject: [PATCH] Punchangle strength depends on healthsize difference as well --- data/qcsrc/server/vore.qc | 41 ++++++++++++++++++++--------------- data/qcsrc/server/w_common.qc | 2 +- docs/TODO.txt | 2 -- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 668eb9f3..cd264c5b 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -290,6 +290,9 @@ void Vore_Swallow(entity e) { // this player is being swallowed by another player, apply the proper changes + float scalediff; + scalediff = cvar("g_healthsize") ? e.scale / e.predator.scale : 1; // the tighter the gut, the greater the effect + e.vore_oldmovetype = e.movetype; e.vore_oldsolid = e.solid; e.punchvector_z = cvar("g_balance_vore_swallow_prey_punchvector"); @@ -319,9 +322,9 @@ void Vore_Swallow(entity e) PlayerSound(e.predator, playersound_swallow, CHAN_VOICE, VOICETYPE_PLAYERSOUND); setanim(e.predator, e.predator.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating - e.predator.punchangle_x = crandom() * cvar("g_balance_vore_swallow_predator_punchangle"); - e.predator.punchangle_y = crandom() * cvar("g_balance_vore_swallow_predator_punchangle"); - e.predator.punchangle_z = crandom() * cvar("g_balance_vore_swallow_predator_punchangle"); + e.predator.punchangle_x = crandom() * cvar("g_balance_vore_swallow_predator_punchangle") * scalediff; + e.predator.punchangle_y = crandom() * cvar("g_balance_vore_swallow_predator_punchangle") * scalediff; + e.predator.punchangle_z = crandom() * cvar("g_balance_vore_swallow_predator_punchangle") * scalediff; e.predator.regurgitate_prepare = 0; e.predator.spawnshieldtime = 0; // lose spawn shield when we vore e.predator.hitsound += 1; // play this for team mates too, as we could be swallowing them to heal them @@ -374,6 +377,9 @@ void Vore_Regurgitate(entity e) { // this player is being regurgitated by their predator, apply the proper changes + float scalediff; + scalediff = cvar("g_healthsize") ? e.scale / e.predator.scale : 1; // the tighter the gut, the greater the effect + e.movetype = e.vore_oldmovetype; if(e.health > 0) // leave SOLID_NOT for dead bodies e.solid = e.vore_oldsolid; @@ -390,8 +396,6 @@ void Vore_Regurgitate(entity e) } // apply velocities - float scalediff; - scalediff = cvar("g_healthsize") ? e.scale / e.predator.scale : 1; // the tighter the gut, the greater the velocity makevectors(e.predator.v_angle); e.velocity = v_forward * cvar("g_balance_vore_regurgitate_force") * scalediff; e.predator.velocity += -v_forward * cvar("g_balance_vore_regurgitate_predatorforce") * scalediff; @@ -422,9 +426,9 @@ void Vore_Regurgitate(entity e) PlayerSound(e.predator, playersound_regurgitate, CHAN_VOICE, VOICETYPE_PLAYERSOUND); setanim(e.predator, e.predator.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating pointparticles(particleeffectnum("vore_regurgitate"), e.predator.origin, '0 0 0', 1); - e.predator.punchangle_x = crandom() * cvar("g_balance_vore_regurgitate_predator_punchangle"); - e.predator.punchangle_y = crandom() * cvar("g_balance_vore_regurgitate_predator_punchangle"); - e.predator.punchangle_z = crandom() * cvar("g_balance_vore_regurgitate_predator_punchangle"); + e.predator.punchangle_x = crandom() * cvar("g_balance_vore_regurgitate_predator_punchangle") * scalediff; + e.predator.punchangle_y = crandom() * cvar("g_balance_vore_regurgitate_predator_punchangle") * scalediff; + e.predator.punchangle_z = crandom() * cvar("g_balance_vore_regurgitate_predator_punchangle") * scalediff; e.predator.regurgitate_prepare = 0; e.predator.action_delay = time + cvar("g_balance_vore_action_delay"); Vore_SetPreyPositions(e.predator); @@ -536,6 +540,9 @@ void Vore_StomachKick() if(self.deadflag != DEAD_NO) return; + float scalediff; + scalediff = pow(self.scale / self.predator.scale, cvar("g_balance_vore_kick_scalediff")); + if(time > self.stomachkick_delay && !self.kick_pressed) { float damage, vol, pitch; @@ -551,20 +558,20 @@ void Vore_StomachKick() // apply player scale to the damage / force of the kick if(cvar("g_healthsize") && cvar("g_balance_vore_kick_scalediff")) { - damage *= pow(self.scale / self.predator.scale, cvar("g_balance_vore_kick_scalediff")); - force *= pow(self.scale / self.predator.scale, cvar("g_balance_vore_kick_scalediff")); - vol *= pow(self.scale / self.predator.scale, cvar("g_balance_vore_kick_scalediff")); // kick sound volume based on the same scale + damage *= scalediff; + force *= scalediff; + vol *= scalediff; // kick sound volume based on the same scale } vol = bound(0, vol, 1); Damage(self.predator, self, self, damage, DEATH_STOMACHKICK, self.predator.origin, force); sound7(self.predator, CHAN_PROJECTILE, strcat("weapons/hit", ftos(floor(random() * 8)), ".wav"), vol, ATTN_NORM, 100 * pitch, 0); - self.predator.punchangle_x = crandom() * cvar("g_balance_vore_kick_predator_punchangle"); - self.predator.punchangle_y = crandom() * cvar("g_balance_vore_kick_predator_punchangle"); - self.predator.punchangle_z = crandom() * cvar("g_balance_vore_kick_predator_punchangle"); - self.punchangle_x = crandom() * cvar("g_balance_vore_kick_prey_punchangle"); - self.punchangle_y = crandom() * cvar("g_balance_vore_kick_prey_punchangle"); - self.punchangle_z = crandom() * cvar("g_balance_vore_kick_prey_punchangle"); + self.predator.punchangle_x = crandom() * cvar("g_balance_vore_kick_predator_punchangle") * scalediff; + self.predator.punchangle_y = crandom() * cvar("g_balance_vore_kick_predator_punchangle") * scalediff; + self.predator.punchangle_z = crandom() * cvar("g_balance_vore_kick_predator_punchangle") * scalediff; + self.punchangle_x = crandom() * cvar("g_balance_vore_kick_prey_punchangle") * scalediff; + self.punchangle_y = crandom() * cvar("g_balance_vore_kick_prey_punchangle") * scalediff; + self.punchangle_z = crandom() * cvar("g_balance_vore_kick_prey_punchangle") * scalediff; // abort the predator's scheduled regurgitation if(random() < cvar("g_balance_vore_kick_cutregurgitate")) diff --git a/data/qcsrc/server/w_common.qc b/data/qcsrc/server/w_common.qc index 80240485..8f4226c1 100644 --- a/data/qcsrc/server/w_common.qc +++ b/data/qcsrc/server/w_common.qc @@ -491,7 +491,7 @@ void PlayerGib(entity e, entity attacker) gib_health = 0; if(cvar("g_healthsize")) // smaller bodies are more likely to gib and vice versa gib_health *= e.scale; -dprint(strcat(ftos(e.modelindex), " ----------------\n")); + if (e.health <= gib_health && e.modelindex != 0) { // don't use any animations as a gib diff --git a/docs/TODO.txt b/docs/TODO.txt index 29fc6db2..5c66a17e 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -152,6 +152,4 @@ - 0.8: Turn the Grabber into an organic weapon, but keep metal parts like the fuel cases and weapon display -- 0.7: Regurgitate a player after he's been digested to minimum amount, rather than making him disappear (use a cvar) - - 0.8: Colormod gibs when regurgitating them, although they are client side and the color cvars are server \ No newline at end of file -- 2.39.2