From 7dc7c9bc7f28c7c63aa50ec1dc3362bd28f943ab Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Mon, 19 Mar 2012 15:33:35 +0200 Subject: [PATCH] Apply scale-based weight to wind fields too (trigger_impulse) --- data/qcsrc/server/g_triggers.qc | 14 +++++++++++++- docs/TODO.txt | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/data/qcsrc/server/g_triggers.qc b/data/qcsrc/server/g_triggers.qc index 92a9cfec..f2c3205c 100644 --- a/data/qcsrc/server/g_triggers.qc +++ b/data/qcsrc/server/g_triggers.qc @@ -1136,6 +1136,9 @@ void trigger_impulse_touch1() other.lastpushtime = time; if(!pushdeltatime) return; + // apply size-based weight + str *= (cvar("g_healthsize") && other.classname == "player") ? pow(other.scale, cvar("g_healthsize_weight") * 0.5) : 1; + other.velocity = other.velocity + normalize(targ.origin - self.origin) * str * pushdeltatime; other.flags &~= FL_ONGROUND; } @@ -1144,6 +1147,7 @@ void trigger_impulse_touch1() void trigger_impulse_touch2() { float pushdeltatime; + float str; // FIXME: Better checking for what to push and not. if not(other.iscreature) @@ -1170,8 +1174,13 @@ void trigger_impulse_touch2() other.lastpushtime = time; if(!pushdeltatime) return; + str = pow(self.strength, pushdeltatime); + + // apply size-based weight + str *= (cvar("g_healthsize") && other.classname == "player") ? pow(other.scale, cvar("g_healthsize_weight") * 0.5) : 1; + // div0: ticrate independent, 1 = identity (not 20) - other.velocity = other.velocity * pow(self.strength, pushdeltatime); + other.velocity = other.velocity * str; } // Spherical (gravity/repulsor) mode @@ -1216,6 +1225,9 @@ void trigger_impulse_touch3() else str = self.strength; + // apply size-based weight + str *= (cvar("g_healthsize") && other.classname == "player") ? pow(other.scale, cvar("g_healthsize_weight") * 0.5) : 1; + other.velocity = other.velocity + normalize(other.origin - self.origin) * str * pushdeltatime; } diff --git a/docs/TODO.txt b/docs/TODO.txt index fd182472..42f58589 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -104,12 +104,12 @@ - +0.8: Some sort of bullet time feature in single player, by setting the slowmo cvar -- 0.8: Does the wind trigger brush need to account scale based gravity? - - 0.8 BUG: Stomach load appeared 101 while my health was 100 - 0.8: Give weapons a weight, which affects the player based on size +- 0.8: Don't allow macros in the tutorial map (use health rot), since their weight makes it impossible to pass some parts + - 0.8: Make some g_healthsize cvars g_balance_healthsize, and move them to balanceVT.cfg - 0.8: Make player fatness depend on frags, using a trick I heard about with shaders -- 2.39.2