]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Punchangle strength depends on healthsize difference as well
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 15 Mar 2012 19:56:17 +0000 (21:56 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 15 Mar 2012 19:56:17 +0000 (21:56 +0200)
data/qcsrc/server/vore.qc
data/qcsrc/server/w_common.qc
docs/TODO.txt

index 668eb9f3ebe79307c084274e4d4013ce74349097..cd264c5b204eace68ca1768746e9843df07c2e0a 100644 (file)
@@ -290,6 +290,9 @@ void Vore_Swallow(entity e)
 {\r
        // this player is being swallowed by another player, apply the proper changes\r
 \r
+       float scalediff;\r
+       scalediff = cvar("g_healthsize") ? e.scale / e.predator.scale : 1; // the tighter the gut, the greater the effect\r
+\r
        e.vore_oldmovetype = e.movetype;\r
        e.vore_oldsolid = e.solid;\r
        e.punchvector_z = cvar("g_balance_vore_swallow_prey_punchvector");\r
@@ -319,9 +322,9 @@ void Vore_Swallow(entity e)
 \r
        PlayerSound(e.predator, playersound_swallow, CHAN_VOICE, VOICETYPE_PLAYERSOUND);\r
        setanim(e.predator, e.predator.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating\r
-       e.predator.punchangle_x = crandom() * cvar("g_balance_vore_swallow_predator_punchangle");\r
-       e.predator.punchangle_y = crandom() * cvar("g_balance_vore_swallow_predator_punchangle");\r
-       e.predator.punchangle_z = crandom() * cvar("g_balance_vore_swallow_predator_punchangle");\r
+       e.predator.punchangle_x = crandom() * cvar("g_balance_vore_swallow_predator_punchangle") * scalediff;\r
+       e.predator.punchangle_y = crandom() * cvar("g_balance_vore_swallow_predator_punchangle") * scalediff;\r
+       e.predator.punchangle_z = crandom() * cvar("g_balance_vore_swallow_predator_punchangle") * scalediff;\r
        e.predator.regurgitate_prepare = 0;\r
        e.predator.spawnshieldtime = 0; // lose spawn shield when we vore\r
        e.predator.hitsound += 1; // play this for team mates too, as we could be swallowing them to heal them\r
@@ -374,6 +377,9 @@ void Vore_Regurgitate(entity e)
 {\r
        // this player is being regurgitated by their predator, apply the proper changes\r
 \r
+       float scalediff;\r
+       scalediff = cvar("g_healthsize") ? e.scale / e.predator.scale : 1; // the tighter the gut, the greater the effect\r
+\r
        e.movetype = e.vore_oldmovetype;\r
        if(e.health > 0) // leave SOLID_NOT for dead bodies\r
                e.solid = e.vore_oldsolid;\r
@@ -390,8 +396,6 @@ void Vore_Regurgitate(entity e)
        }\r
 \r
        // apply velocities\r
-       float scalediff;\r
-       scalediff = cvar("g_healthsize") ? e.scale / e.predator.scale : 1; // the tighter the gut, the greater the velocity\r
        makevectors(e.predator.v_angle);\r
        e.velocity = v_forward * cvar("g_balance_vore_regurgitate_force") * scalediff;\r
        e.predator.velocity += -v_forward * cvar("g_balance_vore_regurgitate_predatorforce") * scalediff;\r
@@ -422,9 +426,9 @@ void Vore_Regurgitate(entity e)
        PlayerSound(e.predator, playersound_regurgitate, CHAN_VOICE, VOICETYPE_PLAYERSOUND);\r
        setanim(e.predator, e.predator.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating\r
        pointparticles(particleeffectnum("vore_regurgitate"), e.predator.origin, '0 0 0', 1);\r
-       e.predator.punchangle_x = crandom() * cvar("g_balance_vore_regurgitate_predator_punchangle");\r
-       e.predator.punchangle_y = crandom() * cvar("g_balance_vore_regurgitate_predator_punchangle");\r
-       e.predator.punchangle_z = crandom() * cvar("g_balance_vore_regurgitate_predator_punchangle");\r
+       e.predator.punchangle_x = crandom() * cvar("g_balance_vore_regurgitate_predator_punchangle") * scalediff;\r
+       e.predator.punchangle_y = crandom() * cvar("g_balance_vore_regurgitate_predator_punchangle") * scalediff;\r
+       e.predator.punchangle_z = crandom() * cvar("g_balance_vore_regurgitate_predator_punchangle") * scalediff;\r
        e.predator.regurgitate_prepare = 0;\r
        e.predator.action_delay = time + cvar("g_balance_vore_action_delay");\r
        Vore_SetPreyPositions(e.predator);\r
@@ -536,6 +540,9 @@ void Vore_StomachKick()
        if(self.deadflag != DEAD_NO)\r
                return;\r
 \r
+       float scalediff;\r
+       scalediff = pow(self.scale / self.predator.scale, cvar("g_balance_vore_kick_scalediff"));\r
+\r
        if(time > self.stomachkick_delay && !self.kick_pressed)\r
        {\r
                float damage, vol, pitch;\r
@@ -551,20 +558,20 @@ void Vore_StomachKick()
                // apply player scale to the damage / force of the kick\r
                if(cvar("g_healthsize") && cvar("g_balance_vore_kick_scalediff"))\r
                {\r
-                       damage *= pow(self.scale / self.predator.scale, cvar("g_balance_vore_kick_scalediff"));\r
-                       force *= pow(self.scale / self.predator.scale, cvar("g_balance_vore_kick_scalediff"));\r
-                       vol *= pow(self.scale / self.predator.scale, cvar("g_balance_vore_kick_scalediff")); // kick sound volume based on the same scale\r
+                       damage *= scalediff;\r
+                       force *= scalediff;\r
+                       vol *= scalediff; // kick sound volume based on the same scale\r
                }\r
                vol = bound(0, vol, 1);\r
 \r
                Damage(self.predator, self, self, damage, DEATH_STOMACHKICK, self.predator.origin, force);\r
                sound7(self.predator, CHAN_PROJECTILE, strcat("weapons/hit", ftos(floor(random() * 8)), ".wav"), vol, ATTN_NORM, 100 * pitch, 0);\r
-               self.predator.punchangle_x = crandom() * cvar("g_balance_vore_kick_predator_punchangle");\r
-               self.predator.punchangle_y = crandom() * cvar("g_balance_vore_kick_predator_punchangle");\r
-               self.predator.punchangle_z = crandom() * cvar("g_balance_vore_kick_predator_punchangle");\r
-               self.punchangle_x = crandom() * cvar("g_balance_vore_kick_prey_punchangle");\r
-               self.punchangle_y = crandom() * cvar("g_balance_vore_kick_prey_punchangle");\r
-               self.punchangle_z = crandom() * cvar("g_balance_vore_kick_prey_punchangle");\r
+               self.predator.punchangle_x = crandom() * cvar("g_balance_vore_kick_predator_punchangle") * scalediff;\r
+               self.predator.punchangle_y = crandom() * cvar("g_balance_vore_kick_predator_punchangle") * scalediff;\r
+               self.predator.punchangle_z = crandom() * cvar("g_balance_vore_kick_predator_punchangle") * scalediff;\r
+               self.punchangle_x = crandom() * cvar("g_balance_vore_kick_prey_punchangle") * scalediff;\r
+               self.punchangle_y = crandom() * cvar("g_balance_vore_kick_prey_punchangle") * scalediff;\r
+               self.punchangle_z = crandom() * cvar("g_balance_vore_kick_prey_punchangle") * scalediff;\r
 \r
                // abort the predator's scheduled regurgitation\r
                if(random() < cvar("g_balance_vore_kick_cutregurgitate"))\r
index 80240485596e9706066d473d741ec1b080dfe074..8f4226c158b044ae4c06a3e6852f57c98789549d 100644 (file)
@@ -491,7 +491,7 @@ void PlayerGib(entity e, entity attacker)
                gib_health = 0;\r
        if(cvar("g_healthsize")) // smaller bodies are more likely to gib and vice versa\r
                gib_health *= e.scale;\r
-dprint(strcat(ftos(e.modelindex), " ----------------\n"));\r
+\r
        if (e.health <= gib_health && e.modelindex != 0)\r
        {\r
                // don't use any animations as a gib\r
index 29fc6db235f8f18a061b4792d849e499bfe9a85f..5c66a17e896d075215c32e9bdb1ff8c7fac5a0a8 100644 (file)
 \r
 - 0.8: Turn the Grabber into an organic weapon, but keep metal parts like the fuel cases and weapon display\r
 \r
-- 0.7: Regurgitate a player after he's been digested to minimum amount, rather than making him disappear (use a cvar)\r
-\r
 - 0.8: Colormod gibs when regurgitating them, although they are client side and the color cvars are server
\ No newline at end of file